jeanluct / braidlab

Matlab package for analyzing data using braids
GNU General Public License v3.0
24 stars 10 forks source link

Support for older OS X versions #102

Closed mbudisic closed 9 years ago

mbudisic commented 9 years ago

Sometimes between now and Snow Leopard, Apple made a change in their OS X standard libraries. This means that binaries compiled in Mavericks and later might not work on Snow Leopard and earlier. An example error generated is Symbol not found: __sincos_stret ... Expected in /usr/lib/libSystem.B.dylib. The fix should be to issue -mmacosx-version-min=10.8 (or earlier) during makedist compile step in braidlab.

See StackExchange: http://stackoverflow.com/questions/19015780/sincos-stret-undefined-symbol-when-linking here http://stackoverflow.com/questions/2923502/what-does-macosx-version-min-imply

I'll see if this does the trick.

mbudisic commented 9 years ago

mmacosx-version-min=10.8 forces C++ compiler to link against libstdc++ over (the default for > 10.8) libc++. This is exactly what it should be, but now linking fails because somehow wrong symbols are being defined. For example

Building with 'Xcode Clang++'.
Undefined symbols for architecture x86_64:
  "std::ios_base::Init::Init()", referenced from:
      __GLOBAL__I_a in randomwalk_helper.o
  "std::ios_base::Init::~Init()", referenced from:
      __GLOBAL__I_a in randomwalk_helper.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

This happens whenever one of the headers from stdlib is used (iostream, vector, etc...)

mbudisic commented 9 years ago

This is a pretty painful thing to hunt down... do we have someone running Snow Leopard? :)

jeanluct commented 9 years ago

Is this in response to a user?

mbudisic commented 9 years ago

Yes, Cecily at UCSD. I'm trying to see if she can compile on her end.

It looks like most of the things still run fine except, surprisingly, randomwalk_helper.cpp. Now, if I define MACOSX_DEPLOYMENT_TARGET=10.8 which should target her version of the OS, I cannot link things on my end. But this is the way that Apple approaches issue of backward compatibility so it's hard to say what is going wrong...

jeanluct commented 9 years ago

Has she considered upgrading OSX? It's a free upgrade... Snow Leopard is getting long in the tooth, so to speak.

On Fri, Dec 12, 2014 at 5:09 PM, Marko Budisic notifications@github.com wrote:

Yes, Cecily at UCSD. I'm trying to see if she can compile on her end.

It looks like most of the things still run fine except, surprisingly, randomwalk_helper.cpp. Now, if I define MACOSX_DEPLOYMENT_TARGET=10.8 which should target her version of the OS, I cannot link things on my end. But this is the way that Apple approaches issue of backward compatibility so it's hard to say what is going wrong...

— Reply to this email directly or view it on GitHub https://github.com/jeanluct/braidlab/issues/102#issuecomment-66849600.

mbudisic commented 9 years ago

Yeah, that's definitely true. No pun intended? :)

mbudisic commented 9 years ago

I'm putting this on hold until I reconnect with Cecily as she's the only one who had an interest in this.

jeanluct commented 9 years ago

Ok, I'll close it. Reopen if necessary.