Skip to content

Commit 621cbd5

Browse files
committed
fix configure.win and update win GHA
1 parent a649401 commit 621cbd5

2 files changed

Lines changed: 32 additions & 5 deletions

File tree

.github/workflows/main.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
R: [ '4.3.1', '4.4.1' ]
20-
os: [ 'macos-15-intel', 'ubuntu-latest' ]
20+
os: [ 'macos-15-intel', 'ubuntu-latest', 'windows-latest']
2121
runs-on: ${{ matrix.os }}
2222
name: ${{ matrix.R }} ${{ matrix.os }} build
2323
env:
@@ -39,18 +39,45 @@ jobs:
3939
sudo apt-get install -y libcurl4-openssl-dev libssh2-1-dev libharfbuzz-dev libfribidi-dev gh &&
4040
sudo rm -rf /var/lib/apt/lists/*
4141
- name: Configuration Information
42+
if: runner.os == 'Linux' || runner.os == 'macOS'
4243
run: |
4344
mkdir ${R_LIBS}
4445
c++ --version
4546
cmake --version
4647
which R
4748
R --version
49+
- name: Configuration Information (Windows)
50+
if: startsWith(matrix.config.os, 'windows')
51+
shell: pwsh
52+
run: |
53+
New-Item -ItemType Directory -Force -Path "$env:R_LIBS" | Out-Null
54+
g++ --version
55+
cmake --version
56+
Get-Command R.exe
57+
R.exe --version
4858
- name: Install R packages
59+
if: runner.os == 'Linux' || runner.os == 'macOS'
4960
run: |
5061
R -e "install.packages(c('remotes'), lib=c('${R_LIBS}'), repo='https://cloud.r-project.org/')"
62+
- name: Install R packages (Windows)
63+
if: startsWith(matrix.config.os, 'windows')
64+
shell: pwsh
65+
run: |
66+
Rscript -e "lib <- Sys.getenv('R_LIBS'); lib <- normalizePath(lib, winslash='/', mustWork=FALSE); dir.create(lib, recursive=TRUE, showWarnings=FALSE); install.packages('remotes', lib=lib, repos='https://cloud.r-project.org/')"
67+
Rscript.exe -e "install.packages(c('remotes', 'desc'), repos='https://cloud.r-project.org/')"
5168
- name: Build and test
69+
if: runner.os == 'Linux' || runner.os == 'macOS'
5270
run: |
5371
set -x
5472
R -e "remotes::install_git(c('.'), lib=c('${R_LIBS}'), configure.vars=c('"MAKEJ=2"'))"
5573
env:
5674
ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS: 2
75+
- name: Build and test (Windows)
76+
if: startsWith(matrix.config.os, 'windows')
77+
shell: pwsh
78+
env:
79+
ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS: 2
80+
run: |
81+
$env:MAKEJ="8"
82+
$env:ADDITIONAL_SITK_MODULES="-DSimpleITK_USE_ELASTIX=ON"
83+
Rcmd.exe INSTALL --build .

configure.win

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ if [ -z "$R_HOME" ]; then
2222
exit 1
2323
fi
2424

25+
export RTOOLS_HOME="$(ls -d /c/rtools* | head -n 1)"
2526
if [ -z "$RTOOLS_HOME" ]; then
2627
echo "Environment variable \"RTOOLS_HOME\" is not set!" 1>&2
2728
exit 1
@@ -103,8 +104,7 @@ export MAKEJ
103104
# Remove ITK-build to save space (if present)
104105
[ -d ITK-build ] && rm -rf ITK-build
105106

106-
# Move wrapped R package into the package root using R
107-
"${RCALL}" -f "${PKGBASED}/sitkmove.R" --args \
108-
"SimpleITK-build/Wrapping/R/Packaging/SimpleITK" \
109-
"${PKGBASED}"
107+
# Move wrapped R package into the package root
108+
# TODO: sitkmove.R fails to move for Windows
109+
cp -r SimpleITK-build/Wrapping/R/Packaging/SimpleITK/* "$PKGBASED/."
110110
)

0 commit comments

Comments
 (0)