Repository navigation
Expand file tree
/
Copy pathconfigure
More file actions
executable file
·110 lines (106 loc) · 3.11 KB
/
Copy pathconfigure
File metadata and controls
executable file
·110 lines (106 loc) · 3.11 KB
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
#!/usr/bin/env bash
CXX_STD=CXX17
JTHREADS=4
if [[ `uname` == 'Darwin' ]] ; then
CMAKE_BUILD_TYPE=Release
fi
if [[ $TRAVIS -eq true ]] ; then
CMAKE_BUILD_TYPE=Release
JTHREADS=2
fi
cd ./src
itkgit=https://github.com/InsightSoftwareConsortium/ITK
itktag=20edc269b1d9bf9ff27a34db40a438b1b3044f3c # April 28, 2025
# if there is a directory but no git,
# remove it
if [[ -d itks ]]; then
if [[ ! -d itks/.git ]]; then
rm -rf itks/
fi
fi
git_exe=`${R_HOME}/bin/Rscript -e "x=Sys.which('git'); cat(x)"`
if [ -z "${git_exe}" ]; then
${R_HOME}/bin/Rscript -e 'if (!requireNamespace("git2r")) install.packages("git2r")'
str='if (!requireNamespace("git2r")) { install.packages("git2r") }'
str="${str}; repo = git2r::clone(\""
str="${str}${itkgit}"
str="${str}\", local_path = \"./itks\")"
if [ -n "${itktag}" ]; then
str="${str}; git2r::checkout(repo, branch = \""
str="${str}${itktag}"
str="${str}\");"
fi
${R_HOME}/bin/Rscript -e "${str}"
cd itks
else
# if no directory, clone it
if [[ ! -d itks ]]; then
git clone $itkgit itks
fi
cd itks
if [[ -d .git ]]; then
git checkout master;
git checkout $itktag
fi
fi
rm -rf .git
cd ../
if [[ ! -d ../data/ ]] ; then
mkdir -p ../data
fi
echo "Dependency;GitTag" > ../data/softwareVersions.csv
echo "ITK;${itktag}" >> ../data/softwareVersions.csv
echo "ITKURL;${itkgit}" >> ../data/softwareVersions.csv
mkdir -p itkb
cd itkb
compcflags=" -fPIC -O2 -Wno-c++11-long-long "
compcxxflags=" ${compcflags} "
osx_sysroot=""
if [[ `uname` == 'Darwin' ]] ; then
osx_sysroot=$(xcrun --sdk macosx --show-sdk-path)
fi
cmaker=`${R_HOME}/bin/Rscript -e "x=Sys.which('cmake'); cat(x)"`
if [[ -z "${cmaker}" ]]; then
res=`${R_HOME}/bin/Rscript -e "cat(('cmaker' %in% installed.packages())*1)"`
if [[ $res -eq 0 ]];
then
git clone https://github.com/stnava/cmaker ;
R CMD INSTALL cmaker ;
rm -rf cmaker ;
fi
cmaker=`${R_HOME}/bin/Rscript -e "x=cmaker::cmake()"`
else
cmaker="cmake"
fi
${cmaker} \
-DCMAKE_BUILD_TYPE:STRING="${CMAKE_BUILD_TYPE}" \
-DCMAKE_CXX_STANDARD="17"\
-DCMAKE_CXX_STANDARD_REQUIRED="YES"\
-DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} ${compcflags} -DNDEBUG "\
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} ${compcxxflags} -DNDEBUG "\
-DCMAKE_OSX_SYSROOT="${osx_sysroot}"\
-DITK_USE_GIT_PROTOCOL:BOOL=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DBUILD_TESTING:BOOL=OFF \
-DBUILD_EXAMPLES:BOOL=OFF \
-DCMAKE_INSTALL_PREFIX:PATH="${R_PACKAGE_DIR}"/libs/ \
-DITK_LEGACY_REMOVE:BOOL=OFF \
-DITK_FUTURE_LEGACY_REMOVE:BOOL=OFF \
-DITK_BUILD_DEFAULT_MODULES:BOOL=OFF \
-DModule_AdaptiveDenoising:BOOL=ON \
-DModule_GenericLabelInterpolator:BOOL=ON \
-DKWSYS_USE_MD5:BOOL=ON \
-DITK_WRAPPING:BOOL=OFF \
-DModule_MGHIO:BOOL=ON \
-DModule_ITKDeprecated:BOOL=OFF \
-DModule_ITKReview:BOOL=ON \
-DModule_ITKVtkGlue:BOOL=OFF \
-D ITKGroup_Core=ON \
-D Module_ITKReview=ON \
-D ITKGroup_Filtering=ON \
-D ITKGroup_IO=ON \
-D ITKGroup_Numerics=ON \
-D ITKGroup_Registration=ON \
-D ITKGroup_Segmentation=ON ../itks/
cd ../
# -DModule_ITKDCMTK:BOOL=ON \