library not found for -lgfortran

Mark Brethen mark.brethen at gmail.com
Wed Jul 9 21:16:06 PDT 2014


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? 

Mark






More information about the macports-dev mailing list