[squeak-dev] Building a linux/Pi library to call via FFI

tim Rowledge tim at rowledge.org
Wed Sep 9 23:27:37 UTC 2015


So after too much annoyance I finally found the stupid problem. It’s an object lesson in ‘stupid things OSs do to people’.

I’m sure somebody somewhere thought it was a good idea to scatter libraries  around the place and then make it possible for applications to not know about all of them. The result is that you end up with shell scripts that try to work out what the library paths are and set environment variables and/or pass arguments along, often to yet another script. Eventually you get to some code in the application that has to look up something involving all this cruft and just have to hope it was all done reasonably well.

And of course, no two *nix versions actually agree on what the paths should be. What a concept!

Thus my situation today; a library lives in /usr/local/lib and I naively make another library and sit it next to that. After all, the first library works ok, right? No problem. But the damn scripts don’t actually do anything with this path, as I discovered after a tedious pair of debugging runs when the *working* library didn’t work. I happened upon looking at all the places where the module loading code seemed to peek. And lo! A link from one such place to the %$^ing /usr/local/lib/libwiringPi.so file. Sigh. Make a link for my new library and it actually loads. Mind you, it returns a Character instead of a Float, so something else is happening now.

I still can’t work out how that link got there. I still can’t work out how the ldconfig cache-thingy doesn’t let the library load. I still can’t work out why RISC OS isn’t the normal OS. Thanks for the assorted suggestions!

tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Useful random insult:- Ready to check in at the HaHa Hilton.




More information about the Squeak-dev mailing list