Package installation
sudo port install python27 py27-scipy py27-numpy py27-networkx py27-h5py py27-matplotlib py27-nose nosetests_select
sudo port install boost +python27
sudo port install doxygen graphviz py27-pygraphviz
Clone with git
git clone https://github.com/opengm/opengm.git
cd opengm/
mkdir build
cd build
cmake ..
Add external library
make -k externalLibs
I don't cry even if I get an error and stop. .. .. Only the external library that can be compiled is added to ../CMakeFile.
--In the following, AD3, TRWS, MRF, QPBO, MAXFLOW, PLANARITY, BLOSSOM5 are added as external libraries. --In addition, boost and hdf5 are used. --Create a python binding (PLANARITY, BLOSSOM5 must be added (2015/11/27)).
diff:../Modification of CMakeFile (example). Addition of external library, Boost, etc.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d5fb1a9..d58c167 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -67,30 +67,30 @@ endif()
OPTION(BUILD_EXAMPLES "Build Examples" ON)
OPTION(BUILD_TUTORIALS "Build Tutorials" ON)
OPTION(BUILD_COMMANDLINE "Build Commandline" OFF)
-OPTION(WITH_AD3 "Include AD3" OFF)
+OPTION(WITH_AD3 "Include AD3" ON)
OPTION(WITH_CPLEX "Include CPLEX" OFF)
OPTION(WITH_GUROBI "Include GUROBI" OFF)
-OPTION(WITH_BOOST "Include BOOST" OFF)
-OPTION(WITH_HDF5 "Include HDF5" OFF)
-OPTION(WITH_TRWS "Include wrapper for TRWS code" OFF)
+OPTION(WITH_BOOST "Include BOOST" ON)
+OPTION(WITH_HDF5 "Include HDF5" ON)
+OPTION(WITH_TRWS "Include wrapper for TRWS code" ON)
OPTION(WITH_GCO "Include wrapper for GCO code" OFF)
-OPTION(WITH_MRF "Include wrapper for MRF code" OFF)
-OPTION(WITH_QPBO "Include wrapper for QPBO code" OFF)
+OPTION(WITH_MRF "Include wrapper for MRF code" ON)
+OPTION(WITH_QPBO "Include wrapper for QPBO code" ON)
OPTION(WITH_FASTPD "Include wrapper for FastPD code" OFF)
-OPTION(WITH_MAXFLOW "Include wrapper for MAXFLOW code" OFF)
+OPTION(WITH_MAXFLOW "Include wrapper for MAXFLOW code" ON)
OPTION(WITH_MAXFLOW_IBFS "Include wrapper for MAXFLOW-IBFScode" OFF)
OPTION(WITH_LIBDAI "Include wrapper for LIBDAI code" OFF)
OPTION(WITH_DAOOPT "Include wrapper for DAOOPT code" OFF)
OPTION(WITH_MPLP "Include wrapper for MPLP code" OFF)
OPTION(WITH_SRMP "Include wrapper for SRMP code" OFF)
-OPTION(WITH_PLANARITY "Include wrapper for PLANARITY code" OFF)
-OPTION(WITH_BLOSSOM5 "Include wrapper for BLOSSOM5 code" OFF)
+OPTION(WITH_PLANARITY "Include wrapper for PLANARITY code" ON)
+OPTION(WITH_BLOSSOM5 "Include wrapper for BLOSSOM5 code" ON)
OPTION(WITH_OPENMP "Include OpenMP" OFF)
OPTION(WITH_VIGRA "Include VIGRA" OFF)
OPTION(WITH_CONICBUNDLE "Include ConicBundleLibrary" OFF)
OPTION(WITH_MATLAB "Activate MatLab-Code" OFF)
OPTION(BUILD_CONVERTER "Build several converters" OFF)
-OPTION(BUILD_PYTHON_WRAPPER "Build python wrapper" OFF)
+OPTION(BUILD_PYTHON_WRAPPER "Build python wrapper" ON)
OPTION(BUILD_MATLAB_WRAPPER "Build matlab wrapper" OFF)
###Grante needs C++11. Since we have not tested OpenGM under this standard yet, using Grante is realy experimental!!!
###OPTION(WITH_GRANTE "Include wrapper for grante" OFF)
Below, set the cmake option so that you don't go to the system / usr / bin / python
(using macports python2.7).
CMake again
rm CMakeCache.txt
cmake .. \
-DPYTHON_EXECUTABLE:FILEPATH=/opt/local/bin/python2.7 \
-DPYTHON_INCLUDE_DIR:PATH=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Headers/ \
-DPYTHON_LIBRARY:FILEPATH=/opt/local/lib/libpython2.7.dylib
And build
make -j 4
Document creation
make doc
And test
make test
Running tests...
...
100% tests passed, 0 tests failed out of 60
Total Test time (real) = 45.89 sec
Test python binding
make test-python-wrapper
...
Ran 70 tests in 3.584s
OK
[100%] Built target test-python-wrapper
If make test-python-wrapper
says there is no nosetests
nosetests to nosetests-2.Link to 7
sudo port select --set nosetests nosetests27
If you install locally
make DESTDIR=$HOME/local install
mkdir $HOME/local/usr/local/lib
cp ../build/src/external/libexternal-library-* $HOME/local/usr/local/lib
with this
--Header files under $ HOME / local / usr / local / include / opengm /
--There is a library for external libraries under $ HOME / local / usr / local / lib /
--The library for python is under $ HOME / local / usr / local / lib / python2.7 / site-packages /
It will be installed.
By the way, if you don't use an external library or python, OpenGM is only a header file.
~/.bash_Add to profile
# opengm
export LD_LIBRARY_PATH=$HOME/local/usr/local/lib/:$LD_LIBRARY_PATH
export PYTHONPATH=$HOME/local/usr/local/lib/python2.7/site-packages/:$PYTHONPATH
After this
macports python2.Run 7
$ python2.7
Python 2.7.10 (default, Oct 18 2015, 09:28:19)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.72)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import opengm
>>>
Recommended Posts