<div dir="ltr">You can use &quot;clang -E&quot; to preprocess Fortran in a way compatible with gcc&#39;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">&lt;<a href="mailto:sean@macports.org" target="_blank">sean@macports.org</a>&gt;</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 &lt;<a href="mailto:sebastien.maret@icloud.com">sebastien.maret@icloud.com</a>&gt; writes:<br>
<br>
&gt; Le 17 avr. 2014 à 18:13, Sean Farley &lt;<a href="mailto:sean@macports.org">sean@macports.org</a>&gt; a écrit :<br>
&gt;<br>
&gt;&gt; Sébastien Maret &lt;<a href="mailto:sebastien.maret@icloud.com">sebastien.maret@icloud.com</a>&gt; writes:<br>
&gt;&gt;<br>
&gt;&gt;&gt; Le 17 avr. 2014 à 01:19, Sean Farley &lt;<a href="mailto:sean@macports.org">sean@macports.org</a>&gt; a écrit :<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Sébastien Maret &lt;<a href="mailto:sebastien.maret@icloud.com">sebastien.maret@icloud.com</a>&gt; writes:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Le 27 mars 2014 à 22:03, Ryan Schmidt &lt;<a href="mailto:ryandesign@macports.org">ryandesign@macports.org</a>&gt; a écrit :<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; On Mar 27, 2014, at 09:14, Sébastien Maret wrote:<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; I’m writing a portfile for a software written in C/C++ and Fortran77/90:<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; <a href="http://trac.macports.org/ticket/42886" target="_blank">http://trac.macports.org/ticket/42886</a><br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; 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&#39;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>

&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; Thanks in advance for your advices.<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; You do know that as of Mavericks, trying to compile C++ code with anything other than clang is a fool’s errand, right?<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; <a href="https://trac.macports.org/wiki/FAQ#libcpp" target="_blank">https://trac.macports.org/wiki/FAQ#libcpp</a><br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; No, I didn’t know that.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; *Why* is it not possible to compile your software using CC=clang and FC=gfortran-mp-4.8?<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; I tried that but the compilation failed. I don’t exactly why but I’ll have a closer look.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Sorry for the late reply, but it took me a while to catch up. Ryan is<br>
&gt;&gt;&gt;&gt; right, of course. You should really figure out why they aren&#39;t compiling<br>
&gt;&gt;&gt;&gt; and try to fix those errors.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Thanks for your answer.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; 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>
&gt;&gt;<br>
&gt;&gt; Looking at the portfile, things seem mostly fine. A few comments (which<br>
&gt;&gt; will hopefully help start documenting the compilers portgroup :-)<br>
&gt;&gt;<br>
&gt;&gt; - compilers.choose is really meant to serve as a way to isolate a c-only<br>
&gt;&gt;  or fortran-only build; since you specify both, you don&#39;t need it<br>
&gt;<br>
&gt; 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>
&gt;&gt; - removing the clang variants only stops macport&#39;s clang compilers from<br>
&gt;&gt;  being used; this is fine but since you don&#39;t need c++ you could mix<br>
&gt;&gt;  clang with gfortran<br>
&gt;<br>
&gt; 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 &#39;cxx&#39;). Also, &quot;non-standard way to pre-process Fortran code&quot;<br>
... I didn&#39;t realize Fortran had a standard ;-P<br>
<div class=""><br>
&gt; 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&#39;s mostly why it existed.<br>
<div class=""><br>
&gt;&gt; - what is it with IRAM, Labri, and Enseeiht not using autoconf? is<br>
&gt;&gt;  everyone in France allergic to autotools?<br>
&gt;<br>
&gt; 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>