up vote 2 down vote favorite
1
share [fb]

I want to install tmux on a machine where I don't have root access. I already compiled libevent and installed it in $HOME/.bin-libevent and now I want to compile tmux, but configure always ends with configure: error: "libevent not found", even though I tried to point to the libevent directory in the Makefile.am by modifying LDFLAGS and CPPFLAGS, but nothing seems to work.

How can I tell the system to look in my home dir for the libevent?

link|improve this question
feedback

2 Answers

up vote 3 down vote accepted

Try:

DIR="$HOME/.bin-libevent"
./configure CFLAGS="-I$DIR/include" LDFLAGS="-L$DIR/lib"

(I'm sure there must be a better way to configure library paths with autoconf. Usually there is a --with-libevent=dir option. But here, it seems there is no such option.)

link|improve this answer
This works. Thanks! – volker Aug 2 at 18:35
Ah... Ok, you deserve this +1 again. – rozcietrzewiacz Aug 2 at 18:43
feedback

Before the configuration and compilation of tmux (or any program) you need to tell it where it can find the libraries it needs. If you have installed some library in a non-standard location, you can use the environmental variable LD_LIBRARY_PRELOAD to tell, where some libraries are located.

I your case:

$ export LD_LIBRARY_PRELOAD=$HOME/.bin-libevent/lib

And then go on with the configuration/compilation.

Later on, the binary will also need to know where your additional libraries can be found, so you'll need to place the export statement in your .bashrc (if bash is your login shell).

link|improve this answer
Thanks, but sadly this doesn't work, same error message. The version number is libevent-2.0.12 which should work – volker Aug 2 at 17:22
Then it seems there is a problem with your libevent compilation. What does find .bin-libevent -name 'libevent.so*' show? – rozcietrzewiacz Aug 2 at 17:42
$ find .bin-libevent -name 'libevent.so*' finds .bin-libevent/lib/libevent.so – volker Aug 2 at 17:47
:) Then you should point at the directory $HOME/.bin-libevent/lib (updated the answer) – rozcietrzewiacz Aug 2 at 17:48
Yes, I am afraid I already tried that as well, still no change. I am quite puzzled and frustrated. – volker Aug 2 at 17:59
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.