Thanks for the pointers on the version specific stuff. I had built libev from scratch, but no magic incantations. My plan has been to bypass libev enventually, and go to bare metal, as you suggest. Libev provides me with a good starting point, although, it's already in the way. As far as the types of events, I want to support everything from mouse/keyboard/timer to sockets, so ultimately, I will do poll as well, but perhaps as a separable thing. Looking at libev, I don't expect there to be much difficulty in going straight to select. -- William =============================== - Shaping clay is easier than digging it out of the ground. > Date: Tue, 30 Oct 2012 16:49:30 +0100 > From: mike-1210@xxxxxxxxxx > To: luajit@xxxxxxxxxxxxx > Subject: Re: noob luajit library loading on unix question > > William Adams wrote: > > I've got a ffi interop thing to libev running on Linux > > (Raspberry Pi). When it comes time to load the library, I seem > > to have to load it explicitly like this: > > > > local libev = ffi.load('libev.so.4.0.0') > > Correct would be 'libev.so.4'. > > > There is a soft link to the library, named libev.so, and I > > thought I'd be able to do this: > > The symlink is only present if you've installed the libev4-dev > package. You can't expect it to be always present on users > systems. > > > Is this normal for Linux systems, or am I missing someting? > > Nope, that's normal. To *build* a package you need the -dev > packages of all required libraries. The linker resolves the > library dependency to the versioned name at build time. > > When a package is *installed* (on a different system) it only > needs the non-dev library packages. It always loads the versioned > library and doesn't need the non-versioned symlink. > > Ok, so that causes problems for the FFI -- but that's how Linux > distros work. You really need to load the versioned name. Or you > could try to load different versions (wrap it in pcall) as long as > the API functions you're using haven't changed. > > [BTW: That begs the question why you're adding a dependency to > libev for a framework that's Linux-specific, anyway? You might as > well add a small wrapper for poll or epoll and be done. Avoids > callback hell, too. And don't bother with epoll unless you're > aiming for high scalability -- poll is much easier to handle and > good enough for most use cases.] > > --Mike >