CompileOnUnix/jp

最近のLinuxディストリビューションでは、すべての依存性がパッケージマネージャで提供されるので、FreeCADのビルドは簡単です. 基本的には以下の３ステップを含みます.

1) FreeCADのソースコードを取得 2) 依存関係を取得 (FreeCADが依存するパッケージ) 3) "cake . && make"でのコンパイル

以下は、全体のプロセスと、あなたが遭遇するかもしれない特殊性についての詳細説明です. もしあなたが、以下のテキストで何らかの間違いや古い記述を見つけたとき(Linuxディストリビューションはしばしば変化するので)や、記述されていないディストリビューションを使用する場合は、テキストの修正にご協力ください.

ソースファイルの取得
FreeCADをコンパイルする前に、ソースコードを入手します. 入手するには３つの方法があります.

Git
ソースコードを入手する一番早く良い方法は、リードオンリーのgitリポジトリを複製することです. (git パッケージをインストールしておく必要があります)

git clone git://free-cad.git.sourceforge.net/gitroot/free-cad/free-cad freecad

This will place a copy of the latest version of the FreeCAD source code in a new directory called "freecad". The first time you try connecting to the free-cad.git.sourceforge.net host, you will receive a message asking to authenticate the sourceforge SSH key, which is normally safe to accept (you can check their SSH keys on the sourceforge website if you are not sure) 上記を実行すると、"FreeCADの"と呼ばれる新しいディレクトリに、の最新バージョンFreeCADのソースコードのコピーを置きます. 初めて free-cad.git.sourceforge.netのホストに接続を試みると、sourceforgeのSSH鍵の認証を尋ねるメッセージを受け取ります. これは、通常、受け入れても安全です. （はっきりしないときは、sourceforge ウェブサイトのSSH鍵をチェックすることができます. ）

Gihub
Gihub上のFreeCADレポジトリは、常に最新版です. github.com/FreeCAD/FreeCAD_sf_master

ソースパッケージ
別の方法として、ソースパッケージのダウンロードもできますが、それらはかなり古い可能性があるので、gitやsubversionで最新版のソースを入手するのが無難です. ディストリビューションによって、ソースパッケージの入手方法はいくつかあります.

Official FreeCAD source packages (distribution-independent): https://sourceforge.net/projects/free-cad/files/FreeCAD%20Source/ Debian: http://packages.debian.org/source/sid/freecad Ubuntu: http://packages.ubuntu.com/source/precise/freecad

依存関係の取得
LinuxでFreeCADをコンパイルするには、最初にサードパーティライブラリに記載されているすべてのライブラリをインストールする必要があります. 最近のディストリビューションでは、一般に、これはいくつかのパッケージをインストールするだけの問題です

Debian and Ubuntu
On Debian-based systems (Debian, Ubuntu, Mint, etc...) it is quite easy to get all needed dependencies installed. Most of the libraries are available via apt-get or synaptic package manager. Below are listed all packgages you need to install. Note that if you don't use the most recent version of your distribution, some of the packages below might be missing from your repositories. In that case, look in the section below. Debianベースのシステム(Debian, Ubuntu, Mint等)では、全ての必要な依存関係をインストールすることは簡単です. ライブラリのほとんどは、apt-getまたはSynapticパッケージマネージャを介して利用できます. インストールするために必要な全てのpackgagesを、以下に記載します. あなたがお使いのディストリビューションの最新バージョンを使用しない場合は、以下のパッケージのいくつかは、リポジトリから欠落している可能性があることに注意してください. その場合、以下の セクションを参照してください.

build-essential cmake python libtool libcoin60-dev libsoqt4-dev libxerces-c-dev libboost-dev libboost-filesystem-dev libboost-regex-dev libboost-program-options-dev libboost-signals-dev libboost-thread-dev libqt4-dev libqt4-opengl-dev qt4-dev-tools python-dev こちらか: libopencascade-dev (official opencascade version) または: liboce*-dev (opencascade community edition) oce-draw gfortran libeigen3-dev libqtwebkit-dev libode-dev swig libzipios++-dev

オプションで、以下の追加パッケージをインストールすることができます.

libsimage-dev (追加のイメージファイルフォーマットをサポートするCoinを作成するために必要) checkinstall (システムのパッケージマネージャにインストールしたファイルを登録するために必要. あとで簡単にアンインストールできます. ) python-pivy (2D製図モジュールに必要) python-qt4 (2D製図モジュールに必要) doxygen and libcoin60-doc (ソースコードのドキュメントを生成する場合) libspnav-dev (Space NavigatorやSpace Pilot等の3Dconnexion製デバイスのサポート)

Fedora
以下のパッケージが必要です.

cmake doxygen swig gcc-gfortran gettext dos2unix desktop-file-utils libXmu-devel freeimage-devel mesa-libGLU-devel OCE-devel python python-devel boost-devel tbb-devel eigen3-devel qt-devel qt-webkit-devel ode-devel xerces-c xerces-c-devel opencv-devel smesh-devel coin2-devel soqt-devel

以下はオプションです. :

libspnav-devel (Space NavigatorやSpace Pilot等の3Dconnexion製デバイスのサポート) pivy ( https://bugzilla.redhat.com/show_bug.cgi?id=458975 Pivyは必須ではありませんが、ドラフトモジュールに必要 )

Fedoraでは公式のレポジトリではcoin2しか提供していないので、coin3でFreeCADをビルドすることはさらに面倒です. しかし、どうしても望むなら、 http://www.zultron.com/rpm-repo/ からcoin3-readyのパッケージをインストールすれば、 全てのcoin3/soqt/pivyパッケージを再構築をせずにすみます.

Gentoo
FreeCADのビルドには、以下のパッケージが必要です.

dev-cpp/eigen dev-games/ode dev-libs/boost dev-libs/xerces-c dev-python/pivy dev-python/PyQt4 media-libs/coin media-libs/SoQt sci-libs/opencascade-6.5 sys-libs/zlib virtual/fortran x11-libs/qt-gui x11-libs/qt-opengl x11-libs/qt-svg x11-libs/qt-webkit x11-libs/qt-xmlpatterns dev-lang/swig-2.0.4-r1 app-admin/eselect-python-20091230 dev-lang/python-2.7.2-r3 dev-util/cmake-2.8.4 sys-apps/findutils-4.4.0

最新のopencascadeが利用できないので、opencascadeをコンパイルしたくなるかもしれませんが、その場合は以下の追加ライブラリが必要です：

media-libs/ftgl virtual/opengl x11-libs/libXmu dev-lang/tcl-8.5.9 dev-lang/tk-8.5.9-r1 dev-tcltk/itcl-3.4_beta1 dev-tcltk/itk-3.4_pre20090417 dev-tcltk/tix-8.4.3 x11-libs/gl2ps sys-devel/automake-1.11 sys-devel/autoconf-2.68 sys-devel/libtool dev-java/java-config-2.1.11-r3

OpenSUSE
以下のパッケージが必要です.

gcc cmake OpenCASCADE-devel libXerces-c-devel python-devel libqt4-devel python-qt4 Coin-devel SoQt-devel boost-devel libode-devel libQtWebKit-devel libeigen3-devel gcc-fortran

FreeCAD 0.13が不安定なので、Eigen3とswigライブラリを追加する必要があります. それらは標準のレポジトリにはありません. それらは以下から１クリックインストールできます.

Eigen3: http://software.opensuse.org/search?q=eigen3&baseproject=openSUSE%3A12.1&lang=en&exclude_debug=true swig: http://software.opensuse.org/search?q=swig&baseproject=openSUSE%3A12.1&lang=en&exclude_debug=true

Also, note that Eigen3 Library from Factory Education was causing problems sometimes, so use the one from KDE 4.8 Extra repo Factory EducationのEigen3ライブラリは、しばしば問題を起こしていたので、KDE 4.8 Extraレポジトリのものを使ってください.

古く一般的でないディストリビューション
他のディストリビューションでは、ユーザーからのフィードバックがほとんど無いので、必要なパッケージを見つけることが難しくなる場合があります. まず、サードパーティライブラリに記載されている必要なライブラリを用意することを試してください. そのうちのいくつかはお使いのディストリビューションで若干異なるパッケージ名（name、libname、name-dev、name-devel、等..）になっているかもしれないことに注意してください.

GNU gcc コンパイラ バージョン 3.0.0以上も必要です. FreeCADは完全にC++で記述されているので、g++も必要です. コンパイル中には、いくつかのPythonスクリプトも実行されます. そのため、Pythonインタプリタが正しく機能する必要があります. ビルドプロセスでのリンカの問題を避けるため、環境変数"LD_LIBRARY_PATH"、もしくは、"ld.so.conf"ファイルに、ライブラリへのパスを追加するのも良いでしょう. これは、最近のディストリビューションでは一般的なことです.

詳細は、ソースファイル内の"README.Linux"にも書かれています.

以下には、あなたのディストリビューションのリポジトリで見つけることができない可能性のある幾つかのライブラリについての追加ヘルプです.

Eigen 3
The Eigen3 library is now required by the Sketcher module. This library is only available starting from Ubuntu 11.10 repositories. For prior Ubuntu releases, you can either download it from here and install it manually, or add the FreeCAD Daily Builds PPA to your software sources before installing it through one of the means listed below.

OpenCASCADE community edition (OCE)
OpenCasCade has recently been forked into a Community edition, which is much, much easier to build. FreeCAD can use any version installed on your system, either the "official" edition or the community edition. The OCE website contains detailed build instructions.

OpenCASCADE official version
Note: You are advised to use the OpenCasCade community edition above, which is easier to build, but this one works too.

Not all Linux distributions have an official OpenCASCADE package in their repositories. You have to check yourself for your distribution if one is available. At least from Debian Lenny and Ubuntu Intrepid on an official .deb package is provided. For older Debian or Ubuntu releases you may get unofficial packages from here. To build your own private .deb packages follow these steps:

wget http://lyre.mit.edu/~powell/opencascade/opencascade_6.2.0.orig.tar.gz wget http://lyre.mit.edu/~powell/opencascade/opencascade_6.2.0-7.dsc wget http://lyre.mit.edu/~powell/opencascade/opencascade_6.2.0-7.diff.gz

dpkg-source -x opencascade_6.2.0-7.dsc

sudo apt-get install build-essential devscripts debhelper autoconf automake libtool bison libx11-dev tcl8.4-dev tk8.4-dev libgl1-mesa-dev libglu1-mesa-dev java-gcj-compat-dev libxmu-dev
 * 1) Install OCC build-deps

cd opencascade-6.2.0 ; debuild
 * 1) Build Opencascade packages. This takes hours and requires
 * 2) at least 8 GB of free disk space

sudo dpkg -i libopencascade6.2-0_6.2.0-7_i386.deb libopencascade6.2-dev_6.2.0-7_i386.deb
 * 1) Install the resulting library debs

Alternatively, you can download and compile the latest version from opencascade.org:

Install the package normally, be aware that the installer is a java program that requires the official java runtime edition from Sun (package name: sun-java6-jre), not the open-source java (gij) that is bundled with Ubuntu. Install it if needed: sudo apt-get remove gij sudo apt-get install sun-java6-jre Be careful, if you use gij java with other things like a browser plugin, they won't work anymore. If the installer doesn't work, try: java -cp path_to_file_setup.jar <-Dtemp.dir=path_to_tmp_directory> run

Once the package is installed, go into the "ros" directory inside the opencascade dir, and do ./configure --with-tcl=/usr/lib/tcl8.4 --with-tk=/usr/lib/tk8.4 Now you can build. Go back to the ros folder and do: make It will take a long time, maybe several hours.

When it is done, just install by doing sudo make install The library files will be copied into /usr/local/lib which is fine because there they will be found automatically by any program. Alternatively, you can also do sudo checkinstall which will do the same as make install but create an entry in your package management system so you can easily uninstall later. Now clean up the enormous temporary compilation files by doing make clean

Possible error 1: If you are using OCC version 6.2, it is likely that the compiler will stop right after the beginning of the "make" operation. If it happens, edit the "configure" script, locate the CXXFLAGS="$CXXFLAGS " statement, and replace it by CXXFLAGS="$CXXFLAGS -ffriend-injection -fpermissive". Then do the configure step again.

Possible error 2: Possibly several modules (WOKSH, WOKLibs, TKWOKTcl, TKViewerTest and TKDraw) will complain that they couldn't find the tcl/tk headers. In that case, since the option is not offered in the configure script, you will have to edit manually the makefile of each of those modules: Go into adm/make and into each of the bad modules folders. Edit the Makefile, and locate the lines CSF_TclLibs_INCLUDES = -I/usr/include and CSF_TclTkLibs_INCLUDES = -I/usr/include and add /tcl8.4 and /tk8.4 to it so they read: CSF_TclLibs_INCLUDES = -I/usr/include/tcl8.4 and CSF_TclTkLibs_INCLUDES = -I/usr/include/tk8.4

SoQt
The SoQt library must be compiled against Qt4, which is the case in most recent distributions. But at the time of writing this article there were only SoQt4 packages for Debian itself available but not for all Ubuntu versions. To get the packages built do the following steps:

wget http://ftp.de.debian.org/debian/pool/main/s/soqt/soqt_1.4.1.orig.tar.gz wget http://ftp.de.debian.org/debian/pool/main/s/soqt/soqt_1.4.1-6.dsc wget http://ftp.de.debian.org/debian/pool/main/s/soqt/soqt_1.4.1-6.diff.gz dpkg-source -x soqt_1.4.1-6.dsc sudo apt-get install doxygen devscripts fakeroot debhelper libqt3-mt-dev qt3-dev-tools libqt4-opengl-dev cd soqt-1.4.1 debuild sudo dpkg -i libsoqt4-20_1.4.1-6_i386.deb libsoqt4-dev_1.4.1-6_i386.deb libsoqt-dev-common_1.4.1-6_i386.deb

If you are on a 64bit system, you will probably need to change i386 by amd64.

Pivy
Pivy is not needed to build FreeCAD or to run it, but it is needed for the 2D Drafting module to work. If you are not going to use that module, you won't need pivy. At the time of writing, Pivy is very new and might not have made its way into your distribution repository. If you cannot find Pivy in your distribution's packages repository, you can grab debian/ubuntu packages on the FreeCAD download page:

http://sourceforge.net/projects/free-cad/files/FreeCAD%20Linux/

or compile pivy yourself:

Pivy compilation instructions

Using cMake
cMake is a newer build system which has the big advantage of being common for different target systems (Linux, Windows, MacOSX, etc). FreeCAD is now using the cMake system as its main building system. Compiling with cMake is usually very simple and happens in 2 steps. In the first step, cMake checks that every needed programs and libraries are present on your system and sets up all that's necessary for the subsequent compilation. You are given a few alternatives detailed below, but FreeCAD comes with sensible defaults. The second step is the compiling itself, which produces the FreeCAD executable.

Since FreeCAD is a heavy application, compiling can take a bit of time (about 10 minutes on a fast machine, 30 minutes on a slow one)

In-souce building
FreeCAD can be built in-source, which means that all the files resulting from the compilation stay in the same folder as the source code. This is fine if you are just looking at FreeCAD, and want to be able to remove it easily by just deleting that folder. But in case you are planning to compile it often, you are advised to make an out-of-source build, which offers many more advantages. The following commands will compile freecad:

cd freecad (the folder where you cloned the freecad source) cmake. make

Your FreeCAD executable will then reside in the "bin" folder, and you can launch it with:

./bin/FreeCAD

Out-of-source build
If you intend to follow the fast evolution of FreeCAD, building in a separate folder is much more convenient. Everytime you update the source code, cMake will then intelligently distinguish which files have changed, and recompile only what is needed. Out-of-source builds are specially handy when using the Git system, because you can easily try other branches without confusing the build system. To build out-of-source, simply create a build directory, distinct from your freecad source folder, and, from the build folder, point cMake to the source folder:

mkdir freecad-build cd freecad-build cmake ../freecad (or whatever the path is to your FreeCAD source folder) make

The FreeCAD executable will then reside in the "bin" directory (within your freecad-build directory).

Configuration options
There are a number of experimental or unfinished modules you may have to build if you want to work on them. To do so, you need to set the proper options for the configuration phase. Do it either on the command line, passing -D : = options to cMake or using one of the availables gui-frontends (eg for Debian, packages cmake-qt-gui or cmake-curses-gui).

As an example, to configure on the command line with the Assembly module built, issue: cmake -D FREECAD_BUILD_ASSEMBLY:BOOL=ON path-to-freecad-root Possible options are listed in FreeCAD's root CmakeLists.txt file.

Using autotools
Autotools is in the process of being deprecated in favor of cMake, but at the moment it is still available to build FreeCAD. You must have automake and libtool installed on your system; on Debian/Ubuntu:

aptitude install automake libtool

If you got the sources with git or subversion, then the very first step must be

./autogen.sh

that creates the configure script and more. For the build process itself we provide a configure script. Just type

./configure

To get everything configured. If you want an overview of all options you can specify, you can type

./configure --help

Normally you need none of them - unless you have one of your libraries installed in a really uncommon directory. After configuration has finished, compiling FreeCAD is as simple as

make

If any error occurs while building from sources, please double-check this page and README.Linux file, then you could jump to the Bug Tracker on SourceForge, choose Any for status and click the Browse button to see previous reports on compile problems. After having built FreeCAD successfully, do

make install

to install it onto your machine. The default install directory is

~/FreeCAD

It will be installed in a FreeCAD folder in your home folder, so you don't need root privileges. Instead of make install, you can also do

checkinstall

In this way FreeCAD will be installed by your package management system, so you can uninstall it easily later. But since all of FreeCAD installation resides into one single directory, just removing the FreeCAD directory is a valid way to uninstall too.

Qt designer plugin
If you want to develop Qt stuff for FreeCAD, you'll need the Qt Designer plugin that provides all custom widgets of FreeCAD. Go to

freecad/src/Tools/plugins/widget

So far we don't provide a makefile -- but calling

qmake plugin.pro

creates it. Once that's done, calling

make

will create the library libFreeCAD_widgets.so. To make this library known to Qt Designer you have to copy the file to $QTDIR/plugin/designer

Doxygen
If you feel bold enough to dive in the code, you could take advantage to build and consult Doxygen generated FreeCAD's Source documentation

Making a debian package
If you plan to build a Debian package out of the sources you need to install those packages first: dh-make devscripts lintian (optional, used for checking if packages are standard-compliant) To build a package open a console, simply go to the FreeCAD directory and call debuild Once the package is built, you can use lintian to check if the package contains errors lintian your-fresh-new-freecad-package.deb (replace by the name of the package you just created)

Note for 64bit systems
When building FreeCAD for 64-bit there is a known issue with the OpenCASCADE 64-bit package. To get FreeCAD running properly you might need to run the ./configure script with the additional define _OCC64 set: ./configure CXXFLAGS="-D_OCC64" For Debian based systems this workaround is not needed when using the prebuilt package because there the OpenCASCADE package is built to set internally this define. Now you just need to compile FreeCAD the same way as described above.

Automake macros
The configure script of FreeCAD makes use of several automake macros that are sometimes not installed with their packages: bnv_have_qt.m4, coin.m4, and soqt.m4. If needed (error while configuring), google for them and you will find them easily. They are just simple scripts that you need to put in your /usr/share/aclocal folder.

Fedora 13
To build & install FreeCAD on Fedora 13, a few tips and tricks are needed:
 * Install a bunch of required packages, most are available from the Fedora 13 repositories
 * Download and build xerces
 * Download and build OpenCascade. Need to point it to xmu: ./configure --with-xmu-include=/usr/include/X11/Xmu --with-xmu-library=/usr/lib
 * Download and build Pivy. You have to remove 2 references to non existent "SoQtSpaceball.h" from pivy/interfaces/soqt.i Commenting out those two lines allow the build & install to work.
 * Configure Freecad. You will need to point it to a few things: ./configure --with-qt4-include=/usr/include --with-qt4-bin=/usr/lib/qt4/bin --with-occ-lib=/usr/local/lib --with-occ-include=/usr/local/inc --with-xercesc-lib=/usr/local/lib
 * make - hits a problem where the build is breaking because the ldflags for soqt are set to "-LNONE" which made libtool barf. My hackish workaround was to modify /usr/lib/Coin2/conf/soqt-default.cfg so that the ldflags are "" instead of "-LNONE". After this -> success !
 * make install

Ubuntu Lucid
In Ubuntu Lucid, you don't need the qtwebkit-dev, since it is included into qt4-dev.

Automatic build scripts
Here is all what you need for a complete build of FreeCAD. It's a one-script-approach and works on a fresh installed distro. The commands will ask for root password (for installation of packages) and sometime to acknowledge a fingerprint for an external repository server or https-subversion repository. This scripts should run on 32 and 64 bit versions. They are written for distinct version, but are also likely to run on a later version with or without minor changes.

If you have such a script for your preferred distro, please send it! We will incorporate it into this article.

Note that this script starts by adding the FreeCAD Daily Builds PPA repository so it can proceed with the Eigen3 library (libeigen3-dev) installation. If you already have this library installed on your system, you can remove the first line.

Ubuntu 10.04 LTS - Lucid Lynx / Ubuntu 10.10 Maverick Meerkat / Ubuntu 11.04 Natty Narwhal
sudo add-apt-repository ppa:freecad-maintainers/freecad-daily && sudo apt-get update sudo apt-get install build-essential python libcoin60-dev libsoqt4-dev \ libxerces-c2-dev libboost-dev libboost-date-time-dev libboost-filesystem-dev \ libboost-graph-dev libboost-iostreams-dev libboost-program-options-dev \ libboost-serialization-dev libboost-signals-dev libboost-regex-dev libboost-thread-dev \ libqt4-dev qt4-dev-tools python2.7-dev libopencascade-dev libsoqt4-dev \ libode-dev subversion cmake libeigen2-dev libsimage-dev python-qt4 \ libtool autotools-dev automake bison flex gfortran libeigen3-dev libqtwebkit-dev git

git clone git://free-cad.git.sourceforge.net/gitroot/free-cad/free-cad freecad
 * 1) checkout the latest source

cd freecad
 * 1) go to source dir

cmake.
 * 1) build configuration

make
 * 1) build FreeCAD

cd bin ./FreeCAD -t 0
 * 1) test FreeCAD

./FreeCAD
 * 1) use FreeCAD


 * 1) Update latest version

cd freecad
 * 1) go to source dir

git pull
 * 1) Update source

cmake.
 * 1) build configuration

make
 * 1) build FreeCAD

OpenSUSE 12.2
No external Repositories are needed to compile FreeCAD 0.13 with this release. However, there is an imcompatability with python3-devel which needs to be removed. FreeCAD can be compiled from GIT similar to in OpenSUSE 12.2

sudo zypper install gcc cmake OpenCASCADE-devel libXerces-c-devel \ python-devel libqt4-devel python-qt4 Coin-devel SoQt-devel boost-devel \ libode-devel libQtWebKit-devel libeigen3-devel gcc-fortran git swig
 * 1) install needed packages for development

mkdir FreeCAD-Compiled cd FreeCAD-Compiled
 * 1) create new dir, and go into it

git clone git://free-cad.git.sourceforge.net/gitroot/free-cad/free-cad
 * 1) get the source


 * 1) Now you will have subfolder in this location called free-cad. It contains the source

mkdir FreeCAD-Build1 cd FreeCAD-Build1
 * 1) make another dir for compilation, and go into it

cmake ../free-cad
 * 1) build configuration

make
 * 1) build FreeCAD

cd bin ./FreeCAD -t 0
 * 1) test FreeCAD

Since you are using git, next time you wish to compile you do not have to clone everything, just pull from git and compile once more

cd free-cad
 * 1) go into free-cad dir created earlier

git pull
 * 1) pull

cd ..
 * 1) get back to previous dir


 * 1) Now repeat last few steps from before.

mkdir FreeCAD-Build2 cd FreeCAD-Build2
 * 1) make another dir for compilation, and go into it

cmake ../free-cad
 * 1) build configuration

make
 * 1) build FreeCAD

cd bin ./FreeCAD -t 0
 * 1) test FreeCAD

OpenSUSE 12.1
For FreeCAD 0.13 unstable you need to add Eigen3 and swig libraries, that don't seem to be in standard repos. You can get them with one-click install here:

Eigen3: http://software.opensuse.org/search?q=eigen3&baseproject=openSUSE%3A12.1&lang=en&exclude_debug=true

swig: http://software.opensuse.org/search?q=swig&baseproject=openSUSE%3A12.1&lang=en&exclude_debug=true

sudo zypper install gcc cmake OpenCASCADE-devel libXerces-c-devel \ python-devel libqt4-devel python-qt4 Coin-devel SoQt-devel boost-devel \ libode-devel libQtWebKit-devel libeigen3-devel gcc-fortran git
 * 1) install needed packages for development

mkdir FreeCAD-Compiled cd FreeCAD-Compiled
 * 1) create new dir, and go into it

git clone git://free-cad.git.sourceforge.net/gitroot/free-cad/free-cad
 * 1) get the source


 * 1) Now you will have subfolder in this location called free-cad. It contains the source

mkdir FreeCAD-Build1 cd FreeCAD-Build1
 * 1) make another dir for compilation, and go into it

cmake ../free-cad
 * 1) build configuration

make
 * 1) build FreeCAD

cd bin ./FreeCAD -t 0
 * 1) test FreeCAD

Since you are using git, next time you wish to compile you do not have to clone everything, just pull from git and compile once more

cd free-cad
 * 1) go into free-cad dir created earlier

git pull
 * 1) pull

cd ..
 * 1) get back to previous dir


 * 1) Now repeat last few steps from before.

mkdir FreeCAD-Build2 cd FreeCAD-Build2
 * 1) make another dir for compilation, and go into it

cmake ../free-cad
 * 1) build configuration

make
 * 1) build FreeCAD

cd bin ./FreeCAD -t 0
 * 1) test FreeCAD

OpenSuse 11.2
This script is not working at the moment because:
 * libXerces-c-devel seams to be disappeared ....

sudo zypper install gcc cmake subversion OpenCASCADE-devel \ libXerces-c-devel python-devel libqt4-devel python-qt4 \ Coin-devel SoQt-devel boost-devel libode-devel libQtWebKit-devel \ libeigen2-devel gcc-fortran
 * 1) install needed packages for development

git clone git://free-cad.git.sourceforge.net/gitroot/free-cad/free-cad freecad
 * 1) get the source

cd freecad
 * 1) go to source dir

cmake.
 * 1) build configuration

nice make
 * 1) build FreeCAD

cd bin ./FreeCAD -t 0
 * 1) test FreeCAD

OpenSuse 11.1
sudo zypper -p http://packman.unixheads.com/suse/11.1/
 * 1) additional repository (for OpenCascade)

sudo zypper install gcc cmake subversion OpenCASCADE-devel \ libXerces-c-devel python-devel libqt4-devel python-qt4 \ Coin-devel SoQt-devel boost-devel libode-devel libQtWebKit-devel \ libeigen2-devel
 * 1) install needed packages for development

git clone git://free-cad.git.sourceforge.net/gitroot/free-cad/free-cad freecad
 * 1) get the source

cd freecad
 * 1) go to source dir

cmake.
 * 1) build configuration

nice make
 * 1) build FreeCAD

cd bin ./FreeCAD -t 0
 * 1) test FreeCAD

Debian Squeeze
sudo apt-get install build-essential python libcoin60-dev libsoqt4-dev \ libxerces-c2-dev libboost-dev libboost-date-time-dev libboost-filesystem-dev \ libboost-graph-dev libboost-iostreams-dev libboost-program-options-dev \ libboost-serialization-dev libboost-signals-dev libboost-regex-dev \ libqt4-dev qt4-dev-tools python2.5-dev \ libsimage-dev libopencascade-dev \ libsoqt4-dev libode-dev subversion cmake libeigen2-dev python-pivy \ libtool autotools-dev automake gfortran
 * 1) get the needed tools and libs

git clone git://free-cad.git.sourceforge.net/gitroot/free-cad/free-cad freecad
 * 1) checkout the latest source

cd freecad
 * 1) go to source dir

cmake.
 * 1) build configuration

make
 * 1) build FreeCAD

cd bin ./FreeCAD -t 0
 * 1) test FreeCAD

Updating the source code
FreeCAD development happens fast, everyday or so there are bug fixes or new features. The cmake systems allows you to intelligently update the source code, and only recompile what has changed, making subsequent compilations very fast. Updating the source code with git or subversion is very easy:

cd freecad (or where you cloned the source code the first time) git pull (if you are using git)

Move into the appropriate build directory and run cmake again (as cmake updates the version number data for the Help menu, ...about FreeCAD), however you do not need to add the path to source code after "cmake", just a space and a dot:

cd ../freecad-build (or wherever your build directory is located)

cmake.

make