Home > Legacy archive > User’s manual > Compiling FARGO

Usually, compiling FARGO is as simple as issuing a make command from the command line, in the source directory (src/ in the distribution provided). However, there is a number of points that need to be taken into account in order to optimize the built for a given platform. Also, by giving an option to the make command, one can switch between a sequential and a parallel (MPI) built.

1. FARGO makefile contains conditionnal parts (begining with ifeq and ending with endif). This is an extension of the GNU make utility. It will not work with another make. On Linux platforms, make is actually gmake, so issuing a make command works fine. However, on other platforms such as Solaris or Alpha stations, it is not the case: you get an error message if you issue a make command, so you must explicitely issue gmake. The only exception to this that I am aware of is the case of Mac OS X: there is a make which is actually the GNU make utility, but no gmake, so you have to type make instead of gmake, in this case only.

2. Issuing simply the adequate command (make or gmake) will compile the code with a very reduced set of compiler flags (-O only, i.e. very basic optimization). If you want to use more platform specific options, then you need to set the value of the environment variable FARGO_ARCH. No makefile editing is required. For instance, if you are working on a Linux workstation and use gcc as your compiler, issue:

if you are working with the bash shell
(check with ’echo $SHELL’) or:

if you are working under tcsh. In any case it is a good idea to define the FARGO_ARCH variable in your .bashrc (resp. .tcshrc) so that compiling always reduce to simply issuing make (or gmake). This feature of the makefile is an idea of Christophe Morisset (IAUNAM).

3. By default, the makefile builds a sequential executable (i.e. which runs on one processor only, on any platform, even without any MPI implementation). In order to build a parallel executable, you have to issue:

Next time you compile, the makefile will remember that the previous build was parallel and recompile only the modified source files. If you want at some point to switch back to a sequential built, issue

Any further make instruction will then correspond to a sequential build. There exists two targets in the makefile : para and seq, which respectively call gmake BUILD=parallel and gmake BUILD=sequential. Since they call gmake and not make, these shortcut targets can be used everywhere except on MAC OS X (otherwise you may just edit these targets by removing the g of gmake).

4. The makefile remembers whether the previous built was sequential or parallel in a file called ’.config’. During the very first build this file does not exist yet, therefore a warning message is issued. Just ignore it.

The table below indicates which value should be given to the FARGO_ARCH variable depending on the platform.

Platformvalue of FARGO_ARCH
Linux platform (pentium 3 or higher) with gcc LINUX
Linux platform, with icc (Intel compiler), optimized for pentium 4 INTEL
MAC OS X (with gcc) MACOSX
Generic platform Undefined
Compaq HP/SC (Digital EV68) with no OpenMP support EV68
Compaq HP/SC (Digital EV68) with OpenMP support EVMP
Sparc SunStation with gcc SPARC

The table below sums up the build command depending on the platform:

Action and platformCommand to issue
Build (or rebuild) on all platforms (except MAC OS X) gmake
Build (or rebuild) on MAC OS X make
Switch to parallel build, on all platforms (except MAC OS X) gmake para
Switch to parallel build on MAC OS X make BUILD=parallel
Switch to sequential build, on all platforms (except MAC OS X) gmake seq
Switch to sequential build on MAC OS X make BUILD=sequential

Site Map | COAST COAST | Contact | RSS RSS 2.0