Boost logo

Boost-Build :

From: Thomas Klimpel (thomas.klimpel_at_[hidden])
Date: 2008-04-01 17:39:05


> I'm confused. Can you explicitly spell out what commands should be
> invoked if sources list of an 'exe' target include a file with
> the .f extension?

The target

exe compatible_calling_conventions :
 compatible_calling_convention.cpp fortran_functions.f

should produce (more or less) the following commands

g++ -c compatible_calling_convention.cpp
g77 -c fortran_functions.f
g++ -o compatible_calling_convention compatible_calling_convention.o fortran_functions.o -lg2c

> > My system currently invokes the gcc-3.4 version of g77 by default,
> > while c and c++ are compiled with gcc-4.1.3. This seems to be the
> > recommended configuration for gcc-4.1. For gcc-4.2, the recommended
> > configuration seems to be to invoke the gcc-4.2 version of gfortran by
> default.

The above is true for my current ubuntu system. For gcc-4.2 and above

g++ -c compatible_calling_convention.cpp
gfortran -c fortran_functions.f
g++ -o compatible_calling_convention compatible_calling_convention.o fortran_functions.o -lgfortran

are probably the commands. I can also do this on my curent system, but the resulting executable crashes with a segmentation fault. (I just tried it. I don't really care about this crash. I have to use g77 if I use gcc-4.1.3 to compile the cpp sources.)

Did I succeed in creating even more confusion? Maybe the following helps to understand why I was talking about different compiler versions:

gcc --version
gcc (GCC) 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)

g++ --version
g++ (GCC) 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)

g77 --version
GNU Fortran (GCC) 3.4.6 (Ubuntu 3.4.6-6ubuntu2)

gfortran --version
GNU Fortran (GCC) 4.2.1 (Ubuntu 4.2.1-5ubuntu4)

Regards,
Thomas

-- 
"If the fool would persist in his folly he would become wise."
   - William Blake
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger

Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk