Reintroduce LJ Ewald tables
[alexxy/gromacs.git] / admin / ci-templates / .build-template.yml
1 .configure-build-template:
2   # Dockerfiles are from dockerhub, user eriklindahl
3   # image in admin/dockerimages/ci-docs-py27
4   stage: configure-build
5   only:
6     refs:
7       - web
8       - pushes
9       - schedules
10       - merge_requests
11   variables:
12     KUBERNETES_CPU_LIMIT: 1
13     KUBERNETES_CPU_REQUEST: 1
14     KUBERNETES_MEMORY_LIMIT: 2Gi
15     CMAKE_COMPILER_SCRIPT: ""
16     CMAKE_EXTRA_OPTIONS: ""
17     CMAKE_SIMD_OPTIONS: "-DGMX_SIMD=AUTO"
18     CMAKE_MPI_OPTIONS: "-DGMX_THREAD_MPI=ON"
19     CMAKE_PRECISION_OPTIONS: "-DGMX_DOUBLE=OFF"
20     CMAKE_BUILD_TYPE_OPTIONS: "-DCMAKE_BUILD_TYPE=Debug"
21     CMAKE_GPU_OPTIONS: "-DGMX_GPU=OFF"
22     CMAKE_GMXAPI_OPTIONS: "-DGMX_PYTHON_PACKAGE=OFF"
23
24   script:
25     - echo $CMAKE_COMPILER_SCRIPT
26     - echo $CMAKE_EXTRA_OPTIONS
27     - echo $CMAKE_SIMD_OPTIONS
28     - echo $CMAKE_GPU_OPTIONS
29     - echo $CMAKE_MPI_OPTIONS
30     - echo $CMAKE_PRECISION_OPTIONS
31     - echo $CMAKE_BUILD_TYPE_OPTIONS
32     - echo $CMAKE_GMXAPI_OPTIONS
33     - if [[ -d $BUILD_DIR ]] ; then
34         rm -rf $BUILD_DIR && mkdir $BUILD_DIR ;
35       else
36         echo "Preparing new build directory" ;
37         mkdir $BUILD_DIR ;
38       fi
39     - cd $BUILD_DIR
40     - cmake ..
41         -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
42         $CMAKE_COMPILER_SCRIPT
43         $CMAKE_EXTRA_OPTIONS
44         $CMAKE_SIMD_OPTIONS
45         $CMAKE_MPI_OPTIONS
46         $CMAKE_PRECISION_OPTIONS
47         $CMAKE_BUILD_TYPE_OPTIONS
48         $CMAKE_GPU_OPTIONS
49         $CMAKE_GMXAPI_OPTIONS
50         -DCMAKE_INSTALL_PREFIX=../$INSTALL_DIR -DGMX_COMPILER_WARNINGS=ON
51         2>&1 | tee cmakeLog.log
52     - awk '/CMake Warning/,/^--|^$/' cmakeLog.log | tee cmakeErrors.log
53     - if [ -s cmakeErrors.log  ] ; then echo "Found CMake warning while processing build"; cat cmakeErrors.log ; exit 1; fi
54     - cd ..
55   artifacts:
56     when: always
57     paths:
58       - $BUILD_DIR
59
60 .configure-build-release-template:
61   # Dockerfiles are from dockerhub, user eriklindahl
62   # image in admin/dockerimages/ci-docs-py27
63   stage: release-configure
64   variables:
65     KUBERNETES_CPU_LIMIT: 1
66     KUBERNETES_CPU_REQUEST: 1
67     KUBERNETES_MEMORY_LIMIT: 2Gi
68     CMAKE_COMPILER_SCRIPT: ""
69     CMAKE_EXTRA_OPTIONS: ""
70     CMAKE_SIMD_OPTIONS: "-DGMX_SIMD=AUTO"
71     CMAKE_MPI_OPTIONS: "-DGMX_THREAD_MPI=ON"
72     CMAKE_PRECISION_OPTIONS: "-DGMX_DOUBLE=OFF"
73     CMAKE_BUILD_TYPE_OPTIONS: "-DCMAKE_BUILD_TYPE=RelWithAssert"
74     CMAKE_GPU_OPTIONS: "-DGMX_GPU=OFF"
75     CMAKE_GMXAPI_OPTIONS: "-DGMX_PYTHON_PACKAGE=OFF"
76     RELEASE_BUILD_DIR: release-builds
77     RELEASE_SOURCE: release-source-from-tarball
78     RELEASE_REGRESSIONTESTS: release-regressiontests-from-tarball
79
80   only:
81     refs:
82       - web
83       - schedules
84       - triggers
85     variables:
86       - $GROMACS_RELEASE
87   script:
88     - VERSION=`cat version.json |
89         python3 -c "import json,sys; print(json.load(sys.stdin)['version'])"`
90     - if [[ $GROMACS_RELEASE != "true" ]] ; then
91           VERSION=$VERSION-dev ;
92       fi
93     - SOURCENAME=gromacs-$VERSION
94     - SOURCETARBALL=$SOURCENAME.tar.gz
95     - REGTESTNAME=regressiontests-$VERSION
96     - REGTESTTARBALL=$REGTESTNAME.tar.gz
97     - echo "$SOURCETARBALL"
98     - echo "$REGTESTTARBALL"
99     - RELEASE_TARBALLS=release-tarballs
100     - rm -rf $RELEASE_TARBALLS $RELEASE_SOURCE $RELEASE_REGRESSIONTESTS && mkdir $RELEASE_TARBALLS
101     - mv $SOURCETARBALL $RELEASE_TARBALLS
102     - mv $REGTESTTARBALL $RELEASE_TARBALLS
103     - cd $RELEASE_TARBALLS
104 # We rename the source and regressiontest directories
105 # to have names for them that don't change for different versions.
106     - tar -xf $SOURCETARBALL
107     - mv $SOURCENAME ../$RELEASE_SOURCE
108     - tar -xf $REGTESTTARBALL
109     - mv $REGTESTNAME ../$RELEASE_REGRESSIONTESTS
110     - rm $SOURCETARBALL
111     - cp $REGTESTTARBALL gmx-regressiontests.tar.gz
112     - cd ..
113     - echo $CMAKE_COMPILER_SCRIPT
114     - echo $CMAKE_EXTRA_OPTIONS
115     - echo $CMAKE_SIMD_OPTIONS
116     - echo $CMAKE_GPU_OPTIONS
117     - echo $CMAKE_MPI_OPTIONS
118     - echo $CMAKE_PRECISION_OPTIONS
119     - echo $CMAKE_BUILD_TYPE_OPTIONS
120     - echo $CMAKE_GMXAPI_OPTIONS
121     - if [[ -d $RELEASE_BUILD_DIR ]] ; then
122         echo "Cleaning up build directory" ;
123         rm -rf $RELEASE_BUILD_DIR && mkdir $RELEASE_BUILD_DIR ;
124       else
125         echo "Preparing new build directory" ;
126         mkdir $RELEASE_BUILD_DIR ;
127       fi
128     - cd $RELEASE_BUILD_DIR
129     - cmake ../$RELEASE_SOURCE/
130         -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
131         $CMAKE_COMPILER_SCRIPT
132         $CMAKE_EXTRA_OPTIONS
133         $CMAKE_SIMD_OPTIONS
134         $CMAKE_MPI_OPTIONS
135         $CMAKE_PRECISION_OPTIONS
136         $CMAKE_BUILD_TYPE_OPTIONS
137         $CMAKE_GPU_OPTIONS
138         $CMAKE_GMXAPI_OPTIONS
139         "-DREGRESSIONTEST_PATH=../$RELEASE_REGRESSIONTESTS"
140         -DCMAKE_INSTALL_PREFIX=../$INSTALL_DIR -DGMX_COMPILER_WARNINGS=ON
141         2>&1 | tee cmakeLog.log
142     - awk '/CMake Warning/,/^--|^$/' cmakeLog.log | tee cmakeErrors.log
143     - if [ -s cmakeErrors.log  ] ; then echo "Found CMake warning while processing build"; cat cmakeErrors.log ; exit 1; fi
144     - cd ..
145   artifacts:
146     when: always
147     paths:
148       - $RELEASE_BUILD_DIR
149       - $RELEASE_REGRESSIONTESTS
150       - $RELEASE_SOURCE
151
152 .binary-build-template:
153   # Dockerfiles are from dockerhub, user eriklindahl
154   # image in admin/dockerimages/ci-docs-py27
155   stage: build
156   only:
157     refs:
158       - web
159       - pushes
160       - schedules
161       - merge_requests
162   script:
163     - cd $BUILD_DIR
164     - cmake --build . -- -j8 2>&1 | tee buildLogFile.log
165     - cmake --build . --target tests -- -j8 2>&1 | tee testBuildLogFile.log
166     - awk '/warning/,/warning.*generated|^$/' buildLogFile.log testBuildLogFile.log
167       | grep -v "CMake" | tee buildErrors.log || true
168     - grep "cannot be built" buildLogFile.log testBuildLogFile.log | tee -a buildErrors.log || true
169     - cmake --build . --target install 2>&1 | tee installBuildLogFile.log
170     - if [ -s buildErrors.log ] ; then echo "Found compiler warning during build"; cat buildErrors.log; exit 1; fi
171     - cd ..
172   artifacts:
173     when: always
174     paths:
175       - $BUILD_DIR
176       - $INSTALL_DIR/
177
178 # Right now we need to use an ugly hack to move the original build directory
179 # and the ccache files out of the build archive, as it is not possible to use
180 # the custom build directory due to https://gitlab.com/gitlab-org/gitlab-runner/issues/4203
181 # As soon as this is resolved we should use the separate build directories instead of
182 # manually hacking things. TODO
183 # Redmine #3361
184 .archive-build-template:
185   # Dockerfiles are from dockerhub, user eriklindahl
186   image: gromacs/ci-docs-clang:2020
187   only:
188     refs:
189       - web
190       - pushes
191       - schedules
192       - merge_requests
193   variables:
194     KUBERNETES_CPU_LIMIT: 4
195     KUBERNETES_CPU_REQUEST: 2
196     KUBERNETES_MEMORY_LIMIT: 4Gi
197   script:
198     - rm -rf gromacs*tar.gz
199     - cd $BUILD_DIR
200     - cmake --build . --target gmx -- -j4 2>&1 | tee buildLogFile.log
201     - cmake --build . --target man -- -j4 2>&1 | tee manBuildLogFile.log
202     - cmake --build . --target completion -- -j4 2>&1 | tee completionBuildLogFile.log
203     - cmake --build . --target install-guide -- -j4 2>&1 | tee installGuideBuildLogFile.log
204     - cmake --build . --target reference_checksum -- -j4 2>&1 | tee checksumBuildLogFile.log
205     - cmake --build . --target package_source -- -j4 2>&1 | tee packageBuildLogFile.log
206     - awk '/warning/,/warning.*generated|^$/' buildLogFile.log manBuildLogFile.log 
207       completionBuildLogFile.log installGuideBuildLogFile.log checksumBuildLogFile.log
208       packageBuildLogFile.log | grep -v "CMake" | tee buildErrors.log || true
209     - grep "cannot be built" buildLogFile.log manBuildLogFile.log 
210       completionBuildLogFile.log installGuideBuildLogFile.log checksumBuildLogFile.log
211       packageBuildLogFile.log | tee -a buildErrors.log || true 
212     - if [ -s buildErrors.log ] ; then echo "Found warnings during build"; cat buildErrors.log; exit 1; fi
213     - mv gromacs*tar.gz ..
214     - cd ..
215     # ugly hack begins here
216     - mkdir tempdir
217     - SOURCETARBALL=`ls gromacs*tar.gz`
218     - mv $SOURCETARBALL tempdir
219     - cd tempdir
220     - tar -xf $SOURCETARBALL
221     - rm -rf gromacs-*/$BUILD_DIR
222     - tar -c --gzip -f $SOURCETARBALL gromacs-*/
223     - mv $SOURCETARBALL ..
224     - cd ..
225     - rm -rf tempdir
226     # Hack ends here
227   artifacts:
228     when: always
229     expire_in: 1 week
230     paths:
231       - $BUILD_DIR/*log
232       - gromacs*tar.gz
233
234
235 .simple-build-template:
236   # Docker images are from dockerhub, user eriklindahl
237   stage: pre-build
238   variables:
239     KUBERNETES_CPU_LIMIT: 8
240     KUBERNETES_CPU_REQUEST: 4
241     KUBERNETES_MEMORY_LIMIT: 8Gi
242     CMAKE_COMPILER_SCRIPT: ""
243     CMAKE_EXTRA_OPTIONS: ""
244     CMAKE_SIMD_OPTIONS: "-DGMX_SIMD=None"
245     CMAKE_MPI_OPTIONS: "-DGMX_THREAD_MPI=ON"
246     CMAKE_PRECISION_OPTIONS: "-DGMX_DOUBLE=OFF"
247     CMAKE_BUILD_TYPE_OPTIONS: "-DCMAKE_BUILD_TYPE=Debug"
248     CMAKE_GPU_OPTIONS: "-DGMX_GPU=OFF"
249     CMAKE_GMXAPI_OPTIONS: "-DGMX_PYTHON_PACKAGE=OFF"
250   only:
251     refs:
252       - web
253       - pushes
254       - schedules
255       - merge_requests
256
257   script:
258     - echo $CMAKE_COMPILER_SCRIPT
259     - echo $CMAKE_EXTRA_OPTIONS
260     - echo $CMAKE_SIMD_OPTIONS
261     - echo $CMAKE_GPU_OPTIONS
262     - echo $CMAKE_MPI_OPTIONS
263     - echo $CMAKE_PRECISION_OPTIONS
264     - echo $CMAKE_BUILD_TYPE_OPTIONS
265     - echo $CMAKE_GMXAPI_OPTIONS
266     - if [[ -d $BUILD_DIR ]] ; then
267         echo "Cleaning up build directory" ;
268         rm -rf $BUILD_DIR && mkdir $BUILD_DIR ;
269       else
270         echo "Preparing new build directory" ;
271         mkdir $BUILD_DIR ;
272       fi
273     - cd $BUILD_DIR
274     - cmake ..
275         -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
276         $CMAKE_COMPILER_SCRIPT
277         $CMAKE_EXTRA_OPTIONS
278         $CMAKE_SIMD_OPTIONS
279         $CMAKE_MPI_OPTIONS
280         $CMAKE_PRECISION_OPTIONS
281         $CMAKE_BUILD_TYPE_OPTIONS
282         $CMAKE_GPU_OPTIONS
283         $CMAKE_GMXAPI_OPTIONS
284         -DCMAKE_INSTALL_PREFIX=../$INSTALL_DIR -DGMX_COMPILER_WARNINGS=ON
285         2>&1 | tee cmakeLog.log
286     - awk '/CMake Warning/,/^--|^$/' cmakeLog.log | tee cmakeErrors.log
287     - if [ -s cmakeErrors.log  ] ; then echo "Found CMake warning while processing build"; cat cmakeErrors.log ; exit 1; fi
288     - cmake --build . -- -j8 2>&1 | tee buildLogFile.log
289     - cmake --build . --target tests -- -j8 2>&1 | tee testBuildLogFile.log
290     - awk '/warning/,/warning.*generated|^$/' buildLogFile.log testBuildLogFile.log
291       | grep -v "CMake" | tee buildErrors.log || true
292     - grep "cannot be built" buildLogFile.log testBuildLogFile.log | tee -a buildErrors.log || true
293     - cmake --build . --target install 2>&1 | tee installBuildLogFile.log
294     - if [ -s buildErrors.log ] ; then echo "Found compiler warning during build"; cat buildErrors.log; exit 1; fi
295     - ctest -D ExperimentalTest --output-on-failure | tee ctestLog.log || true
296     - awk '/The following tests FAILED/,/^Errors while running CTest|^$/'
297          ctestLog.log | tee ctestErrors.log
298     - xsltproc scripts/CTest2JUnit.xsl Testing/`head -n 1 < Testing/TAG`/Test.xml > JUnitTestResults.xml
299     - if [ -s ctestErrors.log ] ; then
300         echo "Error during running ctest";
301         exit 1;
302       fi
303     - cd ..
304   artifacts:
305     reports:
306       junit: $BUILD_DIR/JUnitTestResults.xml
307     paths:
308         - $BUILD_DIR/*log
309     when: always
310     expire_in: 1 week