Monday, February 28, 2011

The GraphLab large scale machine learning framework - installation on MAC OSX 10.6

GraphLab is an open source large scale parallel machine learning framework.

I was asked by Dan, an avid reader of this blog, to supply installation instructions for MAC OSX Snow Leopard 10.6. Installation is quite simple.

1) Install cmake using the following link: cmake 2.8.4

2) Download graphlab code and install GraphLab where XXX is the latest version you can find in here
wget http://graphlab.org/release/graphlabapi_v1_XXXX.tar.gz
tar xvzf graphlabapi_v1_XXXX.tar.gz
cd graphlabapi
./configure --bootstrap 
cd debug #or equivalently cd release
make -j 4
cd tests
./runtests.sh

Anyone who tries it out - update me if it went smoothly!

NOTE: We now support Eigen linear algebra package. It can be installed using the command:
./configure --bootstrap --eigen
However, on MAC OS, gcc45 is required. See explanation here.

NOTE2: The current GraphLab MAC setup default to gcc-4.2. If you like to use your default compiler, you can comment the first few lines of the file CMakeLists.txt in the root graphlab folder, namely the lines:
if(APPLE)
  set(CMAKE_C_COMPILER "gcc-4.2")
  set(CMAKE_CXX_COMPILER "c++-4.2")
endif(APPLE)

Friday, February 25, 2011

Mahout on Amazon EC2 - part 5 - installing Hadoop/Mahout on high performance instance (CentOS/RedHat)

This post explains how to install Mahout ML framework on top of Amazon EC2 (CentOS/RedHat based machine).
The notes are based on older Mahout notes: https://cwiki.apache.org/MAHOUT/mahout-on-amazon-ec2.html which are unfortunately outdated.

Note: part 1 of this post, explains how to install the same installation on top of Ubuntu based machine.

Full procedure should take around 2-3  hours.. :-(

1) Start high performance instance from amazon aws console
Cent OS AMI ID ami-7ea24a17 (x86_64)  Edit AMI
Name:  Basic Cluster Instances HVM CentOS 5.4   
Description:  Minimal CentOS 5.4, 64-bit architecture, and HVM-based virtualization for use with Amazon EC2 Cluster Instances.

2) Login into the instance (right mouse click on running instance from AWS console)

3) Install some required stuff
sudo yum update
sudo yum upgrade
sudo apt-get install python-setuptools  
sudo easy_install "simplejson"

4) Install boto (unfortunately I was not able to install it using easy_install directly)
wget http://boto.googlecode.com/files/boto-1.8d.tar.gz
tar xvzf boto-1.8d.tar.gz
cd boto=1.8d
sudo easy_install .

5) Install maven2 (unfortunately I was not able to install it using yum)
wget http://www.trieuvan.com/apache/maven/binaries/apache-maven-2.2.1-bin.tar.gz
tar xvzf apache-maven-2.2.1-bin.tar.gz
cp -R apache-maven-2.2.1 /usr/local/
ln -s /usr/local/apache-maven-2.2.1/bin/mvn /usr/local/bin/

6) Download and install Hadoop
wget http://apache.cyberuse.com//hadoop/core/hadoop-0.20.2/hadoop-0.20.2.tar.gz   
tar vxzf hadoop-0.20.2.tar.gz  
sudo  mv hadoop-0.20.2 /usr/local/

add the following to $HADOOP_HOME/conf/hadoop-env.sh
export JAVA_HOME=/usr/lib/jvm/jre-openjdk/  
# The maximum amount of heap to use, in MB. Default is 1000  
export HADOOP_HEAPSIZE=2000  

add the following to $HADOOP_HOME/conf/core-site.xml and also $HADOOP_HOME/conf/mapred-site.xml

<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:9000</value>
</property>   <property>
<name>mapred.job.tracker</name>  
<value>localhost:9001</value>
</property>
 <property>  
<name>dfs.replication</name>  
 <value>1</value>      
  </property>
</configuration>


Edit the file hdfs-site.xml

<configuration>
 <property>
  <name>hadoop.tmp.dir</name>
  <value>/home/data/tmp/</value>
 </property>
<property>
 <name>dfs.data.dir</name>
 <value>/home/data/tmp2/</value>
</property>
<property>
 <name>dfs.name.dir</name>
 <value>/home/data/tmp3/</value>
</property>
</configuration>

Note: directory /home/data does not exist, and you will have to create it
when starting the instance using the commands:
# mkdir -p /home/data  
# mount -t ext3 /dev/sdb/ /home/data/ 
The reason for this setup is that the root dir has only 10GB, while /dev/sdb/
has 800GB.

set up authorized keys for localhost login w/o passwords and format your name node
# ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa
# cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys

  • Checkout and build Mahout from trunk. Alternatively, you can upload a Mahout release tarball and install it as we did with the Hadoop tarball (Don't forget to update your .profile accordingly).

    # svn co http://svn.apache.org/repos/asf/mahout/trunk mahout
    # cd mahout
    # mvn clean install
    # cd ..
    # sudo mv mahout /usr/local/mahout-0.4
    


    4)Add the following to your .profile
    export JAVA_HOME=/usr/lib/jvm/java-6-openjdk
    export HADOOP_HOME=/usr/local/hadoop-0.20.2
    export HADOOP_CONF_DIR=/usr/local/hadoop-0.20.2/conf
    export MAHOUT_HOME=/usr/local/mahout-0.4/
    export MAHOUT_VERSION=0.4-SNAPSHOT
    export MAVEN_OPTS=-Xmx1024m
    

    Verify that the paths on .profile point to the exact version you downloaded

    6) Run Hadoop, just to prove you can, and test Mahout by building the Reuters dataset on it. Finally, delete the files and shut it down.

    # $HADOOP_HOME/bin/hadoop namenode -format
    $HADOOP_HOME/bin/start-all.sh
    jps     // you should see all 5 Hadoop processes (NameNode, SecondaryNameNode, DataNode, JobTracker, TaskTracker)
    cd $MAHOUT_HOME
    ./examples/bin/build-reuters.sh
    $HADOOP_HOME/bin/stop-all.sh
    rm -rf /tmp/*   // delete the Hadoop files


  • Remove the single-host stuff you added to $HADOOP_HOME/conf/core-site.xml and $HADOOP_HOME/conf/mapred-site.xml in step #6b and verify you are happy with the other conf file settings. The Hadoop startup scripts will not make any changes to them. In particular, upping the Java heap size is required for many of the Mahout jobs.
    // edit $HADOOP_HOME/conf/mapred-site.xml to include the following:
    <property>
       <name>mapred.child.java.opts</name>
       <value>-Xmx2000m</value>
    </property>

    7) Allow for Hadoop to run even if you will work on a different EC2 machine:
    echo "NoHostAuthenticationForLocalhost yes" >>~/.ssh/config
    

    8) Now bundle the image.
    Using Amazon AWS console - select running instance, right mouse click and then bundle EBS image. Enter image name and description. Now the machine will reboot and the image will be created.
  • Thursday, February 24, 2011

    Some thoughts about accuracy of Mahout's SVD

    I was testing Mahout's SVD code and I encountered some subtleties.
    I wonder if I am missing anything or is there a bug in the code?

    1) The ordering of eigenvalues was the opposite than eigenvectors. But this was hopefully fixed by now in patch-369.
    2) When requesting a rank of 4, we get 3 eigenvalues... So it seems that the rank is always lower by one.
    3) There are two transformations which makes comparison of results with matlab (or pen & paper) harder:

    a) The scaleFactor. Defined in: ./math/src/main/java/org/apache/mahout/math/decomposer/lanczos/LanczosState.java
    I quote a documentation remark in: ./math/src/main/java/org/apache/mahout/math/decomposer/lanczos/LanczosSolver.java:48
    " /** To avoid floating point overflow problems which arise in power-methods like Lanczos, an initial pass is made
     * through the input matrix to
    generate a good starting seed vector by summing all the rows of the input matrix, and
    compute the trace(inputMatrixt*matrix)
    This latter value, being the sum of all of the singular values, is used to rescale the entire matrix, effectively forcing the largest singular value to be strictly less than one, and transforming floating point overflow
    problems into floating point underflow (ie, very small singular values will become invisible, as they  will appear to be zero and the algorithm will terminate).*/
    

    b) The second transformation is orthonogolization of the resulting vector. This step is optional (IMHO).
    see: ./math/src/main/java/org/apache/mahout/math/decomposer/lanczos/LanczosSolver.java:118
    The function call is: orthoganalizeAgainstAllButLast(nextVector, state);
    Again I quote from documentation:
    /** 

    This implementation uses {@link org.apache.mahout.math.matrix.linalg.EigenvalueDecomposition} to do the * eigenvalue extraction from the small (desiredRank x desiredRank) tridiagonal matrix. Numerical stability is * achieved via brute-force: re-orthogonalization against all previous eigenvectors is computed after every pass. * This can be made smarter if (when!) this proves to be a major bottleneck. Of course, this step can be parallelized * as well. *


    If anyone wants to reproduce my test, Can can add the function testLanczosSolver2() to TestLanczosSolver.java (code below).
    1) To run it, you need first to comment the line:
    //nextVector.assign(new Scale(1 / scaleFactor));
    in LanczosSolver.java, so it is easier to compare the results to Matlab, without the scaling.
    2) You need to also comment the line:
    //orthoganalizeAgainstAllButLast(nextVector, basis);
    in LanczosSolver.java

    The factorized matrix is:
    >> A
    
    3.1200 -3.1212 -3.0000
    -3.1110 1.5000 2.1212
    -7.0000 -8.0000 -4.0000
    
    The eigenvalues are;
    >> [a,b]=eig(A'*A)
    
    a =
    
    0.2132 -0.8010 -0.5593
    -0.5785 0.3578 -0.7330
    0.7873 0.4799 -0.3871
    
    b =
    
    0.0314 0 0
    0 42.6176 0
    0 0 131.2553
    

    Now I run the unit test testLanczosSolver2 and I get:
    INFO: Lanczos iteration complete - now to diagonalize the tri-diagonal auxiliary matrix.
    Feb 9, 2011 1:25:36 PM org.slf4j.impl.JCLLoggerAdapter info
    INFO: Eigenvector 0 found with eigenvalue 131.25526355941963
    Feb 9, 2011 1:25:36 PM org.slf4j.impl.JCLLoggerAdapter info
    INFO: Eigenvector 1 found with eigenvalue 42.61761063477249
    Feb 9, 2011 1:25:36 PM org.slf4j.impl.JCLLoggerAdapter info
    INFO: Eigenvector 2 found with eigenvalue 0.03137295830779152
    Feb 9, 2011 1:25:36 PM org.slf4j.impl.JCLLoggerAdapter info
    INFO: LanczosSolver finished.
    

    As you can see the eigenvalues are correct.

    @Test
    public void testLanczosSolver2() throws Exception {
    int numRows = 3; int numCols = 3;
    int numColumns = 3;
    SparseRowMatrix m = new SparseRowMatrix(new int[]{numRows, numCols});
    /**
    
        * 3.1200 -3.1212 -3.0000
          -3.1110 1.5000 2.1212
          -7.0000 -8.0000 -4.0000
    
    */
    m.set(0,0,3.12);
    m.set(0,1,-3.12121);
    m.set(0,2,-3);
    m.set(1,0,-3.111);
    m.set(1,1,1.5);
    m.set(1,2,2.12122);
    m.set(2,0,-7);
    m.set(2,1,-8);
    m.set(2,2,-4);
    
    int rank = 4;
    Matrix eigens = new DenseMatrix(rank, numColumns);
    long time = timeLanczos(m, eigens, rank, false);
    assertTrue("Lanczos taking too long! Are you in the debugger? ", time < 10000);
    }
    
    Update: June 1st, 2011: Now GraphLab has also an efficient SVD Lanczos solver. Some performance benchmarks are found here:

    The GraphLab machine learning framework on Amazon EC2 - part 2 - testing

    This page has moved.

    For linear solver example applications see: http://graphlab.org/gabp.html

    For matrix factorization example applications see http://graphlab.org/pmf.html

    For clustering example applications see http://graphlab.org/clustering.html

    The GraphLab large scale machine learning framework - part 1 - installation on Amazon EC2

    GraphLab is an open source large scale parallel machine learning framework.

    This post explains how to install GraphLab on Amazon EC2 and how to load GraphLab from a preinstalled EC2 image.

    Loading Graphlab from one of our publicly available images:
    1) Follow the directions on http://graphlab.org/download.html to check out the latest available AMI. Launch the selected image using Amazon AWS Console.

    NOTE: Images are available in US-EAST region.
    TIP: Don't forget to allow SSH (Tcp port 22) in the default security group,
    ( In the AWS console go to EC2 -> Network Security -> Security Groups and verify that in the default security group (or the security group you where using)).

    2) After launching the AMI instance, it is always desirable to get the latest
    GraphLab using the commands:
    cd graphlabapi
    hg pull
    hg update
    ./configure
    cd release
    make -j4
    

    3) It is also useful to run unit testing to verify the update went fine:
    cd tests/
    ./runtests.sh
    

    GraphLab installation instructions

    NOTE: The below instruction should be used by advanced users, in case you did not find the required AMI in our public AMI images.

    Installations instructions where moved to the download page.
    Select the matching icon for your operating systems for detailed instructions.

    Monday, February 21, 2011

    Large scale matrix factorization using alternating least suqares: which is better - GraphLab or Mahout?

    I am working in the last couple of weeks on comparing the performance of GraphLab vs. Mahout on Alternaring least squares using Netflix data. To remind, GraphLab is the parallel machine learning system we are building in CMU.

    Initial results are encouraging. Mahout Alternating least squares implementation by Sebastian Schelter was tested on Amazon EC2, using two m2.2xlarge nodes (13x2 virtual cores).

    For running 10 iterations, number of features=20, lambda=0.065, it takes 39272 seconds, while GraphLab implementation in C++ takes only 714 seconds (on a machine with 8 cores).

    Running time may be taken with a grain of salt, since I was not using the exact same machine, but the magnitude of difference will certainly hold even if I would run GraphLab on EC2 (which I plan to do soon).

    Regarding accuracy, Mahout ALS has a test RMSE accuracy of
    0.9310 while GraphLab obtained slightly better accuracy of 0.9279.

    Here is Mahout ALS final output: (of the RMSE computation)
    ubuntu@ip-10-115-27-222:/mnt$ /usr/local/mahout-0.4/bin/
    mahout evaluateALS --probes /user/ubuntu/myout/probeSet/ --userFeatures /tmp/als/out/U/ --itemFeatures /tmp/als/out/M/ | grep RMSE
    11/02/17 12:31:42 WARN driver.MahoutDriver: No evaluateALS.props found on classpath, will use command-line arguments only
    11/02/17 12:31:42 INFO common.AbstractJob: Command line arguments: {--endPhase=2147483647, --itemFeatures=/tmp/als/out/M/, --probes=/user/ubuntu/myout/probeSet/, --startPhase=0, --tempDir=temp, --userFeatures=/tmp/als/out/U/}
    RMSE: 0.9310729597725026, MAE: 0.7298745910296568
    11/02/17 12:31:55 INFO driver.MahoutDriver: Program took 12437 ms
    

    Here is the GraphLab output:
    bickson@biggerbro:~/newgraphlab/graphlabapi/debug/apps/pmf$ ./PMF netflix-r 10 0 --D=20 --max_iter=10 --lambda=0.065 --ncpus=8
    setting run mode 0
    INFO   :pmf.cpp(main:1121): PMF starting
    
    loading data file netflix-r
    Loading netflix-r train
    Creating 99072112 edges...
    ................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................loading data file netflix-re
    Loading netflix-re test
    Creating 1408395 edges...
    ........setting regularization weight to 0.065
    PTF_ALS for matrix (480189, 17770, 27):99072112.  D=20
    pU=0.065, pV=0.065, pT=1, muT=1, D=20
    nuAlpha=1, Walpha=1, mu=0, muT=1, nu=20, beta=1, W=1, WT=1 BURN_IN=10
    complete. Obj=6.83664e+08, TEST RMSE=3.7946.
    INFO   :asynchronous_engine.hpp(run:56): Worker 0 started.
    
    ...
    
    INFO   :asynchronous_engine.hpp(run:56): Worker 7 started.
    
    Entering last iter with 1
    228.524) Iter ALS 1  Obj=2.60675e+08, TRAIN RMSE=2.2904 TEST RMSE=0.9948.
    Entering last iter with 2
    289.594) Iter ALS 2  Obj=6.48921e+07, TRAIN RMSE=1.1400 TEST RMSE=0.9573.
    Entering last iter with 3
    350.487) Iter ALS 3  Obj=4.75073e+07, TRAIN RMSE=0.9754 TEST RMSE=0.9444.
    Entering last iter with 4
    411.551) Iter ALS 4  Obj=4.09914e+07, TRAIN RMSE=0.9063 TEST RMSE=0.9381.
    Entering last iter with 5
    472.615) Iter ALS 5  Obj=3.79096e+07, TRAIN RMSE=0.8718 TEST RMSE=0.9348.
    Entering last iter with 6
    533.039) Iter ALS 6  Obj=3.61298e+07, TRAIN RMSE=0.8513 TEST RMSE=0.9324.
    Entering last iter with 7
    594.177) Iter ALS 7  Obj=3.50076e+07, TRAIN RMSE=0.8382 TEST RMSE=0.9305.
    Entering last iter with 8
    654.41) Iter ALS 8  Obj=3.42655e+07, TRAIN RMSE=0.8294 TEST RMSE=0.9290.
    Entering last iter with 9
    714.095) Iter ALS 9  Obj=3.37535e+07, TRAIN RMSE=0.8234 TEST RMSE=0.9279.
    INFO   :asynchronous_engine.hpp(run:66): Worker 6 finished.
    
    ...
    
    INFO   :asynchronous_engine.hpp(run:66): Worker 2 finished.
    

    Sunday, February 20, 2011

    Installing BLAS/Lapack/ITPP on Amazon EC2/Ubuntu Linux

    BLAS/Lapack are efficient matrix math libraries. The following instructions explains how to install them for Amazon EC2 (Ubuntu maverick version, and Amazon Linux). It++ (itpp) is a popular c++ wrapper for blas/lapack.

    DISLAIMER: The below instructions are for 64 bit machines. For 32 bit machines follow other instructions: http://bickson.blogspot.com/2011/06/graphlab-pmf-on-32-bit-linux.html

    FOR LAZY READERS:
    Just use Amazon EC2 public image ami-c21eedab (Ubuntu)

    INSTALLATION VIA YUM/APT-GET
    Try to install itpp using the following command:
    sudo yum install libitpp-dev
    
    Or
    sudo apt-get install libitpp-dev
    
    TIP: You may also want to install libitpp7-dbg using the yum/apt-get command.
    It is not mandatory, but it helps debugging when you link against libitpp_debug.so
    (instead of libitpp.so).

    If the above worked then we are done. If not, you will need to follow
    instructions below. Thanks to Udi Weinsberg for this tip.

    FOR ADVANCED USERS:


    0) Start with an Ubuntu image like ami-641eed0d, or an Amazon AMI image like:

    1) Install required packages. For Ubuntu:
    sudo apt-get install --yes --force-yes automake autoconf libtool* gfortran
    For Amazon Linux:
    sudo yum install -y automake autoconf libtool* gcc-gfortran

    2) Install lapack.
    Here again their are two options:

    The easy way is to simply (On Ububtu)
    sudo apt-get install --yes --force-yes liblapack-dev
    On Amazon Linux:
    sudo yum install -y lapack-devel blas-devel

    Thanks Akshay Bhat from Cornell for this tip!
    If the liblapack setup was successful, go to step 3.

    If the above command DOES NOT work for you (depends on your OS and setup) you will need to install lapack manually. The procedure is explained in steps a-c below.

    a) Download and prepare the code
    wget http://www.netlib.org/lapack/lapack.tgz
    tar xvzf lapack.tgz
    cd lapack-3.3.0  //if version number changes, change here to the right directory
    mv make.inc.example make.inc
    

    b) edit make.inc and add -m64 -fPIC flag to fortran compiler options:
    # FORTRAN, OPTS, NOOPT, LOADER

    c) compile
    make blaslib
    make
    
    If everthing went OK, test will be run for a couple of minutes
    and the files blas_LINUX.a and lapack_LINUX.a will be created at the main directory

    3) setup LDFLAGS
    export LDFLAGS="-L/usr/lib -lgfortran"

    4) Download and install itpp from
    wget http://sourceforge.net/projects/itpp/files/itpp/4.2.0/itpp-4.2.tar.gz
    tar xvzf itpp-4.2.tar.gz
    cd itpp-4.2
    ./autogen.sh 
    If you installed Lapack from yum/apt-get, you should use the following command:
    ./configure --without-fft --with-blas=/usr/lib64/libblas.so --with-lapack=/usr/lib64/liblapack.so --enable-debug CFLAGS=-fPIC CXXFLAGS=-fPIC CPPFLAGS=-fPIC
    Where /usr/lib64/ is the place where lapack was installed.

    If you installed lapack from source, use the following command
    ./configure --without-fft --with-blas=/home/ubuntu/lapack-3.3.0/blas_LINUX.a --with-lapack=/home/ubuntu/lapack-3.3.0/lapack_LINUX.a CFLAGS=-fPIC CXXFLAGS=-fPIC CPPFLAGS=-fPIC

    make
    sudo make install
    
    Note: If you installed lapack from yum/apt-get, don't forget to add the -lblas -llapack linker flag when you compile against lapack/blas.

    Verifying installation
    To verify that installation went Ok, run the following commands:
    itpp-config --cflags
    itpp-config --libs
    
    1) The command itpp-config should be available from shell.
    2) The right installation path should appear as output.

    Known issues you may encounter:
    Problem:
    *** Warning: Linking the shared library libitpp.la against the^M
    *** static library /usr/lib64/libblas.a is not portable!^M
    libtool: link: g++ -shared -nostdlib /usr/lib/gcc/x86_64-amazon-linux/4.4.4/../../../../lib64/crti.o /usr/lib/gcc/x86_64-amazon-linux/4.4.4/crtbeginS.o  -Wl,--whole-archive ../itpp/base/.libs/libbase.a ../itpp/stat/.libs/libstat.a ../itpp/comm/.libs/libcomm.a ../itpp/fixed/.libs/libfixed.a ../itpp/optim/.libs/liboptim.a ../itpp/protocol/.libs/libprotocol.a ../itpp/signal/.libs/libsignal.a ../itpp/srccode/.libs/libsrccode.a -Wl,--no-whole-archive  -L/usr/lib64/ /usr/lib64/liblapack.a /usr/lib64/libblas.a -lgfortranbegin -lgfortran -L/usr/lib/gcc/x86_64-amazon-linux/4.4.4 -L/usr/lib/gcc/x86_64-amazon-linux/4.4.4/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-amazon-linux/4.4.4/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-amazon-linux/4.4.4/crtendS.o /usr/lib/gcc/x86_64-amazon-linux/4.4.4/../../../../lib64/crtn.o    -Wl,-soname -Wl,libitpp.so.7 -o .libs/libitpp.so.7.0.0^M
    /usr/bin/ld: /usr/lib64/liblapack.a(dgees.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC^M
    /usr/lib64/liblapack.a: could not read symbols: Bad value^M
    collect2: ld returned 1 exit status^M
    make[2]: *** [libitpp.la] Error 1^M
    
    Solution: it seems that lapack was statically compiled without the -fPIC option and thus itpp refuses to link against it. Follow step 2a to install lapack manaually with the -fPIC option.

    Problem:
    make[1]: *** Waiting for unfinished jobs....
    [ 83%] Building CXX object src/graphlab/CMakeFiles/
    
    graphlab_pic.dir/distributed2/distributed_scheduler_list.o /usr/local/lib/libitpp.so: undefined reference to `zgesv_' /usr/local/lib/libitpp.so: undefined reference to `dorgqr_' /usr/local/lib/libitpp.so: undefined reference to `dswap_' /usr/local/lib/libitpp.so: undefined reference to `dgeqp3_' /usr/local/lib/libitpp.so: undefined reference to `dpotrf_' /usr/local/lib/libitpp.so: undefined reference to `dgemm_' /usr/local/lib/libitpp.so: undefined reference to `zungqr_' /usr/local/lib/libitpp.so: undefined reference to `zscal_' /usr/local/lib/libitpp.so: undefined reference to `dscal_' /usr/local/lib/libitpp.so: undefined reference to `dgesv_' /usr/local/lib/libitpp.so: undefined reference to `dgetri_' /usr/local/lib/libitpp.so: undefined reference to `zgemm_' /usr/local/lib/libitpp.so: undefined reference to `zposv_' /usr/local/lib/libitpp.so: undefined reference to `zgetri_' /usr/local/lib/libitpp.so: undefined reference to `dgeev_' /usr/local/lib/libitpp.so: undefined reference to `zgemv_' /usr/local/lib/libitpp.so: undefined reference to `zgeqrf_' /usr/local/lib/libitpp.so: undefined reference to `zgerc_' /usr/local/lib/libitpp.so: undefined reference to `zswap_' /usr/local/lib/libitpp.so: undefined reference to `zgeev_' /usr/local/lib/libitpp.so: undefined reference to `daxpy_' /usr/local/lib/libitpp.so: undefined reference to `dgetrf_' /usr/local/lib/libitpp.so: undefined reference to `zgels_' /usr/local/lib/libitpp.so: undefined reference to `zgetrf_' /usr/local/lib/libitpp.so: undefined reference to `dgees_' /usr/local/lib/libitpp.so: undefined reference to `dcopy_' /usr/local/lib/libitpp.so: undefined reference to `dger_' /usr/local/lib/libitpp.so: undefined reference to `dgels_' /usr/local/lib/libitpp.so: undefined reference to `dgeqrf_' /usr/local/lib/libitpp.so: undefined reference to `zpotrf_' /usr/local/lib/libitpp.so: undefined reference to `zgees_' /usr/local/lib/libitpp.so: undefined reference to `dgesvd_' /usr/local/lib/libitpp.so: undefined reference to `zgeru_' /usr/local/lib/libitpp.so: undefined reference to `dsyev_' /usr/local/lib/libitpp.so: undefined reference to `zaxpy_' /usr/local/lib/libitpp.so: undefined reference to `ddot_' /usr/local/lib/libitpp.so: undefined reference to `zgesvd_' /usr/local/lib/libitpp.so: undefined reference to `zgeqp3_' /usr/local/lib/libitpp.so: undefined reference to `zcopy_' /usr/local/lib/libitpp.so: undefined reference to `dgemv_' /usr/local/lib/libitpp.so: undefined reference to `dposv_' /usr/local/lib/libitpp.so: undefined reference to `zheev_' collect2: ld returned 1 exit status make[2]: *** [tests/anytests] Error 1 make[1]: *** [tests/CMakeFiles/anytests.dir/all] Error 2
    Solution: itpp was compiled using dynamic libraries, but your application did not include the -lblas and -llapack link flags.

    Problem:
    *** Error: You must have "autoconf" installed to compile IT++ SVN sources
    *** Error: You must have "automake" installed to compile IT++ SVN sources
    *** Error: You must have "libtoolize" installed to compile IT++ SVN sources
    
    Solution:
    Need to install the packages autoconf, automake and libtoolize. See yum/apt-get documentation.

    Problem:
    /usr/bin/ld: /home/bickson/lapack-3.3.1/lapack_LINUX.a(dgees.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
    /home/bickson/lapack-3.3.1/lapack_LINUX.a: could not read symbols: Bad value
    collect2: ld returned 1 exit status
    
    Solution:
    It seem you forgot to follow section 2b.

    TIP: It is useful to enable also itpp_debug library which is very useful when debugging your code. This is done by adding the flag --enable-debug to the configure script.

    Problem:
    *** Error in ../../../itpp/base/algebra/ls_solve.cpp on line 271:
    LAPACK library is needed to use ls_solve() function
    
    Solution:
    It seems that itpp is not installed properly -it did not link to lapack.