-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathconfigure
executable file
·510 lines (422 loc) · 17.3 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
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
#!/bin/bash
## TraME config script
function print_help
{
echo "" ;
echo -e "\x1B[32mTraME configure options:\033[0m" >&2 ;
echo "-c Coverage build" ;
echo "-d Development build" ;
echo "-g Debugging build (optimization flags set to -O0 -g)" ;
echo "-h Print help" ;
echo "-i Install path (default: current directory)" ;
echo " Example: /usr/local" ;
echo "-l Enable wrappers for a linear programming library" ;
echo " Examples: -l glpk or -l gurobi" ;
echo "-m Specify the BLAS and Lapack libraries to link against" ;
echo " Examples: -m \"-lopenblas\" or -m \"-framework Accelerate\"" ;
echo "-o Compiler optimization options; defaults to -O3 -march=native" ;
echo "-p Enable OpenMP parallelization features" ;
echo "" ;
}
while getopts hcdgi:l:m:o:pv option; do
case "${option}" in
h) print_help; exit 2;;
c) TRAME_COVERAGE_BUILD="y";;
d) TRAME_DEV_BUILD="dev";;
g) TRAME_DEBUG_BUILD="y";;
i) TRAME_INSTALL_PATH=${OPTARG};;
l) TRAME_LP=${OPTARG};;
m) TRAME_MATRIX_OPS=${OPTARG};;
o) TRAME_OPT=${OPTARG};;
p) TRAME_PARALLEL="y";;
v) TRAME_BUILD_VERBOSE="y";;
?) print_help; exit 2;;
esac
done
if [ -z ${CC+x} ]; then
CC=gcc
fi
if [ -z ${CXX+x} ]; then
CXX=g++
fi
if [ -z ${FC+x} ]; then
FC=gfortran
fi
#
echo ""
echo -e "\x1B[32mTraME Configuration...\033[0m" >&2 ;
echo ""
# compiler checks
IS_DARWIN=$($CXX -dumpmachine 2>&1 | grep -i -c "darwin")
GCC_COMPILER=$($CXX --version 2>&1 | grep -i -c -E "gcc")
GFC_COMPILER=$($FC --version 2>&1 | grep -i -c -E "gcc")
APPLE_COMPILER=$($CXX --version 2>&1 | grep -i -c -E 'apple llvm')
# get working directory
WDIR=${PWD}
# look for Armadillo
if [ -z ${ARMA_INCLUDE_PATH+x} ]; then
declare -a ARMA_DIRS=("${WDIR}/include" "/usr/include" "/usr/local/include" "/opt/include" "/opt/local/include")
ARMA_INCLUDE_PATH=
for i in "${ARMA_DIRS[@]}"; do
if [ -f "$i"/armadillo ]; then
ARMA_INCLUDE_PATH="$i"
break
fi
done
if [[ $ARMA_INCLUDE_PATH == "" ]]; then
echo -e "\x1B[31m - note: cannot find Armadillo files. Cloning from GitHub\033[0m" >&2 ;
echo ""
mkdir ${WDIR}/arma_tmp
if [[ "${TRAME_BUILD_VERBOSE}" == "y" ]]; then
git clone -b unstable --single-branch https://gitlab.com/conradsnicta/armadillo-code.git ${WDIR}/arma_tmp
echo ""
else
git clone -b unstable --single-branch https://gitlab.com/conradsnicta/armadillo-code.git ${WDIR}/arma_tmp > /dev/null 2>&1
fi
mv ${WDIR}/arma_tmp/include/* ${WDIR}/include
rm -rf ${WDIR}/arma_tmp
ARMA_INCLUDE_PATH="./include"
fi
fi
# set build and optimization flags
if [[ "${TRAME_COVERAGE_BUILD}" == "y" ]]; then
TRAME_OPT_FLAGS="-O0 -g --coverage -fno-inline -fno-inline-small-functions -fno-default-inline"
elif [[ "${TRAME_DEBUG_BUILD}" == "y" ]]; then
TRAME_OPT_FLAGS="-O0 -g"
else
if [[ "${TRAME_OPT}" == "" ]]; then
# echo "TraME: experimental optimization enabled; use of NaN or +/-Inf not recognized"
TRAME_OPT_FLAGS="-O3 -march=native -flto -ffp-contract=fast -DNDEBUG -DARMA_NO_DEBUG"
else
TRAME_OPT_FLAGS="${TRAME_OPT}"
fi
if [[ "${TRAME_PARALLEL}" == "y" ]]; then
TRAME_OPT_FLAGS="${TRAME_OPT_FLAGS} -fopenmp"
else
TRAME_OPT_FLAGS="${TRAME_OPT_FLAGS} -DTRAME_DONT_USE_OPENMP"
fi
fi
TRAME_WARN_FLAGS="-Wall"
# shared library name and install path
TRAME_SHLIB_NAME="libtrame.so"
if [[ "${TRAME_INSTALL_PATH}" == "" ]]; then
TRAME_INSTALL_PATH="${WDIR}"
TRAME_INSTALL_LIB_PATH="${WDIR}"
else
TRAME_INSTALL_LIB_PATH="${TRAME_INSTALL_PATH}/lib"
fi
#
# switch between OSX and Linux
if [[ $OSTYPE == darwin* ]] ; then
if [[ !(-z ${TRAME_R_VERSION+x}) ]]; then
TRAME_SHLIB_FLAGS="-dynamiclib -install_name "@loader_path/${TRAME_SHLIB_NAME}" -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress"
TRAME_BLAS_LAPACK="${TRAME_LAPACK_LIBS} ${TRAME_BLAS_LIBS}"
else
TRAME_SHLIB_FLAGS="-dynamiclib -install_name "${TRAME_INSTALL_LIB_PATH}/${TRAME_SHLIB_NAME}" -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress"
TRAME_BLAS_LAPACK="-framework Accelerate"
fi
# look for any Gurobi directories, then choose the latest one
grb_dirs=( /Library/gurobi* )
nmb_dirs=${#grb_dirs[@]}
grb_latest=${grb_dirs[$nmb_dirs-1]}
# 'grb_dirs' will always be non-empty; in the case where no Gurobi directories are detected,
# grb_dirs will contain just '/Library/gurobi*', which is not an actual directory, so we need
# the following sanity check
if [[ !("${TRAME_LP}" == "glpk") && -d $grb_latest ]] ; then
grb_lib_path=( "$grb_latest/mac64/lib/libgurobi*.so" )
grb_lib_latest=${grb_lib_path[0]}
grb_lib_name=$(basename ${grb_lib_latest})
grb_lib_num=${grb_lib_name//[^0-9]/}
TRAME_LP="Gurobi"
LP_INCLUDE_PATH="-DTRAME_USE_GUROBI -I$grb_latest/mac64/include"
LP_LIB_PATH="-L$grb_latest/mac64/lib"
LP_LIB_FLAGS="-lgurobi${grb_lib_num}"
LP_LIB_RPATH="-Wl,-rpath,$grb_latest/mac64/lib"
else
# look for GLPK, or download it
if [ -f ${WDIR}/glpk_tmp/include/glpk.h ]; then
LP_INCLUDE_PATH="-DTRAME_USE_GLPK -I${WDIR}/glpk_tmp/include"
LP_LIB_PATH="-L${WDIR}/glpk_tmp/lib"
elif [ -f /usr/include/glpk.h ]; then
LP_INCLUDE_PATH="-DTRAME_USE_GLPK -I/usr/include"
LP_LIB_PATH="-L/usr/lib"
elif [ -f /usr/local/include/glpk.h ]; then
LP_INCLUDE_PATH="-DTRAME_USE_GLPK -I/usr/local/include"
LP_LIB_PATH="-L/usr/local/lib"
elif [ -f /opt/include/glpk.h ]; then
LP_INCLUDE_PATH="-DTRAME_USE_GLPK -I/opt/include"
LP_LIB_PATH="-L/opt/lib"
elif [ -f /opt/local/include/glpk.h ]; then
LP_INCLUDE_PATH="-DTRAME_USE_GLPK -I/opt/local/include"
LP_LIB_PATH="-L/opt/local/lib"
else
echo -e "\x1B[31m - note: cannot find a linear programming solver. Downloading and building GLPK.\033[0m" >&2 ;
echo ""
mkdir ${WDIR}/glpk_tmp
cd glpk_tmp
if [[ "${TRAME_BUILD_VERBOSE}" == "y" ]]; then
curl -O http://ftp.gnu.org/gnu/glpk/glpk-4.65.tar.gz
tar -xzf glpk-4.65.tar.gz
cd glpk-4.65
./configure --prefix=${WDIR}/glpk_tmp
make
make PREFIX=${WDIR}/glpk_tmp install
echo ""
else
curl -O http://ftp.gnu.org/gnu/glpk/glpk-4.65.tar.gz > /dev/null 2>&1
tar -xzf glpk-4.65.tar.gz > /dev/null 2>&1
cd glpk-4.65
./configure --prefix=${WDIR}/glpk_tmp > /dev/null 2>&1
make > /dev/null 2>&1
make PREFIX=${WDIR}/glpk_tmp install > /dev/null 2>&1
fi
cd ${WDIR}
rm -f ${WDIR}/glpk_tmp/glpk-4.65.tar.gz
rm -rf ${WDIR}/glpk_tmp/glpk-4.65
LP_INCLUDE_PATH="-DTRAME_USE_GLPK -I${WDIR}/glpk_tmp/include"
LP_LIB_PATH="-L${WDIR}/glpk_tmp/lib"
fi
TRAME_LP="GLPK"
LP_LIB_FLAGS="-lglpk"
LP_LIB_RPATH=
fi
elif [[ $OSTYPE == *linux* ]] ; then
TRAME_OPT_FLAGS="-fPIC ${TRAME_OPT_FLAGS}"
TRAME_SHLIB_FLAGS="-fPIC -shared -L${TRAME_INSTALL_LIB_PATH} -Wl,-Bsymbolic-functions -Wl,-z,relro "
TRAME_BLAS_LAPACK="-lblas -llapack"
# look for any Gurobi directories, then choose the latest one
grb_dirs=( /opt/gurobi* )
nmb_dirs=${#grb_dirs[@]}
grb_latest=${grb_dirs[$nmb_dirs-1]}
# 'grb_dirs' will always be non-empty; in the case where no Gurobi directories are detected,
# grb_dirs will contain just '/Library/gurobi*', which is not an actual directory, so we need
# the following sanity check
if [[ !("${TRAME_LP}" == "glpk") && -d $grb_latest ]] ; then
grb_lib_path=( "$grb_latest/linux64/lib/libgurobi*.so" )
grb_lib_latest=${grb_lib_path[0]}
grb_lib_name=$(basename ${grb_lib_latest})
grb_lib_num=${grb_lib_name//[^0-9]/}
TRAME_LP="Gurobi"
LP_INCLUDE_PATH="-DTRAME_USE_GUROBI -I$grb_latest/linux64/include"
LP_LIB_PATH="-L$grb_latest/linux64/lib"
LP_LIB_FLAGS="-lgurobi${grb_lib_num}"
LP_LIB_RPATH="-Wl,-rpath,$grb_latest/linux64/lib"
else
# look for GLPK, or download it
if [ -f ${WDIR}/glpk_tmp/include/glpk.h ]; then
LP_INCLUDE_PATH="-DTRAME_USE_GLPK -I${WDIR}/glpk_tmp/include"
LP_LIB_PATH="-L${WDIR}/glpk_tmp/lib"
elif [ -f /usr/include/glpk.h ]; then
LP_INCLUDE_PATH="-DTRAME_USE_GLPK -I/usr/include"
LP_LIB_PATH="-L/usr/lib"
elif [ -f /usr/local/include/glpk.h ]; then
LP_INCLUDE_PATH="-DTRAME_USE_GLPK -I/usr/local/include"
LP_LIB_PATH="-L/usr/local/lib"
elif [ -f /opt/include/glpk.h ]; then
LP_INCLUDE_PATH="-DTRAME_USE_GLPK -I/opt/include"
LP_LIB_PATH="-L/opt/lib"
elif [ -f /opt/local/include/glpk.h ]; then
LP_INCLUDE_PATH="-DTRAME_USE_GLPK -I/opt/local/include"
LP_LIB_PATH="-L/opt/local/lib"
else
echo -e "\x1B[31m - note: cannot find a linear programming solver. Downloading and building GLPK.\033[0m" >&2 ;
echo ""
mkdir ${WDIR}/glpk_tmp
cd glpk_tmp
if [[ "${TRAME_BUILD_VERBOSE}" == "y" ]]; then
curl -O http://ftp.gnu.org/gnu/glpk/glpk-4.65.tar.gz
tar -xzf glpk-4.65.tar.gz
cd glpk-4.65
./configure --prefix=${WDIR}/glpk_tmp
make
make PREFIX=${WDIR}/glpk_tmp install
echo ""
else
curl -O http://ftp.gnu.org/gnu/glpk/glpk-4.65.tar.gz > /dev/null 2>&1
tar -xzf glpk-4.65.tar.gz > /dev/null 2>&1
cd glpk-4.65
./configure --prefix=${WDIR}/glpk_tmp > /dev/null 2>&1
make > /dev/null 2>&1
make PREFIX=${WDIR}/glpk_tmp install > /dev/null 2>&1
fi
cd ${WDIR}
rm -f ${WDIR}/glpk_tmp/glpk-4.65.tar.gz
rm -rf ${WDIR}/glpk_tmp/glpk-4.65
LP_INCLUDE_PATH="-DTRAME_USE_GLPK -I${WDIR}/glpk_tmp/include"
LP_LIB_PATH="-L${WDIR}/glpk_tmp/lib"
fi
TRAME_LP="GLPK"
LP_LIB_FLAGS="-lglpk"
LP_LIB_RPATH=
fi
elif [[ $OSTYPE == *cygwin* ]] ; then
TRAME_SHLIB_NAME="libtrame.dll"
TRAME_OPT_FLAGS="${TRAME_OPT_FLAGS} -DARMA_DONT_PRINT_CXX11_WARNING"
TRAME_SHLIB_FLAGS="-shared -L${TRAME_INSTALL_LIB_PATH} "
TRAME_BLAS_LAPACK="-lblas -llapack"
# look for any Gurobi directories, then choose the latest one
grb_dirs=( /cygdrive/c/gurobi* )
nmb_dirs=${#grb_dirs[@]}
grb_latest=${grb_dirs[$nmb_dirs-1]}
# 'grb_dirs' will always be non-empty; in the case where no Gurobi directories are detected,
# grb_dirs will contain just '/Library/gurobi*', which is not an actual directory, so we need
# the following sanity check
if [[ !("${TRAME_LP}" == "glpk") && -d $grb_latest ]] ; then
grb_lib_path=( "$grb_latest/win64/bin/libgurobi*.dll" )
grb_lib_latest=${grb_lib_path[0]}
grb_lib_name=$(basename ${grb_lib_latest})
grb_lib_num=${grb_lib_name//[^0-9]/}
TRAME_LP="Gurobi"
LP_INCLUDE_PATH="-DTRAME_USE_GUROBI -I$grb_latest/win64/include"
LP_LIB_PATH="-L$grb_latest/win64/bin"
LP_LIB_FLAGS="-lgurobi${grb_lib_num}"
LP_LIB_RPATH="-Wl,-rpath,$grb_latest/win64/bin"
else
# look for GLPK, or download it
if [ -f ${WDIR}/glpk_tmp/include/glpk.h ]; then
LP_INCLUDE_PATH="-DTRAME_USE_GLPK -I${WDIR}/glpk_tmp/include"
LP_LIB_PATH="-L${WDIR}/glpk_tmp/lib"
elif [ -f /usr/include/glpk.h ]; then
LP_INCLUDE_PATH="-DTRAME_USE_GLPK -I/usr/include"
LP_LIB_PATH="-L/usr/lib"
elif [ -f /usr/local/include/glpk.h ]; then
LP_INCLUDE_PATH="-DTRAME_USE_GLPK -I/usr/local/include"
LP_LIB_PATH="-L/usr/local/lib"
elif [ -f /opt/include/glpk.h ]; then
LP_INCLUDE_PATH="-DTRAME_USE_GLPK -I/opt/include"
LP_LIB_PATH="-L/opt/lib"
elif [ -f /opt/local/include/glpk.h ]; then
LP_INCLUDE_PATH="-DTRAME_USE_GLPK -I/opt/local/include"
LP_LIB_PATH="-L/opt/local/lib"
else
echo -e "\x1B[31m - note: cannot find a linear programming solver. Downloading and building GLPK.\033[0m" >&2 ;
echo ""
mkdir ${WDIR}/glpk_tmp
cd glpk_tmp
if [[ "${TRAME_BUILD_VERBOSE}" == "y" ]]; then
curl -O http://ftp.gnu.org/gnu/glpk/glpk-4.65.tar.gz
tar -xzf glpk-4.65.tar.gz
cd glpk-4.65
./configure --prefix=${WDIR}/glpk_tmp
make
make PREFIX=${WDIR}/glpk_tmp install
echo ""
else
curl -O http://ftp.gnu.org/gnu/glpk/glpk-4.65.tar.gz > /dev/null 2>&1
tar -xzf glpk-4.65.tar.gz > /dev/null 2>&1
cd glpk-4.65
./configure --prefix=${WDIR}/glpk_tmp > /dev/null 2>&1
make > /dev/null 2>&1
make PREFIX=${WDIR}/glpk_tmp install > /dev/null 2>&1
fi
cd ${WDIR}
rm -f ${WDIR}/glpk_tmp/glpk-4.65.tar.gz
rm -rf ${WDIR}/glpk_tmp/glpk-4.65
LP_INCLUDE_PATH="-DTRAME_USE_GLPK -I${WDIR}/glpk_tmp/include"
LP_LIB_PATH="-L${WDIR}/glpk_tmp/lib"
LP_LIB_FLAGS="-lglpk"
LP_LIB_RPATH=
fi
TRAME_LP="GLPK"
LP_LIB_FLAGS="-lglpk"
LP_LIB_RPATH=
fi
else
TRAME_BLAS_LAPACK="-lblas -llapack"
TRAME_LP=""
LP_INCLUDE_PATH=
LP_LIB_PATH=
LP_LIB_FLAGS=
LP_LIB_RPATH=
fi
# final settings
if [[ !(-z ${TRAME_MATRIX_OPS+x}) ]]; then
TRAME_BLAS_LAPACK="${TRAME_MATRIX_OPS}"
fi
if [[ "${TRAME_COVERAGE_BUILD}" == "y" ]]; then
TRAME_SHLIB_FLAGS="--coverage ${TRAME_SHLIB_FLAGS}"
else
TRAME_SHLIB_FLAGS="${TRAME_OPT_FLAGS} ${TRAME_SHLIB_FLAGS}"
fi
if [ "$IS_DARWIN" -eq "1" ] && [ "$GCC_COMPILER" -eq "1" ]; then
TRAME_OPT_FLAGS="-Wa,-q ${TRAME_OPT_FLAGS}"
fi
TRAME_FC_OPT_FLAGS=$TRAME_OPT_FLAGS
if [ "$IS_DARWIN" -eq "1" ] && [ "$GCC_COMPILER" -eq "0" ] && [ "$GFC_COMPILER" -eq "1" ]; then
TRAME_FC_OPT_FLAGS="-Wa,-q ${TRAME_FC_OPT_FLAGS}"
fi
#
# final print:
echo " - OS: ${OSTYPE}"
echo " - C compiler: ${CC}"
echo " - C++ compiler: ${CXX}"
echo " - Fortran compiler: ${FC}"
if [[ "${TRAME_DEV_BUILD}" == "dev" ]]; then
echo " - Build version: development"
elif [[ "${TRAME_COVERAGE_BUILD}" == "y" ]]; then
echo " - Build version: coverage"
elif [[ "${TRAME_DEBUG_BUILD}" == "y" ]]; then
echo " - Build version: debug"
else
echo " - Build version: release"
fi
echo ""
echo " - ARMA_INCLUDE_PATH set to:"
echo " ${ARMA_INCLUDE_PATH}"
echo " - BLAS and Lapack libraries set to:"
echo " ${TRAME_BLAS_LAPACK}"
echo ""
echo " - LP solver: ${TRAME_LP}"
echo " * LP_INCLUDE_PATH:"
echo " ${LP_INCLUDE_PATH}"
echo " * LP_LIB_PATH:"
echo " ${LP_LIB_PATH}"
echo " * LP_LIB_FLAGS:"
echo " ${LP_LIB_FLAGS}"
echo ""
if [[ "${TRAME_PARALLEL}" == "y" ]]; then
echo -e " - OpenMP features: \x1B[32menabled\033[0m" >&2 ;
else
echo -e " - OpenMP features: \x1B[31mdisabled\033[0m" >&2 ;
fi
echo " - Optimization flags:"
echo " ${TRAME_OPT_FLAGS}"
echo ""
echo " - TraME install path:"
echo " ${TRAME_INSTALL_PATH}"
echo ""
echo " - Additional notes:"
if [ "$APPLE_COMPILER" -eq "1" ] && [[ "${TRAME_PARALLEL}" == "y" ]]; then
echo -e " \x1B[31m- You have enabled OpenMP, but your C++ compiler does not\033[0m" >&2 ;
echo -e " \x1B[31m support this feature!\033[0m" >&2 ;
fi
if [ "$IS_DARWIN" -eq "1" ] && [ "$GCC_COMPILER" -eq "1" ]; then
echo " - To enable AVX features, your compiler will use the Apple LLVM"
echo " assembler"
fi
if [ "$IS_DARWIN" -eq "1" ] && [ "$GCC_COMPILER" -eq "0" ] && [ "$GFC_COMPILER" -eq "1" ]; then
echo " - To enable AVX features, your Fortran compiler will use the"
echo " Apple LLVM assembler."
fi
echo ""
echo -e "\x1B[32mConfiguration completed. Creating Makefile... \c\033[0m" >&2 ;
# create Makefile
sed -e "s|@CC@|${CC}|" \
-e "s|@CXX@|${CXX}|" \
-e "s|@FC@|${FC}|" \
-e "s|@ARMA_INCLUDE_PATH@|${ARMA_INCLUDE_PATH}|" \
-e "s|@TRAME_BLAS_LAPACK@|${TRAME_BLAS_LAPACK}|" \
-e "s|@TRAME_WARN_FLAGS@|${TRAME_WARN_FLAGS}|" \
-e "s|@TRAME_OPT_FLAGS@|${TRAME_OPT_FLAGS}|" \
-e "s|@TRAME_FC_OPT_FLAGS@|${TRAME_FC_OPT_FLAGS}|" \
-e "s|@TRAME_SHLIB_NAME@|${TRAME_SHLIB_NAME}|" \
-e "s|@TRAME_SHLIB_FLAGS@|${TRAME_SHLIB_FLAGS}|" \
-e "s|@TRAME_BUILD_PATH@|${WDIR}|" \
-e "s|@TRAME_INSTALL_PATH@|${TRAME_INSTALL_PATH}|" \
-e "s|@LP_INCLUDE_PATH@|${LP_INCLUDE_PATH}|" \
-e "s|@LP_LIB_PATH@|${LP_LIB_PATH}|" \
-e "s|@LP_LIB_FLAGS@|${LP_LIB_FLAGS}|" \
-e "s|@LP_LIB_RPATH@|${LP_LIB_RPATH}|" \
Makefile.in > Makefile
echo -e "\x1B[32mdone.\033[0m" >&2 ;
echo ""