library not found for -lgfortran

Sean Farley sean at macports.org
Thu Jul 10 10:50:27 PDT 2014


Mark Brethen writes:

> On Jul 9, 2014, at 10:26 PM, Sean Farley <sean at macports.org> wrote:
>
>> 
>> Ryan Schmidt writes:
>> 
>>> On Jul 9, 2014, at 7:42 PM, Mark Brethen wrote:
>>> 
>>>> On Jul 8, 2014, at 7:46 PM, Sean Farley wrote:
>>>> 
>>>>> Try setting 'configure.ld ${configure.fc}' in the pre-configure stage
>>>>> and see if that works. It might not but is worth a shot.
>>>> 
>>>> exec gfortran-mp-4.8 --print-file-name libgfortran.dylib
>>>> /opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.2/../../../libgfortran.dylib
>>>> 
>>>> Then, would this be an acceptable workaround?
>>>> 
>>>> pre-configure {
>>>> libgfortran = [exec gfortran-mp-4.8 --print-file-name libgfortran.a]
>>>> configure.ldflags-append "-L${file dirname libgfortran} -lgfortran"
>>>> }
>>> 
>>> The correct Tcl syntax would be:
>>> 
>>> pre-configure {
>>>    set libgfortran [exec ${configure.fc} --print-file-name libgfortran.a]
>>>    configure.ldflags-append "-L[file dirname ${libgfortran}]"
>>> }
>>> 
>>> I removed "-lgfortran", assuming the build system already does that. If it does not, then it would be simpler to just pass the complete path to the library, rather than passing a -L flag to its directory and a -l path to its name.
>> 
>> This would still miss other libraries the compiler needs. While it might
>> work in this case, there is no way it is general enough to work.
>
> So why is the cmake module (from the cmake port) failing to detect the path? 

Apologies in advance, but I don't know. It's a project I'm unfamiliar
with and, unfortunately, have no time to dig into right now. The fact
that the user needs to send libraries for the fortran compiler indicates
some serious brokenness :-( 


More information about the macports-dev mailing list