Compiling Fortran code for Python module
Frank Schima
macsforever2000 at macports.org
Fri May 3 12:53:17 PDT 2013
On May 2, 2013, at 5:15 PM, Ryan Schmidt <ryandesign at macports.org> wrote:
>
> On May 2, 2013, at 17:35, Frank Schima wrote:
>
>> As an update. I added the following line to the Portfile which fixed the Fortran code and then goes on to break the C code being compiled later:
>>
>> build.env-append LDFLAGS=-undefined dynamic_lookup -bundle
>>
>> /usr/bin/clang -bundle -undefined dynamic_lookup -L/opt/local/lib dynamic_lookup build/temp.macosx-10.8-x86_64-2.7/qutip/cyQ/spmatfuncs.o -Lbuild/temp.macosx-10.8-x86_64-2.7 -o build/lib.macosx-10.8-x86_64-2.7/qutip/cyQ/spmatfuncs.so
>> clang: error: no such file or directory: 'dynamic_lookup'
>
> Surely you need to quote that?
>
> build.env-append LDFLAGS="-undefined dynamic_lookup -bundle"
I got the port building with the gcc47 variant finally. The key was, believe it or not, to add the line:
python.add_archflags no
And then I could properly add the LDFLAGS with quotes:
build.env-append LDFLAGS="-undefined dynamic_lookup -bundle"
The python portgroup has the following command when using add_archflags:
if {${python.add_archflags}} {
if {[variant_exists universal] && [variant_isset universal]} {
build.env-append CFLAGS="${configure.universal_cflags}" \
OBJCFLAGS="${configure.universal_cflags}" \
CXXFLAGS="${configure.universal_cxxflags}" \
LDFLAGS="${configure.universal_ldflags}"
} else {
build.env-append CFLAGS="${configure.cc_archflags}" \
OBJCFLAGS="${configure.objc_archflags}" \
CXXFLAGS="${configure.cxx_archflags}" \
FFLAGS="${configure.f77_archflags}" \
F90FLAGS="${configure.f90_archflags}" \
FCFLAGS="${configure.fc_archflags}" \
LDFLAGS="${configure.ld_archflags}"
}
Is this potentially a base bug with build.env-append?
I suppose my workaround breaks universal building but I have not tested that.
Cheers!
Frank
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-dev/attachments/20130503/3308a802/attachment.html>
More information about the macports-dev
mailing list