-
Notifications
You must be signed in to change notification settings - Fork 3
/
configure.win
91 lines (70 loc) · 2.3 KB
/
configure.win
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
## Manual configuration file for Windows version of RNetica
: ${R_HOME=`R RHOME`}
if test -z "${R_HOME}"; then
echo "could not determine R_HOME"
exit 1
fi
## default to assuming Netica library has been found
NETICA_GOOD="no"
NETICA_VERSION=504
## also use pkg-config to check for Netica
##
echo "Checking for pkg-config"
if command -v pkg-config; then
## check via pkg-config for nlopt
if pkg-config --exists netica; then
## obtain cflags and obtain libs
NETICA_HOME=$(pkg-config --variable=prefix netica)
NETICA_CFLAGS=$(pkg-config --cflags netica)
NETICA_LDFLAGS=$(pkg-config --libs netica)
NETICA_VERSION=$(pkg-config --modversion netica)
NETICA_GOOD="yes"
fi
fi
echo "Testing for Netica at ${NETICA_HOME}..."
if test -z "${NETICA_HOME}" ; then
NETICA_GOOD="no"
elif test -e "${NETICA_HOME}/src/Netica.h"; then
NETICA_GOOD="yes"
else
NETICA_GOOD="no"
fi
echo $NETICA_GOOD
if test x"${NETICA_GOOD}" = x"no"; then
echo "Need to download Netica from Norsys.com"
(cd src/Netica; ./Makeit.win) || exit 1
NETICA_HOME="$(pwd)/src/Netica/Netica_API_510"
fi
echo "Using Netica at $NETICA_HOME"
#Moved to Makefile.win
echo "${R_HOME}/bin${R_ARCH_BIN}/Rscript"
x86=`"${R_HOME}/bin${R_ARCH_BIN}/Rscript" -e 'cat(.Machine$sizeof.pointer==8)'`
echo "Building for x86..." $x86
if test $x86 = "TRUE"; then
NETICA_LIB="${NETICA_HOME}/lib64"
INSTALL_LIB="libs/x64"
LONG_SIZE=8
else
NETICA_LIB="${NETICA_HOME}/lib"
INSTALL_LIB="libs/i386"
LONG_SIZE=4
fi
## Need to do this here, as apparently it is not getting picked up in
## Makevars.win
#mkdir -p "${INSTALL_LIB}"
#cp "${NETICA_LIB}/Netica.dll" "${INSTALL_LIB}"
#cp "${NETICA_LIB}/Netica.lib" "${INSTALL_LIB}"
if test -z "$NETICA_CFLAGS"; then
NETICA_CFLAGS=-I"${NETICA_HOME}/src"
fi
if test -z "$NETICA_LDFLAGS"; then
NETICA_LDFLAGS="\${R_PACKAGE_DIR}/${INSTALL_LIB}/Netica.dll"
fi
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%"
echo "%% Netica Home = $NETICA_HOME"
echo "%% Netica Lib = $NETICA_LIB"
echo "%% Install Lib = $INSTALL_LIB"
echo "%% Netica CFlags = $NETICA_CFLAGS"
echo "%% Netica LDFlags = $NETICA_LDFLAGS"
sed -e"s|@NETICA_HOME@|${NETICA_HOME}|" -es"|@NETICA_CFLAGS@|${NETICA_CFLAGS}|" <src/Makevars.winin >src/Makevars.win
sed -e"s|@LONG_SIZE@|LONG_SIZE|" <src/config.h.win >src/config.h