Linux build instructions
From PinballControllers Wiki
This page contains step-by-step instructions for building libpinproc and pypinproc in Linux. This first pass was based off of a 32-bit Ubuntu 10.04 machine. Other flavors of Linux might require slightly different instructions. For those who are on Ubuntu/Debian machines who may not want to build everything manually, feel free to try the Pinbox Toolkit which will automatically build and install these components for you.
Contents |
Tools
- usb/libftdi: 'sudo apt-get install libftdi-dev' ** This should install libftdi, libftdi-dev, libusb, and libusb-dev.
- git: 'sudo apt-get install git-core' ** Needed only if you want to clone git repositories (rather than just downloading source tarballs)
- linux build utilities: 'sudo apt-get install build-essential'
- g++: 'sudo apt-get install g++'
- cmake: 'sudo apt-get install cmake'
- python development libraries: 'sudo apt-get install python-dev' ** Needed for pypinproc only
- python setup-tools: 'sudo apt-get install python-setuptools'
libpinproc
- Build yaml-cpp
mkdir bin cd bin cmake .. make sudo make install
- Build libpinproc
- Download (and extract) libpinproc into a directory of your choice. Note - make sure you select the desired branch to download (either master or dev).
- Download either by clicking 'Download Sources' or by installing a git client and checking out the repository.
- From the command line, 'cd' into the libpinproc directory and run the following commands:
- Download (and extract) libpinproc into a directory of your choice. Note - make sure you select the desired branch to download (either master or dev).
mkdir bin cd bin cmake .. make sudo make install
- NOTE: Some versions of linux (ie. Ubuntu 11.10) appear to only work when libpinproc is built as a shared library. To build a shared library, replace the "cmake .." line above with:
cmake -DBUILD_SHARED_LIBS=ON ..
- You should now have ./pinproctest and ./pinprocfw executables and a libpinproc.a (or libpinproc.so) library file.
pypinproc
- Build pypinproc - libpinproc Python extension
- Download (and extract) pypinproc into a directory of your choice. Note - make sure you select the desired branch to download (either master or dev).
- Download either by clicking 'Download Sources' or by installing a git client and checking out the repository.
- From the command line, 'cd' into your pypinproc directory
- Run 'python setup.py install' ** Might need to use 'sudo' for the install
- If the compile fails, edit setup.py and make sure the 'include_dirs' and 'library_dirs' paths have the correct locations for your libpinproc files.
- On some 64-bit systems, you might get a relocation error such as: 'relocation R_X86_64_32 against `lastErrorText' can not be used when making a shared object; recompile with -fPIC'. If you get this, you'll need to rebuild libpinproc replacing the 'cmake ..' command with 'cmake -DCMAKE_CXX_FLAGS="-fPIC" ..'. After rerunning 'cmake' and 'make' on libpinproc, try to build pypinproc again.
- This should compile pypinproc and install it into your Python packages directory.
- Download (and extract) pypinproc into a directory of your choice. Note - make sure you select the desired branch to download (either master or dev).