I am using the Raspberry Pi, Modell B with the latest version of Raspbian and the Wolfram Engine. For an project I need to wirte an own MathLink Addon and therefore I started to look at the existing examples in: /opt/Wolfram/WolframEngine/10.0/SystemFiles/Links/MathLink/DeveloperKit/Linux-ARM/MathLinkExamples
I tried to built the simple addtwo Example, but only got this error:
OK, I came across an idea:
I copied the contant of the /opt/Wolfram/WolframEngine/10.0/SystemFiles/Links/MathLink/DeveloperKit/Linux-ARM/CompilerAdditions Folder:
and ran sudo /sbin/ldconfig to refresh the cache. Now it works. But that is quite an ugly solution. Which adjustment should I do make it a proper solution?
MathLink binaries are expected to be run from within the Wolfram Language Kernel (e.g. Mathematica), so you’ll see the binaries looking for some of the libraries contained in the $InstallationDirectory. These MathLink examples are providing an interface for the kernel to run the C code. The proper way to use them is to load them within the Kernel with Install.
You can read more about this process in the documentation for Install and our documentation on MathLink/WSTP.
In general, you don’t want to be modifying the system library paths to load non-standard library directories. If you really wanted to run with the Wolfram Language’s libraries, you could just start a binary like this: