代码拉取完成,页面将自动刷新
同步操作将从 吉祥水/SPHinXsys 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
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!!!
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。