.gitlab-ci.yml 7.5 KB
Newer Older
1
image: gitlab-registry.mpcdf.mpg.de/tpurcell/cpp_sisso
Thomas Purcell's avatar
Thomas Purcell committed
2
3
4

stages:
  - build
Thomas Purcell's avatar
Thomas Purcell committed
5
6
  - unit_test
  - bin_test
7
  - doc_builds
Thomas Purcell's avatar
Thomas Purcell committed
8

Thomas Purcell's avatar
Thomas Purcell committed
9
build-intel:
Thomas Purcell's avatar
Thomas Purcell committed
10
  stage: build
Thomas Purcell's avatar
Thomas Purcell committed
11
  script:
12
13
    - python -m venv cpp_sisso_env
    - source cpp_sisso_env/bin/activate
Thomas Purcell's avatar
Thomas Purcell committed
14
15
    - mkdir build_intel/
    - cd build_intel/
16
17
18
    - export I_MPI_ROOT=/home/runner/intel/oneapi/mpi/2021.1-beta10/
    - export INTEL_COMP_ROOT=/home/runner/intel/oneapi/compiler/2021.1-beta10/linux/
    - export MKLROOT=/home/runner/intel/oneapi/mkl/2021.1-beta10/
19
    - export LD_LIBRARY_PATH=$I_MPI_ROOT/lib/:$I_MPI_ROOT/lib/release:$MKLROOT/lib/intel64:$INTEL_COMP_ROOT/lib/:$INTEL_COMP_ROOT/compiler/lib/intel64/:$LD_LIBRARY_PATH:$HOME/intel/oneapi/intelpython/latest/lib/:$HOME/intel/oneapi/intelpython/latest/lib/python3.7
20
    - export PYTHONPATH=$HOME/intel/oneapi/intelpython/latest/lib/python3.7/site-packages/:cpp_sisso_env/lib/python3.7/site-packages/
Thomas Purcell's avatar
Thomas Purcell committed
21
    - export PATH=$INTEL_COMP_ROOT/bin/:$INTEL_COMP_ROOT/bin/intel64:$I_MPI_ROOT/bin:$PATH
22
    - cmake -DCMAKE_CXX_COMPILER=icpc -DCMAKE_C_COMPILE=icc -DCMAKE_CXX_FLAGS="-O3" -DBUILD_TESTS=ON -DBUILD_PARAMS=ON -DBUILD_PYTHON=ON ../
Thomas Purcell's avatar
Thomas Purcell committed
23
24
    - make
    - make install
Thomas Purcell's avatar
Thomas Purcell committed
25
    - cd ../
Thomas Purcell's avatar
Thomas Purcell committed
26
27
28
29
  artifacts:
    when: always
    paths:
      - bin/sisso++
30
      - lib/libsisso.so
31
      - lib/boost/*
Thomas Purcell's avatar
Thomas Purcell committed
32
      - lib/gtest/*
33
34
35
36
      - lib/coin-or/*
      - lib/nlopt/*
      - lib/gtest/*
      - lib/fmt/*
37
      - tests/googletest/sisso_test
38
      - cpp_sisso_env/*
Thomas Purcell's avatar
Thomas Purcell committed
39
    expire_in: 1 days
Thomas Purcell's avatar
Thomas Purcell committed
40

Thomas Purcell's avatar
Thomas Purcell committed
41
test-intel-py:
Thomas Purcell's avatar
Thomas Purcell committed
42
  stage: unit_test
Thomas Purcell's avatar
Thomas Purcell committed
43
44
  dependencies:
    - build-intel
Thomas Purcell's avatar
Thomas Purcell committed
45
  script:
46
    - source cpp_sisso_env/bin/activate
47
48
49
    - export I_MPI_ROOT=/home/runner/intel/oneapi/mpi/2021.1-beta10/
    - export INTEL_COMP_ROOT=/home/runner/intel/oneapi/compiler/2021.1-beta10/linux/
    - export MKLROOT=/home/runner/intel/oneapi/mkl/2021.1-beta10/
50
    - export LD_LIBRARY_PATH=$I_MPI_ROOT/lib/:$I_MPI_ROOT/lib/release:$MKLROOT/lib/intel64:$INTEL_COMP_ROOT/lib/:$INTEL_COMP_ROOT/compiler/lib/intel64/:$LD_LIBRARY_PATH:$HOME/intel/oneapi/intelpython/latest/lib/:$HOME/intel/oneapi/intelpython/latest/lib/python3.7
51
    - export PYTHONPATH=$HOME/intel/oneapi/intelpython/latest/lib/python3.7/site-packages/:cpp_sisso_env/lib/python3.7/site-packages/
52
    - export PATH=$INTEL_COMP_ROOT/bin/:$INTEL_COMP_ROOT/bin/intel64:$I_MPI_ROOT/bin:$PATH
53
    - export OMP_NUM_THREADS=2
Thomas Purcell's avatar
Thomas Purcell committed
54
    - export OMP_PLACES=cores
Thomas Purcell's avatar
Thomas Purcell committed
55
    - pytest tests/pytest
56
57
58
59
60
61

test-intel-googletest:
  stage: unit_test
  dependencies:
    - build-intel
  script:
Thomas Purcell's avatar
Thomas Purcell committed
62
    - source cpp_sisso_env/bin/activate
63
64
65
    - export I_MPI_ROOT=/home/runner/intel/oneapi/mpi/2021.1-beta10/
    - export INTEL_COMP_ROOT=/home/runner/intel/oneapi/compiler/2021.1-beta10/linux/
    - export MKLROOT=/home/runner/intel/oneapi/mkl/2021.1-beta10/
66
67
    - export LD_LIBRARY_PATH=$I_MPI_ROOT/lib/:$I_MPI_ROOT/lib/release:$MKLROOT/lib/intel64:$INTEL_COMP_ROOT/lib/:$INTEL_COMP_ROOT/compiler/lib/intel64/:$LD_LIBRARY_PATH:$HOME/intel/oneapi/intelpython/latest/lib/:$HOME/intel/oneapi/intelpython/latest/lib/python3.7
    - export PYTHONPATH=$HOME/intel/oneapi/intelpython/latest/lib/python3.7/site-packages/:cpp_sisso_env/lib/python3.7/site-packages/
68
    - export PATH=$INTEL_COMP_ROOT/bin/:$INTEL_COMP_ROOT/bin/intel64:$I_MPI_ROOT/bin:$PATH
69
    - export OMP_NUM_THREADS=2
Thomas Purcell's avatar
Thomas Purcell committed
70
    - export OMP_PLACES=cores
Thomas Purcell's avatar
Thomas Purcell committed
71
    - tests/googletest/sisso_test
Thomas Purcell's avatar
Thomas Purcell committed
72
73

test-intel-bin:
Thomas Purcell's avatar
Thomas Purcell committed
74
  stage: bin_test
Thomas Purcell's avatar
Thomas Purcell committed
75
76
77
  dependencies:
    - build-intel
  script:
78
    - source cpp_sisso_env/bin/activate
79
80
81
    - export I_MPI_ROOT=/home/runner/intel/oneapi/mpi/2021.1-beta10/
    - export INTEL_COMP_ROOT=/home/runner/intel/oneapi/compiler/2021.1-beta10/linux/
    - export MKLROOT=/home/runner/intel/oneapi/mkl/2021.1-beta10/
82
    - export LD_LIBRARY_PATH=$I_MPI_ROOT/lib/:$I_MPI_ROOT/lib/release:$MKLROOT/lib/intel64:$INTEL_COMP_ROOT/lib/:$INTEL_COMP_ROOT/compiler/lib/intel64/:$LD_LIBRARY_PATH:$HOME/intel/oneapi/intelpython/latest/lib/:$HOME/intel/oneapi/intelpython/latest/lib/python3.7
83
    - export PYTHONPATH=$HOME/intel/oneapi/intelpython/latest/lib/python3.7/site-packages/:cpp_sisso_env/lib/python3.7/site-packages/
84
    - export PATH=$INTEL_COMP_ROOT/bin/:$INTEL_COMP_ROOT/bin/intel64:$I_MPI_ROOT/bin:$PATH
Thomas Purcell's avatar
Thomas Purcell committed
85
    - export OMP_NUM_THREADS=1
86
87
88
89
90
    - cd tests/exec_test/default/
    - mpiexec -n 1 ../../../bin/sisso++
    - python ../check_model.py
    - cd ../classification/
    - mpiexec -n 1 ../../../bin/sisso++
91
    - python check_model.py
Thomas Purcell's avatar
Thomas Purcell committed
92
    - cd ../gen_proj
Thomas Purcell's avatar
Thomas Purcell committed
93
    - mpiexec -n 2 ../../../bin/sisso++
94
    - python ../check_model.py
Thomas Purcell's avatar
Thomas Purcell committed
95
    - cd ../log_reg
Thomas Purcell's avatar
Thomas Purcell committed
96
    - mpiexec -n 2 ../../../bin/sisso++
Thomas Purcell's avatar
Thomas Purcell committed
97
    - python check_model.py
Thomas Purcell's avatar
Thomas Purcell committed
98
    - cd ../max_corr
Thomas Purcell's avatar
Thomas Purcell committed
99
    - mpiexec -n 2 ../../../bin/sisso++
100
    - python ../check_model.py
101
    - cd ../param
Thomas Purcell's avatar
Thomas Purcell committed
102
    - mpiexec -n 2 ../../../bin/sisso++
103
    - python ../check_model.py
Thomas Purcell's avatar
Thomas Purcell committed
104
105
106
    - cd ../reparam
    - mpiexec -n 2 ../../../bin/sisso++  
    - cd ../../../  
Thomas Purcell's avatar
Thomas Purcell committed
107

Thomas Purcell's avatar
Thomas Purcell committed
108
build-gnu:
Thomas Purcell's avatar
Thomas Purcell committed
109
110
  stage: build
  script:
111
    - conda info --envs
112
113
    - python -m venv cpp_sisso_env
    - source cpp_sisso_env/bin/activate
114
    - export LD_LIBRARY_PATH=$HOME/intel/oneapi/intelpython/latest/lib/:$HOME/intel/oneapi/intelpython/latest/lib/python3.7:$LD_LIBRARY_PATH
115
    - export PYTHONPATH=$HOME/intel/oneapi/intelpython/latest/lib/python3.7/site-packages/:cpp_sisso_env/lib/python3.7/site-packages/
Thomas Purcell's avatar
Thomas Purcell committed
116
117
    - mkdir build_gcc/
    - cd build_gcc/
118
119
    - cmake -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILE=gcc -DCMAKE_CXX_FLAGS="-O3" -DBUILD_TESTS=ON -DBUILD_PARAMS=ON -DBUILD_PYTHON=ON ../

Thomas Purcell's avatar
Thomas Purcell committed
120
121
    - make
    - make install
Thomas Purcell's avatar
Thomas Purcell committed
122
    - cd ../
Thomas Purcell's avatar
Thomas Purcell committed
123
124
125
126
  artifacts:
    when: always
    paths:
      - bin/sisso++
127
      - lib/libsisso.so
128
      - lib/boost/*
Thomas Purcell's avatar
Thomas Purcell committed
129
      - lib/gtest/*
130
131
132
133
      - lib/coin-or/*
      - lib/nlopt/*
      - lib/gtest/*
      - lib/fmt/*
134
      - tests/googletest/sisso_test
135
      - cpp_sisso_env/*
Thomas Purcell's avatar
Thomas Purcell committed
136
137

test-gnu-py:
Thomas Purcell's avatar
Thomas Purcell committed
138
  stage: unit_test
Thomas Purcell's avatar
Thomas Purcell committed
139
140
141
  dependencies:
    - build-gnu
  script:
142
    - source cpp_sisso_env/bin/activate
143
    - export LD_LIBRARY_PATH=$HOME/intel/oneapi/intelpython/latest/lib/:$HOME/intel/oneapi/intelpython/latest/lib/python3.7:$LD_LIBRARY_PATH
144
    - export PYTHONPATH=$HOME/intel/oneapi/intelpython/latest/lib/python3.7/site-packages/:cpp_sisso_env/lib/python3.7/site-packages/
145
    - export OMP_NUM_THREADS=2
Thomas Purcell's avatar
Thomas Purcell committed
146
    - export OMP_PLACES=cores
Thomas Purcell's avatar
Thomas Purcell committed
147
    - pytest tests/pytest
148
149
150
151
152
153

test-gnu-googletest:
  stage: unit_test
  dependencies:
    - build-gnu
  script:
154
    - source cpp_sisso_env/bin/activate
155
    - export OMP_NUM_THREADS=2
Thomas Purcell's avatar
Thomas Purcell committed
156
    - export OMP_PLACES=cores
Thomas Purcell's avatar
Thomas Purcell committed
157
    - tests/googletest/sisso_test
Thomas Purcell's avatar
Thomas Purcell committed
158

Thomas Purcell's avatar
Thomas Purcell committed
159
test-gnu-bin:
Thomas Purcell's avatar
Thomas Purcell committed
160
  stage: bin_test
Thomas Purcell's avatar
Thomas Purcell committed
161
162
163
  dependencies:
    - build-gnu
  script:
164
    - source cpp_sisso_env/bin/activate
165
    - export LD_LIBRARY_PATH=$HOME/intel/oneapi/intelpython/latest/lib/:$HOME/intel/oneapi/intelpython/latest/lib/python3.7:$LD_LIBRARY_PATH
Thomas Purcell's avatar
Thomas Purcell committed
166
    - export PYTHONPATH=$HOME/intel/oneapi/intelpython/latest/lib/python3.7/site-packages/:cpp_sisso_env/lib/python3.7/site-packages/
Thomas Purcell's avatar
Thomas Purcell committed
167
    - export OMP_NUM_THREADS=1
168
169
170
171
172
    - cd tests/exec_test/default/
    - mpiexec -n 1 ../../../bin/sisso++
    - python ../check_model.py
    - cd ../classification/
    - mpiexec -n 1 ../../../bin/sisso++
173
    - python check_model.py
Thomas Purcell's avatar
Thomas Purcell committed
174
    - cd ../gen_proj
175
    - mpiexec -n 1 ../../../bin/sisso++
176
    - python ../check_model.py
Thomas Purcell's avatar
Thomas Purcell committed
177
    - cd ../log_reg
178
    - mpiexec -n 1 ../../../bin/sisso++
Thomas Purcell's avatar
Thomas Purcell committed
179
    - python check_model.py
Thomas Purcell's avatar
Thomas Purcell committed
180
    - cd ../max_corr
181
    - mpiexec -n 1 ../../../bin/sisso++
182
    - python ../check_model.py
183
    - cd ../param
184
    - mpiexec -n 1 ../../../bin/sisso++
185
    - python ../check_model.py
Thomas Purcell's avatar
Thomas Purcell committed
186
187
    - cd ../reparam
    - mpiexec -n 1 ../../../bin/sisso++
188
    - cd ../../../
Thomas Purcell's avatar
Thomas Purcell committed
189
190

pages:
191
  stage: doc_builds
Thomas Purcell's avatar
Thomas Purcell committed
192
193
  script:
    - source cpp_sisso_env/bin/activate
194
195
196
    - cd docs/
    - make html
    - mv _build ../public
Thomas Purcell's avatar
Thomas Purcell committed
197
198
199
200
201
202
203
  artifacts:
    paths:
    - public
  only:
  - master
  - docs
  - joss