Closed Spivoxity closed 5 years ago
The commands needed to build dynamic libraries are different on the Mac. It can be done, because it is done for the standard modules Math and MathL when the system is built, but you will need a different command line. I'll work it out when I have my Mac in front of me.
The command you need is
gcc -m32 -fPIC -bundle -undefined dynamic_lookup -I /usr/local/lib/obc prim.c -o prim.so
I've updated the wiki page to note this. Method A as described on that page works unchanged, and Method B works with this one difference.
(I've no idea whether choosing -shared instead of -bundle makes any difference in this context.)
Trying to follow your "How to add primitves to OBC" I get via obc -C when executing the think executable
And when trying to compile the prim.so for the dynamic linking the __result is undefined
http://spivey.oriel.ox.ac.uk/corner/How_to_add_primitives_to_OBC