Compile lsyncd with Lua at special location

October 11th, 2013 by bostjan

The Situation

First we installed latest Lua (5.2.2) from source. We installed it into separate prefix: /usr/local/lua-5.2.2-1
Symlinks were made to point to actual locations from /usr/local/bin

The Symptoms

This symptom occured first:

It is BOGUS as anyone from the sky could see.

Digging into configure and I first disabled this check altogether.

Then the next symptom occured:


The First Hope

It turns out that we need to set some variables, and we did. As with any normal software you can point it to the actual software locations, like this:

But the same error persisted. WTF #2? Digging into config.log, debugging around for an hour and to our surprise we found…

The Solution

What is actually going on is lsyncd being lazy. Outright lazy! It turns out that you not only have to give it the path to Lua libraries and includes, but you actually have to force it to include it by adding -llua. And then another error occurs, so you have to add the -ldl too, and yet another error comes, solving which requires adding -lm too.
Therefore, the grand final solution was this:

Have fun. I didn’t!

Tags: , , , ,

One Response to “Compile lsyncd with Lua at special location”

  1. Chandrasekhar Gopal says:

    Thank you very much for all these details. This is exactly what I needed to compile lsyncd.

    [gopalc@hdp4-mdw1 lsyncd-2.1.5]$ export LUA_CFLAGS=”-I/usr/local/include” && export LUA_LIBS=”-L/usr/local/lib -llua -ldl -lm” && ./configure

    Thanks !!

Leave a Reply