-
Notifications
You must be signed in to change notification settings - Fork 19
Installation
First, install the dependencies (see below), then proceed.
treePL uses the standard GNU installion system. You can get the source if you have git installed on your system (an easy install for all platforms) by typing git clone git://github.com/blackrim/treePL.git
. If you don't have git and don't want it you can go [here] (https://github.com/blackrim/treePL/downloads) and click on Download as tar or Download as tar.gz. Then unarchive and you should be off.
So you can grab the code either in the archive or with git clone and cd into the src directory and run
./configure
then make
then sudo make install
These should be relatively easy to install, but difficulty depends on the system. It has been successfully installed on a number of linux distributions and MacOSX 10.6 and 10.7.
treePL uses [NLopt] (http://ab-initio.mit.edu/wiki/index.php/NLopt) in addition to some simulated annealing code. The code for this is included in the deps directory. To install this you can run ./configure
and then make
and sudo make install
.
In order to work around some of the issues around gradients and barriers, in addition to analytic gradient calculations, treePL uses rad auto diff sources and adolc. Both are used because rad cannot be used with openmp (yet). If you don't have adolc, treePL will still install but it maybe be less efficient in cross validation.
To install adolc you can use the directory provided with the distribution in the deps
directory. After unpacking, if using gcc you can run autoreconf -fi
. Then for Linux, ./configure --with-openmp-flag=-fopenmp --prefix=/usr
and then make
and sudo make install
. It is very important that adolc is compiled with the openmp flag because that is the reason for using it with treePL. It may be important to expand your LD_LIBRARY_PATH environmental variable if you get a shared library error after compilation. For my computer, I add export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64
to the bottom of my ~/.bashrc file.
If you are on a Mac, the instructions use to be simpler but something has gone horribly askew. Jonathan Eastman has generously worked through the solution and it involves using [homebrew] (http://mxcl.github.com/homebrew/). This is edited from his post in the [issues] (https://github.com/blackrim/treePL/issues/2). This was successful with OS 10.8.1. Install command_line_tools from Xcode (https://developer.apple.com/xcode/)
Install HomeBrew using Terminal:
ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go)
Set up env variable to force 'brew' to build from source. Could be useful to add the line below to ~/.bashrc or ~/.bash_profile
export HOMEBREW_BUILD_FROM_SOURCE=TRUE
Install some dependencies:
brew install --use-gcc automake
brew install --use-gcc autoconf
brew install --use-gcc libtool
brew install --use-gcc nlopt
'brew' works by defined 'formulas' for each package. In order to get adol-c working with OPENMP, we'll need to modify the formula file:
open -t $(brew --prefix)/Library/Formula/adol-c.rb
Copy the lines below (between ######s) and save the adol-c.rb file in the same location
require 'formula'
class AdolC < Formula
homepage 'https://projects.coin-or.org/ADOL-C'
url 'http://www.coin-or.org/download/source/ADOL-C/ADOL-C-2.3.0.tgz'
sha1 'd9124ce0b199cb8b841a9a9ec10d1fb31ed11b49'
head 'https://projects.coin-or.org/svn/ADOL-C/trunk/', :using => :svn
# HEAD contains bugfix for NaNs appearing in 2.2.1
# http://answerpot.com/showthread.php?2997935-sparse_jac+return+unreasonable+NaN's
# realpath is used in configure to find colpack
depends_on 'aardvark_shell_utils' => :build
depends_on 'colpack'
def install
# Configure may get automatically regenerated. So patch configure.ac also.
inreplace %w(configure configure.ac) do |s|
s.gsub! "readlink -f", "realpath"
s.gsub! "lib64", "lib"
end
system "autoreconf -fi"
system "./configure", "--prefix=#{prefix}",
"--with-openmp-flag=-fopenmp"
system "make clean"
system "make install"
system "make test"
end
end
Lastly, install adol-c using the modified formula:
brew install --use-gcc adol-c
Now follow the guidelines to install treePL from the src directory shipped from gitHUB
cd /path/to/treePL
cd src
./configure
make
sudo make install
#Updates
If you have cloned treePL, you can update the code with git pull. It should pull the most recent version and then you would just ./configure
then make
then sudo make install
to install the updated treePL.