forked from ANTsX/ANTsR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
executable file
·69 lines (57 loc) · 2.18 KB
/
configure
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
#!/bin/bash
CXX_STD=CXX11
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)'`
ITKDIR=`${R_HOME}/bin/Rscript -e 'a<-ITKR:::itkDir(); cat(a)'`
# get a version of cmake
cmaker=`which cmake`
if [[ ! -x $cmaker ]] ; then # try r version
cmaker=`${R_HOME}/bin/Rscript -e 'a<-cmaker::cmake()'`
fi
if [[ `uname` -eq Darwin ]] ; then
CMAKE_BUILD_TYPE=Release
fi
if [[ $TRAVIS -eq true ]] ; then
CMAKE_BUILD_TYPE=Release
fi
gitcmd=`which git`
if [[ ! -x $gitcmd ]] ; then # try install git
apt-get install -y git-core
fi
gitcmd=`which git`
if [[ ! -x $gitcmd ]] ; then # try install git
exit 1
fi
cd ./src
# platform-specific Makevars
echo "myantssource=\${PWD}/ants/" > Makevars
echo "ITK = \`\$(R_HOME)/bin/Rscript -e 'ITKR:::itkIncludes()'\`" >> Makevars
needVCL_CAN_STATIC_CONST_INIT_FLOAT=0
if [[ ${#CC} -gt 0 ]] ; then # test the requested compiler
temp=$(${CC} --version | grep clang)
if [[ ${#temp} -gt 0 ]] ; then
needVCL_CAN_STATIC_CONST_INIT_FLOAT=1
fi
else # just try gcc directly
temp=$(gcc --version | grep clang)
if [[ ${#temp} -gt 0 ]] ; then
needVCL_CAN_STATIC_CONST_INIT_FLOAT=1
fi
fi
echo $OSTYPE $needVCL_CAN_STATIC_CONST_INIT_FLOAT
echo "PKG_CPPFLAGS = -I\${ITK} -I\${PWD} \
-I`\${R_HOME}/bin/Rscript -e 'ANTsRCore:::antsIncludes()'` \
-I../inst/include/ " >> Makevars
echo "CXX_STD = CXX11" >> Makevars
echo "myantslib=`\${R_HOME}/bin/Rscript -e 'ANTsRCore:::antsLibs()'` " >> Makevars
echo "libants=\`find \${myantslib} -name \"lib*.a\"\`" >> Makevars
echo "libitk=\`find \\\`\$(R_HOME)/bin/Rscript -e 'ITKR:::itkLibs()'\\\` -name \"lib*.a\"\` " >> Makevars
echo "PKG_LIBS = \${libitk} \${libants} \${libitk} \${libants} \${libitk} \
\${libants} \${libitk} \${libants} \${itklib} \${libants} \
\${libitk} \${libants} \${itklib} \${libants} \${itklib} \
\${libants} \${libitk} \${libants} \${itklib}" >> Makevars
echo ".PHONY: all libs" >> Makevars
echo "all: \$(SHLIB)" >> Makevars
echo "\$(SHLIB): libs" >> Makevars
echo "libs: ; cd \${PWD}" >> Makevars