Group Abstract Group Abstract

Message Boards Message Boards

3
|
12.3K Views
|
15 Replies
|
11 Total Likes
View groups...
Share
Share this post:

LibraryLink back- and forwards compatibility broken in 10.4!

Posted 10 years ago

LibraryLink backwards and forwards compatibility seems to have been broken in version 10.4.0. Was this intentional or is it a bug?

I am seeing the problems on OS X, and I think they don't exist on Windows (per reports of others):

  • If I compile my library with 10.3, it crashes in 10.4.
  • If I compile it with 10.4, it doesn't load in any of the previous versions (10.0–10.3).

10.0–10.3 were both backwards and forwards compatible with each other.

Is this a bug or is it expected (intentional)?

If it is intentional, that is very bad news because it makes it prohibitively complicated to create add-ons that use LibraryLink. I would have to compile my library separately for each Mathematica version on each operating system (not to mention adding code for selecting the right library to load for each version). It is already a big burden to compile on each operating system. If I also have to compile for each version, then I will be forced to simply give up. Only a company can devote so much resource to support a Mathematica add-on, and everyone else (i.e. people using a university site license) will be cut off.

If it is a bug, that is a very good argument for bringing back the prerelease programme. If it is a bug, can we expect a 10.4.1 to fix this?

I have a published package (IGraphM) that is directly affected by this problem.

POSTED BY: Szabolcs Horvát
15 Replies
POSTED BY: Alex Newman
POSTED BY: Szabolcs Horvát
POSTED BY: Alex Newman

Thank you for the help Alex! I'm now keeping two OS X binaries in LibraryResources/MacOSX-x86-64-libc++ and LibraryResources/MacOSX-x86-64-libstdc++ and all is working well. I don't think violating the convention about LibraryResources/$SystemID is a problem because I am adding it to $LibraryPath manually anyway (if the system didn't add it already).

POSTED BY: Szabolcs Horvát
POSTED BY: Alex Newman
Posted 10 years ago
POSTED BY: Itai Seggev
POSTED BY: Szabolcs Horvát
Posted 10 years ago
POSTED BY: Itai Seggev

@Szabolcs I am afraid maintaining two separate versions of the library on OS X may be unavoidable, this is caused by the libc++ vs libstdc++ ABI incompatibility.

POSTED BY: Ilian Gachevski

Thank you for the response. Does this mean then that:

  • The problem exists only on OS X
  • There's only one break in compatibility, i.e. all $10.x$ for $x \le 3$ and again all $10.x$ for $x \ge 4$ are going to be compatible with each other too?

Compiling only two binaries and only on one OS is not that big a deal.

A few more questions:

Is it possible to compile for <= 10.3 if I only have 10.4 available? I noticed that the only difference in the command lines is that 10.3 has -mmacosx-version-min=10.6 -lstdc++ while 10.4 has -mmacosx-version-min=10.9 -lc++. That part seems independent of Mathematica. But we also have -F"..../Mathematica.app/..../CompilerAdditions" and -framework "mathlink". I don't understand what a "framework" is exactly and what sort of linking it involves (static or dynamic). Thus if I specify M10.4's MathLink framework (not 10.3's!) when compiling and I use -lstdc++, will the result work with 10.3? (I know I should try this out...)

Are there similar compatibility breaks on other systems (perhaps between other already released 10.x versions)?

POSTED BY: Szabolcs Horvát

The problem exists only on OS X

Yes, correct.

There's only one break in compatibility, i.e. all 10.x for x?3 and again all 10.x for x?4 are going to be compatible with each other too?

That should largely be true for the 10.x series of products, but I don't think we guarantee perfect binary compatibility between versions with MathLink or the Wolfram RTL.

(you seem to have replied elsewhere, so I'll reply there)

POSTED BY: Alex Newman

OK, here's the test case for the reverse problem:

https://dl.dropboxusercontent.com/u/38623/Backward-compat-testcase.zip

If I compile a LibraryLink library with 10.3.1, then certain things don't work correctly in 10.4.0. Specifically, MLNextPacket() crashes when used as shown here.

Reported as CASE:3544766.

I think it is absolutely essential for Wolfram Research to have a prerelease programme if they want to support a healthy add-on ecosystem. Add-on authors must be able to test their packages before a new version of Mathematica is released.

POSTED BY: Szabolcs Horvát

Hi Szabolcs,

How about your MATLink package, does that use LibraryLink under the hood? I'm using it now, and will go to 10.4 soon as well... or should I perhaps keep both versions installed?

--SH

POSTED BY: Sander Huisman

I haven't run the full testsuite for MATLink yet, but the few things I tried worked correctly. MATLink does not use LibraryLink. It only uses MathLink (WSTP).

POSTED BY: Szabolcs Horvát

Reported one of the two problems (libraries compiled with 10.4 don't load in 10.3) as CASE:3544676.

The test case I sent: https://dl.dropboxusercontent.com/u/38623/Forward-compat.zip

Still working on a test case for the other problem (which is much more involved).

POSTED BY: Szabolcs Horvát
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard