Difference between revisions of "Installation details"
From Yade
(Replaced content with "=This page is deprecated, please find up-to-date information at [https://yade-dem.org/doc/installation.html yade-dem.org]=") |
|||
(6 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
+ | =This page is deprecated, please find up-to-date information at [https://yade-dem.org/doc/installation.html yade-dem.org]= |
||
− | [[Category:Installation]]{{Installation quick access}} |
||
− | |||
− | = Systemwide installation as root = |
||
− | |||
− | By default yade installs in directory <tt>/usr/local</tt>, but to install there you need a root access. So running just <tt>scons ''some options''</tt> should be enough. However, since you want to install yade systemwide as root, it might be better if you built a debian package instead. |
||
− | |||
− | = Installing from debian source packages = |
||
− | |||
− | [http://geo.hmg.inpg.fr/~smilauer/yade This repository] contains weekly snapshots from svn in the form of debian source packages. To compile and install these (assuming that you already have [[Installation#Required_packages|required packages]] installed), you need to add repository source do your '<tt>/etc/apt/sources.list</tt>': |
||
− | |||
− | deb-src http://geo.hmg.inpg.fr/~smilauer/yade ./ |
||
− | |||
− | Pick a revision number you want (eg. 1234), based on the repository contents - see http://geo.hmg.inpg.fr/~smilauer/yade, then run: |
||
− | |||
− | apt-get source yade-svn1234 |
||
− | sudo apt-get build-dep yade-svn1234 |
||
− | cd yade-svn1234-1 |
||
− | fakeroot-tcp debian/rules binary |
||
− | |||
− | Once compiled, you will have optimized (yade-svn1234), debug (yade-svn1234-dbg) and development (yade-svn1234-dev) packages in <tt>../</tt>, which you can install by: |
||
− | |||
− | sudo dpkg -i ../yade-svn1234*.deb |
||
− | |||
− | =Scons options= |
||
− | |||
− | [http://www.scons.org Scons] is the tool used to build and install yade. Always run it from the top directory of yade. |
||
− | |||
− | {| border="1" style="border-collapse:collapse;" cellpadding="7" |
||
− | |+ Scons options |
||
− | ! ''parameter'' |
||
− | ! ''default value'' |
||
− | ! ''description'' |
||
− | |- |
||
− | || <tt>PREFIX</tt> |
||
− | || <tt>/usr/local</tt> |
||
− | || The directory where yade will be installed. Different yade versions '''will not overwrite each other''' in <tt>PREFIX</tt> directory. See version and variant below. This parameter is passed to the preprocessor as <tt>PREFIX</tt> macro (expands to quoted string). |
||
− | |- |
||
− | || <tt>version</tt> |
||
− | || <tt>''auto''</tt> |
||
− | || Scons autodetects svn revision or release number, so it will be "<tt>svn1144</tt>" or "<tt>0.11.0</tt>", for example. If this fails, it will be "unknown". It is used to build `<tt>SUFFIX</tt>` (see `<tt>variant</tt>`). |
||
− | |- |
||
− | || <tt>variant</tt> |
||
− | || <tt>''empty''</tt> |
||
− | || Free-form name that describes variant of this version (usually something like "<tt>-debug</tt>", "<tt>-optimized</tt>" etc. May be empty. <tt>SUFFIX</tt> is a macro defined by the preprocessor (as quoted string) that has the form "<tt>$version$variant</tt>", i.e. <tt>svn1144-debug</tt> if <tt>version=svn1144</tt> and <tt>variant=debug</tt>. |
||
− | |- |
||
− | || <tt>debug</tt> |
||
− | || <tt>1</tt> |
||
− | || Pass debugging flags to the compiler (generates debugging symbols in binaries), defines <tt>YADE_DEBUG</tt> symbols. Defaults to '''''true'''''. |
||
− | |- |
||
− | || <tt>optimize</tt> |
||
− | || <tt>0</tt> |
||
− | || Defines <tt>YADE_CAST</tt> (<tt>YADE_PTR_CAST</tt>) as <tt>static_cast</tt> (<tt>static_pointer_cast</tt>) and pass optimization flags to the compiler. Use together with <tt>debug</tt> to get fast code with debug symbols included. Defaults to '''''false'''''. |
||
− | |- |
||
− | || <tt>buildPrefix</tt> |
||
− | || <tt>..</tt> |
||
− | || Specify where to put the <tt>build-0.11.0</tt> directory, which will hold all files created during compilation. This ensures that the source tree remains clean and that different builds (like optimized and debugging) are strictly separated, like <tt>build-0.11.0</tt> and <tt>build-0.11.0-debug</tt> |
||
− | |- |
||
− | || <tt>jobs</tt> |
||
− | || <tt>4</tt> |
||
− | || How many compilations should run in parallel. Defaults to '''''four''''', if your computer is weak you may want a lower number. Equivalent to make -j4 |
||
− | |- |
||
− | || <tt>CXX</tt> |
||
− | || <tt>g++</tt> |
||
− | || C++ compiler you want to use. You can say <tt>CXX="distcc g++"</tt> to have distributed build, if that is configured. |
||
− | |- |
||
− | || <tt>CPPPATH</tt> |
||
− | || <tt>''empty''</tt> |
||
− | || Additional paths for the c proprocessor (whitespace separated). Use it for locally-installed libraries, eg.: <tt>CPPPATH="/usr/local/include /home/fred/build/log4cxx/include"</tt> |
||
− | |- |
||
− | || <tt>LIBPATH</tt> |
||
− | || <tt>''empty''</tt> |
||
− | || Additional paths for linker (whitespace separated). |
||
− | |} |
||
− | |||
− | To see all the options, along with their default and current values, say `<tt>scons -h</tt>`. |
||
− | |||
− | As an example, to compile yade I use following command |
||
− | |||
− | scons jobs=10 pretty=0 debug=1 optimize=0 profile=0 CXX="distcc g++" PREFIX=/home/janek/YADE useMiniWm3=0 CPPPATH=/usr/include/wm3 |
||
− | |||
− | The last two options are related to [[Installation_details#Installing_the_wildmagic_3_library_on_debian|the wildmagic 3 library]]. All options are stored inside <tt>scons.config</tt> file, so the next time you compile yade, you can really just issue <tt>scons</tt> command, unless you want to change something. |
||
− | |||
− | = Automatic library detection = |
||
− | |||
− | Scons will attempt detection of necessary libraries on your system at every run. If it fails, you can look at the <tt>$buildDir/config.log</tt> (eg.: <tt>../build-0.11.0/config.log</tt>) file to see what went wrong. If you have some of the dependencies (like lib3dviewer) installed locally in /usr/local, you will have to use: |
||
− | scons CPPPATH=/usr/local/include/wm3 LIBPATH=/usr/local/lib |
||
− | so that scons will find it. |
||
− | |||
− | = Installing the wildmagic 3 library on debian = |
||
− | |||
− | The [http://www.geometrictools.com/Downloads/Downloads.html wildmagic 3.11 library] is used by Lattice Geometrical Model when it's available. It's only to have dalaunay triangulation in 2D and 3D during specimen generation. |
||
− | |||
− | Add the following line at the end of your <tt>/etc/apt/sources.list</tt>: |
||
− | |||
− | deb-src http://geo.hmg.inpg.fr/~smilauer/yade ./ |
||
− | |||
− | Then donwload, compile and install wildmagic library: |
||
− | |||
− | sudo apt-get update |
||
− | apt-get source wildmagic |
||
− | sudo apt-get build-dep wildmagic |
||
− | cd wildmagic-3p11/ |
||
− | fakeroot debian/rules binary |
||
− | sudo dpkg -i ../wildmagic-dev*.deb |
||
− | |||
− | To tell scons that wildmagic is installed you need to add those parameters to scons: <tt>useMiniWm3=0</tt>. |
||
− | |||
− | =Backward compatibility options= |
||
− | |||
− | If you have older software installed, you can use: |
||
− | |||
− | {| border="1" style="border-collapse:collapse;" cellpadding="7" |
||
− | |+ Compatibility options |
||
− | ! ''parameter'' |
||
− | ! ''description'' |
||
− | |- |
||
− | || <tt>CXXFLAGS='-DNO_GLUTINIT'</tt> |
||
− | || Older versions of libglut do not have function glutInit(), you should use this compilation flag then. |
||
− | |- |
||
− | || <tt>CXXFLAGS='-DQGLVIEWER20'</tt> |
||
− | || If you are using older QGLViewer (version 2.0) you should use this flag, otherwise you will get error about setFileName(). |
||
− | |- |
||
− | || <tt>CXXFLAGS='-pthread -lpthread'</tt> |
||
− | || If you are compiling with gcc3.3 (an older compiler). |
||
− | |- |
||
− | || <tt>CXXFLAGS='-fPIC'</tt> |
||
− | || When compiling on AMD64. |
||
− | |} |
||
− | |||
− | You can connect several <tt>CXXFLAGS</tt> by spaces: <tt>CXXFLAGS='-DNO_GLUTINIT -DQGLVIEWER20'</tt> |
||
− | |||
− | =Cleaning and uninstalling= |
||
− | |||
− | To clean the compilation invoke from <tt>yade-0.11.0/</tt>: |
||
− | |||
− | scons -c |
||
− | |||
− | You can remove the compilation directory of yade, usually located in upper directory and starting with name <tt>build</tt>, like this one: |
||
− | |||
− | rm -rf ../build-svn1144 |
||
− | |||
− | If yade was installed manually, the you can delete files from |
||
− | |||
− | /usr/local/lib/yade/ |
||
− | /usr/local/include/yade/ |
||
− | /usr/local/bin/yade |
||
− | |||
− | or from (depending where yade was installed): |
||
− | |||
− | /home/''username''/YADE/lib/ |
||
− | /home/''username''/YADE/include/ |
||
− | /home/''username''/YADE/bin/yade |
||
− | |||
− | If yade was installed from debian package, you can simply remove the package, and that's all. |
||
− | |||
− | = Install paths = |
||
− | |||
− | All files installed are versioned so that different versions and variants don't clash with each other - you can have as many version as you want installed at the same time. Supposing that we have <tt>variant=-dbg</tt> and <tt>version=svn1234</tt> (note that <tt>$SUFFIX=-$version$variant</tt>) and <tt>PREFIX=/usr/local</tt>, we have |
||
− | |||
− | {| border="1" style="border-collapse:collapse;" cellpadding="7" |
||
− | |+ Paths |
||
− | ! ''what kind'' |
||
− | ! ''path used'' |
||
− | ! ''example'' |
||
− | |- |
||
− | || executable |
||
− | || <tt>$PREFIX/bin/yade$SUFFIX</tt> |
||
− | || <tt>/usr/local/bin/yade-svn1144-debug</tt> |
||
− | |- |
||
− | || default plugins |
||
− | || <tt>$PREFIX/lib/yade$SUFFIX/lib/*/lib*.so</tt> |
||
− | || <tt>/usr/local/lib/yade-svn1144-debug/*/lib*.so</tt> |
||
− | |- |
||
− | || pkg-config script |
||
− | || <tt>$PREFIX/lib/pkgconfig/yade$SUFFIX</tt> |
||
− | || <tt>/usr/local/lib/pkgconfig/yade-svn1144-debug.pc</tt> |
||
− | |- |
||
− | || user configuration directory |
||
− | || <tt>$HOME/.yade$SUFFIX</tt> |
||
− | || <tt>/home/fred/.yade-svn1144-debug</tt> |
||
− | |- |
||
− | || headers (note: common for a particular version, regardless of variant) |
||
− | || <tt>$PREFIX/include/yade$version/yade/*/*.hpp</tt> |
||
− | || <tt>/usr/local/include/yade-svn1144/yade/*/*.hpp</tt> |
||
− | |} |
||
− | |||
− | |||
− | = See also = |
||
− | |||
− | * '''[[Installation]]''' |
||
− | * [[Reported problems]] |
||
− | * [[Quick subversion tutorial]] |
||
− | * [[New to linux?]] |