Skip to content

Instantly share code, notes, and snippets.

@hsharrison
Created June 26, 2014 18:06
Show Gist options
  • Save hsharrison/24cbe284bd50973052ee to your computer and use it in GitHub Desktop.
Save hsharrison/24cbe284bd50973052ee to your computer and use it in GitHub Desktop.
installing vrpn
wget http://www.cs.unc.edu/Research/vrpn/downloads/vrpn_07_31.zip
unzip vrpn_07_31.zip
rm vrpn_07_31.zip
# compile quat
cd vrpn/quat
sed -i 's@#HW_OS := pc_linux64@HW_OS := pc_linux64@g' Makefile
make
# compile vrpn
cd ..
sed -i 's@#HW_OS := pc_linux64@HW_OS := pc_linux64@g' Makefile
sed -i 's@//#define VRPN_USE_LIBUSB_1_0@#define VRPN_USE_LIBUSB_1_0@g' vrpn_Configure.h
make
# compile vrpn client
cd client_src
sed -i 's@#HW_OS := pc_linux64@HW_OS := pc_linux64@g' Makefile
make
# compile vrpn server
cd ../server_src
sed -i 's@#HW_OS := pc_linux64@HW_OS := pc_linux64@g' Makefile
sed -i 'N; s@ifeq ($(HW_OS),pc_linux64)\
\tSYSLIBS :=@ifeq ($(HW_OS),pc_linux64)\
\tSYSLIBS :=\
# For HID devices\
\tSYSLIBS := -lusb-1.0@g' Makefile
make
# compile vrpn python module for 3.3
cd ../python
# this tweak allows us to install vrpn into a virtualenv
sed -i 'N; s@PYTHON_MODULE_DIR := $(shell $(PYTHON_CONFIG) --exec-prefix)/lib/python$(PYTHON_VERSION)/lib-dynload@ifdef VIRTUAL_ENV\
\tPYTHON_MODULE_DIR := $(VIRTUAL_ENV)/lib/python$(PYTHON_VERSION)/site-packages\
else\
\tPYTHON_MODULE_DIR := $(shell $(PYTHON_CONFIG) --exec-prefix)/lib/python$(PYTHON_VERSION)/lib-dynload\
endif@g' GNUmakefile
sed -i 's@#HW_OS := pc_linux64@HW_OS := pc_linux64@g' GNUmakefile
sed -i 's@#PYTHON_VERSION := 2.7@PYTHON_VERSION := 3.3@g' GNUmakefile
make
make install
# move to install directory
cd ../..
sudo mv vrpn /opt
# link to bin directory
sudo ln -s /opt/vrpn/server_src/pc_linux64/vrpn_server /usr/local/bin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment