$
means shell prompt
-
Install gcc (Takes very long time, about 6 hours)
- go to ~/src
$ cd ~/src
- install gcc (for cmake, takes few HOURS)
$ mkdir gcc_src $ cd gcc_src $ curl -L -O http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-7.3.0/gcc-7.3.0.tar.gz $ tar zxvf gcc-7.3.0 $ mkdir objdir $ cd gcc-7.3.0 $ contrib/download_prerequisites $ cd ../objdir $ ../gcc-7.3.0/configure --prefix=$HOME/usr/local/gcc --disable-multilib $ make && make install
update
PATH
andLD_LIBRARY_PATH
to~/.bashrc
, but don't modify originalexport
just append additional pathsexport LD_LIBRARY_PATH=$HOME/usr/lib:$HOME/usr/local/gcc/lib64:$HOME/usr/local/gcc/lib:$LD_LIBRARY_PATH export PATH=$HOME/usr/bin:$HOME/usr/local/gcc/bin:$PATH
then restart remote shell or use
source
command$ source ~/.bashrc
Check gcc is properly installed
$ gcc --version
-
Install cURL
$ cd ~/src $ curl -L -O https://curl.haxx.se/download/curl-7.60.0.tar.gz $ tar zxvf curl-7.60.0.tar.gz $ cd curl-7.60.0 $ ./configure --prefix=$HOME/usr $ make && make install
update
PATH
andLD_LIBRARY_PATH
to~/.bashrc
, but don't modify originalexport
just append additional pathsexport LD_LIBRARY_PATH=$HOME/usr/lib:$LD_LIBRARY_PATH export PATH=$HOME/usr/bin:$HOME/usr/local/gcc/bin:$PATH
then restart remote shell or use
source
command$ source ~/.bashrc
-
Install Make
$ cd ~/src $ curl -L -O http://ftp.kaist.ac.kr/gnu/make/make-4.2.tar.gz $ tar zxvf make-4.2.tar.gz $ cd make-4.2 $ ./configure --prefix=$HOME/usr $ make && make install $ ln -s /home/bagitup/usr/bin/make /home/bagitup/usr/bin/gmake $ source ~/.bashrc
-
Install binutils
$ cd ~/src $ curl -L -O http://ftp.kaist.ac.kr/gnu/binutils/binutils-2.31.tar.gz $ tar zxvf binutils-2.31.tar.gz $ cd binutils-2.31 $ ./configure --prefix=$HOME/usr $ make && make install $ source ~/.bashrc
-
Install bison
$ cd ~/src $ curl -L -O http://ftp.kaist.ac.kr/gnu/bison/bison-3.0.5.tar.gz $ tar zxvf bison-3.0.5.tar.gz $ cd bison-3.0.5 $ ./configure --prefix=$HOME/usr $ make && make install $ source ~/.bashrc
-
Install LinuxBrew Follow this page's instruction Add or update
PATH
,MANPATH
,INFOPATH
variables on~/.bashrc
, but don't modify or remove original variables, just append additional paths. i.e.# linuxbrew path LINUXBREWHOME=$HOME/.linuxbrew PATH=$LINUXBREWHOME/bin:$PATH MANPATH=$LINUXBREWHOME/share/man:$MANPATH INFOPATH=$ILNUXBREWHOME/share/info:$INFOPATH
then restart remote shell or use
source
command$ source ~/.bashrc
You must check this link and read 'with-out-sudo' part because our system is based on CentOS6. You might need to install
ruby
andgit
for LinuxBrew.$ brew vendor-install ruby $ brew install git
-
install glibc
$ brew install gcc --without-glibc $ brew install glibc $ brew uninstall gcc $ brew install gcc
-
install readline
$ cd ~/src $ curl -L -O ftp://ftp.cwru.edu/pub/bash/readline-7.0.tar.gz $ tar zxvf readline-7.0.tar.gz $ cd readline-7.0 $ ./configure --prefix=$HOME/usr $ make && make install $ source ~/.bashrc
-
install flex
$ cd ~/src
- download recent versions from here
$ curl -L -O https://github.com/westes/flex/releases/download/v2.6.4/flex-2.6.4.tar.gz $ tar zxvf flex-2.6.4.tar.gz $ cd flex-2.6.4 $ ./configure --prefix=$HOME/usr $ make && make install $ source ~/.bashrc
-
install cmake
- download recent version from here
$ cd ~/src $ curl -L -O https://cmake.org/files/v3.12/cmake-3.12.1.tar.gz $ tar zxvf cmake-3.12.1.tar.gz $ cd cmake-3.12.1 $ ./configure --prefix=$HOME/usr/local/cmake $ make && make install
update
~/.bashrc
# cmake path LD_LIBRARY_PATH=$HOME/usr/local/cmake/lib$LD_LIBRARY_PATH PATH=$HOME/usr/local/cmake/bin:$PATH
-
Download OpenFOAM
- We installed all preliminaries. Now download OpenFOAM source from this page
-
Download OpenFOAM
$ mkdir $HOME/OpenFOAM $ cd ~/src $ curl -L -O https://sourceforge.net/projects/openfoamplus/files/v1806/OpenFOAM-v1806.tgz $ curl -L -O https://sourceforge.net/projects/openfoamplus/files/v1806/ThirdParty-v1806.tgz $ tar zxvf OpenFOAM-v1806.tgz $ tar zxvf ThirdParty-v1806.tgz
-
Add new environment variables for MPI to
~/.bashrc
export MPI_ROOT=$MPIHOME
-
Change OpenFOAM bashrc
- open OpenFOAM bashrc
$ vim OpenFOAM_v1806/etc/bashrc
- change
WM_MPLIB
variable to useSYSTEMMPI
export WM_MPLIB=SYSTEMMPI
- create
mpi-system
file
vim etc/config.sh/mpi-system
- save the file with following lines
export MPI_ROOT=$MPIHOME export MPI_ARCH_FLAGS="-DOMPI_SKIP_MPICXX" export MPI_ARCH_INC="-isystem $MPI_ROOT/include" export MPI_ARCH_LIBS="-L$MPI_ROOT/lib -lmpi"
-
type following commands to shell prompt (use parallel build for faster build)
$ export WM_NCOMPPROCS=4
-
Follow official build guide
$ source etc/bashrc $ ./Allwmake
-
TroubleShooting
- If you stuck at
INT32_MAX
error, read this and apply the patch manually but location is different; modify this filewmake/rules/General/Gcc/c++
- If you stuck at