-
Notifications
You must be signed in to change notification settings - Fork 46
/
.cirrus.yml
155 lines (141 loc) · 4.98 KB
/
.cirrus.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
macos_instance:
image: ghcr.io/cirruslabs/macos-ventura-base:latest
build_wheel_task:
skip: $CIRRUS_BRANCH != 'master' && $CIRRUS_TAG == ''
env:
PATH: $HOME/miniconda3/bin/:$PATH
clone_submodules_script:
- git submodule update --init
conda_script:
- wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-py39_4.12.0-MacOSX-arm64.sh -O ~/miniconda.sh
- bash ~/miniconda.sh -b -p $HOME/miniconda3
- export PATH="$HOME/miniconda3/bin/:$PATH"
- conda create -n py3.9 python=3.9
- conda create -n py3.10 python=3.10
- conda create -n py3.11 python=3.11
- conda create -n py3.12 python=3.12
software_cache:
folder: $HOME/software
build_dependencies_script:
- sudo /usr/sbin/softwareupdate --install-rosetta --agree-to-license
- brew update
- brew install --force --verbose
ccache
fftw
llvm
libomp
xquartz
xerces-c
wget
- export LDFLAGS="-L/usr/local/opt/llvm/lib"
- export CPPFLAGS="-I/usr/local/opt/llvm/include -fopenmp"
- brew install qt
- mkdir -p $HOME/software
- cd $HOME/software
- mkdir -p geant4
- cd geant4
- rm -rf src bin data
- mkdir -p src bin data
- if [ ! -d "src/source" ] ; then git clone --branch v11.2.1 https://github.com/Geant4/geant4.git --depth 1 src ; fi
- cd bin
- cmake -DCMAKE_CXX_FLAGS=-std=c++17
-DGEANT4_INSTALL_DATA=OFF
-DGEANT4_INSTALL_DATADIR=$HOME/software/geant4/data
-DGEANT4_USE_QT=ON
-DGEANT4_USE_OPENGL_X11=ON
-DGEANT4_USE_QT_QT6=ON
-DGEANT4_BUILD_MULTITHREADED=ON
-DGEANT4_USE_SYSTEM_EXPAT=OFF
-DGEANT4_USE_GDML=ON
../src
- make -j4
- cd $HOME/software
- mkdir -p itk
- cd itk
- rm -rf src bin
- mkdir -p src bin
- if [ ! -d "src/CMake" ] ; then git clone --branch v5.2.1 https://github.com/InsightSoftwareConsortium/ITK.git --depth 1 src ; fi
- cd bin
- cmake -DCMAKE_CXX_FLAGS=-std=c++17
-DBUILD_TESTING=OFF
-DITK_USE_FFTWD=ON
-DITK_USE_FFTWF=ON
-DITK_USE_SYSTEM_FFTW:BOOL=ON
../src
- make -j4
opengate_core_script:
- conda info
- conda list
- conda init bash
- source ~/.bash_profile
- ls /opt/homebrew/share/qt/plugins/platforms
- source $HOME/software/geant4/bin/geant4make.sh
- export CMAKE_PREFIX_PATH=$HOME/software/geant4/bin:$HOME/software/itk/bin/:${CMAKE_PREFIX_PATH}
- ls
- cd core
- mkdir opengate_core/plugins
- cp -r /opt/homebrew/share/qt/plugins/platforms/* opengate_core/plugins/
- cp -r /opt/homebrew/share/qt/plugins/imageformats/* opengate_core/plugins/
- ls /opt/homebrew/lib
- cd ..
- mkdir all_dist
- |
for PYVERSION in 3.9 3.10 3.11 3.12; do
cd core
rm -rf dist
conda activate py$PYVERSION;
pip install wget colored
pip install wheel delocate
python setup.py sdist bdist_wheel
export DYLD_LIBRARY_PATH=$HOME/software/geant4/bin/BuildProducts/lib:/opt/homebrew/share/qt/plugins/platforms/:/opt/X11/lib/:$DYLD_LIBRARY_PATH:/opt/homebrew/lib
python -c "import os,delocate; print(os.path.join(os.path.dirname(delocate.__file__), 'tools.py'));quit()" | xargs -I{} sed -i."" "s/first, /input.pop('i386',None); first, /g" {}
delocate-listdeps --all dist/*.whl
delocate-wheel -w fixed_wheels -v dist/*.whl
rm -rf dist
ls fixed_wheels
delocate-listdeps --all fixed_wheels/*.whl
mv fixed_wheels dist
cd ..
cp core/dist/* all_dist/
done
- mv all_dist dist
binaries_artifacts:
path: dist/*
pypi_push_task:
depends_on:
- build_wheel
only_if: $CIRRUS_TAG != ''
env:
PATH: $HOME/miniconda3/bin/:$PATH
conda_script:
- wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-py39_4.12.0-MacOSX-arm64.sh -O ~/miniconda.sh
- bash ~/miniconda.sh -b -p $HOME/miniconda3
- export PATH="$HOME/miniconda3/bin/:$PATH"
software_cache:
folder: $HOME/software
env:
TWINE_REPOSITORY: pypi
TWINE_USERNAME: __token__
TWINE_PASSWORD: $PYPI_TOKEN
build_dependencies_script:
- sudo /usr/sbin/softwareupdate --install-rosetta --agree-to-license
- brew update
- brew install --force --verbose
ccache
fftw
llvm
libomp
xquartz
wget
- export LDFLAGS="-L/usr/local/opt/llvm/lib"
- export CPPFLAGS="-I/usr/local/opt/llvm/include -fopenmp"
- conda info
- conda list
- which python
- pip install wget colored
- pip install cibuildwheel==2.11.2
- pip install twine
publish_script:
- wget https://api.cirrus-ci.com/v1/artifact/build/$CIRRUS_BUILD_ID/build_wheel/binaries.zip
- unzip binaries
- twine upload dist/*