Differences between revisions 16 and 17
Revision 16 as of 2008-03-08 23:02:45
Size: 5210
Editor: localhost
Comment: converted to 1.6 markup
Revision 17 as of 2008-11-16 09:40:35
Size: 2215
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
Compiling F.O.X. under Linux is normally easy (it is developped using Mandriva Linux). ''The source code for Fox now includes the [[http://wxwidgets.org|wxWidgets]] and [[http://freeglut.sf.net|freeglut]] libraries'', so dependencies should be minimal. As always, send me an email at vincefn@users.sf.net if you have any trouble with the installation. You can install Fox under Linux either by [[#compile|compiling it from source]] or by using [[#packages|pre-built packages]] for your Linux distribution (currently only Debian).
Line 5: Line 5:
Steps: <<Anchor(compile)>>
=== Compiling from source ===
To compile Fox under Linux, please follow the instructions to [[Compile/Linux| compile Fox under Linux]], which describe the requirements and the compilation itself.
Line 7: Line 9:
 * '''[[#lib|Install the required graphical libraries]]'''
 * '''[[#fox|Get, compile & install Fox]]'''
 * '''[[#optimize|Compile an optimized version of Fox]] '''
<<Anchor(packages)>>
=== Using pre-built packages ===
==== Debian package ====
Thanks to Carlo Segre, Fox is now available in Debian in the ```objcryst-fox``` package. As of 2008/11/16, this package is available in the ''unstable'' branch of Debian. See the [[http://packages.debian.org/sid/objcryst-fox|sid/objcryst-fox package page]].
Line 11: Line 14:
=== Installing the required graphics libraries ===
<<Anchor(lib)>> Below are '''specific instructions to install the required graphics libaries for the following distributions''' :
If you are running Debian ''unstable'', all you need to install Fox is:
 ```aptitude install objcryst-fox```.
Line 14: Line 17:
 * '''[[#mdk|Mandriva]]'''<<BR>>
 * '''[[#fedora|Fedora]]'''<<BR>>
 * '''[[#ubuntu|Ubuntu]]'''<<BR>>
 * '''[[#suse|Suse]]'''<<BR>>
''The following note on how to build Fox on Debian stable or testing was tested on Debian Lenny 2008/11/16 - please be careful with these instructions, most particularly do not add the binaries repository for unstable, only the source repository !''
Line 19: Line 19:
''Please add or correct the instructions for '''your''' distribution...''

If your distribution is not listed, just follow the [[#general|general building instructions]]. <<Anchor(general)>>

==== General Instructions (if your distribution is not listed below) ====
To install F.O.X. under Linux:

 * You will need valid libraries and development files for '''OpenGL'''. You may require a specific library for your card (NVidia,...), the '''Xfree-devel''' or '''libxorg-devel''', and the '''gtk-devel''' (or '''gtk+-devel''' or '''gtk2-devel'''...) packages. For all major distributions, these packages are included either in the default install or as an additionnal package.

==== Mandrake & Mandriva ====
<<Anchor(mdk)>>
===== Mandriva 10.2 (2006) =====
 The required packages (just ```urpmi``` followed by tha package names - you need the '''main''' and '''contrib''' rpm repositories) are :
  * Development packages: ```gcc gcc-c++ gcc-cpp gfortran```
  * Graphics development packages : `libxorg-x11-devel, libgtk+1.2-devel, libMesaglut3-devel `

==== Fedora ====
<<Anchor(fedora)>> ''This is partially a guess since I do not have this distribution, so feel free to correct these''

===== Fedora Core 3 & 4 =====
 * Development packages: ```gcc gcc-c++ gcc-g77```
 * Graphics development package : `xorg-x11-devel, gtk+-devel`

<<Anchor(ubuntu)>>
==== Ubuntu ====
(Ubuntu 7.10)
 * Development packages: ```gcc g++ gcc-g77```
 * Graphics development package : `libgl1-mesa-dev, libglu1-mesa-dev, libgtk2.0-dev`

==== SuSE ====
<<Anchor(suse)>> ''This is partially a guess since I do not have this distribution, so feel free to correct these''

===== SuSE 9.3 =====
 * Development packages: ```gcc gcc-c++ gcc-g77```
 * Graphics development package : `xorg-x11-devel, gtk-devel (or gtk2-devel)`

=== Get, compile & install Fox ===
<<Anchor(fox)>> Get the Fox.tar.bz2 from [[http://sourceforge.net/project/showfiles.php?group_id=27546&release_id=203604|SourceForge]], [[ftp://ftp.ccp14.ac.uk/ccp14/ftp-mirror/objcryst/|CCP14(UK)]], [[http://ccp14.sims.nrc.ca/ccp/ccp14/ftp-mirror/objcryst/|CCP14(Canada)]] or [[http://ccp14.semo.edu/ccp/ccp14/ftp-mirror/objcryst/|CCP14(USA)]]

Then compile and install Fox (replace VERSION by your version of Fox):

{{{
  tar -xjf Fox-VERSION.tar.bz2
  cd Fox-VERSION
  cd Fox
  make
  make install (for this last step you must be root).
}}}

Fox will be installed in /usr/local/bin/Fox. Otherwise the compiled file is in the `src/Fox` subdirectory.

 ''Note'': if during the early stages of the compilation (when freeglut is compiled), you get an error message about ```libGL.la```, this can mean that ```libGL.la``` is not in the same directory as other x11 libraries. On my computer, where ```libGL.la``` is provided by the nVidia installer, I needed to do "```ln -s /usr/lib/libGL.la /usr/X11R6/lib/```".

=== Compiling an optimized version of Fox ===
<<Anchor(optimize)>>
==== Compile options ====
 The first set of optimizations can be activated by using processor-specific optimizations. If you edit the ```Fox/ObjCryst/rules.mak``` file, and search for the part where the ```CPPFLAGS``` are defined:
 {{{
CPPFLAGS = -O3 -w -ffast-math -fstrict-aliasing -pipe -fomit-frame-pointer -funroll-loops
}}}
 ''Auto-vectorization'': starting with gcc 4.0.0, it is possible to automatically '''vectorize''' some loops: append ```-ftree-vectorize``` to the ```CPPFLAGS``` options to do that (see the examples commented out in the ```rules.mak``` file).

==== Profile driven optimizations ====
Fox can be further optimized by making "test runs" which are used to give hints to the compiler on how to best optimize the code. To do this you (i) compile Fox by enabling the "recording" of the optimization, then (ii) you run a few optimizations, then (iii) you recompile using the recorded profile. ''This requires gcc version 3.2 or above''.To do that from the Fox subdirectory, do:

{{{
make clean
make Fox profile=2
src/Fox --nogui example/pbso4-joint.xml --randomize -n 50000 -o /dev/null
src/Fox --nogui example/Cimetidine-powder.xml --randomize -n 50000 -o /dev/null
src/Fox --speedtest
make clean
make Fox profile=3
make install}}}

This yields about 10% faster code.
If you are running Debian ''testing'' (this may work on ''stable'', I have not tested), you'll need the foolowing steps to rebuild Fox for your system:
 * Add to ```/etc/apt/sources.list``` the source packages for ''unstable'' (''note'': as you add only the source package for ''unstable'', this will '''not''' make unstable binaries available for your system), i.e. a line with (please use a local mirror, i.e. replace ```ftp.lip6.fr``` by e.g. ```ftp.uk.debian.org```...):
  ```deb-src http://ftp.lip6.fr/pub/linux/distributions/debian/ unstable main```
 * Update your packages indexes:
  ```aptitude update```
 * Install the build dependencies for Fox:
  ```apt-get build-dep objcryst-fox```
 * Build Fox (this will download the source package and build Fox in the current directory):
  ```apt-get source -b objcryst-fox```
 * Install the ```.deb``` which is now available in the directory (the name will vary with the version of Fox and your architecture):
   ```dpkg -i objcryst-fox_1.7.99.R1047-1_amd64.deb```

Installing Fox on Linux

You can install Fox under Linux either by compiling it from source or by using pre-built packages for your Linux distribution (currently only Debian).

Compiling from source

To compile Fox under Linux, please follow the instructions to compile Fox under Linux, which describe the requirements and the compilation itself.

Using pre-built packages

Debian package

Thanks to Carlo Segre, Fox is now available in Debian in the objcryst-fox package. As of 2008/11/16, this package is available in the unstable branch of Debian. See the sid/objcryst-fox package page.

If you are running Debian unstable, all you need to install Fox is:

  • aptitude install objcryst-fox.

The following note on how to build Fox on Debian stable or testing was tested on Debian Lenny 2008/11/16 - please be careful with these instructions, most particularly do not add the binaries repository for unstable, only the source repository !

If you are running Debian testing (this may work on stable, I have not tested), you'll need the foolowing steps to rebuild Fox for your system:

  • Add to /etc/apt/sources.list the source packages for unstable (note: as you add only the source package for unstable, this will not make unstable binaries available for your system), i.e. a line with (please use a local mirror, i.e. replace ftp.lip6.fr by e.g. ftp.uk.debian.org...):

    • deb-src http://ftp.lip6.fr/pub/linux/distributions/debian/ unstable main

  • Update your packages indexes:
    • aptitude update

  • Install the build dependencies for Fox:
    • apt-get build-dep objcryst-fox

  • Build Fox (this will download the source package and build Fox in the current directory):
    • apt-get source -b objcryst-fox

  • Install the .deb which is now available in the directory (the name will vary with the version of Fox and your architecture):

    • dpkg -i objcryst-fox_1.7.99.R1047-1_amd64.deb

None: Install/Linux (last edited 2011-06-19 14:29:43 by VincentFavreNicolin)