<div dir="ltr">You can use "clang -E" to preprocess Fortran in a way compatible with gcc's cpp (at least on the several codes I have tested it with).<div><br>David</div></div><div class="gmail_extra"><br><br>
<div class="gmail_quote">On Thu, Apr 17, 2014 at 1:16 PM, Sean Farley <span dir="ltr"><<a href="mailto:sean@macports.org" target="_blank">sean@macports.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><br>
Sébastien Maret <<a href="mailto:sebastien.maret@icloud.com">sebastien.maret@icloud.com</a>> writes:<br>
<br>
> Le 17 avr. 2014 à 18:13, Sean Farley <<a href="mailto:sean@macports.org">sean@macports.org</a>> a écrit :<br>
><br>
>> Sébastien Maret <<a href="mailto:sebastien.maret@icloud.com">sebastien.maret@icloud.com</a>> writes:<br>
>><br>
>>> Le 17 avr. 2014 à 01:19, Sean Farley <<a href="mailto:sean@macports.org">sean@macports.org</a>> a écrit :<br>
>>><br>
>>>> Sébastien Maret <<a href="mailto:sebastien.maret@icloud.com">sebastien.maret@icloud.com</a>> writes:<br>
>>>><br>
>>>>> Le 27 mars 2014 à 22:03, Ryan Schmidt <<a href="mailto:ryandesign@macports.org">ryandesign@macports.org</a>> a écrit :<br>
>>>>><br>
>>>>>> On Mar 27, 2014, at 09:14, Sébastien Maret wrote:<br>
>>>>>><br>
>>>>>>> I’m writing a portfile for a software written in C/C++ and Fortran77/90:<br>
>>>>>>> <a href="http://trac.macports.org/ticket/42886" target="_blank">http://trac.macports.org/ticket/42886</a><br>
>>>>>>><br>
>>>>>>> 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?<br>
>>>>>>><br>
>>>>>>> Thanks in advance for your advices.<br>
>>>>>><br>
>>>>>> You do know that as of Mavericks, trying to compile C++ code with anything other than clang is a fool’s errand, right?<br>
>>>>>><br>
>>>>>> <a href="https://trac.macports.org/wiki/FAQ#libcpp" target="_blank">https://trac.macports.org/wiki/FAQ#libcpp</a><br>
>>>>><br>
>>>>> No, I didn’t know that.<br>
>>>>><br>
>>>>>> *Why* is it not possible to compile your software using CC=clang and FC=gfortran-mp-4.8?<br>
>>>>><br>
>>>>> I tried that but the compilation failed. I don’t exactly why but I’ll have a closer look.<br>
>>>><br>
>>>> Sorry for the late reply, but it took me a while to catch up. Ryan is<br>
>>>> right, of course. You should really figure out why they aren't compiling<br>
>>>> and try to fix those errors.<br>
>>><br>
>>> Thanks for your answer.<br>
>>><br>
>>> 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.<br>
>><br>
>> Looking at the portfile, things seem mostly fine. A few comments (which<br>
>> will hopefully help start documenting the compilers portgroup :-)<br>
>><br>
>> - compilers.choose is really meant to serve as a way to isolate a c-only<br>
>> or fortran-only build; since you specify both, you don't need it<br>
><br>
> But isn’t this needed to set both CC, FC and CPP ?<br>
<br>
</div></div>No, if you leave compilers.choose blank, then it will set all the compilers.<br>
<div class=""><br>
>> - removing the clang variants only stops macport's clang compilers from<br>
>> being used; this is fine but since you don't need c++ you could mix<br>
>> clang with gfortran<br>
><br>
> Indeed I do need C++. And since a Fortran compiler is also needed, I would prefer to compiling Fortran and C with compilers from the same compiler suite (GCC) to avoid link problems. In addition the package requires CPP from GCC to compile properly (it is used in a non-standard way to pre-process Fortran code, and this does not work with Apple’s CPP).<br>
<br>
</div>If you need C++, then you forgot to mention it in compilers.choose<br>
(missing 'cxx'). Also, "non-standard way to pre-process Fortran code"<br>
... I didn't realize Fortran had a standard ;-P<br>
<div class=""><br>
> In fact I removed the clang variants because clang does not compile Fortran (same for drgaonegg). Why are variants present when require_fortran is set ?<br>
<br>
</div>But dragonegg does compiler Fortran? That's mostly why it existed.<br>
<div class=""><br>
>> - what is it with IRAM, Labri, and Enseeiht not using autoconf? is<br>
>> everyone in France allergic to autotools?<br>
><br>
> I’m not... In fact, I would love them to use autotools. It would make the packaging a lot easier. I’ll forward your comment to them :-)<br>
<br>
</div>MUMPS and SCOTCH code development can only be measured on geological<br>
timescales.<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
macports-dev mailing list<br>
<a href="mailto:macports-dev@lists.macosforge.org">macports-dev@lists.macosforge.org</a><br>
<a href="https://lists.macosforge.org/mailman/listinfo/macports-dev" target="_blank">https://lists.macosforge.org/mailman/listinfo/macports-dev</a><br>
</div></div></blockquote></div><br></div>