-
Notifications
You must be signed in to change notification settings - Fork 11
Add installation support for windows #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,3 @@ | ||
| .circleci/ | ||
| ^.*\.Rproj$ | ||
| ^\.Rproj\.user$ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| .Rproj.user | ||
| .Rhistory | ||
| .RData | ||
| .Ruserdata | ||
| *.Rproj |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,110 @@ | ||||||||||||||||||||||||||||||
| #!/usr/bin/env sh | ||||||||||||||||||||||||||||||
| set -e | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # configure script that will fetch and build SimpleITK, then move the results | ||||||||||||||||||||||||||||||
| # to somewhere that R can install. It takes a long time and uses | ||||||||||||||||||||||||||||||
| # a substantial amount of disk space | ||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||
| # Requires rtools (https://cran.r-project.org/bin/windows/Rtools/) | ||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # --- Settings --- | ||||||||||||||||||||||||||||||
| # Load shared configuration for all OS (SimpleITK repository URL and tag) | ||||||||||||||||||||||||||||||
| export SimpleITKGit=$(Rscript -e "d <- desc::desc(file='DESCRIPTION'); urls <- strsplit(d\$get_field('URL'), ',')[[1]]; cat(trimws(urls[1]))") | ||||||||||||||||||||||||||||||
| # TODO: parse SITKTAG from DESCRIPTION after new release | ||||||||||||||||||||||||||||||
| # export SITKTAG=v$(Rscript -e "cat(desc::desc_get_field('Version', file='DESCRIPTION'))") | ||||||||||||||||||||||||||||||
| export SITKTAG='1899b2' | ||||||||||||||||||||||||||||||
Artur-man marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| PKGBASED=$(pwd) | ||||||||||||||||||||||||||||||
| echo "$PKGBASED" | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # --- Check R_HOME and RTOOLS_HOME--- | ||||||||||||||||||||||||||||||
| if [ -z "$R_HOME" ]; then | ||||||||||||||||||||||||||||||
| echo "Environment variable \"R_HOME\" is not set!" 1>&2 | ||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||
Artur-man marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| export RTOOLS_HOME="$(ls -d /c/rtools* | head -n 1)" | ||||||||||||||||||||||||||||||
| if [ -z "$RTOOLS_HOME" ]; then | ||||||||||||||||||||||||||||||
| echo "Environment variable \"RTOOLS_HOME\" is not set!" 1>&2 | ||||||||||||||||||||||||||||||
|
Comment on lines
+27
to
+29
|
||||||||||||||||||||||||||||||
| export RTOOLS_HOME="$(ls -d /c/rtools* | head -n 1)" | |
| if [ -z "$RTOOLS_HOME" ]; then | |
| echo "Environment variable \"RTOOLS_HOME\" is not set!" 1>&2 | |
| if [ -z "$RTOOLS_HOME" ]; then | |
| for rtools_dir in /c/rtools*; do | |
| if [ -d "$rtools_dir" ]; then | |
| export RTOOLS_HOME="$rtools_dir" | |
| break | |
| fi | |
| done | |
| fi | |
| if [ -z "$RTOOLS_HOME" ]; then | |
| echo "Environment variable \"RTOOLS_HOME\" is not set, and no Rtools installation was found under /c/rtools*." 1>&2 |
Copilot
AI
Apr 6, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PATH entry ${RTOOLS_HOME}/x86_64-w64-mingw32.static.posix/bin does not match the Rtools 4.5 layout suggested in the README (e.g., C:/rtools45 uses ucrt64/bin). As written, this will fail to find the compiler on current Rtools installations. Update the PATH logic to handle the current Rtools directory structure (or detect the correct subdir).
| export PATH="${RTOOLS_HOME}/usr/bin:${RTOOLS_HOME}/x86_64-w64-mingw32.static.posix/bin:${PATH}" | |
| if [ -d "${RTOOLS_HOME}/ucrt64/bin" ]; then | |
| RTOOLS_BIN="${RTOOLS_HOME}/ucrt64/bin" | |
| elif [ -d "${RTOOLS_HOME}/x86_64-w64-mingw32.static.posix/bin" ]; then | |
| RTOOLS_BIN="${RTOOLS_HOME}/x86_64-w64-mingw32.static.posix/bin" | |
| elif [ -d "${RTOOLS_HOME}/mingw64/bin" ]; then | |
| RTOOLS_BIN="${RTOOLS_HOME}/mingw64/bin" | |
| else | |
| echo "Could not find an Rtools compiler bin directory under ${RTOOLS_HOME}" 1>&2 | |
| exit 1 | |
| fi | |
| export PATH="${RTOOLS_HOME}/usr/bin:${RTOOLS_BIN}:${PATH}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Windows package-install step installs
remotestwice and installsdescwithout targeting the same library path as$env:R_LIBS. This can lead to packages landing in a non-writable default library or not being visible via.libPaths()during the build. Install bothremotesanddesconce, explicitly into$env:R_LIBS(after normalizing/creating it).