install 15.3 KB
Newer Older
Pietro Incardona's avatar
Pietro Incardona committed
1
#! /bin/bash
Pietro Incardona's avatar
Pietro Incardona committed
2

Pietro Incardona's avatar
Pietro Incardona committed
3
4
5
6
7
source script/help
source script/discover_os
source script/show_solutions
source script/pre_req
source script/remove_old
incardon's avatar
incardon committed
8
source script/set_mpi
incardon's avatar
incardon committed
9
source script/conf_PETSC
Pietro Incardona's avatar
Pietro Incardona committed
10

11

Pietro Incardona's avatar
Pietro Incardona committed
12
13
14
15
## Check that your home is not empty

if [ x"$HOME" == x"" ]; then
	 echo -e "Your $HOME folder is empty \033[91;5;1m FAILED \033[0m"
Pietro Incardona's avatar
Pietro Incardona committed
16
	 exit 1
Pietro Incardona's avatar
Pietro Incardona committed
17
18
fi

Pietro Incardona's avatar
Pietro Incardona committed
19
##
Pietro Incardona's avatar
Pietro Incardona committed
20

Pietro Incardona's avatar
Pietro Incardona committed
21
22
23
install_req=1
i_dir=" "
sq=0
incardon's avatar
incardon committed
24
nomake=0
Pietro Incardona's avatar
Pietro Incardona committed
25

incardon's avatar
incardon committed
26
while getopts :di:smhc: FLAG; do
Pietro Incardona's avatar
Pietro Incardona committed
27
	case $FLAG in
Pietro Incardona's avatar
Pietro Incardona committed
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
	    d)
	      echo "Disable depencencies installation"
	      install_req=0
	      ;;
	    i)
	      echo "Setting dependencies installation dir: $OPTARG"
	      i_dir=$OPTARG
	      ;;
	    s)
	      echo "Skipping user cin"
	      sq=1
	      ;;
	    c)
	      echo "Fowarding options $OPTARG to configure script"
	      configure_options=$OPTARG
	      ;;
incardon's avatar
incardon committed
44
            m)
incardon's avatar
incardon committed
45
              echo "Skip to make the testing"
incardon's avatar
incardon committed
46
47
              nomake=1
              ;;
Pietro Incardona's avatar
Pietro Incardona committed
48
	    h)  #show help
Pietro Incardona's avatar
Pietro Incardona committed
49
50
51
52
53
      	      HELP
              ;;
    	    \?) #unrecognized option - are fowarded to configure
              ;;
	esac
incardon's avatar
incardon committed
54
55
done

incardon's avatar
incardon committed
56
57
discover_os

58
59
## Remove old dependencies and installations

Pietro Incardona's avatar
Pietro Incardona committed
60
61
62
63
if [ x"$i_dir" == x" " ]; then
 i_dir="$HOME"
fi

64
65
remove_old $i_dir

incardon's avatar
incardon committed
66
67
## Check and try to install the prerequisites

incardon's avatar
incardon committed
68
pre_req
incardon's avatar
incardon committed
69
70
71

## clone the dependencies

incardon's avatar
incardon committed
72
git submodule init
Yaser Afshar's avatar
Yaser Afshar committed
73
74
75
76
if [ $? -ne 0 ]; then
  echo -e "Configure\033[91;5;1m FAILED \033[0m"
  exit 1
fi
incardon's avatar
incardon committed
77

incardon's avatar
incardon committed
78
git submodule update
Yaser Afshar's avatar
Yaser Afshar committed
79
80
81
82
if [ $? -ne 0 ]; then
  echo -e "Configure\033[91;5;1m FAILED \033[0m"
  exit 1
fi
incardon's avatar
incardon committed
83

incardon's avatar
incardon committed
84
85
86
# Create config directory in each submodule

cd openfpm_data
incardon's avatar
incardon committed
87
88
89
if [ ! -d src/config  ]; then
  mkdir src/config
fi
incardon's avatar
incardon committed
90
91
92
cd ..

cd openfpm_devices
incardon's avatar
incardon committed
93
94
95
if [ ! -d src/config  ]; then
  mkdir src/config
fi
incardon's avatar
incardon committed
96
97
98
cd ..

cd openfpm_vcluster
incardon's avatar
incardon committed
99
100
101
if [ ! -d src/config  ]; then
  mkdir src/config
fi
incardon's avatar
incardon committed
102
103
104
cd ..

cd openfpm_io
incardon's avatar
incardon committed
105
106
107
if [ ! -d src/config  ]; then
  mkdir src/config
fi
incardon's avatar
incardon committed
108
109
cd ..

incardon's avatar
incardon committed
110
111
112
113
114
115
cd openfpm_numerics
if [ ! -d src/config  ]; then
  mkdir src/config
fi
cd ..

incardon's avatar
incardon committed
116
# Create config directory
incardon's avatar
incardon committed
117

incardon's avatar
incardon committed
118
119
120
if [ ! -d src/config ]; then
  mkdir src/config
fi
incardon's avatar
incardon committed
121

incardon's avatar
incardon committed
122
## generate configure script
incardon's avatar
incardon committed
123

incardon's avatar
incardon committed
124
sh ./autogen.sh
Incardona Pietro's avatar
Incardona Pietro committed
125
126
127
128
if [ $? -ne 0 ]; then
  echo -e "Configure\033[91;5;1m FAILED \033[0m"
  exit 1
fi
incardon's avatar
incardon committed
129

incardon's avatar
incardon committed
130
## check for options
incardon's avatar
incardon committed
131
132
133
134

echo -e "\033[1;34;5mDEPENCENCIES INSTALLATION DIR      \033[0m"
echo -e "Every required dependencies if needed will be installed into: \033[1;34;5m$i_dir\033[0m"
echo -e "if you want to install somewhere else do ./install -i /somewhere/else"
incardon's avatar
incardon committed
135
136
137
138
if [ x"$configure_options" == x"" ]; then
    echo -e "OpenFPM will be installed into: \033[1;34;5m/usr/local\033[0m"
    echo "if you want to install in a different place use ./install -c \"--prefix=/where/you/want/to/install\""
fi
incardon's avatar
incardon committed
139
if [ $sq -eq 0 ]; then
140
  unset commands
incardon's avatar
incardon committed
141
142
143
  commands[0]="Continue"
  possible_solutions "${commands[@]}"
fi
incardon's avatar
incardon committed
144

Pietro Incardona's avatar
Pietro Incardona committed
145
ncore=4
incardon's avatar
incardon committed
146
echo -e "\033[1mHow many core you want to use to install the dependencies?\033[0m"
147
148
149
if [ $sq -eq 0 ]; then
  read ncore
fi
incardon's avatar
incardon committed
150

incardon's avatar
incardon committed
151
152
153
154
echo -e "Installing requirements into: $i_dir "

##

incardon's avatar
incardon committed
155
## Take all the options with the exception of -d -i -s
incardon's avatar
incardon committed
156
157
158

## call the configure script

incardon's avatar
incardon committed
159
160
### Installing PETSC

incardon's avatar
incardon committed
161
if [ ! -d "$i_dir/PETSC" -o ! -d "$i_dir/EIGEN" ]; then
incardon's avatar
incardon committed
162
163
164
    echo -e "\033[1;34m Optional packages  \033[0m"
    echo -e "\033[1mDo you want to install linear algebra packages ?(y/n)\033[0m"
    echo "Installation can take long time (90 minutes on i7-3612QM 4 cores)"
165
166
167
168
169
    if [ $sq -eq 0 ]; then
      read inst_lin_alg
    else
      inst_lin_alg = n
    fi
incardon's avatar
incardon committed
170
171
fi

172
173
lin_alg_dir=""
lin_alg_lib=""
Pietro Incardona's avatar
Pietro Incardona committed
174
lin_alg_inc=""
incardon's avatar
incardon committed
175
176
177
178
179
180
181
182
183
184
185
if [ -d "$i_dir/METIS" ]; then
    configure_options=" $configure_options --with-metis=$i_dir/METIS "
fi
if [ -d "$i_dir/BOOST" ]; then
    configure_options=" $configure_options --with-boost=$i_dir/BOOST "
fi
if [ -d "$i_dir/PARMETIS" ]; then
    configure_options=" $configure_options --with-parmetis=$i_dir/PARMETIS "
fi
if [ -d "$i_dir/HDF5" ]; then
    configure_options=" $configure_options --with-hdf5=$i_dir/HDF5/bin/h5pcc "
incardon's avatar
incardon committed
186
fi
Pietro Incardona's avatar
Pietro Incardona committed
187
188
189
if [ -d "$i_dir/LIBHILBERT" ]; then
    configure_options=" $configure_options --with-libhilbert=$i_dir/LIBHILBERT "
fi
incardon's avatar
incardon committed
190

Pietro Incardona's avatar
Pietro Incardona committed
191
192
193
### if we are on linux we have to add -rt

if [ x"$platform" = x"linux" ]; then
Pietro Incardona's avatar
Pietro Incardona committed
194
	lin_alg_lib="$lin_alg_lib -lrt"
Pietro Incardona's avatar
Pietro Incardona committed
195
196
fi

incardon's avatar
incardon committed
197
198
### MPI compilers must be in your PATH folder

199
set_mpi $i_dir $ncore $CC $CXX $F77 $FC
incardon's avatar
incardon committed
200

201
202
### METIS and ParMETIS must be installed independently from sistem wide installation

incardon's avatar
incardon committed
203
./script/install_Parmetis.sh $i_dir $ncore
204
configure_options=" $configure_options --with-parmetis=$i_dir/PARMETIS "
incardon's avatar
incardon committed
205
./script/install_Metis.sh $i_dir $compiler_gcc $compiler_gpp $ncore
206
configure_options=" $configure_options --with-metis=$i_dir/METIS "
207

incardon's avatar
incardon committed
208
MPI_installed=0
incardon's avatar
incardon committed
209
MPI_System_prv=1
210
211
METIS_installed=1
PARMETIS_installed=1
incardon's avatar
incardon committed
212
BOOST_installed=0
incardon's avatar
incardon committed
213
BOOST_System_prv=1
Pietro Incardona's avatar
Pietro Incardona committed
214
LAPACK_installed=0
incardon's avatar
incardon committed
215
LAPACK_System_prv=1
Pietro Incardona's avatar
Pietro Incardona committed
216
SUITESPARSE_installed=0
incardon's avatar
incardon committed
217
SUITESPARSE_System_prv=1
Pietro Incardona's avatar
Pietro Incardona committed
218
EIGEN_installed=0
incardon's avatar
incardon committed
219
EIGEN_System_prv=1
Pietro Incardona's avatar
Pietro Incardona committed
220
HDF5_installed=0
incardon's avatar
incardon committed
221
HDF5_System_prv=1
Pietro Incardona's avatar
Pietro Incardona committed
222
LIBHILBERT_installed=0
incardon's avatar
incardon committed
223
224
225
conf_err=1

if [ $install_req -eq 0 ]; then
incardon's avatar
incardon committed
226
    ./configure $options $configure_options "$configure_blas_option"
incardon's avatar
incardon committed
227
228
229
else
    while [ $conf_err -ne 0 ]
    do
230
        ./configure $options $configure_options "$configure_blas_option"
incardon's avatar
incardon committed
231
232
233
234
235
236
        conf_err=$?

	echo "Configure script terminated with $conf_err"

        ## if MPI or METIS installation required install it
        if [ $conf_err -eq 200  ]; then
237
            echo "MPI not found try to install, $MPI_installed"
incardon's avatar
incardon committed
238
239
240
241
            if [ $MPI_installed -eq 1 ]; then
                echo "Error the installation of MPI failed"
                exit 1
            fi
242
            ./script/install_MPI.sh $i_dir $ncore $CC $CXX $F77 $FC
incardon's avatar
incardon committed
243
            MPI_installed=1
Pietro Incardona's avatar
Pietro Incardona committed
244
            export PATH="$i_dir/MPI/bin:$PATH"
245
            configure_options="$configure_options CXX=mpic++ "
incardon's avatar
incardon committed
246
247
248
249
250
251
        elif [ $conf_err -eq 201  ]; then
            echo "Metis not found try to install"
            if [ $METIS_installed -eq 1  ]; then
                echo "Error the installation of METIS failed"
                exit 1
            fi
incardon's avatar
incardon committed
252
            ./script/install_Metis.sh $i_dir $compiler_gcc $compiler_gpp
incardon's avatar
incardon committed
253
            METIS_installed=1
Yaser Afshar's avatar
Yaser Afshar committed
254
            configure_options=" $configure_options --with-metis=$i_dir/METIS "
incardon's avatar
incardon committed
255
        elif [ $conf_err -eq 202 ]; then
256
            echo "Boost not found try to install in $i_dir with $compiler_opt"
incardon's avatar
incardon committed
257
            if [ $BOOST_installed -eq 1  ]; then
incardon's avatar
incardon committed
258
259
260
                echo "Error the installation of Boost failed"
                exit 1
            fi
incardon's avatar
incardon committed
261
            if [ x"$CXX" == x"icpc" ]; then
incardon's avatar
incardon committed
262
              ./script/install_BOOST.sh $i_dir $ncore intel-linux
incardon's avatar
incardon committed
263
264
            elif [ x"$CXX" == x"clang++" ]; then
              ./script/install_BOOST.sh $i_dir $ncore darwin
incardon's avatar
incardon committed
265
266
267
            else
              ./script/install_BOOST.sh $i_dir $ncore gcc
            fi
incardon's avatar
incardon committed
268
            BOOST_installed=1
Yaser Afshar's avatar
Yaser Afshar committed
269
            configure_options=" $configure_options --with-boost=$i_dir/BOOST "
270
	elif [ $conf_err -eq 208 ]; then
271
272
273
274
275
            echo "ParMetis not found try to install"
            if [ $PARMETIS_installed -eq 1  ]; then
                echo "Error the installation of ParMETIS failed"
                exit 1
            fi
incardon's avatar
incardon committed
276
            ./script/install_Parmetis.sh $i_dir $ncore
277
278
            PARMETIS_installed=1
            configure_options=" $configure_options --with-parmetis=$i_dir/PARMETIS "
Pietro Incardona's avatar
Pietro Incardona committed
279
280
281
        elif [ $conf_err -eq 207 ]; then
            echo "HDF5 not found try to install"
            if [ $HDF5_installed -eq 1 ]; then
Pietro Incardona's avatar
Pietro Incardona committed
282
283
                echo "Error the installation of HDF5 failed"
                exit 1	
Pietro Incardona's avatar
Pietro Incardona committed
284
            fi
incardon's avatar
incardon committed
285
            ./script/install_HDF5.sh $i_dir $ncore
Pietro Incardona's avatar
Pietro Incardona committed
286
            configure_options=" $configure_options --with-hdf5=$i_dir/HDF5/bin/h5pcc "
Pietro Incardona's avatar
Pietro Incardona committed
287
            HDF5_installed=1
Pietro Incardona's avatar
Pietro Incardona committed
288
289
290
291
292
293
294
295
296
        elif [ $conf_err -eq 210 ]; then
            echo "LIBHILBERT not found try to install"
            if [ $LIBHILBERT_installed -eq 1 ]; then
                echo "Error the installation of LIBHILBERT failed"
                exit 1
            fi
            ./script/install_LIBHILBERT.sh $i_dir $ncore
            configure_options=" $configure_options --with-libhilbert=$i_dir/LIBHILBERT "
            LIBHILBERT_installed=1
incardon's avatar
incardon committed
297
298
299
300
301
        elif [ $conf_err -ne 0 ]; then
            echo "I do not know how to recover from this error"
            exit 1
        fi
    done
incardon's avatar
incardon committed
302

incardon's avatar
incardon committed
303
    if [ x"$inst_lin_alg" == x"y" ]; then
incardon's avatar
incardon committed
304
        ./script/install_EIGEN.sh $i_dir $ncore
incardon's avatar
incardon committed
305
        ./script/install_PETSC.sh $i_dir $ncore $CC $CXX $F77 $FC
incardon's avatar
incardon committed
306
307
    fi

incardon's avatar
incardon committed
308
309
310
311
	### collect PETSC configuration options
	conf_PETSC

    ./configure $options $configure_options "$configure_blas_option"
incardon's avatar
incardon committed
312

incardon's avatar
incardon committed
313
314
fi

Pietro Incardona's avatar
Pietro Incardona committed
315
### Create example.mk
316
install_base=$(cat install_dir)
317
318
openmp_flags="$(cat openmp_flags) $(cat openfpm_flags)"

incardon's avatar
incardon committed
319
320
echo "INCLUDE_PATH= $openmp_flags  -I. -I$install_base/openfpm_numerics/include -I$install_base/openfpm_pdata/include/config -I$install_base/openfpm_pdata/include -I$install_base/openfpm_data/include -I$install_base/openfpm_vcluster/include -I$install_base/openfpm_io/include -I$install_base/openfpm_devices/include -I$i_dir/METIS/include -I$i_dir/PARMETIS/include -I$i_dir/BOOST/include -I$i_dir/HDF5/include -I$i_dir/LIBHILBERT/include  $lin_alg_inc" > example.mk
echo "LIBS_PATH= $openmp_flags -L$install_base/openfpm_devices/lib -L$install_base/openfpm_pdata/lib  -L$install_base/openfpm_vcluster/lib -L$i_dir/METIS/lib -L$i_dir/PARMETIS/lib  -L$i_dir/BOOST/lib -L$i_dir/HDF5/lib -L$i_dir/LIBHILBERT/lib  $lin_alg_dir" >> example.mk
Pietro Incardona's avatar
Pietro Incardona committed
321
322
echo "LIBS=-lvcluster -lofpm_pdata -lofpmmemory -lparmetis -lmetis -lboost_iostreams -lhdf5 -llibhilbert  $lin_alg_lib" >> example.mk
echo "LIBS_SE2=-lvcluster -lofpmmemory_se2 -lparmetis -lmetis -lboost_iostreams -lhdf5 -llibhilbert $lin_alg_lib" >> example.mk
Pietro Incardona's avatar
Pietro Incardona committed
323
324
cp example.mk src/example.mk
cp example.mk example/example.mk
325

incardon's avatar
incardon committed
326
if [ $nomake -eq 0 ]; then
incardon's avatar
incardon committed
327
  make clean
incardon's avatar
incardon committed
328
329
  make
fi
incardon's avatar
incardon committed
330
331
332
333
334

if [ $? -ne 0 ]; then
  conf_err=1
fi

incardon's avatar
incardon committed
335
336
echo "Command used to configure"
echo ""
incardon's avatar
incardon committed
337
echo -e "\033[1m ./configure $options $configure_options \033[0m "
incardon's avatar
incardon committed
338
echo ""
incardon's avatar
incardon committed
339
340
341
342
343
344
345

if [ x"$platform" = x"linux" ]; then
  bash_library="export LD_LIBRARY_PATH=\"\$LD_LIBRARY_PATH"
else
  bash_library="export DYLD_LIBRARY_PATH=\"\$DYLD_LIBRARY_PATH"
fi

Pietro Incardona's avatar
Pietro Incardona committed
346
bash_path="export PATH=\""
incardon's avatar
incardon committed
347
348
349
350

echo -e "\033[1;34;5m ---------------------------------------  \033[0m"
echo -e "\033[1;34;5m --------- INSTALLATION REPORT ---------  \033[0m"
echo ""
incardon's avatar
incardon committed
351
352
echo -e "\033[1;34;5m ---------- Mandatory packages ---------  \033[0m"
echo ""
incardon's avatar
incardon committed
353

incardon's avatar
incardon committed
354
355
if [ -d "$i_dir/MPI" ]; then
  installation_report="$installation_report \033[92;1mMPI\033[0m Installed: \033[1m $i_dir/MPI \033[0m\n"
Pietro Incardona's avatar
Pietro Incardona committed
356
  bash_path="$bash_path:$i_dir/MPI/bin:"
incardon's avatar
incardon committed
357
358
359
  bash_library="$bash_library:$i_dir/MPI/lib"
elif [ $MPI_System_prv -eq 1 ]; then
  installation_report="$installation_report \033[92;1mMPI\033[0m Installed: \033[1m System installation \033[0m\n"
incardon's avatar
incardon committed
360
fi
incardon's avatar
incardon committed
361

Pietro Incardona's avatar
Pietro Incardona committed
362
if [ -d "$i_dir/METIS" ]; then
incardon's avatar
incardon committed
363
  installation_report="$installation_report \033[92;1mMETIS\033[0m Installed: \033[1m $i_dir/METIS \033[0m\n"
incardon's avatar
incardon committed
364
  bash_library="$bash_library:$i_dir/METIS/lib"
365
366
fi

Pietro Incardona's avatar
Pietro Incardona committed
367
if [ -d "$i_dir/PARMETIS" ]; then
incardon's avatar
incardon committed
368
369
370
371
  installation_report="$installation_report \033[92;1mPARMETIS\033[0m Installed: \033[1m $i_dir/PARMETIS \033[0m\n"
  bash_library="$bash_library:$i_dir/PARMETIS/lib"
fi

Pietro Incardona's avatar
Pietro Incardona committed
372
if [ -d "$i_dir/BOOST" ]; then
incardon's avatar
incardon committed
373
  installation_report="$installation_report \033[92;1mBOOST\033[0m Installed: \033[1m $i_dir/BOOST \033[0m\n"
incardon's avatar
incardon committed
374
  bash_library="$bash_library:$i_dir/BOOST/lib"
incardon's avatar
incardon committed
375
376
377
378
elif [ $BOOST_System_prv -eq 1 ]; then
  installation_report="$installation_report \033[92;1mBOOST\033[0m Installed: \033[1m System installation \033[0m\n"
fi

Pietro Incardona's avatar
Pietro Incardona committed
379
if [ -d "$i_dir/HDF5" ]; then
incardon's avatar
incardon committed
380
381
382
  installation_report="$installation_report \033[92;1mHDF5\033[0m Installed: \033[1m $i_dir/HDF5 \033[0m\n"
  bash_library="$bash_library:$i_dir/HDF5/lib"
fi
incardon's avatar
incardon committed
383

Pietro Incardona's avatar
Pietro Incardona committed
384
385
386
387
388
if [ -d "$i_dir/LIBHILBERT" ]; then
  installation_report="$installation_report \033[92;1mLibHilbert\033[0m Installed: \033[1m $i_dir/LIBHILBERT \033[0m\n"
  bash_library="$bash_library:$i_dir/LIBHILBERT/lib"
fi

incardon's avatar
incardon committed
389
390
391
392
393
394
395
396
397
398
399
400
401
echo -e "$installation_report"

echo ""
echo -e "\033[1;34;5m ---------- Optional packages -----------  \033[0m"
echo ""

installation_report=""

if [ -d "$i_dir/PETSC" ]; then
  installation_report="$installation_report \033[92;1mPETSC\033[0m Installed: \033[1m $i_dir/PETSC \033[0m\n"
  bash_library="$bash_library:$i_dir/PETSC/lib"
else
  installation_report="$installation_report \033[91;1mPETSC\033[0m Installed: \033[1m NO \033[0m\n"
incardon's avatar
incardon committed
402
fi
incardon's avatar
incardon committed
403

incardon's avatar
incardon committed
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
if [ -d "$i_dir/EIGEN" ]; then
  installation_report="$installation_report \033[92;1mEIGEN\033[0m Installed: \033[1m $i_dir/EIGEN \033[0m\n"
fi

echo -e "$installation_report"

echo -e "\033[1;34;5m --------------------------------  \033[0m"

installation_report=""

if [ -d "$i_dir/TRILINOS" ]; then
  installation_report="$installation_report \033[92;1mTRILINOS\033[0m Installed: \033[1m $i_dir/TRILINOS \033[0m\n"
  bash_library="$bash_library:$i_dir/TRILINOS/lib"
else
  installation_report="$installation_report \033[91;1mTRILINOS\033[0m Installed: \033[1m NO \033[0m\n"
fi

if [ -d "$i_dir/OPENBLAS" ]; then
  installation_report="$installation_report \033[92;1mOPENBLAS\033[0m Installed: \033[1m $i_dir/OPENBLAS \033[0m\n"
  bash_library="$bash_library:$i_dir/OPENBLAS/lib"
else
  installation_report="$installation_report \033[91;1mOPENBLAS\033[0m Installed: \033[1m NO \033[0m\n"
Pietro Incardona's avatar
Pietro Incardona committed
426
fi
incardon's avatar
incardon committed
427
428
429

if [ -d "$i_dir/SUITESPARSE" ]; then
  installation_report="$installation_report \033[92;1mSUITESPARSE\033[0m Installed: \033[1m $i_dir/SUITESPARSE \033[0m\n"
incardon's avatar
incardon committed
430
  bash_library="$bash_library:$i_dir/SUITESPARSE/lib"
incardon's avatar
incardon committed
431
432
else
  installation_report="$installation_report \033[91;1mSUITESPARSE\033[0m Installed: \033[1m NO \033[0m\n"
Pietro Incardona's avatar
Pietro Incardona committed
433
fi
incardon's avatar
incardon committed
434
435
436
437
438
439

if [ -d "$i_dir/SCALAPACK" ]; then
  installation_report="$installation_report \033[92;1mSCALAPACK\033[0m Installed: \033[1m $i_dir/SCALAPACK \033[0m\n"
  bash_library="$bash_library:$i_dir/SCALAPACK/lib"
else
  installation_report="$installation_report \033[91;1mSCALAPACK\033[0m Installed: \033[1m NO \033[0m\n"
Pietro Incardona's avatar
Pietro Incardona committed
440
fi
incardon's avatar
incardon committed
441

incardon's avatar
incardon committed
442
443
444
445
446
if [ -d "$i_dir/MUMPS" ]; then
  installation_report="$installation_report \033[92;1mMUMPS\033[0m Installed: \033[1m $i_dir/MUMPS \033[0m\n"
  bash_library="$bash_library:$i_dir/MUMPS/lib"
else
  installation_report="$installation_report \033[91;1mMUMPS\033[0m Installed: \033[1m NO \033[0m\n"
Pietro Incardona's avatar
Pietro Incardona committed
447
fi
incardon's avatar
incardon committed
448
449
450
451
452
453

if [ -d "$i_dir/SUPERLU_DIST" ]; then
  installation_report="$installation_report \033[92;1mSUPERLU_DIST\033[0m Installed: \033[1m $i_dir/SUPERLU_DIST \033[0m\n"
  bash_library="$bash_library:$i_dir/SUPERLU_DIST/lib"
else
  installation_report="$installation_report \033[91;1mSUPERLU_DIST\033[0m Installed: \033[1m NO \033[0m\n"
454
455
fi

incardon's avatar
incardon committed
456
457
458
459
460
461
462
if [ -d "$i_dir/HYPRE" ]; then
  installation_report="$installation_report \033[92;1mHYPRE\033[0m Installed: \033[1m $i_dir/HYPRE \033[0m\n"
  bash_library="$bash_library:$i_dir/HYPRE/lib"
else
  installation_report="$installation_report \033[91;1mHYPRE\033[0m Installed: \033[1m NO \033[0m\n"
fi

Pietro Incardona's avatar
Pietro Incardona committed
463
bash_path="$bash_path$PATH\""
incardon's avatar
incardon committed
464
bash_library="$bash_library\""
incardon's avatar
incardon committed
465
466
467
468
469
470
471

##### Writing openfpm_vars file

echo "$bash_path" > $HOME/openfpm_vars
echo "$bash_library" >> $HOME/openfpm_vars

echo -e "$installation_report"
incardon's avatar
incardon committed
472
473
474
475
476
477
478
479
echo ""
echo ""
if [ $conf_err -eq 0  ]; then
  echo -e "Install summary\033[92;5;1m SUCCEED \033[0m"
else
  echo -e "Install summary\033[91;5;1m FAILED \033[0m"
fi

incardon's avatar
incardon committed
480
481
echo ""
if [ x"$platform" = x"linux" ]; then
incardon's avatar
incardon committed
482
  echo "Before run any openfpm program you must execute the following command. A simple way would be to append this line at the end of your $HOME/.bashrc"
incardon's avatar
incardon committed
483
else
incardon's avatar
incardon committed
484
  echo "Before run any openfpm program you must execute the following command. A simple way would be to append this line at the end of your $HOME/.bash_profile"
incardon's avatar
incardon committed
485
486
fi
echo ""
incardon's avatar
incardon committed
487
echo -e "\033[1m source $HOME/openfpm_vars \033[0m"
incardon's avatar
incardon committed
488
echo ""
incardon's avatar
incardon committed
489
echo -e "\033[91;1m if you have in your .bashrc or .bash_profile old openfpm setting, please remove it\033[0m"
incardon's avatar
incardon committed
490
491
echo ""
echo ""
492
493
494
if [ $conf_err -ne 0 ]; then
  exit 1
fi