在UBUNTU上安装IBAMR
# 拷贝软件
scp -r -P 9999 npuheart9@10.69.30.128:~/.IBAMR.BAK ibamr
scp -r -P 6666 mpiuser@10.69.30.128:~/cloud/.IBAMR.BAK .
# 安装gcc
sudo apt-get install gcc g++ gfortran mpich make zlib1g-dev python m4 vim
# 首先安装boost
cd ~/ibamr
tar xvfz boost_1_64_0.tar.gz
mv boost_1_64_0 boost
export BOOST_ROOT=$HOME/ibamr/boost
mkdir $BOOST_ROOT/include
ln -s $BOOST_ROOT/boost $BOOST_ROOT/include
rm boost_1_64_0.tar.gz
# 安装HDF5
cd ~/ibamr
mkdir hdf5
tar xvfz hdf5-1.8.12.tar.gz
cd hdf5-1.8.12
./configure \
CC=gcc \
CXX=g++ \
FC=gfortran \
F77=gfortran \
--enable-production \
--disable-debug \
--prefix=$HOME/ibamr/hdf5
make -j72
make check
make install
cd $HOME/ibamr
rm hdf5-1.8.12.tar.gz
rm -r hdf5-1.8.12
# 安装silo
cd $HOME/ibamr
tar xvfz silo-4.10.tar.gz
cd silo-4.10
./configure \
CC=gcc \
CXX=g++ \
FC=gfortran \
F77=gfortran \
--prefix=$HOME/ibamr/silo \
--disable-silex
# --without-readline
# --with-zlib="$HOME/ibamr/zlib/include,$HOME/ibamr/zlib/lib"
make -j72
make install
cd $HOME/ibamr
rm -r silo-4.10
rm silo-4.10.tar.gz
# 安装petsc
cd ~/ibamr
tar xvfz petsc-3.10.5.tar.gz
mv petsc-3.10.5 petsc
export PETSC_DIR=$HOME/ibamr/petsc
export PETSC_ARCH=linux-opt
cd $PETSC_DIR
./configure \
--CC=mpicc \
--CXX=mpicxx \
--FC=mpif90 \
--COPTFLAGS="-O3" \
--CXXOPTFLAGS="-O3" \
--FOPTFLAGS="-O3" \
--PETSC_ARCH=$PETSC_ARCH \
--with-debugging=0 \
--download-hypre=1 \
--download-fblaslapack=1 \
--with-x=0
make -j72
make test
# 安装samrai
cd ~/ibamr
tar xvfz SAMRAI-v2.4.4.tar.gz
mv SAMRAI samrai
cd samrai
# 打补丁
mv ../ibamr-samrai-fixes.patch ibamr-samrai-fixes.patch
patch -p1 < ibamr-samrai-fixes.patch
# 配置安装
./configure \
CFLAGS="-O3" \
CXXFLAGS="-O3" \
FFLAGS="-O3" \
--prefix=$HOME/ibamr/samrai/linux-g++-opt \
--with-CC=mpicc \
--with-CXX=mpicxx \
--with-F77=mpifort \
--with-hdf5=$HOME/ibamr/hdf5 \
--without-hypre \
--without-silo \
--without-blaslapack \
--without-cubes \
--without-eleven \
--without-kinsol \
--without-petsc \
--without-sundials \
--without-x \
--with-doxygen \
--with-dot \
--disable-debug \
--enable-opt \
--enable-implicit-template-instantiation \
--disable-deprecated
make -j72
make install
cd ~/ibamr
rm SAMRAI-v2.4.4.tar.gz
# 安装libmesh
# 注意:最新版的IBAMR需要libmesh1.1.0以上版本
cd $HOME/ibamr/
tar xvfz libmesh-1.2.1.tar.gz
mv libmesh-1.2.1 libmesh
cd ~/ibamr/libmesh
mkdir objs-opt
cd objs-opt
../configure \
--prefix=$HOME/ibamr/libmesh/1.2.1-opt \
--with-methods=opt \
PETSC_DIR=$HOME/ibamr/petsc \
PETSC_ARCH=linux-opt \
CC=mpicc \
CXX=mpicxx \
FC=mpif90 \
F77=mpif90 \
--enable-exodus \
--enable-triangle \
--disable-boost \
--disable-openmp \
--disable-perflog \
--disable-pthreads \
--disable-strict-lgpl \
--disable-glibcxx-debugging
make -j72
make install
cd $HOME/ibamr/
rm libmesh-1.2.1.tar.gz
# 安装ibamr
cd ~/ibamr
cd IBAMR
mkdir ibamr-objs-opt
cd ibamr-objs-opt
../configure \
CC=mpicc \
CXX=mpicxx \
F77=mpif90 \
FC=mpif90 \
MPICC=mpicc \
MPICXX=mpicxx \
CFLAGS="-O3 -Wall" \
CXXFLAGS="-O3 -Wall -std=c++11" \
FFLAGS="-O3 -Wall" \
FCFLAGS="-O3 -Wall" \
CPPFLAGS="-DOMPI_SKIP_MPICXX" \
--with-hypre=$PETSC_DIR/$PETSC_ARCH \
--with-samrai=$HOME/ibamr/samrai \
--with-hdf5=$HOME/ibamr/hdf5 \
--with-silo=$HOME/ibamr/silo \
--with-boost=$HOME/ibamr/boost \
--enable-libmesh \
--with-libmesh=$HOME/ibamr/libmesh/1.2.1-opt \
--with-libmesh-method=opt
配置成功会有提示:
configure: IBAMR appears to have been configured successfully. Now:
make lib Build the IBAMR library and its supporting IBTK library
make examples Build all of the IBAMR and IBTK example programs
Note that the IBAMR and IBTK example programs are not run by "make examples".
To run the examples, e.g.,
make examples
cd examples/IB/explicit/ex0
./main2d input2d
You may also build and run individual example programs, e.g., via
cd examples/IB/explicit/ex0
make examples
./main2d input2d
# 按照提示
make lib
make examples
cd examples/IB/explicit/ex0
./main2d input2d
# 添加环境变量
vi ~/.bashrc
# 在末行添上
export BOOST_ROOT=$HOME/ibamr/boost
export PETSC_DIR=$HOME/ibamr/petsc
export PETSC_ARCH=linux-opt
export IBAMR_DIR=~/ibamr/IBAMR/ibamr-objs-opt
# 激活一下,嘿嘿
source ~/.bashrc
网友评论