Commit e56f76db authored by jean-pierre charras's avatar jean-pierre charras

Update compiling.txt doc.

parent 389656e5
Compiling KiCad from Source Compiling KiCad from Source
=========================== ===========================
KiCad Documentation Team KiCad Documentation Team
Last revised on 31-Jan-2010 by Jerry Jacobs Last revised on 12-mars-2012 by jp Charras
Introduction Introduction
------------ ------------
...@@ -25,7 +25,21 @@ On linux: ...@@ -25,7 +25,21 @@ On linux:
Install "mesa". Use your package manager to install the Install "mesa". Use your package manager to install the
development libaries. development libaries.
Tools in PATH After a fresh install you need the following packages to compile and run
KiCad from source.
CMake - Cross-platform make
GLUT - The OpenGL Utility Library
wxGTK or wxWidgets - The wxWidgets GUI toolkit with GTK+ bindings
Boost - Collection of portable C++ source libraries
Because boost is in the repository of kicad you don't need to install them.
Useful, but not required:
Doxygen - Documentation system for several programming languages
Compiler and basic development tools
------------- -------------
Make sure g++, make and other tools are in your path. Make sure g++, make and other tools are in your path.
If windows, then try running g++ and make from within your msys bash shell. If windows, then try running g++ and make from within your msys bash shell.
...@@ -37,48 +51,27 @@ Install or Build wxWidgets ...@@ -37,48 +51,27 @@ Install or Build wxWidgets
WARNING: WARNING:
see wxWidgets_patch_notes.txt for patches and issues in wxWidgets. see wxWidgets_patch_notes.txt for patches and issues in wxWidgets.
If on windows, download If on Windows, download
http://sourceforge.net/projects/wxwindows/files/wxAll/2.9.3/wxWidgets-2.9.3.zip/download http://sourceforge.net/projects/wxwindows/files/wxAll/2.9.3/wxWidgets-2.9.3.zip/download
or a newer version. or a newer version.
Do NOT use previous versions which all have issues for KiCad. Do NOT use previous versions which all have annoying issues for KiCad.
Start msys so you have a bash shell. Decide where your wxWidgets build directory Start msys so you have a bash shell.
will be. It must be where you can access it from within the msys environment, Note also since 2.9 versions no need to build a "debug" version of the wxWidgets library,
such as home/<user>. Edit your msys/1.0/etc/fstab file if needed to provide the release abd the debug version are same.
access to this build directory from msys. (Note that if you want you can build
a "debug" version of the wxWidgets library at this point, instead of the release
version, or in addition to the the release version.)
Unzip the wmMWS zip file into the build directory. Change directories into
there, and then:
mkdir build-release
mkdir build-debug
.Release Unzip the wxWidgets zip file into the build directory. Change directories into
---- there, and then:
cd build-release
../configure --enable-unicode --enable-monolithic --disable-shared --with-msw --with-opengl
make
make install
----
.Debug mkdir Release
---- cd Release
cd build-debug ../configure --enable-unicode --enable-monolithic=no --disable-shared --with-opengl
../configure --enable-unicode --enable-monolithic --enable-debug --enable-debug_gdb --disable-shared --with-msw --with-opengl
make make
make install
----
The default install path is /usr/local. Generally speaking MinGW likes header and under Linux, but not under Windows:
files in /mingw/include and library link files in /mingw/lib. You can install sudo make install that install wxWidgets libs and headers in /usr/local/
path by setting --prefix=/mingw to configure above to change where "make install"
puts everything. We will refer to the --prefix setting as <wxInstallDir> below.
Verify that wx-config is in your path. Modify your PATH environment variable
if need be so you can run wx-config from a command prompt. You may have to
restart your msys shell, depending on how you modify your PATH.
If on linux, use your package manager to install shared object libraries and the If on linux, you can use your package manager to install the
development versions of the wxWidgets packages which include the C++ headers. An development versions of the wxWidgets packages which include the C++ headers. An
alternative is to build static libaries from source. Verify that wx-config is in alternative is to build static libaries from source. Verify that wx-config is in
your path by running it from a command prompt. Linux users then go to next step. your path by running it from a command prompt. Linux users then go to next step.
...@@ -100,11 +93,24 @@ command prompt. ...@@ -100,11 +93,24 @@ command prompt.
Obtain Sources Obtain Sources
-------------- --------------
You can use the Launchpad repository or a tar file for this. See the wiki. You can use the Launchpad repository or a tar file for this. See the wiki.
To download files from Launchpad repository, you should install bazaar (bzr) that is a
version control system like subversion, mercurial, git...
Launchpad repository handle 2 branches: Launchpad repository handle 2 branches for KiCda sources:
- a testing branch (used by developers) - a testing branch (used by developers)
- a stable branch (a copy of the testing branch, when this testing branch is near a stable state)) - a stable branch (a copy of the testing branch, when this testing branch is near a stable state))
Testing branch:
bzr branch lp:kicad kicad_testing
Stable branch:
bzr branch lp:kicad/stable kicad_stable
Components and Footprints libraries
bzr branch lp:~kicad-lib-committers/kicad/library kicad_libraries
Documentation and translations:
bzr branch lp:~kicad-developers/kicad/doc kicad_doc
Create Makefiles with CMake Create Makefiles with CMake
--------------------------- ---------------------------
...@@ -112,14 +118,14 @@ If windows, go into your msys shell. Linux and windows users both then make ...@@ -112,14 +118,14 @@ If windows, go into your msys shell. Linux and windows users both then make
two "out of source" build directories: two "out of source" build directories:
cd <kicadSource> cd <kicadSource>
mkdir -p build/release mkdir -p build/release
mkdir build/debug mkdir build/debug (if you want a debug version of KiCad)
cd build/release cd build/release
On either cmake command line shown below, you can optionally include On either cmake command line shown below, you can optionally include
-DCMAKE_INSTALL_PREFIX=<finallInstallDir> -DCMAKE_INSTALL_PREFIX=<finallInstallDir>
If windows, run the following command: If windows, run the following command:
cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release -DwxWidgets_ROOT_DIR=<wxInstallDir> ../../ cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release -DKICAD_TESTING_VERSION=ON -DwxWidgets_ROOT_DIR=<wxInstallDir> ../../
If linux, run instead the following command: If linux, run instead the following command:
cmake -DCMAKE_BUILD_TYPE=Release ../../ cmake -DCMAKE_BUILD_TYPE=Release ../../
...@@ -152,7 +158,8 @@ Although normally you do not install the Debug binaries, you can debug them ...@@ -152,7 +158,8 @@ Although normally you do not install the Debug binaries, you can debug them
where they were built. where they were built.
If windows, run the following command: If windows, run the following command:
cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Debug -DwxWidgets_USE_DEBUG=ON -DwxWidgets_ROOT_DIR=<wxInstallDir> ../../ cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Debug -DKICAD_TESTING_VERSION=ON -DwxWidgets_ROOT_DIR=<wxInstallDir> ../../
where <wxInstallDir> is <wxWidgets path>/Release
If linux, run instead the following command: If linux, run instead the following command:
cmake -DCMAKE_BUILD_TYPE=Debug -DwxWidgets_USE_DEBUG=ON ../../ cmake -DCMAKE_BUILD_TYPE=Debug -DwxWidgets_USE_DEBUG=ON ../../
...@@ -178,9 +185,6 @@ One of these 2 option *must* be set to ON: ...@@ -178,9 +185,6 @@ One of these 2 option *must* be set to ON:
CMAKE_BUILD_TYPE Release/Debug (REQUIRED) CMAKE_BUILD_TYPE Release/Debug (REQUIRED)
Choose build type: Release/Debug. Choose build type: Release/Debug.
wxWidgets_USE_DEBUG ON/OFF (REQUIRED)
Should be set to ON only when CMAKE_BUILD_TYPE=Debug.
wxWidgets_USE_STATIC ON/OFF (OPTIONAL) wxWidgets_USE_STATIC ON/OFF (OPTIONAL)
CMAKE_VERBOSE_MAKEFILE ON/OFF (OPTIONAL) CMAKE_VERBOSE_MAKEFILE ON/OFF (OPTIONAL)
......
Compiling KiCad on Debian & Ubuntu
==================================
First written: 10-Mar-2009
Updated: 31-Oct-2009
Lasted edited by: Jerry Jacobs <xor.gate.engineering@gmail.com>
This file is AsciiDoc formatted to you can convert it to pdf/xhtml/xml
Ubuntu 9.10 (Karmic Koala)
--------------------------
After a fresh install you need the following packages to compile and run
KiCad from source.
Boost - Collection of portable C++ source libraries
CMake - Cross-platform make
Doxygen - Documentation system for several programming languages
GLUT - The OpenGL Utility Library
wxGTK - The wxWidgets GUI toolkit with GTK+ bindings
zlib - General purpose data compression library
Because boost is in the repository of kicad you don't need to install them.
Install these with aptitude:
----
sudo aptitude install build-essential cmake doxygen subversion libglut3 libglut3-dev libwxgtk libwxgtk-dev zlib1g zlib1g-dev
----
Checkout the source
----
svn checkout https://kicad.svn.sourceforge.net/svnroot/kicad/trunk/kicad kicad
----
Generate makefiles
----
cd /home/<you>/<kicad-src-dir>
cmake .
----
Compile
----
make
----
*Note* on multicore systems you can do parallel make jobs to speed
up compiling by giving the option -j {JOBS} to make.
Ubuntu 9.04
-----------
Special thanks to David J S Briscoe <david@djsbriscoe.vispa.com>
The first thing I did was follow this page up to the running kicad section
http://basicubuntu.blogspot.com/2009/02/installing-kicad-on-ubuntu.html
This resulted in the error message detailed in this post
http://tech.groups.yahoo.com/group/kicad-devel/message/3180
SNIPPET
The build fails with the following message
----------------------------------------------------------:
david@ubuntu:~/Desktop/KICAD_SVN$ fakeroot debian/rules binary
test -d debian/patched || install -d debian/patched
dpatch apply-all
dpatch cat-all >>patch-stampT
mv -f patch-stampT patch-stamp
mkdir -p /home/david/Desktop/KICAD_SVN/build/kicad
mkdir -p /home/david/Desktop/KICAD_SVN/build/bitmaps
cd /home/david/Desktop/KICAD_SVN/build/kicad && cmake \
-DKICAD_DEMOS=/home/david/Desktop/KICAD_SVN/debian/kicad-common/usr/share/doc/ki\
cad/demos ../../kicad \
-DXPM_CPP_PATH=/home/david/Desktop/KICAD_SVN/build/bitmaps
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so
-- Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/lib/libX11.so
-- Check for installed OpenGL -- found
-- Check for installed Boost -- not found
CMake Error at CMakeModules/CheckFindPackageResult.cmake:6 (message):
Boost was not found - it is required to build Kicad
Call Stack (most recent call first):
CMakeLists.txt:111 (check_find_package_result)
-- Configuring incomplete, errors occurred!
make: *** [configure-stamp] Error 1
david@ubuntu:~/Desktop/KICAD_SVN$
-----------------------------------------------------------------:
SNIPPET
The next step was to remove any libboost 1.34 libraries using the apt-get
remove command (can't remember the exact commands I used) as the Ubuntu 9.04
(Jaunty) repositories only had the 1.34 version available.
After this I installed the boost 1.37 libraries
using this command
---------------------------------------
sudo apt-get install libboost1.37-dev
---------------------------------------
This pulled down all the required files and dependencies (as far as I
know-how do I check this?)
I then entered the following command
---------------------------------------
fakeroot debian/rules binary
---------------------------------------
and everything was built properly (I saw a few warnings flash past-will
these be logged anywhere?)
I was left with a bunch of debian packaged files. I installed the main one,
the common one and an English language documentation one (I can supply more
details if needed later as I am not using Ubuntu at the moment).
The first link above describes moving the libraries and other files into the
same place as the compiled executables. I didn't do this, so I have a
duplicate installation.
The above method needs some fine tuning and improvements. If you can let me
know of a tidier way of compiling Kicad please let me know.
Maybe there is a way of automating things with scripts, my Linux knowledge
doesn't go that far, yet.
Ubuntu (8.04)
-------------
Original from:
http://basicubuntu.blogspot.com/2009/02/installing-kicad-on-ubuntu.html
Required software and dependencies
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We need to install the following packages: debhelper, dpatch, libx11-dev,
libglu1-mesa-dev, libgl1-mesa-dev, mesa-common-dev, libwxbase2.8-dev,
libwxgtk2.8-dev, libboost-dev, subversion, cmake (>= 2.6.0).
---------------------------------------
sudo apt-get install debhelper dpatch libx11-dev libglu1-mesa-dev
libgl1-mesa-dev mesa-common-dev libwxbase2.8-dev libwxgtk2.8-dev
libboost-dev fakeroot subversion libboost-serialization-dev
---------------------------------------
And finally, we need cmake, but we need atleast version 2.6, the one
from the repository is not the updated one (atleast for ubuntu 8.04).
You can download version 2.6 from newer ubuntu releases.
Just search for cmake on http://packages.ubuntu.com then get a newer
cmake .deb file and install the downloaded package on the console
with:
---------------------------------------
sudo dpkg -i <packagename.deb>
---------------------------------------
But if what the repository gives you is atleast version 2.6, then
simply
---------------------------------------
sudo apt-get install cmake
---------------------------------------
Get KiCad Sourcecode
~~~~~~~~~~~~~~~~~~~~
We will be getting the source codes through subversion. Create a directory
where you'll be downloading the source codes, and go to that
directory. type the following:
---------------------------------------
svn checkout https://kicad.svn.sourceforge.net/svnroot/kicad/trunk/kicad kicad
svn checkout https://kicad.svn.sourceforge.net/svnroot/kicad/trunk/kicad-doc kicad-doc
svn checkout https://kicad.svn.sourceforge.net/svnroot/kicad/trunk/kicad-library kicad-library
---------------------------------------
Also we need the following to get the debian specific stuff
---------------------------------------
svn checkout http://svn.flexserv.de/kicad/trunk/debian
---------------------------------------
Compiling
~~~~~~~~~
To compile simply do the following on your terminal (make sure you're still in
the same directory where you did the svn)
---------------------------------------
fakeroot debian/rules binary
---------------------------------------
hopefully, there will be no errors.
You'll find the compiled version of KiCad in the following directory:
---------------------------------------
debian/kicad/usr/bin/
---------------------------------------
to complete things up, you'll need to copy the following folders
---------------------------------------
debian/kicad-common/usr/share/kicad/library
debian/kicad-common/usr/share/kicad/modules
debian/kicad-common/usr/share/kicad/template
---------------------------------------
in here
---------------------------------------
debian/kicad/usr/share
---------------------------------------
again, to run KiCad go to
---------------------------------------
cd debian/kicad/usr/bin/
---------------------------------------
and double click KiCad
Debian squeeze (testing)
------------------------
Special Note
~~~~~~~~~~~~
After SVN trunk revision 1753 boost library 1.36 or higher is needed
to compile KiCad.
Installing Packages
~~~~~~~~~~~~~~~~~~~
The following packages should be installed with
synaptic, apt-get or aptitude:
- build-essential
- cmake
- libboost-dev
- libwxgtk2.8-dev
- libglut3-dev
The following packages will also be installed then
- cmake dependencies
- boost development dependencies
- wxwidgets development dependencies
- opengl3 (glut) development dependencies
Get KiCad sourcecode
~~~~~~~~~~~~~~~~~~~~
Checkout sourcecode using subversion or download latest release.
.*Subversion*
---------------------------------------
svn checkout https://kicad.svn.sourceforge.net/svnroot/kicad/trunk/kicad kicad
---------------------------------------
.*Release*
---------------------------------------
wget http://iut-tice.ujf-grenoble.fr/cao/kicad-sources-2009-02-16.tar.gz
tar -xvf kicad-sources-2009-02-16.tar.gz
---------------------------------------
Compiling
~~~~~~~~~
Run 'cmake .' in the root of the source directory then build the
binaries with 'make'.
Installing
~~~~~~~~~~
For installing you could use 'make install' or build a debian package.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment