1 # Test goal: Initial build with close-to-default settings that always needs to pass before follow-up CI stages run
2 # Test intents (should change rarely and conservatively):
3 # OS: Ubuntu oldest supported
6 # CMake: oldest supported
9 # Scope: configure, build, unit tests
10 # Test implementation choices (free to change as needed):
14 # Parallelism nt/ntomp: 4/2
17 # Test scope: configure, build, unit tests
24 image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-20.04-llvm-12
27 CMAKE: /usr/local/cmake-3.16.3/bin/cmake
28 KUBERNETES_CPU_LIMIT: 8
29 KUBERNETES_CPU_REQUEST: 4
30 KUBERNETES_MEMORY_REQUEST: 8Gi
31 CMAKE_SIMD_OPTIONS: "-DGMX_SIMD=None"
32 CMAKE_MPI_OPTIONS: "-DGMX_THREAD_MPI=ON"
33 CMAKE_PRECISION_OPTIONS: "-DGMX_DOUBLE=OFF"
34 CMAKE_BUILD_TYPE_OPTIONS: "-DCMAKE_BUILD_TYPE=Debug"
35 CMAKE_GPU_OPTIONS: "-DGMX_GPU=OFF"
36 CMAKE_GMXAPI_OPTIONS: "-DGMX_PYTHON_PACKAGE=OFF"
37 COMPILER_MAJOR_VERSION: 12
38 BUILD_DIR: simple-build
40 - CMAKE=${CMAKE:-$(which cmake)}
41 - echo $CMAKE_COMPILER_SCRIPT
42 - echo $CMAKE_EXTRA_OPTIONS
43 - echo $CMAKE_SIMD_OPTIONS
44 - echo $CMAKE_GPU_OPTIONS
45 - echo $CMAKE_MPI_OPTIONS
46 - echo $CMAKE_PRECISION_OPTIONS
47 - echo $CMAKE_BUILD_TYPE_OPTIONS
48 - echo $CMAKE_GMXAPI_OPTIONS
49 - if [[ -d $BUILD_DIR ]] ; then
50 echo "Cleaning up build directory" ;
51 rm -rf $BUILD_DIR && mkdir $BUILD_DIR ;
53 echo "Preparing new build directory" ;
60 -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
61 $CMAKE_COMPILER_SCRIPT
65 $CMAKE_PRECISION_OPTIONS
66 $CMAKE_BUILD_TYPE_OPTIONS
69 -DCMAKE_INSTALL_PREFIX=../$INSTALL_DIR -DGMX_COMPILER_WARNINGS=ON
70 2>&1 | tee cmakeLog.log
71 - awk '/CMake Warning/,/^--|^$/' cmakeLog.log | tee cmakeErrors.log
72 - if [ -s cmakeErrors.log ] ; then echo "Found CMake warning while processing build"; cat cmakeErrors.log ; exit 1; fi
73 - $CMAKE --build . -- -j$KUBERNETES_CPU_LIMIT 2>&1 | tee buildLogFile.log
74 - $CMAKE --build . --target tests -- -j$KUBERNETES_CPU_LIMIT 2>&1 | tee testBuildLogFile.log
75 - awk '/warning/,/warning.*generated|^$/' buildLogFile.log testBuildLogFile.log
76 | grep -v "CMake" | tee buildErrors.log || true
77 - grep "cannot be built" buildLogFile.log testBuildLogFile.log | tee -a buildErrors.log || true
78 - $CMAKE --build . --target install 2>&1 | tee installBuildLogFile.log
79 - if [ -s buildErrors.log ] ; then echo "Found compiler warning during build"; cat buildErrors.log; exit 1; fi
80 - ctest -D ExperimentalTest --output-on-failure | tee ctestLog.log || true
81 - awk '/The following tests FAILED/,/^Errors while running CTest|^$/'
82 ctestLog.log | tee ctestErrors.log
83 - xsltproc $CI_PROJECT_DIR/scripts/CTest2JUnit.xsl Testing/`head -n 1 < Testing/TAG`/Test.xml > JUnitTestResults.xml
84 - if [ -s ctestErrors.log ] ; then
85 echo "Error during running ctest";
91 junit: $BUILD_DIR/JUnitTestResults.xml