Skip to content

Commit 34827e5

Browse files
committed
The script files that the initial commit ignored for some reason
1 parent 80fff87 commit 34827e5

File tree

6 files changed

+600
-0
lines changed

6 files changed

+600
-0
lines changed
+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
#!/bin/bash
2+
# -----------------------------------------------------------------------------
3+
#
4+
# Copyright (C) 2021 CERN & University of Surrey for the benefit of the
5+
# BioDynaMo collaboration. All Rights Reserved.
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
#
10+
# See the LICENSE file distributed with this work for details.
11+
# See the NOTICE file distributed with this work for additional information
12+
# regarding copyright ownership.
13+
#
14+
# -----------------------------------------------------------------------------
15+
16+
if [[ $# -ne 1 ]]; then
17+
echo "ERROR: Wrong number of arguments.
18+
Description:
19+
This script builds GCC.
20+
The archive will be stored in BDM_PROJECT_DIR/build/gcc.tar.gz
21+
Arguments:
22+
\$1 BDM_PROJECT_DIR" 1>&2;
23+
exit 2
24+
fi
25+
26+
GCC_VERSION_TXZ=gcc-11.5.0
27+
28+
29+
BDM_PROJECT_DIR=$1
30+
31+
32+
# import util functions
33+
. $BDM_PROJECT_DIR/util/installation/common/util.sh
34+
35+
GCC_INSTALL_DIR=$BDM_PROJECT_DIR/third_party/gcc
36+
37+
GCC_TXZ_FILE=$BDM_PROJECT_DIR/third_party/$GCC_VERSION_TXZ.tar.xz
38+
39+
build_gcc(){
40+
41+
DEST_DIR=$BDM_PROJECT_DIR/build/build-third-party/build_gcc
42+
rm -rf $DEST_DIR
43+
rm -rf $GCC_INSTALL_DIR
44+
mkdir -p $DEST_DIR
45+
mkdir -p $GCC_INSTALL_DIR
46+
tar -Jxvf $GCC_TXZ_FILE -C $DEST_DIR --strip-components=1
47+
cd $DEST_DIR
48+
./configure --disable-multilib --prefix="$GCC_INSTALL_DIR"
49+
make -j$(CPUCount)
50+
make install
51+
return
52+
}
53+
54+
SPECIFIC_BDM_OS=$(DetectOs)
55+
56+
DEFAULT_GCCBD_OPTION="Yes"
57+
58+
if echo "$SPECIFIC_OSES_SUPPORTED" | grep -Eiq "$SPECIFIC_BDM_OS" ; then
59+
DEFAULT_GCCBD_OPTION="No"
60+
fi
61+
62+
while true; do
63+
read -p "Do you want to build GCC or use your platform's default version? (Y(Yes/build) / N(No/default))
64+
Default option for your platform: ($DEFAULT_GCCBD_OPTION): " GCCBD_ANS
65+
66+
case $GCCBD_ANS in
67+
[yY] ) echo "Building GCC:" 1>&2;
68+
build_gcc
69+
exit 0;;
70+
[nN] ) echo "Using default GCC" 1>&2;
71+
exit 0;;
72+
"" ) echo "Initiating default option ($DEFAULT_GCCBD_OPTION): " 1>&2;
73+
if [ "$DEFAULT_GCCBD_OPTION" == "Yes" ]; then
74+
echo "Building GCC" 1>&2;
75+
build_gcc
76+
exit 0
77+
elif [ "$DEFAULT_GCCBD_OPTION" == "No" ]; then
78+
echo "Using default GCC:" 1>&2;
79+
exit 0
80+
fi ;;
81+
* ) echo "Please answer yes (Y/y) or no (N/n) " 1>&2;;
82+
esac
83+
84+
85+
done
+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#!/bin/bash
2+
# -----------------------------------------------------------------------------
3+
#
4+
# Copyright (C) 2021 CERN & University of Surrey for the benefit of the
5+
# BioDynaMo collaboration. All Rights Reserved.
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
#
10+
# See the LICENSE file distributed with this work for details.
11+
# See the NOTICE file distributed with this work for additional information
12+
# regarding copyright ownership.
13+
#
14+
# -----------------------------------------------------------------------------
15+
16+
if [[ $# -ne 1 ]]; then
17+
echo "ERROR: Wrong number of arguments.
18+
Description:
19+
This script builds NEST.
20+
The archive will be stored in BDM_PROJECT_DIR/build/.tar.gz
21+
Arguments:
22+
\$1 BDM_PROJECT_DIR" 1>&2;
23+
exit 2
24+
fi
25+
26+
NEST_VERSION_TGZ=nest-simulator-3.8
27+
28+
29+
PYV2=`echo $PYVERS | cut -d . -f 1-2`
30+
31+
BDM_PROJECT_DIR=$1
32+
33+
34+
# import util functions
35+
. $BDM_PROJECT_DIR/util/installation/common/util.sh
36+
37+
NEST_INSTALL_DIR=$BDM_PROJECT_DIR/third_party/nest
38+
39+
NEST_TGZ_FILE=$BDM_PROJECT_DIR/third_party/$NEST_VERSION_TGZ.tar.gz
40+
41+
build_NEST(){
42+
BDM_OS=$(DetectOs2)
43+
PYTH=""
44+
FEATURES=""
45+
if [ $BDM_OS == "osx" ]; then
46+
47+
if [ $brewpy == "yes" ]; then
48+
PYTH="$(brew --prefix)/bin/python${PYV2}"
49+
else
50+
export PYENV_NEST=$(brew --prefix)/opt/.pyenv
51+
eval "$(pyenv init -)"
52+
pyenv shell $PYVERS
53+
PYTH="`pyenv which python`"
54+
fi
55+
else
56+
PYTH="`pyenv which python`"
57+
fi
58+
DEST_DIR=$BDM_PROJECT_DIR/build/build-third-party/build_nest
59+
rm -rf $DEST_DIR
60+
rm -rf $NEST_INSTALL_DIR
61+
mkdir -p $DEST_DIR
62+
mkdir -p $NEST_INSTALL_DIR
63+
if ! [ -e $NEST_TGZ_FILE ]; then
64+
curl -o $NEST_TGZ_FILE https://github.com/nest/nest-simulator/archive/refs/tags/v3.8.tar.gz
65+
fi
66+
tar -xvzf $NEST_TGZ_FILE -C $DEST_DIR --strip-components=1
67+
cd $DEST_DIR
68+
mkdir obj
69+
cd obj
70+
echo $PYTH
71+
cmake -DCMAKE_INSTALL_PREFIX=$NEST_INSTALL_DIR ..
72+
cmake --build . --parallel $(CPUCount) --target install
73+
74+
return
75+
}
76+
build_NEST
77+
exit 0;
78+
79+
done
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
#!/bin/bash
2+
# -----------------------------------------------------------------------------
3+
#
4+
# Copyright (C) 2021 CERN & University of Surrey for the benefit of the
5+
# BioDynaMo collaboration. All Rights Reserved.
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
#
10+
# See the LICENSE file distributed with this work for details.
11+
# See the NOTICE file distributed with this work for additional information
12+
# regarding copyright ownership.
13+
#
14+
# -----------------------------------------------------------------------------
15+
16+
if [[ $# -ne 1 ]]; then
17+
echo "ERROR: Wrong number of arguments.
18+
Description:
19+
This script builds ParaView.
20+
The archive will be stored in BDM_PROJECT_DIR/build/PARAVIEW.tar.gz
21+
Arguments:
22+
\$1 BDM_PROJECT_DIR" 1>&2;
23+
exit 2
24+
fi
25+
26+
PARAVIEW_VERSION_TXZ=ParaView-v5.9.0
27+
CATALYST_VERSTON_TGZ=catalyst-for-paraview-5.9
28+
BDM_PROJECT_DIR=$1
29+
30+
31+
# import util functions
32+
. $BDM_PROJECT_DIR/util/installation/common/util.sh
33+
34+
PARAVIEW_INSTALL_DIR=$BDM_PROJECT_DIR/third_party/paraview
35+
CATALYST_TGZ_FILE=$BDM_PROJECT_DIR/third_party/$CATALYST_VERSTON_TGZ.tar.gz
36+
PARAVIEW_TXZ_FILE=$BDM_PROJECT_DIR/third_party/$PARAVIEW_VERSION_TXZ.tar.xz
37+
38+
build_paraview(){
39+
FEATURES=""
40+
PYTH=""
41+
BDM_OS=$(DetectOs2)
42+
43+
44+
if [ $BDM_OS = "osx" ]; then
45+
46+
if [ $brewpy == "yes" ]; then
47+
PYTH="$(brew --prefix)/bin/python${PYV2}"
48+
else
49+
export PYENV_ROOT=$(brew --prefix)/opt/.pyenv
50+
eval "$(pyenv init -)"
51+
pyenv shell $PYVERS
52+
PYTH="`pyenv which python`"
53+
fi
54+
55+
else
56+
PYTH="`pyenv which python`"
57+
fi
58+
59+
DEST_DIR=$BDM_PROJECT_DIR/build/build-third-party/build_paraview
60+
61+
62+
63+
rm -rf $DEST_DIR
64+
rm -rf $PARAVIEW_INSTALL_DIR
65+
mkdir -p $DEST_DIR
66+
mkdir -p $DEST_DIR/catalyst
67+
mkdir -p $PARAVIEW_INSTALL_DIR
68+
mkdir -p $PARAVIEW_INSTALL_DIR/catalyst
69+
tar -xvzf $CATALYST_TGZ_FILE -C $DEST_DIR/catalyst --strip-components=1
70+
tar -Jxvf $PARAVIEW_TXZ_FILE -C $DEST_DIR --strip-components=1
71+
export Qt5_DIR=$BDM_PROJECT_DIR/build/third_party/qt
72+
cd $DEST_DIR/catalyst
73+
mkdir obj
74+
cd obj
75+
cmake -DCMAKE_INSTALL_PREFIX=$PARAVIEW_INSTALL_DIR/catalyst ..
76+
make -j$(CPUCount)
77+
make install
78+
cd $DEST_DIR
79+
mkdir obj
80+
cd obj
81+
export catalyst_DIR=$PARAVIEW_INSTALL_DIR/catalyst
82+
cmake -DENABLE_ospray:BOOL=ON -DENABLE_ospraymaterials:BOOL=ON -DENABLE_paraviewsdk:BOOL=ON -DPARAVIEW_USE_PYTHON=YES -DPARAVIEW_USE_CATALYST=YES -DPARAVIEW_ENABLE_CATALYST=YES -DPARAVIEW_ENABLE_NONESSENTIAL=YES -DPARAVIEW_USE_MPI=ON -DVTK_MODULE_ENABLE_ParaView_Catalyst=YES -DVTK_MODULE_ENABLE_ParaView_PythonCatalyst=YES -DPYTHON_EXECUTABLE="$PYTH" -DCMAKE_INSTALL_PREFIX=$PARAVIEW_INSTALL_DIR ..
83+
make -j$(CPUCount)
84+
make install
85+
return
86+
}
87+
88+
89+
SPECIFIC_BDM_OS=$(DetectOs)
90+
91+
DEFAULT_PARAVIEWBD_OPTION="Yes"
92+
93+
if echo "$SPECIFIC_OSES_SUPPORTED" | grep -Eiq "$SPECIFIC_BDM_OS" ; then
94+
DEFAULT_PARAVIEWBD_OPTION="No"
95+
fi
96+
97+
while true; do
98+
read -p "Do you want to build, download or offer provided ParaView? (Y(Yes/build) / N(No/download))
99+
Default option for your platform: ($DEFAULT_PARAVIEWBD_OPTION): " PARAVIEWBD_ANS
100+
101+
case $PARAVIEWBD_ANS in
102+
[yY] ) echo "Building ParaView:" 1>&2;
103+
build_paraview
104+
exit 0;;
105+
[nN] ) echo "Downloading ParaView:" 1>&2;
106+
exit 1;;
107+
#[pP] ) echo "Extracting Provided ParaView:" 1>&2;
108+
# exit 3 ;;
109+
"" ) echo "Initiating default option ($DEFAULT_PARAVIEWBD_OPTION): " 1>&2;
110+
if [ "$DEFAULT_PARAVIEWBD_OPTION" == "Yes" ]; then
111+
echo "Building ParaView:" 1>&2;
112+
build_paraview
113+
exit 0
114+
elif [ "$DEFAULT_PARAVIEWBD_OPTION" == "No" ]; then
115+
echo "Downloading ParaView:" 1>&2;
116+
exit 1
117+
elif [ "$DEFAULT_PARAVIEWBD_OPTION" == "Prov" ]; then
118+
echo "Extracting Provided ParaView:" 1>&2;
119+
exit 3
120+
fi ;;
121+
* ) echo "Please answer yes (Y/y) or no (N/n) " 1>&2;;
122+
esac
123+
124+
125+
done
+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
#!/bin/bash
2+
# -----------------------------------------------------------------------------
3+
#
4+
# Copyright (C) 2021 CERN & University of Surrey for the benefit of the
5+
# BioDynaMo collaboration. All Rights Reserved.
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
#
10+
# See the LICENSE file distributed with this work for details.
11+
# See the NOTICE file distributed with this work for additional information
12+
# regarding copyright ownership.
13+
#
14+
# -----------------------------------------------------------------------------
15+
16+
if [[ $# -ne 1 ]]; then
17+
echo "ERROR: Wrong number of arguments.
18+
Description:
19+
This script builds QT.
20+
The archive will be stored in BDM_PROJECT_DIR/build/QT.tar.gz
21+
Arguments:
22+
\$1 BDM_PROJECT_DIR" 1>&2;
23+
exit 2
24+
fi
25+
26+
QT_VERSION_TXZ=qtbase-everywhere-opensource-src-5.15.16
27+
28+
BDM_PROJECT_DIR=$1
29+
30+
31+
# import util functions
32+
. $BDM_PROJECT_DIR/util/installation/common/util.sh
33+
34+
QT_INSTALL_DIR=$BDM_PROJECT_DIR/third_party/qt
35+
36+
QT_TXZ_FILE=$BDM_PROJECT_DIR/third_party/$QT_VERSION_TXZ.tar.xz
37+
declare -a QT_MODULE_TXZ=("qtsvg-everywhere-opensource-src-5.15.16" "qtxmlpatterns-everywhere-opensource-src-5.15.16" "qttools-everywhere-opensource-src-5.15.16" "qtwayland-everywhere-opensource-src-5.15.16" "qtmultimedia-everywhere-opensource-src-5.15.16" "qtmqtt-everywhere-opensource-src-5.15.16" "qtknx-everywhere-opensource-src-5.15.16" "qtimageformats-everywhere-opensource-src-5.15.16")
38+
39+
build_qt(){
40+
BDM_OS=$(DetectOs2)
41+
42+
DEST_DIR=$BDM_PROJECT_DIR/build/build-third-party/build_qt
43+
rm -rf $DEST_DIR
44+
rm -rf $QT_INSTALL_DIR
45+
mkdir -p $DEST_DIR
46+
tar -Jxvf $QT_TXZ_FILE -C $DEST_DIR --strip-components=1
47+
cd $DEST_DIR
48+
sed -i 's@/usr/local/Qt-$\$\[QT_VERSION]@/usr/local/Qt@g' configure.pri
49+
sed -i "s@/usr/local/Qt@$QT_INSTALL_DIR@g" configure.pri
50+
./configure -xcb -xcb-xlib -bundled-xcb-xinput -opensource -confirm-license
51+
make -j$(CPUCount)
52+
make install
53+
QMAKE_BIN=$QT_INSTALL_DIR/bin/qmake
54+
arraylength=${#QT_MODULE_TXZ[@]}
55+
for((i=0; i<${arraylength}; i++));
56+
do
57+
mkdir $BDM_PROJECT_DIR/build/build-third-party/build_qt_module_$i
58+
tar -Jxvf $BDM_PROJECT_DIR/third_party/qtmodules/${QT_MODULE_TXZ[$i]}.tar.xz -C $BDM_PROJECT_DIR/build/build-third-party/build_qt_module_$i --strip-components=1
59+
cd $BDM_PROJECT_DIR/build/build-third-party/build_qt_module_$i
60+
$QMAKE_BIN .
61+
make -j$(CPUCount)
62+
make install
63+
done
64+
return
65+
}
66+
67+
SPECIFIC_BDM_OS=$(DetectOs)
68+
69+
DEFAULT_QTBD_OPTION="Yes"
70+
71+
if echo "$SPECIFIC_OSES_SUPPORTED" | grep -Eiq "$SPECIFIC_BDM_OS" ; then
72+
DEFAULT_ROOTBD_OPTION="No"
73+
fi
74+
75+
while true; do
76+
read -p "Do you want to build or download QT? (Y(Yes/build) / N(No/download))
77+
Default option for your platform: ($DEFAULT_QTBD_OPTION): " QTBD_ANS
78+
79+
case $QTBD_ANS in
80+
[yY] ) echo "Building QT:" 1>&2;
81+
build_qt
82+
exit 0;;
83+
[nN] ) echo "Downloading QT:" 1>&2;
84+
exit 1;;
85+
"" ) echo "Initiating default option ($DEFAULT_QTBD_OPTION): " 1>&2;
86+
if [ "$DEFAULT_QTBD_OPTION" == "Yes" ]; then
87+
echo "Building QT:" 1>&2;
88+
build_qt
89+
exit 0
90+
elif [ "$DEFAULT_QTBD_OPTION" == "No" ]; then
91+
echo "Downloading QT:" 1>&2;
92+
exit 1
93+
fi ;;
94+
* ) echo "Please answer yes (Y/y) or no (N/n) " 1>&2;;
95+
esac
96+
97+
98+
done

0 commit comments

Comments
 (0)