sakra / FindMathematica

CMake module for Mathematica.
MIT License
59 stars 14 forks source link

Linking to libMLi3.a versus libMLi4.a on Mac OS X. #1

Closed rljacobson closed 9 years ago

rljacobson commented 9 years ago

On Mac OS X with Mathematica 10 I'd like to statically link my code to libMLi3.a instead of libMLi4.a because libMLi4.a requires also linking to CoreFoundation and seems to introduce a weird performance penalty on startup and shutdown. Setting Mathematica_USE_STATIC_LIBRARIES to TRUE seems to always find libMLi4.a. Is there a way to specifically select libMLi3.a instead?

sakra commented 9 years ago

Set the variable Mathematica_MathLink_FIND_VERSION_MAJOR, i.e.:

set (Mathematica_MathLink_FIND_VERSION_MAJOR 3)
set (Mathematica_USE_STATIC_LIBRARIES ON)
find_package(Mathematica)
rljacobson commented 9 years ago

Perfect! Thank you.