Issues with compiler flags in gfortran

Joshua Root jmr at macports.org
Tue Jan 22 10:37:57 UTC 2019


On 2019-1-22 17:08 , Ken Cunningham wrote:
> 
> On 2019-01-21, at 9:22 PM, Joshua Root wrote:
> 
>> On 2019-1-22 01:47 , Nicolas Pavillon wrote:
>>> I then tried with another gfortran compiler outside of macports, and it
>>> could compile without any issue if I remove macports’ prefix from the
>>> path, which seems to indicate that the issue is coming from the
>>> assembler in macports.
>>
>> So this means that gfortran is using whatever assembler it happens to
>> find first in $PATH? That seems undesirable. Is there not a way to
>> configure it to always use a particular assembler?
>>
>> - Josh
> 
> 
> MacPorts cctools assembler is /opt/local/bin/as, which is the same as Xcode's assembler. 

Yes. It doesn't sound like gfortran is consistently using that though,
if changing PATH changes things.

> if you extract the cctools source and look in the as/driver.c file, you will see that it has two behaviours.
> 
> On older systems, by default it runs the ancient gnu as 1.38, which can't do much. 
> 
> On newer systems, or if certain flags are set, it runs the "clang" that is **next to it**. 

That also seems undesirable.

I think this issue overall is covered by
<https://trac.macports.org/ticket/37846>, and I agree with jeremyhu's
assessment there.

- Josh


More information about the macports-dev mailing list