Group Abstract Group Abstract

Message Boards Message Boards

3
|
12K 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
POSTED BY: Szabolcs Horvát
15 Replies
POSTED BY: Alex Newman
Posted 10 years ago
POSTED BY: Itai Seggev
Posted 10 years ago

You can in fact build a 10.3-compatible version with 10.4, it's just slightly ugly. What you need to do is replace

-F"/Applications/Mathematica 10.4.app/Contents/SystemFiles/Links/MathLink/DeveloperKit/MacOSX-x86-64/CompilerAdditions" -framework "mathlink"

with

-Wl,"/Applications/Mathematica 10.4.app/Contents/SystemFiles/Links/MathLink/DeveloperKit/MacOSX-x86-64/CompilerAdditions/mathlink.framework/Versions/4.25/mathlink"

so that you're explictly linking in the libstdc++ version of MathLink rather than the libc++ version (called 4.36). This is not at all obvious from Apple's documentation, and we had to experiment internally to make sure this worked prior to shipping 10.4. I'm glad we did so that I had this answer handy for you. :)

POSTED BY: Itai Seggev

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
POSTED BY: Szabolcs Horvát
POSTED BY: Szabolcs Horvát
POSTED BY: Szabolcs Horvát

I believe that if you add the following extension to your PacletInfo.m, the $SystemID value is significant:

Paclet[
        Name -> "My Paclet",
        Version -> "x.x.x",
        Extensions -> {
            {"LibraryLink", Root->"LibraryResources"}
        }
]

This will tell FindLibrary where to find your libraries (informed by the $SystemID). Using a full path is perfectly valid for corner cases like this, though.

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 BY: Alex Newman
POSTED BY: Szabolcs Horvát
POSTED BY: Szabolcs Horvát
POSTED BY: Ilian Gachevski

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
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard