Skip to content

Instantly share code, notes, and snippets.

@martinhansdk
Last active November 8, 2017 17:40
Show Gist options
  • Save martinhansdk/db5fd127f85bfd5e2907a5f6c733f2db to your computer and use it in GitHub Desktop.
Save martinhansdk/db5fd127f85bfd5e2907a5f6c733f2db to your computer and use it in GitHub Desktop.
build_pcb2gcode.sh
boost_*
pcb2gcode/
pcb2gcodeGUI/
pcb2gcode.list
*~

This builds and installs pcb2gcode and pcb2gcodeGUI on a linuxcnc machine which is debian wheezy. To run:

git clone https://gist.github.com/martinhansdk/db5fd127f85bfd5e2907a5f6c733f2db build_pcb2gcode
cd build_pcb2gcode
bash build_pcb2gcode.sh
#!/bin/bash
set -e
set -x
# debian wheezy does not have a version gcc that supports c++11 which
# pcb2gcode needs, but we can install clang-3.5 instead
cat - > pcb2gcode.list << HERE
deb http://llvm.org/apt/wheezy/ llvm-toolchain-wheezy main
deb-src http://llvm.org/apt/wheezy/ llvm-toolchain-wheezy main
deb http://ftp.debian.org/debian/ wheezy-backports main
HERE
wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key|sudo apt-key add -
sudo cp pcb2gcode.list /etc/apt/sources.list.d/
sudo apt-get update
sudo apt-get install clang-3.5 clang-3.5-doc libclang-common-3.5-dev libclang-3.5-dev libclang1-3.5 libclang1-3.5-dbg libllvm-3.5-ocaml-dev libllvm3.5 libllvm3.5-dbg lldb-3.5 llvm-3.5 llvm-3.5-dev llvm-3.5-doc llvm-3.5-examples llvm-3.5-runtime clang-modernize-3.5 clang-format-3.5 python-clang-3.5 lldb-3.5-dev build-essential automake autoconf autoconf-archive libtool libboost-program-options-dev libgtkmm-2.4-dev gerbv git qt5-default libqt5svg5-dev
WORKDIR=$PWD
export CXX=clang-3.5
### install boost
wget http://sourceforge.net/projects/boost/files/boost/1.58.0/boost_1_58_0.tar.gz
tar xzf boost_1_58_0.tar.gz
cd $WORKDIR/boost_1_58_0
./bootstrap.sh --with-libraries=program_options
./b2 toolset=clang variant=release link=static
sudo ./b2 install
sudo ldconfig
### build and install pcb2gcodeGUI
cd $WORKDIR
git clone https://github.com/pcb2gcode/pcb2gcodeGUI.git
cd pcb2gcodeGUI/
qmake -d
make
sudo make install
### build and install pcb2gcode
cd $WORKDIR
git clone https://github.com/pcb2gcode/pcb2gcode.git
cd pcb2gcode
autoreconf -fvi
./configure --enable-static-boost
make BOOST_PROGRAM_OPTIONS_LIBS=-lboost_program_options BOOST_PROGRAM_OPTIONS_LDFLAGS=-L/usr/local/lib
sudo make install
cd $WORKDIR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment