Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#35217 closed defect (wontfix)

boost @1.50.0 Porfile does not pass configure.c{xx}flags to boost build

Reported by: acmorrow (Andrew C. Morrow) Owned by: adfernandes (Andrew Fernandes)
Priority: Normal Milestone:
Component: ports Version: 2.1.1
Keywords: Cc:
Port: boost

Description (last modified by ryandesign (Ryan Carsten Schmidt))

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}\" ;"

Change History (5)

comment:1 Changed 12 years ago by acmorrow (Andrew C. Morrow)

Cc: andrew.c.morrow@… added

Cc Me!

comment:2 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: andrew.c.morrow@… removed
Description: modified (diff)
Milestone: MacPorts Future
Owner: changed from macports-tickets@… to adfernandes@…

comment:3 Changed 12 years ago by adfernandes (Andrew Fernandes)

Resolution: wontfix
Status: newclosed

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

comment:4 Changed 12 years ago by acmorrow (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.

comment:5 Changed 12 years ago by adfernandes (Andrew Fernandes)

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 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! :-)

Note: See TracTickets for help on using tickets.