Skip to content

Instantly share code, notes, and snippets.

@rpavlik
Last active November 21, 2016 12:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rpavlik/13867c53ca097a7b3ebe to your computer and use it in GitHub Desktop.
Save rpavlik/13867c53ca097a7b3ebe to your computer and use it in GitHub Desktop.
Building OSVR on debian jessie
# Git - for retrieving source
sudo apt-get install git gitk git-core
# CMake - for configuring the source, ccmake is a command-line "gui" provided by cmake-curses-gui, while cmake-gui is provided by cmake-qt-gui
# Pulls in a lot of basic build deps with it if you don't have them.
sudo apt-get install cmake cmake-curses-gui cmake-qt-gui
# Installs the standard compilers, etc.
sudo apt-get install build-essential
# Sets up a directory for check out source and make build directories in.
mkdir src
cd src
# Libfunctionality - dependency of osvr-server
git clone https://github.com/osvr/libfunctionality.git
mkdir libfunctionality-build
cd libfunctionality-build/
# Configures the build system
# the CMAKE_INSTALL_PREFIX that is specified here is actually the default, will do a system-wide install, but will work by default (may need to run ldconfig after installing)
# but that only matters if you run make install, and we won't actually even need to for this instance.
# (Wizards are of course welcome to generate Ninja build files instead of makefiles, etc.)
cmake ../libfunctionality -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr/local
# Compiles - you can add -j4 where 4 is the number of simultaneous compiles you want (number of cores, typically, or w/o hyperthreading, cores+1)
make
# OSVR-Core - the main package. Has additional dependencies (mostly build/run dependencies, not transitive) that we'll install here
# jsoncpp is a standard package - even if not on debian, you probably have this package, and it's probably ancient but usable.
sudo apt-get install libjsoncpp-dev libusb-1.0-0-dev
# These are a subset of the boost libraries - we don't need all the libraries installed by libboost-all-dev but you can install that metapackage if you prefer.
# You very likely have more installed already though.
sudo apt-get install libboost-dev libboost-filesystem-dev libboost-program-options-dev libboost-thread-dev
# OpenCV is actually an optional dependency - you can specify -DBUILD_WITH_OPENCV=FALSE later on if you don't want it at all
# The specific packages needed are these, but they lack the CMake config file to make building easier, so just install the whole thing.
# libopencv-calib3d-dev libopencv-core-dev libopencv-features2d-dev libopencv-highgui-dev libopencv-imgproc-dev
sudo apt-get install libopencv-dev
# Optional dependency, for some of the examples.
sudo apt-get install libsdl2-dev
# Get the source
git clone --recursive https://github.com/OSVR/OSVR-Core.git
# OK, now we've got the deps. Let's configure and build.
mkdir OSVR-Core-build
cd OSVR-Core-build
# We can do this command line, command-line gui (ccmake with the same args), or gui (cmake-gui).
# Easy to start with command line then fire up the GUI if you need to make changes, that's my personal preference.
cmake ../OSVR-Core -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr/local
# Compiles - just as before, can build in parallel
make
# this will run the server, with the default config file, right from within the build tree.
bin/osvr_server share/osvrcore/osvr_server_config.json
@schmidtbag
Copy link

I think there are missing dependencies, because this fails to build. Here are the last few lines showing where it fails:
-- Generating /home/pschmidt/src/libfunctionality-build/OSVR-Core-build/src/osvr/Util/ClientCallbackTypesC.h -- Configuring done -- Generating done -- Build files have been written to: /home/pschmidt/src/libfunctionality-build/OSVR-Core-build make[2]: *** No rule to make target 'jsoncpp_lib-NOTFOUND', needed by 'bin/osvr_json_to_c'. Stop. CMakeFiles/Makefile2:1488: recipe for target 'devtools/CMakeFiles/osvr_json_to_c.dir/all' failed make[1]: *** [devtools/CMakeFiles/osvr_json_to_c.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... [ 0%] Built target vrpn_atmel [ 1%] Built target markdown-readme [ 1%] Built target gpsnmea [ 1%] Built target gtest [ 1%] Built target quat Makefile:160: recipe for target 'all' failed make: *** [all] Error 2

@Seegras
Copy link

Seegras commented Nov 21, 2016

This will clutter everything all over the system. Hasn't anyone built deb-packages out of these yet?
I tried with libfunctionaility, but that gives me failed tests, and I guess, the test-cases are actually broken; I opened an issue there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment