0

Macports uses the default -stdlib option which is libc++ on OSX 10.11. However, I need to use libstdc++ because I use other libraries rely on that. Up to this point, this question is the same with the following two questions: 1 and 2, and I know the answer is sudo port install PORTNAME configure.cxx_stdlib="libstdc++".

However, I need to install an older port (specifically Boost 1.52) and the way to do it is to check out the port's directory at the desired revision using the svn command (which creates a directory called PORTNAME in the current location, and populates that with everything the port needs to build) and then we install the port as follows:

$ cd PORTNAME
$ sudo port install

If I add configure.cxx_stdlib="libstdc++" to the end of the install command, macports does not honor the request. I edit the Portfile of the downloaded older port manually and add the instruction there but that didn't workout. I edit the macports.conf file but this didn't workout either...

TL;DR, how do we compile an "older" port with libstdc++ on OSX 10.11?

Community
  • 1
  • 1
Halil Sen
  • 259
  • 2
  • 11
  • just build it from source as per the boost website? – Richard Hodges Dec 30 '15 at 13:11
  • Thanks Richard Hodges, as a last resort, I did as you suggested. But still, I want to know if it is doable with macports and learn how to do it. – Halil Sen Dec 30 '15 at 13:15
  • can't help there. I've never managed to get macports to work reliably. I build everything from source. I find it easer and more controllable. I use separate build trees for each toolchain variant so there's no confusion. e.g. `build/c++14-libc++/local_system/...` and `build/c++14-libc++/ios/...` etc. – Richard Hodges Dec 30 '15 at 13:24
  • @HalilŞEN, if you want this reopened, let me know. I didn't know I had the power to close this as a duplicate all by myself. – David Hammen Dec 30 '15 at 14:00
  • However, I strongly suggest that you do not want to do this. libc++ and libstdc++ are not compatible. You'll inadvertently break a lot of the tools you use by switching from one library to another, particularly so with Boost. There are lots of tools that depend on Boost. I suggest you instead rebuild the small bit of stuff that you built using libstdc++ with the clang rather than gcc. – David Hammen Dec 30 '15 at 14:01
  • @DavidHammen Well I would like it to be reopened because as I explained in the question, this is a different issue and the answers of the similar questions does not resolve it. – Halil Sen Dec 30 '15 at 17:14
  • @DavidHammen The issue is that I am the end-user of the library which is compiled against `libstdc++`. So that is not an option for me. Is there a way to set the default `stdlib` as `libstdc++` on macports so that every port will be compiled against it? – Halil Sen Dec 30 '15 at 17:16
  • @RichardHodges I am definitely having hard time too and me being a mac/unix rookie does not help at all! It seems that if nobody responds with a reliable answer, I will have to choose your path as well. Thanks anyways – Halil Sen Dec 30 '15 at 17:25
  • @HalilŞEN programming for Linux is like going to a shop and getting everything you want, every time, with no hassle or stress. Programming Apple products is like paying for a dominatrix - it hurts but is strangely fulfilling once you get into it. Programming for Microsoft is like being repeatedly made to walk into a brick wall by your gaolers and threatened with death if you want to leave. – Richard Hodges Dec 30 '15 at 18:24
  • @RichardHodges Nice analogy. However, I must admit that I was pretty happy on the Microsoft side, mostly thanks to visual studio.. But again, I am just coding algorithms and developing solvers, so there is nothing really OS dependent going on... – Halil Sen Dec 30 '15 at 22:21

0 Answers0