How to compile MOFEM on the Glasgow University development server?

50 views
Skip to first unread message

zahur.ullah1

unread,
Jun 2, 2017, 11:36:52 AM6/2/17
to mofem Group
How to compile MOFEM on the Glasgow University development server?

Lukasz Kaczmraczyk

unread,
Jun 2, 2017, 12:04:38 PM6/2/17
to mofem...@googlegroups.com
Libraries of mofem ecosystem are preinstalled in /opt directory, you need clone and install core library and user modules

1) Modify .bashrc

Open file for editing
jed .bashrc

At the end of file add 
# history
export HISTSIZE=20000
export HISTFILESIZE=1000000000
# path
export PATH=/opt/local/bin:$PATH
# boost
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/local_boost_1_54_0/lib/
# MOFEM install directort
export MOFEM_INSTALL_DIR
=$HOME

Update bash configuration
source .bashrc

2) Clone repository and install core library
# Make directory
# mkdir $MOFEM_INSTALL_DIR

# Change to your $MOFEM_INSTALL_DIR
cd $MOFEM_INSTALL_DIR

# Cloning MoFEM source code:
git clone https
://bitbucket.org/likask/mofem-cephas.git mofem-cephas

# Make a build directory
mkdir $MOFEM_INSTALL_DIR
/lib
cd $MOFEM_INSTALL_DIR
/lib

# Configuring and compiling code:
cmake -DCMAKE_BUILD_TYPE=Release  -DPETSC_DIR=/opt/petsc -DPETSC_ARCH=arch-linux2-c-opt -DMOAB_DIR=/opt/local_new_moab -DADOL-C_DIR=/opt/local_adol-c-2.5.2 -DTETGEN_DIR=/opt/tetgen1.5.0 -DMED_DIR=/opt/local  -DCMAKE_INSTALL_PREFIX=$MOFEM_INSTALL_DIR/users_modules/ -DBOOST_DIR=/opt/local_boost_1_54_0 -DMED_DIR=/opt/med -DBLA_VENDOR=Apple $MOFEM_INSTALL_DIR/mofem-cephas/mofem/
# Building code:
make
-j8 install

# Testing and publishing results on MoFEM CDashTesting WebPage:
ctest
--http1.0 -D Experimental


3) Configuration, compilation and testing user modules
cd $MOFEM_INSTALL_DIR/users_modules
# Configuration:
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-I/opt/local_boost_1_54_0/include -DCMAKE_EXE_LINKER_FLAGS=-L/opt/local_boost_1_54_0/lib users_modules
# Build:
make
-j8
# Testing:
ctest
--http1.0 -D Experimental


Karol Lewandowski

unread,
Jun 2, 2017, 1:56:10 PM6/2/17
to mofem...@googlegroups.com
We can also install debug version. To do that you we compile the library in debug mode: 
# Make a build directory

mkdir $MOFEM_INSTALL_DIR
/lib_debug
cd $MOFEM_INSTALL_DIR
/lib_debug

# Configuring and compiling code:
cmake -DCMAKE_BUILD_TYPE=Debug  -DPETSC_DIR=/opt/petsc -DPETSC_ARCH=arch-linux2-c-opt -DMOAB_DIR=/opt/local_new_moab -DADOL-C_DIR=/opt/local_adol-c-2.5.2 -DTETGEN_DIR=/opt/tetgen1.5.0 -DMED_DIR=/opt/local  -DCMAKE_INSTALL_PREFIX=$MOFEM_INSTALL_DIR/users_modules_debug/ -DBOOST_DIR=/opt/local_boost_1_54_0 -DMED_DIR=/opt/med $MOFEM_INSTALL_DIR/mofem-cephas/mofem/

# Building code:
make
-j8 install

Next we configure users modules as well: 
cd $MOFEM_INSTALL_DIR/users_modules_debug

# Configuration:
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS=-I/opt/local_boost_1_54_0/include -DCMAKE_EXE_LINKER_FLAGS=-L/opt/local_boost_1_54_0/lib users_modules
# Build:
make
-j8

Lukasz Kaczmraczyk

unread,
Jun 5, 2017, 7:37:50 AM6/5/17
to mofem Group
Install commands are in the script. 

1) Login to your account
2) Run script
~lukasz/install_script.sh
Reply all
Reply to author
Forward
0 new messages