Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question

4 Answers 4

up vote 41 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.)

share|improve this answer
    
This works. Thanks! –  volker Aug 2 '11 at 18:35
    
Ah... Ok, you deserve this +1 again. –  rozcietrzewiacz Aug 2 '11 at 18:43
2  
This is the approach that made make finally work. I tried setting other environment variables and setting prefix and exec-prefix, but once I included these flags stuff actually got built. –  wizonesolutions Jan 10 '13 at 16:34

I had the same issue on RHEL 5.4 and actually found libevent is installed but there is no libevent.so symlink, only the real version of the library:

/usr/lib64/libevent-1.1a.so.1
/usr/lib64/libevent-1.1a.so.1.0.2

So, ln -s /usr/lib64/libevent-1.1a.so.1 /usr/lib64/libevent.so works pretty well for me without the need to install or alter anything. No idea why RedHat's libevent rpm didn't create the symlink. Maybe a bug to report?

But now, it's complaining for this: error: event.h: No such file or directory.

share|improve this answer
    
I got the same exact error: error: event.h: No such file or directory. –  gkb0986 Aug 7 '13 at 18:00
    
I'm on RHEL 6, and I just downloaded and compiled libevent, installing it to a user folder. Then I used @Stéphane Gimenez's trick above to get it compiling. To get it running, I aliases with the LD_PRELOAD trick given by @rozcietrzewiacz: tmux='LD_PRELOAD=/opt-local/lib/libevent-2.0.so.5 /opt-local/bin/tmux'. Works like a charm! –  csl Dec 4 at 15:00

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).

share|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 '11 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 '11 at 17:42
    
$ find .bin-libevent -name 'libevent.so*' finds .bin-libevent/lib/libevent.so –  volker Aug 2 '11 at 17:47
    
:) Then you should point at the directory $HOME/.bin-libevent/lib (updated the answer) –  rozcietrzewiacz Aug 2 '11 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 '11 at 17:59

I was having a similar problem and discovered that after running sudo yum install libevent-devel I was able to successfully make and install tmux.

EDIT: If you are installing this on a Red Hat machine, you will also need to visit the channels selection for your server on the Red Hat Network and add the RHEL Server Optional channel. This will give you access to the -devel packages for libevent (the base and supplementary channels do not provide it).

share|improve this answer
1  
This would be the normal way to fix it, but in this case it was "a machine where I don't have root access" –  Michael Mrozek Nov 28 '12 at 15:21
    
This helped me. I wasn't root and I hadn't installed the devel lib. –  polym Jul 13 at 9:23
    
where do you get the devel lib as a tar file? –  arrowill12 Nov 4 at 18:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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