====== FreeCAD on LMDE2 ====== As described on the [[http://www.freecadweb.org|FreeCAD website]]: "FreeCAD is a parametric 3D modeler made primarily to design real-life objects of any size". The easiest way to install it on Debian Jessie / LMDE2 is to use the **//Menu > Software Manager//** search for ''FreeCAD'' and install the software. Unfortunately, the current version in the Debian repos is 0.14, while the latest available version is, as of this writing, 0.16 (or even pre-0.17)... What we'll try to do here is use an LMDE2 Virtual Machine to compile the latest release version (0.16), and create a .deb package that will be used to install this FreeCAD version on a workstation. In case you ask yourself why so much complication, and not compile immediately on the workstation, here are 2 reasons. * Compiling often requires installation of a lot of complementary packages that we do not always want installed on the workstation. * Once a .deb package is available, (re)installation becomes an easy task. The following is based on [[http://www.falkotimme.com/howtos/checkinstall/|this article]] explaining how to create a .deb package using checkinstall. ===== Virtual Machine ===== We assume that a clean LMDE2 Virtual Machine is available as our starting platform. If you don't know what VM's are or how to use them, you can refer to [[http://wiki.strategicz.com/vhyper/doku.php?id=vms|this other wiki]]. ==== SSH ==== As we intend to mainly (exclusively) use the command line interface to compile FreeCAD, we'll activate an SSH server on our VM, making sure it uses at least one **Bridged Adapter**, so we'll be able to access it //via// ssh to carry out all operations. As we intend to act as root, we'll also allow remote root login on this system: <Code:bash |VM CONSOLE: Install openssh-server> > sudo apt-get install openssh-server > sudo nano /etc/ssh/sshd_config FROM: PermitRootLogin without-password TO: PermitRootLogin yes CTRL-X + Y (save) > sudo service ssh restart </Code> We'll also transfer our public ssh key to the VM so we'll be able to log into it without entering a password: <Code:bash |WORKSTATION CONSOLE: Transfer public SSH key> > ssh-copy-id root@your.vm.ip.address </Code> ===== FreeCAD .deb Compilation ===== We will refer to the [[http://www.freecadweb.org/wiki/?title=CompileOnUnix|FreeCAD Website instructions]] to install on Debian Linux. Let's now ssh into the VM to start our operations: <Code:bash |WORKSTATION CONSOLE: Login to VM> > ssh root@your.vm.ip.address </Code> From here on, all commands will be executed in our VM's console, as you can see we also assume that we'll be acting as **root** on the VM. ==== Install checkinstall ==== As our objective is to generate a .deb file, our first step will be to install ''checkinstall'': <Code:bash |Install checkinstall> > apt-get install checkinstall </Code> ==== Get the FreeCAD Source ==== <Code:bash |Use git to Get FreeCAD Source> > cd ~ > git clone https://github.com/FreeCAD/FreeCAD.git free-cad-code </Code> This will place a copy of the latest version of the FreeCAD source code in a new directory called "free-cad-code". ==== Install Third Party Libraries ==== We now need to install all the FreeCAD required third party libraries, as well as the compiler environment: <Code:bash |Install compile environment and third party libraries> > apt-get install \\ build-essential \\ cmake \\ python \\ python-matplotlib \\ libtool \\ libcoin80-dev \\ libsoqt4-dev \\ libxerces-c-dev \\ libboost-dev \\ libboost-filesystem-dev \\ libboost-regex-dev \\ libboost-program-options-dev \\ libboost-signals-dev \\ libboost-thread-dev \\ libboost-python-dev \\ libqt4-dev \\ libqt4-opengl-dev \\ qt4-dev-tools \\ python-dev \\ python-pyside \\ pyside-tools \\ liboce-foundation-dev \\ liboce-modeling-dev \\ liboce-ocaf-dev \\ liboce-visualization-dev \\ liboce-ocaf-lite-dev \\ oce-draw \\ libeigen3-dev \\ libqtwebkit-dev \\ libshiboken-dev \\ libpyside-dev \\ libode-dev \\ swig \\ libzipios++-dev \\ libfreetype6 \\ libfreetype6-dev \\ libsimage-dev \\ python-pivy \\ python-qt4 \\ libspnav-dev \\ libmedc-dev \\ libvtk6-dev \\ libproj-dev </Code> The following packages are required if we want to create a Debian package: <Code:bash |Additional packages> > apt-get install dh-make devscripts lintian </Code> ==== Make an Out-of-Source Build ==== <Code:bash |Build FreeCAD out-of-source> > mkdir freecad-build > cd freecad-build > cmake ../free-cad-code -DCMAKE_BUILD_TYPE=Release > make </Code> The FreeCAD executable now resides in the''bin'' folder, we can launch it with: <Code:bash |Launch FreeCAD> > ./bin/FreeCAD </Code>