-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigureMfem.sh
executable file
·68 lines (63 loc) · 2.15 KB
/
configureMfem.sh
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
#! /bin/#!/usr/bin/env bash
cd ..;
#if mfem directory exists then stash and update it,
#else download the lastest version.
if [[ -d "mfem" ]]; then
echo "Mfem directory found!"
cd mfem;
echo "Stashing current changes and pulling latest from mfem github repo."
git stash;
git pull https://github.com/mfem/mfem.git;
cd ..
else
echo "Mfem directory Not found!";
echo "Downloading latest mfem repo from github!";
git clone https://github.com/mfem/mfem.git;
fi
#Copying custom modifications to the mfem directory.
cd mfem-apps
echo "Linking custom settings to mfem directory!"
rm ../mfem/config/user.cmake;
ln -s $(pwd)/config/user.cmake ../mfem/config/user.cmake;
echo "Replacing 'defaults.cmake' with custom file. Old file renamed to 'defaults.cmake.old'!"
if [[ ! -f ../mfem/config/defaults.cmake.old ]]; then
mv ../mfem/config/defaults.cmake ../mfem/config/defaults.cmake.old;
fi
rm ../mfem/config/defaults.cmake;
ln -s $(pwd)/config/defaults.cmake ../mfem/config/defaults.cmake;
echo "Replacing 'config/cmake/modules' with custom file. Old file renamed to 'config/cmake/modules.old'!"
if [[ ! -d ../mfem/config/cmake/modules.old ]]; then
mv ../mfem/config/cmake/modules ../mfem/config/cmake/modules.old;
fi
rm ../mfem/config/cmake/modules;
ln -s $(pwd)/config/cmake/modules ../mfem/config/cmake/modules;
echo "Creating link to external mfem directory inside source directory!"
rm mfem;
ln -s ../mfem mfem;
if [[ -d "/etc/apt" ]]; then
echo "It seems you have an apt based package manager."
echo "Installing required packages
Please enter the password!"
sudo apt-get install libopenmpi-dev libpetsc-real-dev libhypre-dev libmetis-dev libparmetis-dev libsuitesparse-dev libsuperlu-dist-dev;
else
echo "Since you do not have an apt based package manager,
Please install the development packages of these libraries!"
echo "openmpi
petsc-real
hypre
metis
parmetis
suitesparse
libsuperlu-dist"
fi
#Build mfem as a library
#cd ..
#if [[ -d "mfem-build" ]]; then
# echo "Pre-Existing 'mfem-build' directory Found!"
#else
# echo "Making a build directory named mfem-build"
# mkdir mfem-build;
#fi
#cd mfem-build;
#cmake ../mfem/;
#make -j4;