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