Compiler variants in portfile

Sean Farley sean at macports.org
Thu Apr 17 09:13:55 PDT 2014


Sébastien Maret <sebastien.maret at icloud.com> writes:

> Le 17 avr. 2014 à 01:19, Sean Farley <sean at macports.org> a écrit :
>
>> Sébastien Maret <sebastien.maret at icloud.com> writes:
>> 
>>> Le 27 mars 2014 à 22:03, Ryan Schmidt <ryandesign at macports.org> a écrit :
>>> 
>>>> On Mar 27, 2014, at 09:14, Sébastien Maret wrote:
>>>> 
>>>>> I’m writing a portfile for a software written in C/C++ and Fortran77/90:
>>>>> http://trac.macports.org/ticket/42886
>>>>> 
>>>>> Following a comment macsforever2000, I’ve modified my original port to provide several fortran compiler variants. However, my port requires that CC, CXX, CPP, and FC/F77 are all from a gcc variant. For example, it's not possible to compile it using CC=clang and FC=gfortran-mp-4.8. How can I modify it so that all compilers come from the same compiler suite?
>>>>> 
>>>>> Thanks in advance for your advices.
>>>> 
>>>> You do know that as of Mavericks, trying to compile C++ code with anything other than clang is a fool’s errand, right?
>>>> 
>>>> https://trac.macports.org/wiki/FAQ#libcpp
>>> 
>>> No, I didn’t know that.
>>> 
>>>> *Why* is it not possible to compile your software using CC=clang and FC=gfortran-mp-4.8?
>>> 
>>> I tried that but the compilation failed. I don’t exactly why but I’ll have a closer look. 
>> 
>> Sorry for the late reply, but it took me a while to catch up. Ryan is
>> right, of course. You should really figure out why they aren't compiling
>> and try to fix those errors.
>
> Thanks for your answer.
>
> I found the problem: the link was done against libstdc++ instead if libc++. I’ve fixed this and I’ve just posted a revised version of the port on the tracker.

Looking at the portfile, things seem mostly fine. A few comments (which
will hopefully help start documenting the compilers portgroup :-)

- compilers.choose is really meant to serve as a way to isolate a c-only
  or fortran-only build; since you specify both, you don't need it

- removing the clang variants only stops macport's clang compilers from
  being used; this is fine but since you don't need c++ you could mix
  clang with gfortran

- what is it with IRAM, Labri, and Enseeiht not using autoconf? is
  everyone in France allergic to autotools?

- (note to self) I really need to figure out why mpi_variant_isset
  doesn't work outside of a staging block (e.g. pre-configure)

I'll try to compile the port today and see if I can get clang working.


More information about the macports-dev mailing list