|
24 | 24 | OS="${{ matrix.os }}"
|
25 | 25 | OS=$(echo "$OS" | sed s/://)
|
26 | 26 | echo "ARTIFACT=$OS" >> $GITHUB_ENV
|
27 |
| - - name: Downgrade OS X Version |
28 |
| - if: matrix.os == 'macos-10.15' |
29 |
| - run: | |
30 |
| - echo "CMAKE_CXX_FLAGS=-mmacosx-version-min=10.12" >> $GITHUB_ENV |
31 |
| - - uses: actions/checkout@v3 |
32 |
| - with: |
33 |
| - repository: ANTsX/ANTs |
34 |
| - # NB: This commit mirrors the state of the kousu/ANTs repository |
35 |
| - # at the time of https://github.com/kousu/ANTs/pull/5. |
36 |
| - ref: ${{ github.event.inputs.git_ref || 'b37e8b56e4e518b0f2947f80d0e3701a5ddfe120' }} |
37 |
| - # The step below sets an option inside the cmake file to use the `https` protocol, which addresses: |
38 |
| - # https://github.blog/2021-09-01-improving-git-protocol-security-github/#no-more-unauthenticated-git |
39 |
| - - name: Patch in fix for insecure git:// protocol |
40 |
| - run: | |
41 |
| - perl -pi -e 's/http instead." ON\)/http instead." OFF\)/g' SuperBuild.cmake |
42 |
| - - name: cmake generate |
43 |
| - run: | |
44 |
| - mkdir antsbin |
45 |
| - cd antsbin |
46 |
| - # TODO: check if cmake picks up CMAKE_CXX_FLAGS without being told about it |
47 |
| - # NB: `BUILD_TESTING=OFF` fixes https://github.com/ANTsX/ANTs/issues/1236 |
48 |
| - cmake \ |
49 |
| - -DBUILD_TESTING=OFF \ |
50 |
| - -DBUILD_SHARED_LIBS=OFF \ |
51 |
| - -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \ |
52 |
| - ../ |
53 |
| - - name: make |
54 |
| - working-directory: antsbin |
55 |
| - run: | |
56 |
| - make VERBOSE=1 -j 4 |
57 |
| - timeout-minutes: 300 |
58 |
| - # for debugging, don't let a crash/timeout here fail the whole build |
59 |
| - # (github CI seems glitchy about giving reliable output about what happened on timeouts) |
60 |
| - continue-on-error: true |
61 |
| - - name: pre-package |
62 |
| - run: | |
63 |
| - mkdir fakeroot/ |
64 |
| - cd antsbin/ANTS-build |
65 |
| - make VERBOSE=1 -j 4 DESTDIR="../../fakeroot" install |
66 |
| - continue-on-error: true |
67 | 27 | - name: package
|
68 | 28 | run: |
|
69 | 29 | # snip out the apps we need for https://github.com/neuropoly/spinalcordtoolbox, since including all of ANTS is too much
|
|
89 | 49 | runs-on: ubuntu-latest
|
90 | 50 | container: ${{ matrix.os }}
|
91 | 51 | steps:
|
92 |
| - - name: install centos toolchain |
93 |
| - if: contains(matrix.os, 'centos') |
94 |
| - run: | |
95 |
| - yum install -y make gcc gcc-c++ git zlib-devel |
96 |
| - - name: install centos toolchain |
97 |
| - if: contains(matrix.os, 'centos:stream8') |
98 |
| - run: | |
99 |
| - yum install -y cmake |
100 |
| - - name: install centos toolchain |
101 |
| - if: contains(matrix.os, 'centos:7') |
102 |
| - run: | |
103 |
| - # centos7 has a new enough cmake available, but it's not in the default repo |
104 |
| - yum install -y epel-release |
105 |
| - yum install -y cmake3 |
106 |
| - ln -s /usr/bin/cmake3 /usr/bin/cmake # make it the default |
107 |
| - - name: install archlinux toolchain |
108 |
| - if: contains(matrix.os, 'archlinux') |
109 |
| - run: | |
110 |
| - pacman -Syy --noconfirm make cmake gcc git libffi |
111 |
| - # first, rewrite OS names to be safe for github artifacts. |
112 |
| - - name: names |
113 |
| - run: | |
114 |
| - OS="${{ matrix.os }}" |
115 |
| - OS=$(echo "$OS" | sed s/://) |
116 |
| - echo "ARTIFACT=$OS" >> $GITHUB_ENV |
117 |
| - - uses: actions/checkout@v3 |
118 |
| - with: |
119 |
| - repository: ANTsX/ANTs |
120 |
| - # NB: This commit mirrors the state of the kousu/ANTs repository |
121 |
| - # at the time of https://github.com/kousu/ANTs/pull/5. |
122 |
| - ref: ${{ github.event.inputs.git_ref || 'b37e8b56e4e518b0f2947f80d0e3701a5ddfe120' }} |
123 |
| - # The step below sets an option inside the cmake file to use the `https` protocol, which addresses: |
124 |
| - # https://github.blog/2021-09-01-improving-git-protocol-security-github/#no-more-unauthenticated-git |
125 |
| - - name: Patch in fix for insecure git:// protocol |
126 |
| - run: | |
127 |
| - perl -pi -e 's/http instead." ON\)/http instead." OFF\)/g' SuperBuild.cmake |
128 |
| - - name: context |
129 |
| - run: | |
130 |
| - set -x |
131 |
| - set |
132 |
| - pwd |
133 |
| - whoami |
134 |
| - hostname || true |
135 |
| - df -h || true |
136 |
| - uname -a |
137 |
| - gcc -v |
138 |
| - cmake --version |
139 |
| - ifconfig |
140 |
| - curl ifconfig.me |
141 |
| - continue-on-error: true |
142 |
| - - name: cmake generate |
143 |
| - run: | |
144 |
| - mkdir antsbin |
145 |
| - cd antsbin |
146 |
| - # NB: `BUILD_TESTING=OFF` fixes https://github.com/ANTsX/ANTs/issues/1236 |
147 |
| - cmake \ |
148 |
| - -DBUILD_TESTING=OFF \ |
149 |
| - -DBUILD_SHARED_LIBS=OFF \ |
150 |
| - ../ |
151 |
| - - name: make |
152 |
| - working-directory: antsbin |
153 |
| - run: | |
154 |
| - make VERBOSE=1 -j 4 |
155 |
| - timeout-minutes: 300 |
156 |
| - # for debugging, don't let a crash/timeout here fail the whole build |
157 |
| - # (github CI seems glitchy about giving reliable output about what happened on timeouts) |
158 |
| - continue-on-error: true |
159 |
| - - name: pre-package |
160 |
| - run: | |
161 |
| - mkdir fakeroot/ |
162 |
| - cd antsbin/ANTS-build |
163 |
| - make VERBOSE=1 -j 4 DESTDIR="../../fakeroot" install |
164 |
| - continue-on-error: true |
165 | 52 | - name: package
|
166 | 53 | run: |
|
167 | 54 | # snip out the apps we need for https://github.com/neuropoly/spinalcordtoolbox, since including all of ANTS is too much
|
@@ -195,76 +82,6 @@ jobs:
|
195 | 82 | OS="${{ matrix.os }}"
|
196 | 83 | OS=$(echo "$OS" | sed s/://)
|
197 | 84 | echo "ARTIFACT=$OS" >> $GITHUB_ENV
|
198 |
| - - uses: actions/checkout@v3 |
199 |
| - with: |
200 |
| - repository: ANTsX/ANTs |
201 |
| - # NB: This commit mirrors the state of the kousu/ANTs repository |
202 |
| - # at the time of https://github.com/kousu/ANTs/pull/5. |
203 |
| - ref: ${{ github.event.inputs.git_ref || 'b37e8b56e4e518b0f2947f80d0e3701a5ddfe120' }} |
204 |
| - # The step below sets an option inside the cmake file to use the `https` protocol, which addresses: |
205 |
| - # https://github.blog/2021-09-01-improving-git-protocol-security-github/#no-more-unauthenticated-git |
206 |
| - - name: Patch in fix for insecure git:// protocol |
207 |
| - run: | |
208 |
| - perl -pi -e 's/http instead." ON\)/http instead." OFF\)/g' SuperBuild.cmake |
209 |
| -
|
210 |
| - ########################################## START OF ITK WORKAROUND ############################################### |
211 |
| - # ITK v5.1 has an upstream bug (https://github.com/InsightSoftwareConsortium/ITK/issues/1967) that prevents |
212 |
| - # building ITK with MS Visual Studio 2019 (which is what the `windows-2019` GitHub Actions runner uses). This bug |
213 |
| - # was fixed in ITK v5.2. |
214 |
| - # |
215 |
| - # Normally, to pull in an upstream fix, we would update ANTs, which in turn would update ITK (because the `make` |
216 |
| - # step for ANTs clones ITK to a specific commit, hardcoded by ANTs in its External_ITKv5.cmake file). However, |
217 |
| - # updating ANTs to pull in the ITK v5.2 fix has the side effect of changing the registration results on SCT's end. |
218 |
| - # |
219 |
| - # So, we need a way to apply a fix for the ITK issue that *doesn't* involve updating ANTs. Luckily, there is a |
220 |
| - # quick and dirty workaround, described here: https://github.com/SuperElastix/SimpleElastix/pull/425#issuecomment-878516818 |
221 |
| - # |
222 |
| - # In order to apply the workaround, we have to manually clone ITK ourselves (prior to the ANTs `make` step), |
223 |
| - # then apply the fix, then continue on with building ANTs normally. |
224 |
| - # |
225 |
| - # TODO: Remove this fix after we update ANTs to a version that uses ITK v5.2 or higher. |
226 |
| - ################################################################################################################## |
227 |
| - - name: 'WORKAROUND: Manually clone ITK' |
228 |
| - run: | |
229 |
| - mkdir antsbin |
230 |
| - cd antsbin |
231 |
| - git clone https://github.com/InsightSoftwareConsortium/ITK.git ITKv5 |
232 |
| - cd ITKv5 |
233 |
| - git checkout 1e708db2f586997e408cfdc2cea5114ae5575892 # This commit corresponds to: |
234 |
| - # https://github.com/ANTsX/ANTs/blob/b37e8b56e4e518b0f2947f80d0e3701a5ddfe120/SuperBuild/External_ITKv5.cmake#L154 |
235 |
| - # i.e. the ITK commit specified by the version of ANTs we're currently using. |
236 |
| - - name: 'WORKAROUND: Apply fix for `lrintf` issue in ITK dependency' |
237 |
| - run: sed -i '93,120d' antsbin/ITKv5/Modules/ThirdParty/OpenJPEG/src/openjpeg/opj_includes.h |
238 |
| - - name: 'WORKAROUND: Skip ITK clone in Superbuild' |
239 |
| - run: | |
240 |
| - # These `sed` commands remove the git project settings from the `ExternalProject_Add` cmake function call |
241 |
| - sed -i '/ GIT_REPOSITORY ${${proj}_REPOSITORY}/d' SuperBuild/External_ITKv5.cmake |
242 |
| - sed -i '/ GIT_TAG ${${proj}_GIT_TAG}/d' SuperBuild/External_ITKv5.cmake |
243 |
| - ########################################### END OF ITK WORKAROUND ################################################ |
244 |
| - |
245 |
| - - name: cmake generate |
246 |
| - run: | |
247 |
| - cd antsbin |
248 |
| - # NB: `BUILD_TESTING=OFF` fixes https://github.com/ANTsX/ANTs/issues/1236 |
249 |
| - cmake \ |
250 |
| - -DBUILD_TESTING=OFF \ |
251 |
| - -DBUILD_SHARED_LIBS=OFF \ |
252 |
| - -DZLIB_INCLUDE_DIR=D:\lib\zlib \ |
253 |
| - -DZLIB_LIBRARY=D:\lib\zlib\libz.dll.a \ |
254 |
| - ../ |
255 |
| - - name: Add msbuild to PATH |
256 |
| - |
257 |
| - with: |
258 |
| - msbuild-architecture: x64 |
259 |
| - - name: make |
260 |
| - working-directory: antsbin |
261 |
| - shell: cmd |
262 |
| - run: | |
263 |
| - msbuild ALL_BUILD.vcxproj -property:Configuration=Release |
264 |
| - timeout-minutes: 300 |
265 |
| - # for debugging, don't let a crash/timeout here fail the whole build |
266 |
| - # (github CI seems glitchy about giving reliable output about what happened on timeouts) |
267 |
| - continue-on-error: true |
268 | 85 | - name: package
|
269 | 86 | run: |
|
270 | 87 | # snip out the apps we need for https://github.com/neuropoly/spinalcordtoolbox, since including all of ANTS is too much
|
|
0 commit comments