library not found for -lgfortran

Ryan Schmidt ryandesign at
Wed Jul 9 17:46:59 PDT 2014

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.

> Is there is a variable that expands to the fortran compiler?


More information about the macports-dev mailing list