Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use local installations for benchmarking #53

Merged
merged 21 commits into from
May 12, 2017
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 22 additions & 49 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# These are the directories that contain everything we need after 'make setup'
# is completed. We assume that 'matlab' is available on the PATH.
export INCLUDEPATH := $(shell pwd)/libraries/include/
export LIBPATH := $(shell pwd)/libraries/lib/
export BINPATH := $(shell pwd)/libraries/bin/
export JAVAPATH := $(shell pwd)/libraries/share/
export DEBUGBINPATH := $(shell pwd)/libraries/debug/bin/
export DEBUGINCLUDEPATH := $(shell pwd)/libraries/debug/include/
export DEBUGLIBPATH := $(shell pwd)/libraries/debug/lib/

# Locate the python bin.
PYTHON_BIN := $(shell which python3.3)
ifndef PYTHON_BIN
Expand Down Expand Up @@ -38,52 +48,10 @@ COPY := False
USER := ""
PASSWORD := ""

################################################################################################
# How to use: #
# Specify the environment variables in this file or set these variables from the command line. #
# All environment path variables should end with a slash. #
# Note that four settings need to be changed for this to work. #
# 1) SHOGUN_PATH #
# 2) PYTHONPATH #
# 3) WEKA_CLASSPATH #
# 4) MATLAB_BIN #
################################################################################################

# Set the environment variable for the mlpack executables.

ifdef $(shell which mlpack_knn)
export MLPACK_BIN=$(shell dirname $(firstword $(shell which mlpack_knn)))/
else
export MLPACK_BIN=""
endif

# Set the environment variable for the mlpack executables.
export MLPACK_BIN_DEBUG=$(MLPACK_BIN)

# Export the MLPACK_PATH environment variable.
export MLPACK_PATH=$(shell dirname $(MLPACK_BIN))/
# Set the environment variable for the compiled mlpack executables.
export MLPACK_BIN_SRC=methods/mlpack/src/build/
export MLPACK_BIN_DEBUG_SRC=methods/mlpack/src/build/

# Set the environment variable for the matlab executable.
# You can use the following command to search the 'matlab' file everytime:
# export MATLAB_BIN=$(shell find / -name matlab -print 2>/dev/null -quit)
export MATLAB_BIN=""

# Export the MATLABPATH environment variable.
export MATLABPATH=$(shell pwd)/methods/matlab/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what your plans are, but I think we have to set the MATLABPATH environment variable to add the methods/matlab folder to the MATLAB search path.


# Export the WEKA_CLASSPATH environment variable.
# You can use the following command to search the 'weka.jar' file everytime:
# export WEKA_CLASSPATH=".:$(shell find / -name weka.jar -print 2>/dev/null -quit)"
export WEKA_CLASSPATH=".:/Users/marcus/Downloads/weka-3-6-11/weka.jar"

# Export the SHOGUN_PATH environment variable.
export SHOGUN_PATH=""

# Export the PYTHONPATH environment variable.
export PYTHONPATH=""

# Set the environment variable for the the ms_print executable.
export MS_PRINT_BIN=$(shell which ms_print)

Expand All @@ -92,12 +60,14 @@ export VALGRIND_BIN=$(shell which valgrind)

# Export the path to the FLANN library.
export FLANN_PATH=methods/flann/

# Export the path to the ANN library.
export ANN_PATH=methods/ann/

# Export the path to the HLearn library.
export HLEARN_PATH=""
# Set LD_LIBRARY_PATH correctly.
export LD_LIBRARY_PATH=$(shell echo $(LIBPATH))
# Set PYTHONPATH correctly.
PYVERSION=$(shell python3 -c 'import sys; print("python" + sys.version[0:3])')
export PYTHONPATH=$(shell printenv PYTHONPATH):$(shell pwd)/libraries/lib/$(shell echo $(PYVERSION))/dist-packages:$(shell pwd)/libraries/lib/$(shell echo $(PYVERSION))/site-packages

# Color settings.
NO_COLOR=\033[0m
Expand Down Expand Up @@ -200,11 +170,14 @@ endif

.scripts:
# Compile the java files for the weka methods.
javac -cp $(shell echo $(WEKA_CLASSPATH)) -d methods/weka methods/weka/src/*.java
javac -cp $(shell echo $(JAVAPATH)/weka.jar) -d methods/weka methods/weka/src/*.java
# Compile the ann scripts.
g++ -O0 -std=c++11 methods/ann/src/allknn.cpp -o methods/ann/allknn -I$(MLPACK_PATH)/include -I$(ANN_PATH)/include -L$(MLPACK_PATH)/lib -L$(ANN_PATH)/lib -lANN -lmlpack -lboost_program_options
g++ -O0 -std=c++11 methods/ann/src/allknn.cpp -o methods/ann/allknn -I$(INCLUDEPATH) -L$(LIBPATH) -lANN -lmlpack -lboost_program_options
# Compile the FLANN scripts.
g++ -O0 -std=c++11 methods/flann/src/allknn.cpp -o methods/flann/allknn -I$(MLPACK_PATH)/include -I$(FLANN_PATH)/include -L$(MLPACK_PATH)/lib -L$(FLANN_PATH)/lib -lmlpack -lboost_program_options
g++ -O0 -std=c++11 methods/flann/src/allknn.cpp -o methods/flann/allknn -I$(INCLUDEPATH) -L$(LIBPATH) -lmlpack -lboost_program_options -llz4
# Compile the mlpack scripts. (Can't do this until ANN is released or a
# git version of mlpack is used.)
#cd methods/mlpack/src/ && ./build_scripts.sh

.setup:
cd libraries/ && ./download_packages.sh && ./install_all.sh
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Benchmarks are run with the `make` command.
* `make run` -- Perform the benchmark.
* `make memory` -- Get memory profiling information.
* `make test` -- Test the configuration file. Check for correct syntax and then try to open files referred in the configuration file.
* `make setup` -- Download and set up all of the libraries to compare against.
* `make scripts` -- Make additional scripts.


Expand Down
16 changes: 5 additions & 11 deletions libraries/ann_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,22 @@
# Include files will be installed to ../include/.
# Library files will be installed to ../lib/.
#
# One ann*.tar.gz file should be located in this directory containing the
# One ann.tar.gz file should be located in this directory containing the
# source code of the desired mlpack version.
tars=`ls ann*.tar.gz | wc -l`;
tars=`ls ann.tar.gz | wc -l`;
if [ "$tars" -eq "0" ];
then
echo "No ann source .tar.gz found in libraries/!"
exit 1
fi
if [ "$tars" -ne "1" ];
then
echo "More than one ann source .tar.gz found."
echo "Ensure only one is present in libraries/!"
echo "No source ann.tar.gz found in libraries/!"
exit 1
fi

# Remove any old directory.
rm -rf ann/
mkdir ann/
tar -xzpf ann*.tar.gz --strip-components=1 -C ann/
tar -xzpf ann.tar.gz --strip-components=1 -C ann/

cd ann/
make linux-g++
CXXFLAGS=-fPIC make linux-g++
cp -r include/* ../include/
cp -r bin/* ../bin/
cp -r lib/* ../lib/
17 changes: 6 additions & 11 deletions libraries/annoy_install.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,20 @@
# Include files will be installed to ../include/.
# Library files will be installed to ../lib/.
#
# One annoy*.tar.gz file should be located in this directory.
tars=`ls annoy*.tar.gz | wc -l`;
# One annoy.tar.gz file should be located in this directory.
tars=`ls annoy.tar.gz | wc -l`;
if [ "$tars" -eq "0" ];
then
echo "No annoy source .tar.gz found in libraries/!"
exit 1
fi
if [ "$tars" -ne "1" ];
then
echo "More than one annoy source .tar.gz found."
echo "Ensure only one is present in libraries/!"
echo "No source annoy.tar.gz found in libraries/!"
exit 1
fi

# Remove any old directory.
rm -rf annoy/
mkdir annoy/
tar -xzpf annoy*.tar.gz --strip-components=1 -C annoy/
tar -xzpf annoy.tar.gz --strip-components=1 -C annoy/

cd annoy/
python3 setup.py build
python3 setup.py install --prefix=../../ -O2
PYVER=`python3 -c 'import sys; print("python" + sys.version[0:3])'`;
PYTHONPATH=../lib/$PYVER/site-packages/ python3 setup.py install --prefix=../ -O2
14 changes: 4 additions & 10 deletions libraries/flann_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,19 @@
# Include files will be installed to ../include/.
# Library files will be installed to ../lib/.
#
# One flann*.tar.gz file should be located in this directory containing the
# One flann.tar.gz file should be located in this directory containing the
# source code of the desired mlpack version.
tars=`ls flann*.tar.gz | wc -l`;
tars=`ls flann.tar.gz | wc -l`;
if [ "$tars" -eq "0" ];
then
echo "No flann source .tar.gz found in libraries/!"
exit 1
fi
if [ "$tars" -ne "1" ];
then
echo "More than one flann source .tar.gz found."
echo "Ensure only one is present in libraries/!"
echo "No source flann.tar.gz found in libraries/!"
exit 1
fi

# Remove any old directory.
rm -rf flann/
mkdir flann/
tar -xzpf flann*.tar.gz --strip-components=1 -C flann/
tar -xzpf flann.tar.gz --strip-components=1 -C flann/

cd flann/
mkdir build/
Expand Down
26 changes: 7 additions & 19 deletions libraries/hlearn_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,31 @@
# Include files will be installed to ../include/.
# Library files will be installed to ../lib/.
#
# One HLearn*.tar.gz file should be located in this directory. Also since
# One HLearn.tar.gz file should be located in this directory. Also since
# HLearn depends on subhask, a subhask*.tar.gz file should also be located in
# this directory.
tars=`ls HLearn*.tar.gz | wc -l`;
tars=`ls HLearn.tar.gz | wc -l`;
if [ "$tars" -eq "0" ];
then
echo "No HLearn source .tar.gz found in libraries/!"
exit 1
fi
if [ "$tars" -ne "1" ];
then
echo "More than one HLearn source .tar.gz found."
echo "Ensure only one is present in libraries/!"
echo "No source HLearn.tar.gz found in libraries/!"
exit 1
fi

subhasktars=`ls subhask*.tar.gz | wc -l`;
subhasktars=`ls subhask.tar.gz | wc -l`;
if [ "$tars" -eq "0" ];
then
echo "No subhask source .tar.gz found in libraries/!"
exit 1
fi
if [ "$tars" -ne "1" ];
then
echo "More than one subhask source .tar.gz found."
echo "Ensure only one is present in libraries/!"
echo "No source subhask.tar.gz found in libraries/!"
exit 1
fi

# Remove any old directory.
rm -rf hlearn/
mkdir hlearn/
tar -xzpf HLearn*.tar.gz --strip-components=1 -C hlearn/
tar -xzpf HLearn.tar.gz --strip-components=1 -C hlearn/

rm -rf subhask/
mkdir subhask/
tar -xvzpf subhask*.tar.gz --strip-components=1 -C subhask/
tar -xvzpf subhask.tar.gz --strip-components=1 -C subhask/

cd hlearn/
cabal sandbox init
Expand Down
2 changes: 1 addition & 1 deletion libraries/matlab_install.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
#
# This does not install MATLAB but instead simply checks for its presence.
if [ ! -f /opt/matlab/bin/matlab ];
if [ ! -f `which matlab` ];
then
echo "MATLAB not found!"
exit 1
Expand Down
21 changes: 11 additions & 10 deletions libraries/mlpack_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,29 @@
# Include files will be installed to ../include/.
# Library files will be installed to ../lib/.
#
# One mlpack*.tar.gz file should be located in this directory containing the
# One mlpack.tar.gz file should be located in this directory containing the
# source code of the desired mlpack version.
tars=`ls mlpack*.tar.gz | wc -l`;
tars=`ls mlpack.tar.gz | wc -l`;
if [ "$tars" -eq "0" ];
then
echo "No mlpack source .tar.gz found in libraries/!"
exit 1
fi
if [ "$tars" -ne "1" ];
then
echo "More than one mlpack source .tar.gz found."
echo "Ensure only one is present in libraries/!"
echo "No source mlpack.tar.gz found in libraries/!"
exit 1
fi

# Remove any old directory.
rm -rf mlpack/
mkdir mlpack/
tar -xzpf mlpack*.tar.gz --strip-components=1 -C mlpack/
tar -xzpf mlpack.tar.gz --strip-components=1 -C mlpack/

cd mlpack/
mkdir build/
cd build/
cmake -DCMAKE_INSTALL_PREFIX=../../ -DBUILD_TESTS=OFF ../
make install

# Also install debug version.
cd ..
mkdir build-debug/
cd build-debug/
cmake -DDEBUG=ON -DCMAKE_INSTALL_PREFIX=../../debug/ -DBUILD_TEST=OFF ../
make install
16 changes: 5 additions & 11 deletions libraries/mlpy_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,19 @@
# Include files will be installed to ../include/.
# Library files will be installed to ../lib/.
#
# One mlpy*.tar.gz file should be located in this directory.
tars=`ls mlpy*.tar.gz | wc -l`;
# One mlpy.tar.gz file should be located in this directory.
tars=`ls mlpy.tar.gz | wc -l`;
if [ "$tars" -eq "0" ];
then
echo "No mlpy source .tar.gz found in libraries/!"
exit 1
fi
if [ "$tars" -ne "1" ];
then
echo "More than one mlpy source .tar.gz found."
echo "Ensure only one is present in libraries/!"
echo "No source mlpy.tar.gz found in libraries/!"
exit 1
fi

# Remove any old directory.
rm -rf mlpy/
mkdir mlpy/
tar -xzpf mlpy*.tar.gz --strip-components=1 -C mlpy/
tar -xzpf mlpy.tar.gz --strip-components=1 -C mlpy/

cd mlpy/
python3 setup.py build
python3 setup.py install --prefix=../../ -O2
python3 setup.py install --prefix=../ -O2
16 changes: 5 additions & 11 deletions libraries/scikit_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,19 @@
# Include files will be installed to ../include/.
# Library files will be installed to ../lib/.
#
# One scikit*.tar.gz file should be located in this directory.
tars=`ls scikit*.tar.gz | wc -l`;
# One scikit.tar.gz file should be located in this directory.
tars=`ls scikit.tar.gz | wc -l`;
if [ "$tars" -eq "0" ];
then
echo "No scikit source .tar.gz found in libraries/!"
exit 1
fi
if [ "$tars" -ne "1" ];
then
echo "More than one scikit source .tar.gz found."
echo "Ensure only one is present in libraries/!"
echo "No source scikit.tar.gz found in libraries/!"
exit 1
fi

# Remove any old directory.
rm -rf scikit/
mkdir scikit/
tar -xzpf scikit*.tar.gz --strip-components=1 -C scikit/
tar -xzpf scikit.tar.gz --strip-components=1 -C scikit/

cd scikit/
python3 setup.py build
python3 setup.py install --prefix=../../ -O2
python3 setup.py install --prefix=../ -O2
14 changes: 4 additions & 10 deletions libraries/shogun_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,18 @@
# Include files will be installed to ../include/.
# Library files will be installed to ../lib/.
#
# One shogun*.tar.gz file should be located in this directory.
tars=`ls shogun*.tar.gz | wc -l`;
# One shogun.tar.gz file should be located in this directory.
tars=`ls shogun.tar.gz | wc -l`;
if [ "$tars" -eq "0" ];
then
echo "No shogun source .tar.gz found in libraries/!"
exit 1
fi
if [ "$tars" -ne "1" ];
then
echo "More than one shogun source .tar.gz found."
echo "Ensure only one is present in libraries/!"
echo "No source shogun.tar.gz found in libraries/!"
exit 1
fi

# Remove any old directory.
rm -rf shogun/
mkdir shogun/
tar -xzpf shogun*.tar.gz --strip-components=1 -C shogun/
tar -xzpf shogun.tar.gz --strip-components=1 -C shogun/

cd shogun/
mkdir build/
Expand Down
Loading