10
$\begingroup$

WolframLibraryVersion, defined in WolframLibrary.h, was bumped from 3 to 4 in Mathematica 11.2. This causes libraries compiled with M11.2 to fail to load in earlier versions.

Is it possible to compile a M11.1-compatible library using M11.2?

$\endgroup$
  • $\begingroup$ To my understanding, not possible using only 11.2, although you could probably take the WolframRTL library and headers from an 11.1 and then persuade 11.2 to compile against them. $\endgroup$ – ilian Sep 17 '17 at 15:57
  • $\begingroup$ @ilian It seems that if not using MathLink, only the headers are needed for compilation. It doesn't seem to link against anything except MathLink. The error is caused by returning a certain value in WolframLibrary_getVersion, but in principle, I can return anything I want there. Looking at what actually changed in WolframLibrary.h, it appears that the WolframIOLibrary functions were removed (moved into a separate header actually). Shouldn't then it be sufficient to just manually return 3 for the WolframLibraryVersion? $\endgroup$ – Szabolcs Sep 17 '17 at 16:56
  • $\begingroup$ @ilian Ideally just compile with the 11.1 headers instead, if one has access to those, of course. Another question: do libraries compiled with earlier versions generally work in later versions? What if the later version of M has a different WolframLibraryVersion? (I know about the compatibility break between 10.3 and 10.4 on Mac, and this question does not refer to that.) $\endgroup$ – Szabolcs Sep 17 '17 at 16:59
  • $\begingroup$ @ilian Some better support/documentation about these compatibility issues would be very welcome. It looks like if I want to be safe, and support 10.0+ with my package, I currently need to keep around at least 3 different versions of M to compile with ... 10.0 for the libstdc++ version on Mac, 11.1 for the last version that still has WolframLibraryVersion=3 and needs libc++, and the latest version for daily work $\endgroup$ – Szabolcs Sep 17 '17 at 17:01
  • $\begingroup$ @ilian It seems it would be quite helpful if I could include some of the v11.1 headers in my project, which would mean putting them in a public git repository. Do you think this is something I could get permission for if I write to support, or it's not even worth bothering with? (The headers are copyrighted.) $\endgroup$ – Szabolcs Sep 18 '17 at 16:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.