.gitlab-ci.yml 7.16 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
103
    - cd ../../../
Thomas Purcell's avatar
Thomas Purcell committed
104

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

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

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

Thomas Purcell's avatar
Thomas Purcell committed
156
test-gnu-bin:
Thomas Purcell's avatar
Thomas Purcell committed
157
  stage: bin_test
Thomas Purcell's avatar
Thomas Purcell committed
158
159
160
  dependencies:
    - build-gnu
  script:
161
    - source cpp_sisso_env/bin/activate
162
    - 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
163
    - 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
164
    - export OMP_NUM_THREADS=1
165
166
167
168
169
    - cd tests/exec_test/default/
    - mpiexec -n 1 ../../../bin/sisso++
    - python ../check_model.py
    - cd ../classification/
    - mpiexec -n 1 ../../../bin/sisso++
170
    - python check_model.py
Thomas Purcell's avatar
Thomas Purcell committed
171
    - cd ../gen_proj
172
    - mpiexec -n 1 ../../../bin/sisso++
173
    - python ../check_model.py
Thomas Purcell's avatar
Thomas Purcell committed
174
    - cd ../log_reg
175
    - mpiexec -n 1 ../../../bin/sisso++
Thomas Purcell's avatar
Thomas Purcell committed
176
    - python check_model.py
Thomas Purcell's avatar
Thomas Purcell committed
177
    - cd ../max_corr
178
    - mpiexec -n 1 ../../../bin/sisso++
179
    - python ../check_model.py
180
    - cd ../param
181
    - mpiexec -n 1 ../../../bin/sisso++
182
    - python ../check_model.py
183
    - cd ../../../