[90985] trunk/dports/science

Leo Singer aronnax at macports.org
Wed Mar 21 07:11:58 PDT 2012


Attached is a revised Portfile.  I am having trouble with get_canonical_archflags.  After adding to build.post_args-append:

                    CC="${configure.cc} [get_canonical_archflags cc]" \
                    CL="${configure.cc} [get_canonical_archflags ld]" \
                    CXX="${configure.cxx} [get_canonical_archflags cxx]" \
                    CXXL="${configure.cxx} [get_canonical_archflags ld]"

I get the following error message:

:info:build shell command "/usr/bin/make HEALPIX_TARGET=osx BINDIR=/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_science_healpix/healpix/work/Healpix_2.20a/bin LIBDIR=/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_science_healpix/healpix/work/Healpix_2.20a/lib INCDIR=/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_science_healpix/healpix/work/Healpix_2.20a/include EXTERNAL_CFITSIO=yes CFITSIO_INCDIR=/opt/local/include CFITSIO_LIBDIR=/opt/local/lib CFITSIO_EXT_LIB=/opt/local/lib/libcfitsio.a CFITSIO_EXT_INC=/opt/local/include CC=\"/usr/bin/llvm-gcc-4.2 {-arch x86_64"} CL=\"/usr/bin/llvm-gcc-4.2 {-arch x86_64"} CXX=\"/usr/bin/llvm-g++-4.2 {-arch x86_64"} CXXL=\"/usr/bin/llvm-g++-4.2 {-arch x86_64"}" returned error 2

I do not know why the curly braces are showing up in the arguments to Make.

Thank you for the feedback.

Leo

On Mar 21, 2012, at 2:25 AM, Ryan Schmidt wrote:

> 
> On Mar 20, 2012, at 14:08, aronnax at macports.org wrote:
> 
>> Revision: 90985
>>         https://trac.macports.org/changeset/90985
>> Author:   aronnax at macports.org
>> Date:     2012-03-20 12:08:01 -0700 (Tue, 20 Mar 2012)
>> Log Message:
>> -----------
>> New port: healpix
>> 
>> Added Paths:
>> -----------
>>   trunk/dports/science/healpix/
>>   trunk/dports/science/healpix/Portfile
>>   trunk/dports/science/healpix/files/
>>   trunk/dports/science/healpix/files/patch-src-cxx-cxxsupport-arr.h.diff
> 
> 
>> +master_sites        sourceforge
>> +master_sites.mirror_subdir ${name}/Healpix_${version}
> 
> You could simplify this to:
> 
> master_sites        sourceforge:project/healpix/Healpix_${version}
> 
> That's how we usually write it.
> 
> 
>> +use_configure       no
> 
> Because you turn off the standard configure mechanism, you're responsible for ensuring you use the right -arch flags. See [get_canonical_archflags]. Adding a universal variant may also be possible.
> 
> 
>> +# Find a compiler that supports OpenMP.  Courtesy of Adam Mercer.
>> +if {${configure.compiler} == "clang"} {
>> +   configure.compiler llvm-gcc-4.2
>> +}
>> +
>> +if {${configure.compiler} == "gcc-4.0"} {
> 
> Systems on which gcc-4.0 is the default are Tiger and Leopard.
> 
>> +   configure.compiler gcc-4.2
> 
> Of those, only Leopard's Xcode also has gcc-4.2.
> 
>> +   if {![file executable ${configure.cc}]} {
> 
> So this block takes effect only on Tiger.
> 
>> +       depends_build-append port:apple-gcc42
>> +       configure.compiler apple-gcc-4.2
> 
> The apple-gcc42 port does not build on Tiger:
> 
> https://trac.macports.org/ticket/32127
> 
> So I think py-healpy cannot be used on Tiger.
> 
>> +       # base (as of 2.0.3) doesn't set cxx for apple-gcc-4.2
>> +       configure.cxx ${prefix}/bin/g++-apple-4.2
> 
> This 2.0.3 bug was fixed in 2.0.4 so this workaround is no longer needed.
> 
> 
> The above also applies to py-healpy.
> 
> 
> 
>> +build.post_args-append \
>> +                    HEALPIX_TARGET=osx \
>> +                    BINDIR=${worksrcpath}/bin \
>> +                    LIBDIR=${worksrcpath}/lib \
>> +                    INCDIR=${worksrcpath}/include \
>> +                    EXTERNAL_CFITSIO=yes \
>> +                    CFITSIO_INCDIR=${prefix}/include \
>> +                    CFITSIO_LIBDIR=${prefix}/lib \
>> +                    CFITSIO_EXT_LIB=${prefix}/lib/libcfitsio.a \
>> +                    CFITSIO_EXT_INC=${prefix}/include \
>> +                    CC=${configure.cc} CL=${configure.cc} \
>> +                    CXX=${configure.cxx} CXXL=${configure.cxx}
> 
> Here's where you probably would deal with -arch flags, perhaps e.g.
> 
> CC="${configure.cc} [get_canonical_archflags cc]"
> 
> (untested)
> 
> (and the same for CL, CXX, CXXL)
> 
> 
>> +build {
>> +    system "${build.cmd} -C ${worksrcpath}/src/cxx ${build.post_args}"
>> +    system "${build.cmd} -C ${worksrcpath}/src/C/subs static install AR=\"ar -rsv\" ${build.post_args}"
>> +}
> 
> This is fine, but note system also has a -W argument you can use to change the current working directory. That would look like:
> 
>    system -W ${worksrcpath}/src/cxx "${build.cmd} ${build.post_args}"
>    system -W ${worksrcpath}/src/C/subs "${build.cmd} static install AR=\"ar -rsv\" ${build.post_args}"
> 
> 
>> +pre-destroot {
>> +    # This file is just a copy of ${worksrcpath}/lib/libhpxgif.a
>> +    # and conflicts with port:giflib.
>> +    file delete ${worksrcpath}/lib/libgif.a
>> +}
> 
> This should be in post-build, or more simply, since you're already overriding it, in build.
> 
> 
>> +destroot {
>> +    xinstall -d ${destroot}${prefix}/include
>> +    xinstall -d ${destroot}${prefix}/lib
>> +    xinstall -d ${destroot}${prefix}/bin
> 
> MacPorts automatically creates these directories for you.
> 
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Portfile
Type: application/octet-stream
Size: 2798 bytes
Desc: not available
URL: <http://lists.macosforge.org/pipermail/macports-dev/attachments/20120321/39c3345e/attachment.obj>


More information about the macports-dev mailing list