v0.14.0
docker_build_core_lib_script.sh
Go to the documentation of this file.
1 #!/bin/bash
2 
3 # Determine number of cores to compile code
4 NBCORES=$(cat /proc/cpuinfo | grep processor | wc -l)
5 NB_MAX=12
6 if (($NBCORES > $NB_MAX)); then
7  NB=$NB_MAX
8 else
9  NB=$NBCORES
10 fi
11 echo Nb. of cores $NBCORES and nb. of cores used to compilation $NB
12 
13 set -e
14 
15 echo "Configure"
16 # Make build directory
17 mkdir -p $MOFEM_BUILD_DIR
18 
19 cd $MOFEM_BUILD_DIR
20 # Configure mofem core lib
21 /opt/local/bin/cmake \
22  -DCMAKE_BUILD_TYPE=Release \
23  -DCMAKE_CXX_FLAGS="-Wall -Wno-sign-compare" \
24  -DMPI_RUN_FLAGS="--allow-run-as-root" \
25  -DPETSC_DIR=$PETSC_DIR \
26  -DPETSC_ARCH=$PETSC_ARCH \
27  -DMOAB_DIR=$PETSC_DIR/$PETSC_ARCH \
28  -DMED_DIR=/opt/med \
29  -DADOL-C_DIR=$PETSC_DIR/$PETSC_ARCH \
30  -DTETGEN_DIR=/opt/tetgen1.5.0 \
31  -DBUILD_SHARED_LIBS=yes \
32  -DCMAKE_INSTALL_PREFIX=$MOFEM_INSTALL_DIR $MOFEM_SRC_DIR
33 
34 # Install and build core library
35 echo "Build"
36 make -k -j $NB install
37 
38 # Run tests and send results to CDash
39 ctest --output-on-failure -D Experimental
40 make clean
41 
42 #-DCGM_DIR=$PETSC_DIR/$PETSC_ARCH \
43 #-DMESHKIT_DIR=$PETSC_DIR/$PETSC_ARCH \