It is sometimes desirable to compile Tor from source, and perhaps run an unreleased version (e.g., to test the latest changes, use new features unavailable in the latest release, etc.). What is the procedure for doing so?
To compile and install Tor from git follow these steps:
Step 0: Make sure you have
git, a working "C compiler" and "GNU make" installed on your linux box. You also need
libssl-dev libraries before you start.
If you're on debian/ubuntu type:
sudo apt-get install git build-essential automake libevent-dev libssl-dev zlib1g-dev
Step 1: Clone Tor from git.torproject.org
git clone https://git.torproject.org/tor.git
- Step 3: run
- Step 4: run
./configure --disable-asciidocif you don't want to build the manpages.
(See 'note' if you get error at this step)
- Step 5: run
- Step 6 (optional): run
Note: If you have problems finding libraries at step 4 try the following instead:
CPPFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib" \ ./configure
And if you have mysterious
autoconf failures while linking openssl,
consider setting your
LD_LIBRARY_PATH to the openssl lib directory.
setenv LD_LIBRARY_PATH /usr/your_username/lib.
see INSTALL for more details.
UPDATE (after Roger Dingledine's comment):
Please, do not use the "--enable-bufferevents" feature for stable installations. It's not mature yet.
The --enable-bufferevents option has not ever worked. It is a partial feature that needs somebody to finish it.
Tor can now optionally build with the "bufferevents" buffered IO backend provided by Libevent 2. To use this feature, make sure you have the latest possible version of Libevent, and pass the --enable-bufferevents flag to configure when building Tor from source. This feature will make our networking code more flexible, let us stack layers on each other, and let us use more efficient zero-copy transports where available.