[MacPorts] #35217: boost @1.50.0 Porfile does not pass configure.c{xx}flags to boost build
#35217: boost @1.50.0 Porfile does not pass configure.c{xx}flags to boost build ---------------------------------------+------------------------------------ Reporter: andrew.c.morrow@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: MacPorts Future Component: ports | Version: 2.1.1 Keywords: | Port: boost ---------------------------------------+------------------------------------ I've been experimenting with building various macports C++ libraries with XCode 4.5 DP2, with the compiler hardcoded to clang, and with '-std=c++11 -stdlib=libc++' edited into configure.cxxflags in portconfigure.tcl: default configure.cxxflags {"${configure.optflags} -std=c++11 -stdlib=libc++"} I'll be the first to admit this is a somewhat exotic setup, but I've actually had surprisingly good success so far. One problem I have discovered is that my modified configure.cxxflags were not being passed along into the boost build system when building boost. In the Boost Portfile there is a line like this: write_jam "using darwin : : ${filter}${configure.cxx} ;" Which configures the user-config.jam file used by boosts build system. Based on the information here: http://www.boost.org/boost- build2/doc/html/bbv2/overview/configuration.html I think that this line should be modified to something more like: write_jam "using darwin : : ${filter}${configure.cxx} : <compileflags>\"${configure.cppflags}\" <cflags>\"${configure.cflags}\" <cxxflags>\"${configure.cxxflags}\" <linkflags>\"${configure.cxxflags} ${configure.ldflags}\" ;" -- Ticket URL: <https://trac.macports.org/ticket/35217> MacPorts <http://www.macports.org/> Ports system for Mac OS
#35217: boost @1.50.0 Porfile does not pass configure.c{xx}flags to boost build ---------------------------------------+------------------------------------ Reporter: andrew.c.morrow@… | Owner: adfernandes@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.1 Keywords: | Port: boost ---------------------------------------+------------------------------------ Changes (by ryandesign@…): * cc: andrew.c.morrow@… (removed) * owner: macports-tickets@… => adfernandes@… * milestone: MacPorts Future => Old description:
I've been experimenting with building various macports C++ libraries with XCode 4.5 DP2, with the compiler hardcoded to clang, and with '-std=c++11 -stdlib=libc++' edited into configure.cxxflags in portconfigure.tcl:
default configure.cxxflags {"${configure.optflags} -std=c++11 -stdlib=libc++"}
I'll be the first to admit this is a somewhat exotic setup, but I've actually had surprisingly good success so far.
One problem I have discovered is that my modified configure.cxxflags were not being passed along into the boost build system when building boost. In the Boost Portfile there is a line like this:
write_jam "using darwin : : ${filter}${configure.cxx} ;"
Which configures the user-config.jam file used by boosts build system. Based on the information here:
http://www.boost.org/boost- build2/doc/html/bbv2/overview/configuration.html
I think that this line should be modified to something more like:
write_jam "using darwin : : ${filter}${configure.cxx} : <compileflags>\"${configure.cppflags}\" <cflags>\"${configure.cflags}\" <cxxflags>\"${configure.cxxflags}\" <linkflags>\"${configure.cxxflags} ${configure.ldflags}\" ;"
New description: I've been experimenting with building various macports C++ libraries with XCode 4.5 DP2, with the compiler hardcoded to clang, and with '-std=c++11 -stdlib=libc++' edited into configure.cxxflags in portconfigure.tcl: {{{ default configure.cxxflags {"${configure.optflags} -std=c++11 -stdlib=libc++"} }}} I'll be the first to admit this is a somewhat exotic setup, but I've actually had surprisingly good success so far. One problem I have discovered is that my modified configure.cxxflags were not being passed along into the boost build system when building boost. In the Boost Portfile there is a line like this: {{{ write_jam "using darwin : : ${filter}${configure.cxx} ;" }}} Which configures the user-config.jam file used by boosts build system. Based on the information here: http://www.boost.org/boost- build2/doc/html/bbv2/overview/configuration.html I think that this line should be modified to something more like: {{{ write_jam "using darwin : : ${filter}${configure.cxx} : <compileflags>\"${configure.cppflags}\" <cflags>\"${configure.cflags}\" <cxxflags>\"${configure.cxxflags}\" <linkflags>\"${configure.cxxflags} ${configure.ldflags}\" ;" }}} -- -- Ticket URL: <https://trac.macports.org/ticket/35217#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS
#35217: boost @1.50.0 Porfile does not pass configure.c{xx}flags to boost build ----------------------------------------+----------------------------------- Reporter: andrew.c.morrow@… | Owner: adfernandes@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.1.1 Resolution: wontfix | Keywords: Port: boost | ----------------------------------------+----------------------------------- Changes (by adfernandes@…): * status: new => closed * resolution: => wontfix Comment: I agree, this sounds like a great suggestion. Unfortunately, the boost documentation lies... a lot. Disclaimer: I've done a lot of (non-MacPorts) work building `boost` for iOS, and it really is not fun at all. The main problem with adding compiler flags like you show is that it only sometimes works. If you look at the `darwin.jam` file (and if you can manage to read it, since virtually all of it is undocumented, untested, not-working, and so on) you'll see that the build system magically adds and removes compiler flags depending on what it thinks you want to do. It modifies the flags based on compiler, SDK, operating system, version, and so on. As far as I can tell, none of it is really tested except for what is explicitly stated on the boost documentation page. You'll note that as of `boost-1.50.0` you cannot use `apple-clang++-3.1` to build `boost`, even though clang-2.8 and later are technically supported. You know, I've actually looked a lot into this because of #35172. What I wanted to do was build boost with gcc-4.7 and link the gcc-runtime in statically. That would entail adding `-static-gcc` and `-static-c++` flags. However, the `boost` build system won't let you do that. I don't know why. It just has a snarky "man, that's a bad idea, so I won't let you do that" message in the jam file. (I suspect it has to do with [http://stackoverflow.com/questions/3430400/linux-static-linking-is-dead this linux-ism], but do not know.) My feelings are that unless this provides a reasonable benefit to a reasonable subset of users, it risks too much breakage to do this. -- Ticket URL: <https://trac.macports.org/ticket/35217#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#35217: boost @1.50.0 Porfile does not pass configure.c{xx}flags to boost build ----------------------------------------+----------------------------------- Reporter: andrew.c.morrow@… | Owner: adfernandes@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.1.1 Resolution: wontfix | Keywords: Port: boost | ----------------------------------------+----------------------------------- Comment(by andrew.c.morrow@…): How frustrating. Thanks for taking the time to explain your reasoning. I can always hack it in myself and take my chances. -- Ticket URL: <https://trac.macports.org/ticket/35217#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS
#35217: boost @1.50.0 Porfile does not pass configure.c{xx}flags to boost build ----------------------------------------+----------------------------------- Reporter: andrew.c.morrow@… | Owner: adfernandes@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.1.1 Resolution: wontfix | Keywords: Port: boost | ----------------------------------------+----------------------------------- Comment(by adfernandes@…): Agreed. BTW, I'm sure that you'll be fine getting boost to work on '''your''' system. It's everybody else's that I'd be worried about (from a maintainer's point of view). Take a look at [http://stackoverflow.com/questions/9100723/using- boostfilesysystem-path-from-framework-on-ios this] build problem. The accepted answer was by a buddy of mine. It was really horrible for him to figure out on a really, really tight deadline. My advice, just because it compiles and links... don't trust it until you have a tested executable! :-) -- Ticket URL: <https://trac.macports.org/ticket/35217#comment:5> MacPorts <http://www.macports.org/> Ports system for Mac OS
participants (1)
-
MacPorts