forked from ecrc/exageostatR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure
executable file
·578 lines (523 loc) · 16.9 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
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
#!/usr/bin/env bash
# Configure script for R package generation
#
#
#
#Sys.setenv(PKG_CONFIG_PATH=paste(Sys.getenv("PKG_CONFIG_PATH"),paste(.libPaths(),"exageostat/lib/pkgconfig",sep='/',collapse=':'),sep=':'))
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${R_HOME}/exageostat/lib/pkgconfig
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$R_LIBS_USER/exageostat/lib/pkgconfig
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$R_LIBS/exageostat/lib/pkgconfig
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$R_PACKAGE_DIR/exageostat/lib/pkgconfig # if user uses -l option
#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${R_HOME}/exageostat/lib
#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$R_LIBS_USER/exageostat/lib
#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$R_LIBS/exageostat/lib
#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$R_PACKAGE_DIR/exageostat/lib
#export CPATH=$CPATH:$R_INCLUDE_DIR
#export CPATH=$R_INCLUDE_DIR
#export C_INCLUDE_PATH=$R_INCLUDE_DIR
#export CPLUS_INCLUDE_PATH=$R_INCLUDE_DIR
#export GCC_INCLUDE_DIR=$R_INCLUDE_DIR
#STRARPU_HOME=$TMPDIR
echo "==========================================="
mv ./patches/stars-h.patch $TMPDIR
echo $TMPDIR
echo $OPENBLAS_ROOT
echo $OPEMBLASROOT
echo $R_PACKAGE_DIR
echo $R_INCLUDE_DIR
echo ${R_HOME}
echo ${TMPDIR}
echo ${TEMPDIR}
echo ${TMPDIR}
echo ${TMP}
echo ${TEMP}
echo "============================================"
#echo -e " \033[38;2;255;0;0m CMake is required and not found!"
#echo -e " \033[0;0;0;0;0m"
#Get the number of CPUs
cpucores=`getconf _NPROCESSORS_ONLN`
#cpucores=1
#VARIABLES
MAKE=${MAKE:-make -j $(cpucores) -l $((cpucores + 1))}
BASEDIR=$(pwd)
TMPDIR=$BASEDIR/_$$
#export STARPU_HOME=~/trash"
#TMPDIR="/tmp/exageostatr"
BUILD_DEPENDENCIES='true'
err=0
CUDAVALUE="OFF"
MPIVALUE="OFF"
mkdir -p $TMPDIR
SETUP_DIR=${R_PACKAGE_DIR:-''}
print_usage() {
echo "usage: $0 [--enable-mpi|--disable-mpi] [--prefix /path/to/install]"
}
while [ -n "$1" ]
do
case "$1" in
--enable-cuda)
CUDAVALUE="ON"
shift
;;
--enable-mpi)
MPIVALUE="ON"
shift
;;
--disable-mpi)
MPIVALUE="OFF"
shift
;;
--build-deps)
BUILD_DEPENDENCIES='true'
shift
;;
--no-build-deps)
BUILD_DEPENDENCIES='false'
shift
;;
--prefix)
shift
SETUP_DIR=$1
# Set this paths as rpath during compilation
rpaths="-Wl,-rpath=$SETUP_DIR/lib -L$SETUP_DIR/lib "
echo "LDFLAGS += $rpaths " >> $BASEDIR/src/Makefile
shift
;;
--help|-h)
print_usage
exit 0
;;
*)
print_usage
exit 1
;;
esac
done
if [ -z "$SETUP_DIR" ]; then
# Use RLIBS for setup dir
arr=(`Rscript -e '.libPaths()' | awk '{Rprintf "%s ",$2}'`)
for i in ${!arr[*]};
do
dir=`echo ${arr[$i]}|tr -d \"`
if [ -d "$dir" ] && [ -w "$dir" ]
then
SETUP_DIR="$dir/exageostat"
break
fi
done
fi
mkdir -p $SETUP_DIR
if [ -z "$SETUP_DIR" ]
then
echo "Check your .libPaths() in R. Could not find a writable directory."
exit 1;
fi
PREFIX=$SETUP_DIR
############################## Check OS
echo "Finding the current os type"
echo
osType=$(uname)
case "$osType" in
"Darwin")
{
echo "Running on Mac OSX."
CURRENT_OS="OSX"
LIBEXT="dylib"
export DYLD_LIBRARY_PATH=$PREFIX/lib:$DYLD_LIBRARY_PATH
} ;;
"Linux")
{
echo "Running on LINUX."
CURRENT_OS="LINUX"
LIBEXT="so"
export LD_LIBRARY_PATH=$PREFIX/lib:$LD_LIBRARY_PATH
} ;;
*)
{
echo "Unsupported OS, exiting"
exit
} ;;
esac
# check submodules just in case
#git submodule update --init --recursive 2>&1 >/dev/null || true
##### check and build dependencies
# prepare environment
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH
if [ -n "$MKLROOT" ] && [ -d "$MKLROOT" ]; then
echo "mkl_dir directory exists!"
echo "Great... continue set-up"
source ${MKLROOT}/bin/mklvars.sh intel64
DEFINE_BLAS_LIBS_CMAKE="-DBLAS_LIBRARIES='-L${MKLROOT}/lib -Wl,-rpath,${MKLROOT}/lib -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm -ldl'"
#DEFINE_BLAS_LIBS_CMAKE="-DBLAS_LIBRARIES='-L${MKLROOT}/lib\ -Wl,-rpath,${MKLROOT}/lib\ -lmkl_intel_lp64\ -lmkl_sequential\ -lmkl_core\ -lpthread\ -lm\ -ldl'"
XFLAG="-DBLA_VENDOR=Intel"
else
echo "MKL not found, trying to compile and use OpenBLAS"
XFLAG="-DBLA_VENDOR=Open"
USE_OPENBLAS='true'
fi
#set pkgconfig path including possible installation dir
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$SETUP_DIR/lib/pkgconfig
# openblas
if [ "true" == "$USE_OPENBLAS" ]
then
#obenblas will not be installed.
_OPENBLAS='true'
# _OPENBLAS='false'
if pkg-config --exists openblas
then
#check for lapacke.h
# _LOCATION=`pkg-config --variable=includedir openblas`
# if stat "${_LOCATION}/lapacke.h" >/dev/null 2>&1
# then
_LOCATION=`pkg-config --variable=libdir openblas`
echo "OpenBLAS FOUND in [$_LOCATION]"
_OPENBLAS='true'
# fi
fi
if [ -n "$OPENBLAS_ROOT" ] && [ -d "$OPENBLAS_ROOT" ];
then
echo "OpenBLAS FOUND in [$OPENBLAS_ROOT]"
_OPENBLAS='true'
fi
if [ "false" == "${_OPENBLAS}" ]
then
if [ "$BUILD_DEPENDENCIES" == "true" ]
then
echo "Building OpenBLAS..."
cd $TMPDIR
wget https://github.com/xianyi/OpenBLAS/archive/v0.3.7.tar.gz -O - | tar -zx
cd OpenBLAS-0.3.7
$MAKE -j PREFIX=$PREFIX >/dev/null|| $MAKE PREFIX=$PREFIX || { echo 'OpenBLAS installation failed' ; exit 1; }
$MAKE install PREFIX=$PREFIX
export CPATH=$PREFIX/include:$CPATH
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH
OPENBLAS_CFLAGS=`pkg-config --variable=includedir openblas`
OPENBLAS_LIBS=`pkg-config --variable=libdir openblas`
PKG_CPPFLAGS=`pkg-config --variable=includedir openblas`
PKG_LIBS=-l$PREFIX/lib/libopenblas.so
echo "========================="
echo $PKG_LIBS
echo "+++++++++++++++++++++++++="
#DEFINE_BLAS_LIBS_CMAKE="-DBLAS_DIR='${PREFIX}' -DCBLAS_DIR='${PREFIX}' -DLAPACK_DIR='${PREFIX}' -DLAPACKE_DIR='${PREFIX}' -DTMG='${PREFIX}'"
#export OPENBLAS_CFLAGS=-I$PREFIX/include
#export OPENBLAS_LIBS=-L$PREFIX/lib
#export BLAS_OPENBLAS_CFLAGS=-I{$PREFIX/include
export BLAS_OPENBLAS_LIBS=-l$PREFIX/lib/libopenblas.so
#cp $PREFIX/lib/libopenblas.so $BASEDIR/src
#export BLAS_LIBS=-L{$PREFIX}/lib
else
echo "####################"
echo "OpenBLAS NOT FOUND"
echo "Please download it from: https://github.com/xianyi/OpenBLAS/releases"
echo "After installing it, set the proper PKG_CONFIG_PATH variable"
echo ""
err=1
fi
fi
fi
# gsl
if pkg-config --exists --atleast-version=2 gsl
then
_LOCATION=`pkg-config --variable=prefix gsl`
echo "gsl FOUND in [$_LOCATION]"
else
if [ "$BUILD_DEPENDENCIES" == "true" ]
then
echo "Building GSL..."
cd $TMPDIR
wget https://ftp.gnu.org/gnu/gsl/gsl-2.4.tar.gz -O - | tar -zx
cd gsl-2.4
./configure --prefix=$PREFIX
$MAKE || $MAKE VERBOSE=1 || { echo 'GSL installation failed' ; exit 1; }
$MAKE install
else
echo "####################"
echo "gsl NOT FOUND"
echo "Please download it from: https://ftp.gnu.org/gnu/gsl/gsl-2.4.tar.gz"
echo "After installing it, set the proper PKG_CONFIG_PATH variable"
echo ""
err=1
fi
fi
echo "==========================================="
#EXAGEOSTAT_CONFIG=`Rscript -e '.libPaths()' | awk '{printf "%s/exageostat/lib/pkgconfig:",substr($2,2,length($2)-2)}'`
echo ${R_HOME}
echo "==========================================="
echo $R_LIBS_USER
echo "==========================================="
echo $R_LIBS
echo "==========================================="
#Rscript -e '.libPaths()'
echo $PKG_LIBS
echo "==========================================="
echo $PKG_CXXFLAGS
echo "==========================================="
echo $PKG_CONFIG_PATH
echo "==========================================="
echo $PKG_CPPFLAGS
echo "==========================================="
#nm $PREFIX/lib/libopenblas.so | grep "LAPACKE_slarfb_work"
echo "==========================================="
# nlopt
if pkg-config --exists --atleast-version=2.4 nlopt
then
_LOCATION=`pkg-config --variable=prefix nlopt`
echo "nlopt FOUND in [$_LOCATION]"
else
if [ "$BUILD_DEPENDENCIES" == "true" ]
then
echo "Building NLOPT..."
cd $TMPDIR
wget http://ab-initio.mit.edu/nlopt/nlopt-2.4.2.tar.gz -O - | tar -zx
cd nlopt-2.4.2
./configure --enable-shared --without-guile --prefix=$PREFIX
$MAKE || $MAKE VERBOSE=1 || { echo 'NLOPT installation failed' ; exit 1; }
$MAKE install
else
echo "####################"
echo "nlopt NOT FOUND"
echo "Please download it from: http://ab-initio.mit.edu/nlopt/nlopt-2.4.2.tar.gz"
echo "After installing it, set the proper PKG_CONFIG_PATH variable"
echo ""
err=1
fi
fi
# hwloc
if pkg-config --exists hwloc
then
_LOCATION=`pkg-config --variable=prefix hwloc`
echo "hwloc FOUND in [$_LOCATION]"
else
if [ "$BUILD_DEPENDENCIES" == "true" ]
then
echo "Building Hwloc..."
cd $TMPDIR
wget https://www.open-mpi.org/software/hwloc/v1.11/downloads/hwloc-1.11.5.tar.gz -O - | tar -zx
cd hwloc-1.11.5
./configure --prefix=$PREFIX
$MAKE || $MAKE VERBOSE=1 || { echo 'HWLOC installation failed' ; exit 1; }
$MAKE install
else
echo "####################"
echo "hwloc NOT FOUND"
echo "Please download it from: https://www.open-mpi.org/software/hwloc/v1.11/downloads/hwloc-1.11.5.tar.gz"
echo "After installing it, set the proper PKG_CONFIG_PATH variable"
echo ""
err=1
fi
fi
if pkg-config --exists libstarpu-1.2
then
echo " libstarpu-1.2 exist"
else
echo "libstarpu-1.2 not exist"
fi
if pkg-config --exists starpu-1.2
then
echo " starpu-1.2 exist"
else
echo "starpu-1.2 not exist"
fi
if pkg-config --exists libstarpu-1.3
then
echo " libstarpu-1.3 exist"
else echo "libstarpu-1.3 not exist"
fi
if pkg-config --exists starpu-1.3
then
echo " starpu-1.3 exist"
else
echo "starpu-1.3 not exist"
fi
if pkg-config --exists libstarpu
then
echo " libstarpu exist"
else
echo "libstarpu not exist"
fi
if pkg-config --exists starpu
then
echo " starpu exist"
else
echo "starpu not exist"
fi
# StarPU
if pkg-config --exists starpu-1.2
then
_LOCATION=`pkg-config --variable=prefix libstarpu`
echo "StarPU FOUND in [$_LOCATION]"
else
if [ "$BUILD_DEPENDENCIES" == "true" ]
then
echo "Building StarPU..."
cd $TMPDIR
wget https://files.inria.fr/starpu/starpu-1.2.9/starpu-1.2.9.tar.gz -O - | tar -zx
cd starpu-1.2.9
#CFLAGS=-Wno-implicit-function-declaration
if [ "$CUDAVALUE" == "ON" ]; then
if [ "$MPIVALUE" == "ON" ]; then
./configure --disable-starpufft --enable-cuda --disable-opencl --prefix=$PREFIX --disable-starpu-top --disable-starpufft --disable-build-doc --disable-starpufft-examples --disable-fortran --with-perf-model-dir=$TMPDIR --disable-fstack-protector-all --disable-gcc-extensions
else
./configure --disable-starpufft --enable-cuda --disable-opencl --prefix=$PREFIX --disable-starpu-top --disable-starpufft --disable-build-doc --disable-starpufft-examples --disable-fortran --with-perf-model-dir=$TMPDIR --disable-fstack-protector-all --disable-gcc-extensions
fi
else
if [ "$MPIVALUE" == "ON" ]; then
./configure --disable-starpufft --disable-cuda --disable-opencl --prefix=$PREFIX --disable-starpu-top --disable-starpufft --disable-build-doc --disable-starpufft-examples --disable-fortran --with-perf-model-dir=$TMPDIR --disable-fstack-protector-all --disable-gcc-extensions
else
./configure --disable-starpufft --disable-cuda --disable-opencl --prefix=$PREFIX --disable-starpu-top --disable-starpufft --disable-build-doc --disable-starpufft-examples --disable-fortran --disable-glpk --with-perf-model-dir=$TMPDIR --disable-fstack-protector-all --disable-gcc-extensions
fi
fi
$MAKE || $MAKE VERBOSE=1 || { echo 'STARPU installation failed' ; exit 1; }
$MAKE install
else
echo "####################"
echo "StarPU NOT FOUND"
echo "Please download it from: http://starpu.gforge.inria.fr/files/"
echo "After installing it, set the proper PKG_CONFIG_PATH variable"
echo ""
err=1
fi
fi
#echo "???????????????"
#cp $BASEDIR/src/libs/libudev.so.1 $PREFIX/lib
#cp $BASEDIR/src/libs/libudev.so $PREFIX/lib
#echo "????????????"
echo "============STARPU======================"
echo "$(ls $PREFIX/lib)"
echo "======================================"
#echo "Sameh ======================================"
#echo "$(ls $PREFIX/lib)"
#echo "======================================"
#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PREFIX/lib
cd $BASEDIR
set -x
# CHAMELEON
#if pkg-config --exists chameleon
#then
# _LOCATION=`pkg-config --variable=prefix chameleon`
# echo "CHAMELEON FOUND in [$_LOCATION]"
#else
if [ "$BUILD_DEPENDENCIES" == "true" ]
then
echo "Building CHAMELEON..."
cd $TMPDIR
rm -rf h
git clone https://github.com/ecrc/hicma h
cd h
git submodule update --init --recursive 2>&1 >/dev/null || true
cd chameleon
git checkout 8595b23
git submodule update --init --recursive 2>&1 >/dev/null || true
#cp -r $BASEDIR/src/hicma $TMPDIR/h
#cd $TMPDIR/h/chameleon
mkdir -p build && cd build
rm -rf ./CMake*
LDFLAGS="-L$PREFIX/lib" cmake -DCMAKE_C_FLAGS=-fPIC -DCHAMELEON_USE_MPI=$MPIVALUE -DCMAKE_BUILD_TYPE="Release" -DCMAKE_C_FLAGS_RELEASE="-O3 -Ofast -w" -DCHAMELEON_USE_CUDA=$CUDAVALUE -DCHAMELEON_ENABLE_EXAMPLE=OFF -DCHAMELEON_ENABLE_TESTING=OFF -DCHAMELEON_ENABLE_TIMING=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=$PREFIX "$DEFINE_BLAS_LIBS_CMAKE" ..
echo "======================================"
echo "$(cat ./runtime/starpu/CMakeFiles/runtime_starpu_include.dir/build.make)"
echo "$(cat ./build.make)"
echo "======================================"
$MAKE || $MAKE VERBOSE=1 || { echo 'CHAMELEON installation failed' ; exit 1; }
$MAKE install
else
echo "####################"
echo "CHAMELEON NOT FOUND"
echo "Please download it from: https://gitlab.inria.fr/solverstack/chameleon.git"
echo "After installing it, set the proper PKG_CONFIG_PATH variable"
echo ""
err=1
fi
#fi
echo "============CHAMELEON======================"
echo "$(ls $PREFIX/lib)"
echo "======================================"
# starsh
#if pkg-config --exists --atleast-version=0.1.1 starsh
#then
# _LOCATION=`pkg-config --variable=prefix starsh`
# echo "starsh FOUND in [$_LOCATION]"
#else
if [ "$BUILD_DEPENDENCIES" == "true" ]
then
echo "Building STARS-H..."
#cd $BASEDIR/src/stars-h
cd $TMPDIR
rm -rf stars-h
git clone https://github.com/ecrc/stars-h stars-h
cd stars-h
git checkout 687c2dc6df085655959439c38a40ccbe7cb57f82
git apply ../stars-h.patch
git submodule update --init --recursive 2>&1 >/dev/null || true
mkdir -p build && cd build
rm -rf ./CMake*
cmake -DCMAKE_C_FLAGS=-fPIC -DCMAKE_BUILD_TYPE="Release" -DCMAKE_C_FLAGS_RELEASE="-O3 -Ofast -w" -DOPENMP=OFF -DSTARPU=OFF -DEXAMPLES=OFF -DTESTING=OFF -DMPI=$MPIVALUE -DCMAKE_INSTALL_PREFIX=$PREFIX "$XFLAG" "$DEFINE_BLAS_LIBS_CMAKE" ..
$MAKE || $MAKE VERBOSE=1 || { echo 'STARS-H installation failed' ; exit 1; }
$MAKE install
else
echo "####################"
echo "starsh NOT FOUND"
echo "Please download it from: https://github.com/ecrc/stars-h"
echo "After installing it, set the proper PKG_CONFIG_PATH variable"
echo ""
err=1
fi
#fi
echo "============STARSH======================"
echo "$(ls $PREFIX/lib)"
echo "======================================"
# hicma
#if pkg-config --exists hicma
#then
# _LOCATION=`pkg-config --variable=prefix hicma`
# echo "hicma FOUND in [$_LOCATION]"
#else
if [ "$BUILD_DEPENDENCIES" == "true" ]
then
echo "Building HiCMA..."
cd $TMPDIR
cd h
git checkout c8287eed9ea9a803fc88ab067426ac6baacaa534
mkdir -p build && cd build
rm -rf ./CMake*
cmake -DHICMA_USE_MPI=$MPIVALUE -DCMAKE_BUILD_TYPE="Release" -DCMAKE_C_FLAGS_RELEASE="-O3 -Ofast -w" -DBUILD_SHARED_LIBS=ON -DHICMA_ENABLE_TESTING=OFF -DHICMA_ENABLE_TIMING=OFF -DCMAKE_INSTALL_PREFIX=$PREFIX "$XFLAG" "$DEFINE_BLAS_LIBS_CMAKE" ..
$MAKE || $MAKE VERBOSE=1 || { echo 'HICMA installation failed' ; exit 1; }
$MAKE install
else
echo "####################"
echo "hicma NOT FOUND"
echo "Please download it from: https://github.com/ecrc/hicma"
echo "After installing it, set the proper PKG_CONFIG_PATH variable"
echo ""
err=1
fi
#fi
echo "============HICMA======================"
echo "$(ls $PREFIX/lib)"
echo "======================================"
# use rpaths in makefile
# TODO use a R defined value for PREFIX and have this directly in the Makefile
#Dummy makefile in src to trigger real one from cmake.
cd $BASEDIR/
rm -rf ./CMakeFiles ./CMakeCache.txt
cmake -DCMAKE_BUILD_TYPE="Release" -DCMAKE_C_FLAGS_RELEASE="-O3 -Ofast -w" -DBUILD_SHARED_LIBS=ON -DEXAGEOSTAT_EXAMPLES=OFF "$XFLAG" "$DEFINE_BLAS_LIBS_CMAKE" -DEXAGEOSTAT_USE_MPI=$MPIVALUE -DEXAGEOSTAT_USE_HICMA=ON ./src
echo "============EXAGEOSTAT======================"
echo "$(ls $PREFIX/lib)"
echo "======================================"
echo "$(ls ./src)"
echo "======================================"
echo "$(ls ../)"
echo "======================================"
echo "$(ls ../src)"
echo "======================================"
echo "$(ls ../exageostatr)"
echo "======================================"
echo "$(find ../ -name exageostat.so)"
echo "======================================"
echo "$(find ../ -name "exageostat.so")"
echo "======================================"
cat > src/Makefile << EOF
.PHONY: all clean
all:
(cd .. && make VERBOSE=1 && cp ./lib*.${LIBEXT} ./src/exageostat.so)
EOF
exit $err