Compiling Fortran code for Python module

Joshua Root jmr at macports.org
Fri May 3 17:32:11 PDT 2013


On 2013-5-4 05:53 , Frank Schima wrote:
> 
> 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

Oh, yeah. I figured you were already doing that. :-/

> 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?

build.env-append is WAI, but it could be considered a missing feature
that you can't append to the existing value of an environment variable,
only append new variables to the environment.

> I suppose my workaround breaks universal building but I have not tested
> that.

And build_arch support. The fix is to add the archflags yourself at the
same time you set your other flags.

- Josh


More information about the macports-dev mailing list