Skip to content

Instantly share code, notes, and snippets.

@drio
Created August 18, 2010 22:03
Show Gist options
  • Save drio/536325 to your computer and use it in GitHub Desktop.
Save drio/536325 to your computer and use it in GitHub Desktop.
How to compile tmux
NOTE: I am using bash for this.
NOTE2: Another approach for getting tmux would be to use gentoo-prefix or netbsd's pkgsrc. I
didn't have too much luck with gentoo-prefix. NetBSD was pretty straight forward but it had
an old version of tmux (1.1).
Here is how to get tmux compiled if you can get your systadmins to installed it ... or
any other weird reason. I assume you have some basic libraries and headers installed (like
ncurses, etc...). If not, you'll have to compile those ones too.
1. download libevent. notice that it seems you need 1.4.14-stable. tmux seems to require that
one specifically
2. Untar the tarball and configure (specify a prefix so you can later do make install).
3. Compile and do make install.
4. Download tmux
5. untar the tarball and change the configure (go to the part of your OS, in my
case it was linux--- Use uname to find out):
CFLAGS+= -std=c99 -D_GNU_SOURCE -D_POSIX_SOURCE -I/stornext/snfs1/next-gen/drio-scratch/tmux/libevent-1.4.14b-stable
Notice the -I. We are telling the compiler where to look to find the headers
Also, change the config.mk to have:
LIBS+= -L/stornext/snfs1/next-gen/drio-scratch/tmux/local/lib -lncurses -lcrypt -lutil -levent -lrt
Notice the -L. We are telling the linker where to find the libraries.
6. do a make. You should have now the tmux binary.
7. Make sure you set your LD_LIBRARY_PATH to have the path to your libevent lib:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/hgsc/boost_libs/lib:/stornext/snfs1/next-gen/drio-scratch/tmux/local/lib
8. Enjoy tmux.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment