2ff46293660e8caa4be4c41dd862242abed67a90
[alexxy/gromacs.git] / admin / ci-scripts / gromacs-base-build.sh
1 #!/usr/bin/env bash
2 set -e
3 CMAKE=${CMAKE:-$(which cmake)}
4 cd $BUILD_DIR
5 $CMAKE --build . -- -j$KUBERNETES_CPU_LIMIT 2>&1 | tee buildLogFile.log
6 $CMAKE --build . --target tests -- -j$KUBERNETES_CPU_LIMIT 2>&1 | tee testBuildLogFile.log
7 awk '/warning/,/warning.*generated|^$/' buildLogFile.log testBuildLogFile.log \
8       | grep -v "CMake" | tee buildErrors.log || true
9 grep "cannot be built" buildLogFile.log testBuildLogFile.log | tee -a buildErrors.log || true
10 $CMAKE --build . --target install 2>&1 | tee installBuildLogFile.log
11 if [ -s buildErrors.log ] ; then echo "Found compiler warning during build"; cat buildErrors.log; exit 1; fi
12 find . -mindepth 1 -name '*.o' ! -type l -printf '%p\n' -delete 2>&1 > remove-build-objects.log
13 cd ..