-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure
executable file
·51 lines (38 loc) · 1.55 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
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)'`
CMAKE_BUILD_TYPE=Release
str='options(timeout=200); download.file('
str=${str}'"https://ndownloader.figshare.com/files/27383972"'
str=${str}', destfile = "ROBEX.zip", mode = "wb")'
"${R_HOME}/bin/Rscript" -e "${str}"
"${R_HOME}/bin/Rscript" -e 'unzip("ROBEX.zip", exdir = ".")'
rm ROBEX.zip
mkdir -p inst/dat
mkdir -p inst/ref_vols/
cp -r ROBEX/dat/* inst/dat/
cp -r ROBEX/ref_vols/* inst/ref_vols/
cp ROBEX/runROBEX.sh inst/
mkdir -p src
cd src/
# make sure these are tabs
all_flags="-Wformat=0 -Wno-inconsistent-missing-override -Wno-parentheses -Wno-writable-strings -Wno-unused-result"
echo "PKG_CXXFLAGS=${all_flags}" > Makefile
echo "CXXFLAGS=${all_flags}" >> Makefile
# echo "PKG_CFLAGS=${all_flags}" >> Makefile
echo "ROBEX: build" >> Makefile
echo " cd build && make && chmod +x ROBEX && cp ROBEX ../../inst/ && rm -rf ../build/*" >> Makefile
echo "clean:" >> Makefile
echo " rm -rf ROBEX/" >> Makefile
# echo "ROBEX: \$(MAKE) -j 2 && \$(MAKE) all install" > Makevars
mkdir -p build
cd build
# -DCMAKE_INSTALL_PREFIX:PATH="${R_PACKAGE_DIR}/inst/" \
cmake -DITK_DIR:PATH="${ITKDIR}" \
-DCMAKE_CXX_FLAGS="${all_flags}" \
-DCMAKE_EXE_LINKER_FLAGS:STRING=-lstdc++ \
-DCMAKE_BUILD_TYPE:STRING="${CMAKE_BUILD_TYPE}" ../../ROBEX
cd ../../
# needed for warning
# rm -rf ROBEX