[146030] trunk/dports/science/clhep/Portfile

Mojca Miklavec mojca at macports.org
Thu Feb 25 22:56:38 PST 2016


On 26 February 2016 at 05:51, Ryan Schmidt wrote:
>> On Feb 25, 2016, at 12:29 AM, mojca at macports.org wrote:
>>
>> Revision
>> 146030
>> Author
>> mojca at macports.org
>> Date
>> 2016-02-24 22:29:31 -0800 (Wed, 24 Feb 2016)
>> Log Message
>>
>> clhep: upgrade to version 2.3.1.1, requires C++11 (libc++, clang >= 3.5)
>
> Unless this is a special case, you should include the cxx11 1.0 portgroup, rather than managing the compiler blacklisting yourself

I would.

The problem is the following chunk of code from the PortGroup which
prevents the port from building on < 10.9:

    if {${configure.cxx_stdlib} eq "libstdc++"} {
        ui_error "${subport} does not support your selected MacPorts
C++ runtime. libc++ must be selected and C++-based ports built against
it."

        if {${os.major} < 13} {
            ui_error "Please follow the instructions on
https://trac.macports.org/wiki/LibcxxOnOlderSystems."
            ui_error "After adding the required options to
macports.conf, essentially reinstall all ports like you would when
switching OS X versions."
            ui_error "Follow step 3 on
https://trac.macports.org/wiki/Migration in order to do this."
        }

        return -code error "libstdc++ unsupported."
    }

(Well, I believe I just found a workaround. If I use both the cxx11
PortGroup as well as set "configure.cxx_stdlib libc++" manually, then
MacPorts seems to be happy even on < 10.9. Is that what I should do?)

> (though it's possible this project has compiler requirements above and beyond what the portgroup uses, in which case you can augment it).

For some reason I have to blacklist clang-3.4 and 3.3 (clang < 600).
This might be a problem in the source code, but at the moment clang
3.4 doesn't work.

> If this port has no C++ library dependencies (looks that way, since it declares no library dependencies at all),

Indeed. No dependencies at all.

> then you can force the use of libc++, which you should do by setting configure.cxx_stdlib to libc++, rather than manually appending to ldflags.

I did. There is already a line
    configure.cxx_stdlib libc++
but either this wasn't enough and I had to add another flag to LDFLAGS
or perhaps I was just confused because it kept failing with clang 3.4
during a linking step. I need to test again whether I can leave that
out.

Mojca

See also https://its.cern.ch/jira/browse/CLHEP-134


More information about the macports-dev mailing list