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:
sudo make addtwo
/usr/bin/cc -c -I/opt/Wolfram/WolframEngine/10.0/SystemFiles/Links/MathLink/DeveloperKit/Linux-ARM/MathLinkExamples/../CompilerAdditions addtwo.c
/usr/bin/c++ -I/opt/Wolfram/WolframEngine/10.0/SystemFiles/Links/MathLink/DeveloperKit/Linux-ARM/MathLinkExamples/../CompilerAdditions addtwotm.o addtwo.o -L/opt/Wolfram/WolframEngine/10.0/SystemFiles/Links/MathLink/DeveloperKit/Linux-ARM/MathLinkExamples/../CompilerAdditions -lML32i4 -lm -lpthread -lrt -lstdc++ -ldl -luuid -o addtwo
/usr/bin/ld: cannot find -luuid
collect2: ld returned 1 exit status
Makefile:29: recipe for target 'addtwo' failed
make: *** [addtwo] Error 1
I could not manage to get it to work, could anyone help me?
Thanks a lot,
Thank you Alex and Illian for your help :)!
It is now working as expected!
You could add to your LD_LIBRARY_PATH
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:
libML32i3.a libML32i3.so libML32i4.a libML32i4.so mathlink.h mcc mprep
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?
Hi, the process is failing because it needs the uuid development libraries. You can install them with the following commands:
sudo apt-get update
sudo apt-get install uuid-dev
We'll update the installer to require this package.
Thank you very much, Alex.
Now I could built the example.
But sadly, on execution of the binary I get now following error:
./addtwo: error while loading shared libraries: libML32i4.so: cannot open shared object file: No such file or directory
Any idea about that?
Thanks a lot for your help,
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.
"/SystemFiles/Links/MathLink/DeveloperKit/" <> $SystemID <>
link = Install["addtwo"];
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: