← Back to team overview

yade-dev team mailing list archive

Re: Fortran libraries

 

> Thanks Vaclav for such a quick reply.
> 
> Could you explain to me more clearly.  I am quite clueless.
>     * f77 -c   testF.f 
>     * g++ -c testC.cpp 
>     * g++ -o test testF.o testC.o -lg2c 
> 
> From the above example, testF.f is the fortran code i want to link,
> and g2c is the corresponding library    Could you explain an example
> on how to do it to me please in SConstruct?  

Depends what you want to link it to. All plugins in pkg/ are linked
automatically and there is no way to add such things to them. The
easiest would be to have your plug in in extra perhaps, where you
specify for each plugin what LIBS it needs (including other plugins from
yade using linkPlugins). I think if you add something like to
extra/SConscript

env.SharedLibrary('CWBoonPlugin',['testC.cpp','testF.f'],LIBS=env['LIBS']+linkPlugins(['SomePluginFromPkgYouUse','OtherPluginHere'])+['g2c'])

that should do the trick. Scons should pickup the fortran compiler
automatically, but if it uses one you don't want (i.e. gfortran instead
of g77), read "man scons"; you should be able to additionally pass
something like FORTRAN='f77' if needed as option.

v





Follow ups

References