.gitlab-ci.yml 7.52 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
Thomas Purcell's avatar
Thomas Purcell committed
7

Thomas Purcell's avatar
Thomas Purcell committed
8
build-intel:
Thomas Purcell's avatar
Thomas Purcell committed
9
  stage: build
Thomas Purcell's avatar
Thomas Purcell committed
10
  script:
11
12
    - python -m venv cpp_sisso_env
    - source cpp_sisso_env/bin/activate
Thomas Purcell's avatar
Thomas Purcell committed
13
14
    - mkdir build_intel/
    - cd build_intel/
15
16
17
    - 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/
18
    - 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
19
    - 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
20
    - export PATH=$INTEL_COMP_ROOT/bin/:$INTEL_COMP_ROOT/bin/intel64:$I_MPI_ROOT/bin:$PATH
21
    - 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
22
23
    - make
    - make install
Thomas Purcell's avatar
Thomas Purcell committed
24
    - cd ../
Thomas Purcell's avatar
Thomas Purcell committed
25
26
27
28
  artifacts:
    when: always
    paths:
      - bin/sisso++
29
      - lib/libsisso.so
30
      - lib/boost/*
Thomas Purcell's avatar
Thomas Purcell committed
31
      - lib/gtest/*
32
33
34
35
      - lib/coin-or/*
      - lib/nlopt/*
      - lib/gtest/*
      - lib/fmt/*
36
      - tests/googletest/sisso_test
37
      - cpp_sisso_env/*
Thomas Purcell's avatar
Thomas Purcell committed
38
    expire_in: 1 days
Thomas Purcell's avatar
Thomas Purcell committed
39

Thomas Purcell's avatar
Thomas Purcell committed
40
test-intel-py:
Thomas Purcell's avatar
Thomas Purcell committed
41
  stage: unit_test
Thomas Purcell's avatar
Thomas Purcell committed
42
43
  dependencies:
    - build-intel
Thomas Purcell's avatar
Thomas Purcell committed
44
  script:
45
    - source cpp_sisso_env/bin/activate
46
47
48
    - 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/
49
    - 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
50
    - export PYTHONPATH=$HOME/intel/oneapi/intelpython/latest/lib/python3.7/site-packages/:cpp_sisso_env/lib/python3.7/site-packages/
51
    - export PATH=$INTEL_COMP_ROOT/bin/:$INTEL_COMP_ROOT/bin/intel64:$I_MPI_ROOT/bin:$PATH
52
    - export OMP_NUM_THREADS=2
Thomas Purcell's avatar
Thomas Purcell committed
53
    - export OMP_PLACES=cores
Thomas Purcell's avatar
Thomas Purcell committed
54
    - pytest tests/pytest
55
56
57
58
59
60

test-intel-googletest:
  stage: unit_test
  dependencies:
    - build-intel
  script:
Thomas Purcell's avatar
Thomas Purcell committed
61
    - source cpp_sisso_env/bin/activate
62
63
64
    - 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/
65
66
    - 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/
67
    - export PATH=$INTEL_COMP_ROOT/bin/:$INTEL_COMP_ROOT/bin/intel64:$I_MPI_ROOT/bin:$PATH
68
    - export OMP_NUM_THREADS=2
Thomas Purcell's avatar
Thomas Purcell committed
69
    - export OMP_PLACES=cores
Thomas Purcell's avatar
Thomas Purcell committed
70
    - tests/googletest/sisso_test
Thomas Purcell's avatar
Thomas Purcell committed
71
72

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

Thomas Purcell's avatar
Thomas Purcell committed
107
build-gnu:
Thomas Purcell's avatar
Thomas Purcell committed
108
109
  stage: build
  script:
110
    - conda info --envs
111
112
    - python -m venv cpp_sisso_env
    - source cpp_sisso_env/bin/activate
113
    - export LD_LIBRARY_PATH=$HOME/intel/oneapi/intelpython/latest/lib/:$HOME/intel/oneapi/intelpython/latest/lib/python3.7:$LD_LIBRARY_PATH
114
    - 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
115
116
    - mkdir build_gcc/
    - cd build_gcc/
117
118
    - 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
119
120
    - make
    - make install
Thomas Purcell's avatar
Thomas Purcell committed
121
    - cd ../
Thomas Purcell's avatar
Thomas Purcell committed
122
123
124
125
  artifacts:
    when: always
    paths:
      - bin/sisso++
126
      - lib/libsisso.so
127
      - lib/boost/*
Thomas Purcell's avatar
Thomas Purcell committed
128
      - lib/gtest/*
129
130
131
132
      - lib/coin-or/*
      - lib/nlopt/*
      - lib/gtest/*
      - lib/fmt/*
133
      - tests/googletest/sisso_test
134
      - cpp_sisso_env/*
Thomas Purcell's avatar
Thomas Purcell committed
135
136

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

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

Thomas Purcell's avatar
Thomas Purcell committed
158
test-gnu-bin:
Thomas Purcell's avatar
Thomas Purcell committed
159
  stage: bin_test
Thomas Purcell's avatar
Thomas Purcell committed
160
161
162
  dependencies:
    - build-gnu
  script:
163
    - source cpp_sisso_env/bin/activate
164
    - 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
165
    - 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
166
    - export OMP_NUM_THREADS=1
167
168
169
170
171
    - cd tests/exec_test/default/
    - mpiexec -n 1 ../../../bin/sisso++
    - python ../check_model.py
    - cd ../classification/
    - mpiexec -n 1 ../../../bin/sisso++
172
    - python check_model.py
Thomas Purcell's avatar
Thomas Purcell committed
173
    - cd ../gen_proj
174
    - mpiexec -n 1 ../../../bin/sisso++
175
    - python ../check_model.py
Thomas Purcell's avatar
Thomas Purcell committed
176
    - cd ../log_reg
177
    - mpiexec -n 1 ../../../bin/sisso++
Thomas Purcell's avatar
Thomas Purcell committed
178
    - python check_model.py
Thomas Purcell's avatar
Thomas Purcell committed
179
    - cd ../max_corr
180
    - mpiexec -n 1 ../../../bin/sisso++
181
    - python ../check_model.py
182
    - cd ../param
183
    - mpiexec -n 1 ../../../bin/sisso++
184
    - python ../check_model.py
Thomas Purcell's avatar
Thomas Purcell committed
185
186
    - cd ../reparam
    - mpiexec -n 1 ../../../bin/sisso++
187
    - cd ../../../
Thomas Purcell's avatar
Thomas Purcell committed
188
189
190
191
192
193
194
195
196
197
198
199
200
201

pages:
  script:
    - source cpp_sisso_env/bin/activate
    - pip install mkdocs mkdocs-material pymdown-extensions mkdocs-minify-plugin
    - mkdocs build
    - mv site public
  artifacts:
    paths:
    - public
  only:
  - master
  - docs
  - joss