Install Torch7 in Ubuntu

I feel that the install steps listed at the official website of torch have a couple of issues:

  1. it assumes that some of the build system dependencies have been already installed, such as cmake, curl, etc.
  2. One of the cmake steps in install.sh file involves explicit use of luajit2.1, which supposedly is broken in Ubuntu, as listed in this issue.

The following step effectively solves the issue#1 listed above:

#install build related dependencies
sudo apt-get install curl cmake git build-essential \
python-dev libxml2-dev libxslt-dev libfftw3-dev \
libsox-dev libssl-dev

To solve the build error listed in issue#2, open the install.sh file in the torch source folder and edit the following line:

cmake .. -DCMAKE_INSTALL_PREFIX="${PREFIX}" \
-DCMAKE_BUILD_TYPE=Release -DWITH_LUAJIT21=ON

to

cmake .. -DCMAKE_INSTALL_PREFIX="${PREFIX}" \
-DCMAKE_BUILD_TYPE=Release

That’s it! Now delete the build/ folder in torch root directory and restart the build process..
Enjoy!!!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s