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" ;
58 -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
59 $CMAKE_COMPILER_SCRIPT
63 $CMAKE_PRECISION_OPTIONS
64 $CMAKE_BUILD_TYPE_OPTIONS
67 -DCMAKE_INSTALL_PREFIX=../$INSTALL_DIR -DGMX_COMPILER_WARNINGS=ON
68 2>&1 | tee cmakeLog.log
69 - awk '/CMake Warning/,/^--|^$/' cmakeLog.log | tee cmakeErrors.log
70 - if [ -s cmakeErrors.log ] ; then echo "Found CMake warning while processing build"; cat cmakeErrors.log ; exit 1; fi
71 - $CMAKE --build . -- -j$KUBERNETES_CPU_LIMIT 2>&1 | tee buildLogFile.log
72 - $CMAKE --build . --target tests -- -j$KUBERNETES_CPU_LIMIT 2>&1 | tee testBuildLogFile.log
73 - awk '/warning/,/warning.*generated|^$/' buildLogFile.log testBuildLogFile.log
74 | grep -v "CMake" | tee buildErrors.log || true
75 - grep "cannot be built" buildLogFile.log testBuildLogFile.log | tee -a buildErrors.log || true
76 - $CMAKE --build . --target install 2>&1 | tee installBuildLogFile.log
77 - if [ -s buildErrors.log ] ; then echo "Found compiler warning during build"; cat buildErrors.log; exit 1; fi
78 - ctest -D ExperimentalTest --output-on-failure | tee ctestLog.log || true
79 - awk '/The following tests FAILED/,/^Errors while running CTest|^$/'
80 ctestLog.log | tee ctestErrors.log
81 - xsltproc $CI_PROJECT_DIR/scripts/CTest2JUnit.xsl Testing/`head -n 1 < Testing/TAG`/Test.xml > JUnitTestResults.xml
82 - if [ -s ctestErrors.log ] ; then
83 echo "Error during running ctest";
89 junit: $BUILD_DIR/JUnitTestResults.xml