Difference between revisions of "Flow engines on ubuntu 12.04"

From Yade

 
(31 intermediate revisions by 2 users not shown)
Line 1: Line 1:
  +
The following instructions allow you to install on your computer YADE, an open-source framework for discrete numerical models, coupled to the PFV (Pore-scale Finite Volumes) model, to perform true hydromechanical simulations.
== 1. download openblas and compile it ==
 
Openblas is a packaged version of Kazushige Goto's gotoblas, which is recommended by most matrix library developpers. It is available precompiled in 12.04 but it breaks python's matplotlib because it provides a different version of lapack, which is a dependency of matplotlib.
 
   
Therefore, you should download the sources at github:
+
Here you'll find instruction for the download and the compilation of the code.
  +
  +
  +
== Download Yade ==
  +
You can install either a release (numbered version, which is frozen) or the current developement version (updated by the developers frequently).
  +
  +
=== Release version ===
  +
  +
Releases can be downloaded from the download page[https://launchpad.net/yade/+download], as compressed archive. Uncompressing the archive gives you a directory with the sources.
  +
  +
Once you downloaded the sources, you have to install dependencies following the instructions from here: https://yade-dem.org/doc/installation.html#prerequisities
  +
  +
=== Current development version ===
  +
  +
Developement version (trunk) can be obtained from the code repository at github. Follow instructions from here to download: https://www.yade-dem.org/wiki/Yade_on_github#Setup
  +
  +
Once you downloaded the sources, you have to install dependencies following the instructions from here: https://yade-dem.org/doc/installation.html#prerequisities
  +
  +
== Flow Engine ==
  +
  +
To add the flow engine and perform coupled fluid-particle simulations, follow the instructions below. Basically there are just a number of dependencies that need to be satisfied.
  +
  +
=== Openblas ===
  +
Openblas is a packaged version of Kazushige Goto's gotoblas, which is recommended by most matrix library developers. It is available precompiled in 12.04 but it breaks python's matplotlib because it provides a different version of lapack, which is a dependency of matplotlib.
  +
  +
==== Download and compilation ====
  +
You should download the sources at github:
 
https://github.com/xianyi/OpenBLAS/zipball/master
 
https://github.com/xianyi/OpenBLAS/zipball/master
   
  +
Prerequisites:
prerequisites:
 
  +
*gfortran - type on a terminal "sudo apt-get install gfortran"
*gfortran
 
  +
Optional:
  +
*pthread - type on a terminal "sudo apt-get install libpthread-stubs0-dev"
   
  +
Open a terminal and place you into the folder where the openblas sources have been downloaded. Unpack the compressed file. To compile, do this:
Compile somewhere in your home dir (be sure to have gfortran installed and type make FC=gfortran so as to use the right compiler) and keep the /path/to/libopenblas.so.0 in mind for the next steps.
 
  +
*type "make FC=gfortran" so as to use the right compiler;
  +
*type "sudo make install", to install the library.
   
Make a symlink to /path/to/openblas.so.0 in the standard path so that yade will find it at startup:
+
Make a symlink to /path/to/libopenblas.so.0 in the standard path so that yade will find it at startup:
   
sudo ln -s /path/to/libopenblas.so.0 /usr/lib/libopenblas.so.0
+
*sudo ln -s /path/to/libopenblas.so.0 /usr/lib/libopenblas.so.0
   
 
''Note for ubuntu 10.04 users'': it may be easier on 10.04 to compile the ancestor of openblas: [http://www.tacc.utexas.edu/documents/13601/b58aeb8c-9d8d-4ec2-b5f1-5a5843b4d47b gotoblas]
 
''Note for ubuntu 10.04 users'': it may be easier on 10.04 to compile the ancestor of openblas: [http://www.tacc.utexas.edu/documents/13601/b58aeb8c-9d8d-4ec2-b5f1-5a5843b4d47b gotoblas]
   
  +
==== Prerequisities and Compilation ====
== 2. Compile taucs ==
 
  +
As a prerequisite, you have to install ParMETIS (Parallel Graph Partitioning and Fill-reducing Matrix Ordering). To do this open a terminal and type:
Download taucs sources from the CGAL project or, simpler, download the version that I already configured for 12.04 + openblas [http://geo.hmg.inpg.fr/~chareyre/code here])
 
  +
*sudo apt-get install libparmetis-dev
  +
You can also download and compile your own metis-4.0.1 (it doesn't really matter both ways should work)
  +
  +
To compile, open a terminal and place you into the folder where the taucs sources have been downloaded. To compile, do this:
  +
* type "make"
  +
* type "sudo make install", to install the library (this step may give harmless error messages even if it actually compiled (it failed at post-built test stages), ignore them and just check that /src/taucs.h and /lib/linux/libtaucs.a are present).
  +
  +
=== Cholmod ===
  +
[http://www.cise.ufl.edu/research/sparse/cholmod/ CHOLMOD] is a set of ANSI C routines for sparse Cholesky factorization and update/downdate. It is part of the SuiteSparse library.
  +
  +
Download the SuiteSparse sources from [http://www.cise.ufl.edu/research/sparse/SuiteSparse/ here] (ATTENTION, download version 3.7.1)
  +
  +
Open the config file and replace the legacy blas by openblas in the link targets. The lapack lib should be left empty as openblas comes with its own version of lapack.
  +
  +
Then compile and install:
  +
*make
  +
*sudo make install
   
  +
=== Eigen ===
Configure the build by editing /config/linux.mk (you need at least to set the path to openblas, or to other libs you may want to use).
 
  +
Eigen is a C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms.
   
  +
You should verify that the version of eigen3 you have installed among Yade prerequisities, is of version >3.1. If it's not the case, you have to delete the libeigen3-dev you've installed.
Compiling taucs may give harmless error messages even if it actually compiled (it failed at post-built test stages), ignore them and just check that /src/taucs.h and /lib/linux/libtaucs.a are present.
 
   
  +
To verify the version of libeigen3-dev, open a terminal and type:
make
 
(sudo) make install
+
*sudo apt-get install apt-show-versions
  +
*sudo apt-show-versions libeigen3-dev
   
  +
If the version is <3.1, delete the library and type:
prerequisites:
 
  +
*sudo apt-get purge libeigen3-dev
* openblas
 
* metis or parmetis (you can just install parmetis from 12.04, or download and compile your own metis-4.0.1 from http://glaros.dtc.umn.edu/gkhome/fsroot/sw/metis/OLD, it doesn't really matter both ways should work)
 
* ?
 
   
  +
Then download [http://eigen.tuxfamily.org/index.php?title=Main_Page here] the correct version of eigen3 and follow the installation instructions (it is not necessary the compilation, just a "make install" to copy the headers into a /usr shared folder
== 3. configure the compilation of yade/lib/triangulation ==
 
   
  +
=== Get LinSolv version of flow engines ===
It should be possible to do it all in the scons.profile, but for the moment I just modified /trunk/lib/sconscript like this:
 
  +
Get the "linsolv" version of flow engines. Please contact [mailto:bruno.chareyre@hmg.inpg.fr Bruno Chareyre] or [mailto:ema.catalano@gmail.com Emanuele Catalano] for this.
   
  +
== Compile Yade with Flow Engine ==
# vim: set filetype=python :
 
  +
You're now ready to compile Yade. This operation will create and executable file and you'll be able to perform coupled fluid-particle simulations.
   
  +
Follow this instructions (for complete informations about compilation options, go [https://yade-dem.org/doc/installation.html#compilation here]:
env.Install('$LIBDIR/lib',env.SharedLibrary('yade-support',[
 
  +
*Open a terminal and place you in the folder that contains the trunk/ folder (Yade sources). Type:
env.Combine('yade-support.cpp',['base/Math.cpp']+
 
  +
*mkdir Yade
['factory/ClassFactory.cpp','factory/DynLibManager.cpp','multimethods/Indexable.cpp','serialization/Serializable.cpp','pyutil/gil.cpp']
 
  +
*mv trunk/ ./Yade/trunk
# compile TesselationWrapper only if cgal is enabled in features
 
  +
*cd Yade
+(Split('triangulation/KinematicLocalisationAnalyser.cpp triangulation/Timer.cpp triangulation/basicVTKwritter.cpp
 
  +
*mkdir build
triangulation/FlowBoundingSphere.cpp triangulation/PeriodicFlow.cpp triangulation/Tenseur3.cpp triangulation/TriaxialState.cpp')
 
  +
*cd build/
if 'cgal' in env['features'] else [])
 
  +
*cmake -DENABLE_LINSOLV=ON -DINSTALL_PREFIX=/path/to/Yade/ /path/to/Yade/trunk/ (this will create the makefile)
+(['opengl/GLUtils.cpp'] if 'opengl' in env['features'] else [])
 
  +
*make (this will take several minutes or hours, depending on your machine specs)
),
 
  +
*make install
],LIBS=['dl','m']+([''''taucs','metis','openblas','gomp','gfortran''''] if 'cgal' in env['features'] else [])
 
+[l for l in env['LIBS'] if l!='yade-support']+(['glut','GL','GLU'] if 'opengl' in env['features'] else []),
 
LINKFLAGS=env['LINKFLAGS']+[''''-L/path/to/taucs_full/lib/linux'''',''''-L/path/to/metis-4.0''' ''(if compiled)'' ',
 
''''-L/path/to/lib/openblas/lib/'''','-pthread','-Wl','-Bsymbolic-function','-ansi'],CXXFLAGS=env['CXXFLAGS']+['-fPIC','-frounding-math','-ansi']
 
))
 
   
  +
To launch Yade, type:
== 5. Compile Yade with linsolv enabled ==
 
  +
*cd path/to/Yade/bins
  +
*./yade
   
  +
Have fun! All you need to know about Yade is [https://yade-dem.org/doc/index.html here]. Write on Yade's users mailing list if you have any problem.
As usual, get the "linsolv" version of flow engines and compile yade with cgal enabled, and -DFLOW_ENGINE, -DLINSOLV in Yade's compile flags.
 

Latest revision as of 19:46, 18 January 2013

The following instructions allow you to install on your computer YADE, an open-source framework for discrete numerical models, coupled to the PFV (Pore-scale Finite Volumes) model, to perform true hydromechanical simulations.

Here you'll find instruction for the download and the compilation of the code.


Download Yade

You can install either a release (numbered version, which is frozen) or the current developement version (updated by the developers frequently).

Release version

Releases can be downloaded from the download page[1], as compressed archive. Uncompressing the archive gives you a directory with the sources.

Once you downloaded the sources, you have to install dependencies following the instructions from here: https://yade-dem.org/doc/installation.html#prerequisities

Current development version

Developement version (trunk) can be obtained from the code repository at github. Follow instructions from here to download: https://www.yade-dem.org/wiki/Yade_on_github#Setup

Once you downloaded the sources, you have to install dependencies following the instructions from here: https://yade-dem.org/doc/installation.html#prerequisities

Flow Engine

To add the flow engine and perform coupled fluid-particle simulations, follow the instructions below. Basically there are just a number of dependencies that need to be satisfied.

Openblas

Openblas is a packaged version of Kazushige Goto's gotoblas, which is recommended by most matrix library developers. It is available precompiled in 12.04 but it breaks python's matplotlib because it provides a different version of lapack, which is a dependency of matplotlib.

Download and compilation

You should download the sources at github: https://github.com/xianyi/OpenBLAS/zipball/master

Prerequisites:

  • gfortran - type on a terminal "sudo apt-get install gfortran"

Optional:

  • pthread - type on a terminal "sudo apt-get install libpthread-stubs0-dev"

Open a terminal and place you into the folder where the openblas sources have been downloaded. Unpack the compressed file. To compile, do this:

  • type "make FC=gfortran" so as to use the right compiler;
  • type "sudo make install", to install the library.

Make a symlink to /path/to/libopenblas.so.0 in the standard path so that yade will find it at startup:

  • sudo ln -s /path/to/libopenblas.so.0 /usr/lib/libopenblas.so.0

Note for ubuntu 10.04 users: it may be easier on 10.04 to compile the ancestor of openblas: gotoblas

Prerequisities and Compilation

As a prerequisite, you have to install ParMETIS (Parallel Graph Partitioning and Fill-reducing Matrix Ordering). To do this open a terminal and type:

  • sudo apt-get install libparmetis-dev

You can also download and compile your own metis-4.0.1 (it doesn't really matter both ways should work)

To compile, open a terminal and place you into the folder where the taucs sources have been downloaded. To compile, do this:

  • type "make"
  • type "sudo make install", to install the library (this step may give harmless error messages even if it actually compiled (it failed at post-built test stages), ignore them and just check that /src/taucs.h and /lib/linux/libtaucs.a are present).

Cholmod

CHOLMOD is a set of ANSI C routines for sparse Cholesky factorization and update/downdate. It is part of the SuiteSparse library.

Download the SuiteSparse sources from here (ATTENTION, download version 3.7.1)

Open the config file and replace the legacy blas by openblas in the link targets. The lapack lib should be left empty as openblas comes with its own version of lapack.

Then compile and install:

  • make
  • sudo make install

Eigen

Eigen is a C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms.

You should verify that the version of eigen3 you have installed among Yade prerequisities, is of version >3.1. If it's not the case, you have to delete the libeigen3-dev you've installed.

To verify the version of libeigen3-dev, open a terminal and type:

  • sudo apt-get install apt-show-versions
  • sudo apt-show-versions libeigen3-dev

If the version is <3.1, delete the library and type:

  • sudo apt-get purge libeigen3-dev

Then download here the correct version of eigen3 and follow the installation instructions (it is not necessary the compilation, just a "make install" to copy the headers into a /usr shared folder

Get LinSolv version of flow engines

Get the "linsolv" version of flow engines. Please contact Bruno Chareyre or Emanuele Catalano for this.

Compile Yade with Flow Engine

You're now ready to compile Yade. This operation will create and executable file and you'll be able to perform coupled fluid-particle simulations.

Follow this instructions (for complete informations about compilation options, go here:

  • Open a terminal and place you in the folder that contains the trunk/ folder (Yade sources). Type:
  • mkdir Yade
  • mv trunk/ ./Yade/trunk
  • cd Yade
  • mkdir build
  • cd build/
  • cmake -DENABLE_LINSOLV=ON -DINSTALL_PREFIX=/path/to/Yade/ /path/to/Yade/trunk/ (this will create the makefile)
  • make (this will take several minutes or hours, depending on your machine specs)
  • make install

To launch Yade, type:

  • cd path/to/Yade/bins
  • ./yade

Have fun! All you need to know about Yade is here. Write on Yade's users mailing list if you have any problem.