hpc gfortran

Sean Farley sean at macports.org
Thu Mar 28 16:58:36 PDT 2013


Lawrence Velázquez writes:

> On Mar 25, 2013, at 3:58 PM, Sean Farley <sean at macports.org> wrote:
>
>> Joshua Root writes:
>> 
>>> On 2013-3-26 05:44 , Sean Farley wrote:
>>>> 
>>>> I would say it is worth it because currently there is no sane way to
>>>> specify a sole fortran compiler.
>>> 
>>> What do you mean by this exactly? What is the problem with e.g.
>>> 
>>> depends_build port:gcc47
>>> configure.fc ${prefix}/bin/gfortran-mp-4.7
>>> ?
>> 
>> Then what does configure.fc get set to in the +clang variant?
>
> Technically, you could do something like this.
>
>     depends_build       port:clang-3.2 \
>                         port:gcc47
>     configure.compiler  macports-clang-3.2
>     configure.fc        [portconfigure::configure_get_compiler fc macports-gcc-4.7]
>
> But I think that dependency on full-bore GCC is what bothers you.

So, I'm more and more convinced that this is the way to go and have
consolidated my own fortran portgroup to the following:

depends_lib-append  port:gcc47
configure.fc        [portconfigure::configure_get_compiler fc macports-gcc-4.7]
configure.f77       [portconfigure::configure_get_compiler f77 macports-gcc-4.7]
configure.f90       [portconfigure::configure_get_compiler f90 macports-gcc-4.7]

That's a little short to be a port group but the benefit would be that
there is one place for the logic of getting the default fortran compiler
(and also one thing to grep for "PortGroup.*fortran"). A few questions:

1) If the above snippet is ok, should I go ahead and add it? The
behavior would be:

If you include the fortran portgroup, you will get gfortran-4.7 as a
fortran compiler. Other compilers won't be touched. You will get no
new variants. Just the fortran compiler.

2) My next portgroup would be "multiplecompilers" (for ports wanting all
the gcc4X, clang-3.X, and dragonegg variants) but that's a kinda
long name, should this just be named "compilers"? The behavior would be:

If you include the compilers portgroup, you will get gfortran-4.7 as a
default fortran compiler PLUS all the compiler variants (+gcc44
... +gcc48, +clang31 .. +clang33, +dragonegg31 ... +dragonegg33).

3) This is a little off topic but I'd also like to add a "debug"
portgroup, so that I can finally finish porting my "sciency" ports
over. This would replace the code snippet in the cmake portgroup. The
new behavior would be

If you include the debug portgroup, you will get a new variant (+debug)
that will add common debug flags and remove optimizations (e.g. -O2).

Comments?


More information about the macports-dev mailing list