From: Vladimir Prus (ghost_at_[hidden])
Date: 2006-05-18 02:44:46
On Wednesday 17 May 2006 19:16, Toon Knapen wrote:
> >> 1- the file testpostfor is compiled with "g++", is it possible to change
> >> it in such a way so that it gets compiled with "g77"?
> > Should not "g++" do the right thing about .f files?
> This 'workaround' might only work with gcc/f77. But not all
> compiler-drivers are that intelligent.
> >> (Now I have changed gfortran.jam, but I don't want to do it that way)
> >> 2- When linking "testf" it also use "g++", so, how to link with "g77"?
> >> When linking with g++ it fails because there is no main defined, but
> >> with g77 it links without problem.
> > Would you mind using different type for that, say:
> > fortran_exe testf : ......
> This is not a complete solution IMHO. What if you want to link an
> executable that contains object-files that are compiled by the fortran
> compiler as well as the C++ compiler? On that case you need to link with
> the Fortran library as well as the C++ library!
Won't you get two 'main' functions in that case?
> How this should be handled IMHO is that the runtime libraries of the
> compiler used generate an object-file should be propagates just like
> usage-requirements on the object-file. These usage-requirements are thus
> propagated to the executable when it will be linked using this object-file.
The gotcha is that I don't know how to get the list of runtime libraries. Can
you give the list of libraries needed for fortran? Fixing gfortran.jam to add
those to link line will be straight-forward.
-- Vladimir Prus http://vladimir_prus.blogspot.com Boost.Build V2: http://boost.org/boost-build2
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