Fortan question & devel/fortrancl/Portfile ?

Sean Farley sean at macports.org
Tue Jan 29 13:03:22 PST 2013


On Tue, Jan 29, 2013 at 2:06 PM, Ryan Schmidt <ryandesign at macports.org> wrote:
> On Jan 29, 2013, at 06:11, Peter Danecek <Peter.Danecek at bo.ingv.it> wrote:
>
>> I am just browsing some Portfiles to understand how to handle fortran builds correctly.
>>
>> At this point I came about something I may not understand in devel/fortrancl/Portfile (or is it just a copy-paste bug?)
>>
>> Why the g95 variant would depend on port:gcc45 ?
>>
>> --- snip ---
>> variant gcc45 conflicts g95 description {build with gfortran-mp-4.5} {
>>  depends_build-append    port:gcc45
>>  configure.compiler      macports-gcc-4.5
>> }
>>
>> variant g95 conflicts gcc45 description {build with g95} {
>>  depends_build-append    port:gcc45
>>  configure.fc            g95
>> }
>> --- snap ---
>
> That is most certainly a copy-paste mistake. Obviously a g95 variant should depend on the g95 port not the gcc45 port.
>
>
>> Now my question:
>> For the C compiler there is some default behaviour, how to choose the right compiler without depending on the actual system setup. Only in case a certain compiler version does not build, there is a possibility to influence the choice (at least this is what I understood).
>>
>> I did not find any clear indications on how to do "the right thing" for Fortran compilers, and maybe there I no a completely clear strategy (???) on how to make Fortran compilation independent of the actual system. There are all these variants around. But for example if I have installed several versions of gccXX with the respective gfortran, I may end up with quite a mix of gfortran dependencies.
>>
>> Then I observe that all these variants are usually conflicting. However, I guess (in theory) there are actually two different situations:
>>
>> (1) I have some software written in fortran, and here obviously one single compiler is be fine (for example python extensions).
>> (2) I want to compile the fortran bindings of a library, to be used with "my preferred fortran compiler". Here I might want to install bindings for different compilers (or versions).
>>
>> I guess, however the second case is not supported for the moment.
>>
>> So which are the knobs to look at, when creating ports of fortran programs (or programs with fortran bindings)?
>>
>> Maybe I just missed the right place to look at?
>
> I don't understand most of your questions.
>
> With regard to (1) and (2) above, our solutions are geared toward (1); I'd never heard of the use case you describe in (2) before.

(2) is pretty much what I'm trying to outline by having a fortran
portgroup. It would give you the product of
{clang,llvm-gcc,system-gcc}{gfortran,g95} and would make it easy to
add a compiler (since it would all be in one place).

Without such a portgroup, how would you build a port like scipy with
all gcc compilers vs. default c compiler + gfortran (or even g95)?


More information about the macports-dev mailing list