-
Notifications
You must be signed in to change notification settings - Fork 50
/
Allwmake.firstInstall
executable file
·89 lines (77 loc) · 2.44 KB
/
Allwmake.firstInstall
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/bash
cd ${0%/*} || exit 1 # run from this directory
if [ "$PWD" != "$WM_PROJECT_DIR" ]
then
echo
echo "Error: Current directory is not \$WM_PROJECT_DIR"
echo " The environment variables are not consistent with the installation."
echo " Please source configuration files."
echo
echo "Examples:"
echo " bash: . etc/bashrc"
echo " tcsh: source etc/cshrc"
echo
echo " If you sourced the configuration files, please check the 'foamInstall' entry."
echo
exit 1
fi
if [ -z "$PARAVIEW_SYSTEM" ] && [ -z "$QT_BIN_DIR" ]
then
echo
echo "\$QT_BIN_DIR not set. To compile Paraview from sources"
echo "the command \$QT_BIN_DIR/qmake needs to be valid."
echo
echo "Examples: "
echo " Ubuntu: \"export QT_BIN_DIR=/usr/bin\""
echo " Fedora: \"export QT_BIN_DIR=/usr/lib64/qt4/bin\""
echo " openSuse: \"export QT_BIN_DIR=/usr/bin\""
echo
read -r -p "Proceed without compiling ParaView [Y/n] " response
if [[ $response =~ ^([nN][oO]|[nN])$ ]]
then
exit 0
fi
fi
# Check whether we will be compiling cudaSolvers
if [ -f $CUDA_BIN_DIR/nvcc ]
then
echo
echo "Cuda compiler detected at $CUDA_BIN_DIR/nvcc;"
echo "cudaSolvers will be compiled by default."
echo
# If yes, check presence of $CUDA_ARCH
if [ -z "$CUDA_ARCH" ]
then
echo
echo "\$CUDA_ARCH is required by nvcc compiler but not set."
echo "Check section '-gpu-architecture' in 'man nvcc' for details."
echo
read -r -p "Proceed without compiling cudaSolvers? [Y/n] " response
if [[ $response =~ ^([nN][oO]|[nN])$ ]]
then
exit 0
fi
export CUDA_IGNORE
fi
echo "Cuda architecture set to: $CUDA_ARCH"
fi
# wmake is required for subsequent targets
( cd wmake/src && make )
# build ThirdParty sources
( cd $WM_THIRD_PARTY_DIR && ./AllMake.pre )
# We make sure the ThirdParty packages environment variables are up-to-date
# before compiling the rest of OpenFOAM
. $WM_PROJECT_DIR/etc/settings.sh
# build OpenFOAM libraries and applications
src/Allwmake
applications/Allwmake
if [ "$1" = doc ]
then
doc/Allwmake
fi
# build ThirdParty sources that depend on main installation
export WM_NCOMPPROCS=1
( cd $WM_THIRD_PARTY_DIR && ./AllMake.post )
# Build extend-bazaar packages
#( cd extend-bazaar && ./Allwmake)
# ----------------------------------------------------------------- end-of-file