Skip to content
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

ENH: Update ANTs #173

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/package-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: true
fail-fast: false
matrix:
config:
- { os: ubuntu-latest, r: "release" }
Expand Down
11 changes: 7 additions & 4 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ CXX_STD=CXX17
ITKRCMAKE=`${R_HOME}/bin/Rscript -e 'a<-ITKR:::itkIncludes(); cat(a)'`
ITKRLIB=`${R_HOME}/bin/Rscript -e 'a<-ITKR:::itkLibs(); cat(a)'`
compflags=`${R_HOME}/bin/Rscript -e 'a<-ITKR:::itkCompileFlags(); cat(a)'`
osx_sysroot=""
if [[ `uname` == 'Darwin' ]] ; then
compflags=" ${compflags} -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1 -stdlib=libc++ "
osx_sysroot=$(xcrun --show-sdk-path)
fi
ITKDIR=`${R_HOME}/bin/Rscript -e 'a<-ITKR:::itkDir(); cat(a)'`
ITKTAG=`${R_HOME}/bin/Rscript -e 'env = asNamespace("ITKR"); if ("itkTag" %in% names(env)) cat(ITKR::itkTag()) else cat("")'`
Expand Down Expand Up @@ -50,7 +51,7 @@ fi
echo $OSTYPE $needVCL_CAN_STATIC_CONST_INIT_FLOAT

if [[ `uname` == 'Darwin' ]] ; then
PKG_CPPFLAGS="${PKG_CPPFLAGS} -I"/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1""
PKG_CPPFLAGS="${PKG_CPPFLAGS} -isysroot${osx_sysroot}"
fi

echo "PKG_CPPFLAGS=${PKG_CPPFLAGS} -I\${ITK} -I\${PWD} -I\${myantssource}/Examples/include/ \
Expand All @@ -68,6 +69,8 @@ echo "libants=\`find \${myantslib} -name \"lib*.a\"\`" >> Makevars
# echo "libitk=\`find \\\`\$(R_HOME)/bin/Rscript -e 'ITKR:::itkLibs()'\\\` -name \"lib*.a\"\` " >> Makevars
echo "libitk=\`find ${ITKRLIB} -name \"lib*.a\"\`" >> Makevars

# Duplicate libants and libitk to avoid issues with the order of the libraries. This isn't a good solution but
# cmake's suggested ordering didn't work either
echo "PKG_LIBS=${PKG_LIBS} \${libants} \${libitk} \${libants} \${libitk} \
\${libants} \${libitk} \${libants} \${libitk} \${libants} \${libitk}" >> Makevars

Expand All @@ -89,8 +92,7 @@ ThresholdImage LabelClustersUniquely SurfaceBasedSmoothing" >> Makevars

# get / set up ANTs code
antsgit=https://github.com/ANTsX/ANTs.git
antstag=d87f266dffdbcef00407d260eab20f4738a98825 # with itk v5.3rc04 2023 nov 25
antstag=1892feff83b792b563500f379fff7733da5465a6
antstag=fc0589fd23826e53d51e67eb8a3f9a3d63e63a14 # 2025-02-26, label geometry measures
antsrtag=`git log --pretty=format:'%H' -n 1`
if [[ ! -s ants/CMakeLists.txt ]] ; then
git clone $antsbranch $antsgit ants
Expand Down Expand Up @@ -121,6 +123,7 @@ cd ./antb
cmake -DITK_DIR:PATH=${ITKDIR} \
-DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} ${compflags} -DNDEBUG "\
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} ${compflags} -DNDEBUG "\
-DCMAKE_OSX_SYSROOT="${osx_sysroot}" \
-DBUILD_SHARED_LIBS=OFF \
-DANTS_INSTALL_LIBS_ONLY=ON \
-DBUILD_ALL_ANTS_APPS=OFF \
Expand Down
Loading