1 Star 0 Fork 2

Michael/SPHinXsys

forked from 吉祥水/SPHinXsys 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
install_SPHinXsys.txt 7.38 KB
一键复制 编辑 原始数据 按行查看 历史
genre 提交于 2020-05-20 13:55 . revert back
SPHinXsys is a multi-physics, multi-resolution SPH library.
SPHinXsys provides a C++ API that is used to build physics-specific applications;
it is not a standalone application itself.
This is a simple instruction for install SPHinXsys on Linux system
There are three 3rd-party libraries, i.e. simbody, tbb and boost, which should be installed
before we can compile and link SPHinXsys.
If you are using Ubuntu system, you can use apt install tbb and boost,
apt install simbody is not recommended as that simbody version is 3.5.1(too low for SPHinXsys)
if you Ubuntu is lower than 19.0
Ubuntu install tbb and boost :
sudo apt-get install libtbb-dev
sudo apt-get install libboost-all-dev
and set
echo 'export TBB_HOME=/usr/lib/x86_64-linux-gnu' >> ~/.bashrc
echo 'export BOOST_HOME=/usr/lib/x86_64-linux-gnu' >> ~/.bashrc
For self advanced installation on Linux:
gcc
First, Install simbody Library :
Note : The easy way is using miniconda.(not recommaned, install simbody can help to you to understand the code)
Step 0, Check the gcc version, gcc-4.9.0 or higher version is required and gcc-7.3.0 is recommended.
Chekc the cmake version, if you want to install simboy by hand, please using cmake 3.12.2 or higher
Step 1, Install LAPACK library.
$ sudo apt-get install cmake liblapack-dev
-------------------------------------------------------------------------------------------------------------
If you want install from source, you can
LAPACK version 3.8.0 and higher may be required for some applications (OpenSim).
$ wget http://www.netlib.org/lapack/lapack-3.8.0.tar.gz
LAPACK can be downloaded from http://www.netlib.org/lapack/,
unzip it to your prefered folder(for example "$HOME/lapack-source")
$ tar xvzf lapack-3.8.0.tar.gz
and compiled using the following method,
the default installation and build path is "$HOME/lapack-prefix" and "$HOME/lapack-build"
$ mkdir $HOME/lapack-prefix
$ mkdir $HOME/lapack-build
$ cd $HOME/lapack-build
$ cmake $HOME/lapack-source -DCMAKE_INSTALL_PREFIX=$HOME/lapack-prefix -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_SHARED_LIBS=ON
$ make
$ make install
$ echo 'export LIBRARY_PATH=$HOME/lapack-prefix/lib:$LIBRARY_PATH' >> ~/.bashrc
$ echo 'export LD_LIBRARY_PATH=$LIBRARY_PATH:$LD_LIBRARY_PATH' >> ~/.bashrc
-------------------------------------------------------------------------------------------------------------
Step 2, Download a release version from https://github.com/simbody/simbody/releases
$ wget https://github.com/simbody/simbody/archive/Simbody-3.7.tar.gz
$ tar xvzf Simbody-3.7.tar.gz
Step 3, Unzip the repository into your prefered folder , e.g., $HOME/simbody-Simbody-3.7
Create a directory for installation, e.g.,
$ mkdir $HOME/simbody
Then create a directory in which we'll build Simbody.
We'll assume you choose $HOME/simbody-build. Don't choose a location inside $HOME/simbody-source.
$ mkdir $HOME/simbody-build
$ cd $HOME/simbody-build
Step 4, Configure and geneartes Make file:
$ cmake $HOME/simbody-Simbody-3.7 -DCMAKE_INSTALL_PREFIX=$HOME/simbody -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_VISUALIZER=on (optional set to ON if simbody visualizer is going to be used)
-DBUILD_STATIC_LIBRARIES=on (optional, leave it off if you don't know what are you doing)
Step 5, Build and Install
$ make doxygen //Note that this is optional
$ make -j8
$ ctest -j8
$ make -j8 install
Step 6, Allow Simbody and other projects to find simbody:
Mac:
$ echo 'export SIMBODY_HOME=$HOME/simbody' >> ~/.bash_profile
Linux:
$ echo 'export SIMBODY_HOME=$HOME/simbody' >> ~/.bashrc
Setp 7, Set environment variables
If your CMAKE_INSTALL_PREFIX is /usr/local/, run:
$ sudo ldconfig
If your CMAKE_INSTALL_PREFIX is neither /usr/ nor /usr/local/ (e.g., ~/simbody'):
Mac:
$ echo 'export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$HOME/simbody-prefix/lib' >> ~/.bash_profile
Linux:
$ echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SIMBODY_HOME/lib' >> ~/.bashrc
$ echo 'export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:$SIMBODY_HOME/include' >> ~/.bashrc
Note that, you may need to replace lib64 with the appropriate directory on your computer.
If you have apt install TBB and Boost, you can neglected the following.
----------------------------------------------------------------------------------------------------------
Second, TBB library:
Step 1, Download a release version from : https://github.com/01org/tbb/releases, new version is good,
and then unzip it to the appropriate directory, e.g.,$HOME/tbb-versioin, on your computer
Setp 2, Set environment variables
Mac:
$ echo 'export PATH = $HOME/tbb-versioin/bin/intel64/vc14' >> ~/.bash_profile
Linux:
$ echo 'PATH = $HOME/tbb-versioin/bin/intel64/vc14' >> ~/.bashrc
Note that, you may need to replace lib64 with the appropriate directory on your computer
Step 3, Allow Simbody and other projects to find TBB:
Mac:
$ echo 'export TBB_HOME=$HOME/tbb-versioin' >> ~/.bash_profile
Linux:
$ echo 'export TBB_HOME=$HOME/tbb-versioin' >> ~/.bashrc
Third, BOOST library
Step 1, Download a release version from : https://www.boost.org/, recommaned version 1.69.0,
unzip it to your prefered directory, e.g., $HOME/boost-source
Create a directory for installation, e.g.,
$ mkdir $HOME/boost-prefix
Step 2, BUild:
Unix :
$ cd $HOME/boost-source
$bash bootstrap.sh --prefix=$HOME/boost-prefix
$./bjam install
To build with MPI add full path to mpic++ or jsut mpic++ at the end of user-config.jam file.
like, #MPI
using mpi : /usr/bin/mpic++
Windows:
using cmd system
$ bootstrap
$ b2 install --prefix=$HOME/boost-prefix --layout=tagged address-model=64 architecture=x86
Step 3, other projects to find BOOST:
Mac:
$ echo 'export BOOST_HOME = $HOME/boost-prefix' >> ~/.bash_profile
Linux:
$ echo 'export BOOST_HOME = $HOME/boost-prefix' >> ~/.bashrc
Step 4, Check the installation, two folders lib and include should be cterated in $HOME/boost-prefix.
----------------------------------------------------------------------------------------------------------
Last, bu not least, Chek path is crrectly setup:
$ echo $SIMBODY_HOME
$ echo $TBB_HOME
$ echo $BOOST_HOME
Final step :
download the SPHinXsys from https://github.com/Xiangyu-Hu/SPHinXsys
or Bitbucket if you have the link and password to the internal group repository for the newest version.
$ git clone https://github.com/Xiangyu-Hu/SPHinXsys.git
$ mkdir $HOME/sphinxsys-build
$ cd $HOME/sphinxsys-build
- To buid a SPHinXsys project o CPU:
$ cmake /path/to/sphinxsys/source-code -DCMAKE_BUILD_TYPE=RelWithDebInfo
- To buid a SPHinXsys project o GPU:
* Download the UAMMD framework from https://github.com/RaulPPelaez/UAMMD.git and store it in /path/to/UAMMD
* set the following two directories and include them in the cmake file related to the test-case:
set(uammd_src /path/to/UAMMD/src)
set(gpuSPHINXsys ${CMAKE_SOURCE_DIR}/gpuSPHINXsys)
include_directories(${uammd_src} ${gpuSPHINXsys})
* add the above-mentioned directories to executables:
ADD_EXECUTABLE(${PROJECT_NAME} ${DIR_SRCS} ${uammd_SRCS} ${gpuSolvers_SRCS})
* now you can build the project with the following cmake command:
$ cmake /path/to/sphinxsys/source-code -DCMAKE_BUILD_TYPE=RelWithDebInfo -DACTIVATE_CUDA=on
THEN you can play with SPHInXsys, for example
$ cd /path/to/sphinxsys-build/cases_test/test_2d_dambreak
$ make -j
$ cd /bin
$ ./test_2d_dambreak
Have FUN!!!
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhyue8888/SPHinXsys.git
git@gitee.com:zhyue8888/SPHinXsys.git
zhyue8888
SPHinXsys
SPHinXsys
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385