https://wiki.inkscape.org/wiki/api.php?action=feedcontributions&user=Sombriks&feedformat=atomInkscape Wiki - User contributions [en]2024-03-29T13:52:31ZUser contributionsMediaWiki 1.36.1https://wiki.inkscape.org/wiki/index.php?title=Compiling_Inkscape&diff=38674Compiling Inkscape2008-11-14T00:08:44Z<p>Sombriks: /* Getting and Installing Source packages */</p>
<hr />
<div>Hopefully, Inkscape will compile right out of the box. If it doesn't, well that's what this page is for.<br />
<br />
Jot down notes, questions, findings, tips, etc. here on things you run into. It's a good idea to<br />
make mention of what version of the code you're trying to compile, the distribution you're running,<br />
and other such information that might be pertinent.<br />
<br />
If legitimate bugs are found or patches developed, please move them to the tracker at Sourceforge<br />
rather than inlining them here. <br />
<br />
= Notes =<br />
Inkscape needs automake1.7 or automake1.8 to compile NOT automake1.9 it has a bug ( link: http://sourceforge.net/mailarchive/message.php?msg_id=10288631 ) that prevents compiling of Inkscape. If you have already tried to do a $ make with automake1.9 then $ ./autogen.sh from your inkscape-cvs dir and proceed as normal.<br />
(On the other hand, I've repeatedly built it with automake-1.9.4. ralf)<br />
<br />
You may want to also [http://wiki.inkscape.org/wiki/index.php/OtherProjects#Inkscape_Plugins.2C_Scripts.2C_and_Templates add plugins] during or after compiling.<br />
<br />
= OS &amp; Distribution Specific =<br />
* '''Linux'''<br />
** [[CompilingAutopackage|Autopackage]] (multi-distro)<br />
** [[CompilingFedora|Fedora]]<br />
** [[CompilingGentoo|Gentoo]]<br />
** [[CompilingDebian|Debian]]<br />
** [[CompilingUbuntu|Ubuntu]]<br />
** [[CompilingYellowDog|Yellow Dog]]<br />
** [[CompilingSuse|Suse]]<br />
** [[CompilingSlackware|Slackware]]<br />
** [[CompilingYoper|Yoper]]<br />
** [[CompilingMandrake|Mandrakelinux]]<br />
* [[CompilingMacOsX|Mac OS X]]<br />
* [[Win32Port|Windows]]<br />
* [[CompilingSPARC|SPARC]]<br />
* [[CompilingSunSolaris|Sun Solaris]]<br />
* [[CompilingStatic|Static Compiles]]<br />
<br />
= Package Config (pkg-config) =<br />
<br />
If you must compile and install any of these from source, you may find an error like this when trying to<br />
compile them or Inkscape itself:<br />
<br />
checking for gtk+-2.0 >= 2.0.0 libxml-2.0 >= 2-2.4.24 sigc++-1.2 gtkmm-2.0... Package gtkmm-2.0 was not found in the pkg-config search path.<br />
Perhaps you should add the directory containing `gtkmm-2.0.pc'<br />
to the PKG_CONFIG_PATH environment variable<br />
No package 'gtkmm-2.0' found<br />
<br />
A solution is to set the PKG_CONFIG_PATH variable as so:<br />
<br />
for bash:<br />
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig<br />
for csh:<br />
setenv PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/usr/lib/pkgconfig<br />
<br />
A good place to put this line is in your .bashrc or .cshrc file<br />
<br />
= Getting and Installing Source packages =<br />
<br />
If your distro does not have some packages available (like many don't, ie, Fedora Core 2), you must often download<br />
source packages and build and install them yourself. Actually this is not that hard, and is similar to<br />
doing a Gentoo 'emerge.'<br />
<br />
* Usually you download a file with a name like somepackage-1.0.tar.gz. Unpack it with<br />
<br />
$ tar zxf somepackage-1.0.tar.gz<br />
or<br />
$ tar jxf somepackage-1.0.tar.bz2<br />
<br />
* Then 'cd' into the new directory.<br />
<br />
* Configure it with the command:<br />
<br />
$ ./configure<br />
<br />
* Build it with:<br />
<br />
$ make<br />
<br />
* As the 'root' user, install it with:<br />
<br />
# make install<br />
<br />
== Boehm-GC ==<br />
<br />
Source: http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source<br />
<br />
* Download this file:<br />
** http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc6.7.tar.gz<br />
* Unpack it<br />
** tar zxf gc6.7.tar.gz<br />
* Configure and build it<br />
** cd gc6.7<br />
** ./configure --disable-shared --enable-static<br />
** make<br />
* Install it<br />
** su (or however else you become root)<br />
** make install<br />
<br />
Binaries: If searching for a package for GC, the name of it is sometimes:<br />
<br />
* gc<br />
* libgc<br />
* gc-devel<br />
* libgc-devel<br />
* boehm-gc (on Gentoo)<br />
* debian/ubuntu: sudo apt-get install libgc-dev<br />
<br />
== libSigc++ ==<br />
<br />
Source: http://ftp.gnome.org/pub/GNOME/sources/libsigc++/2.0/<br />
<br />
With this file, and for [[GlibMM]] and [[GtkMM]] below, it is usually desirable for us developers to<br />
build this C++ library statically. This removes a dependency that might be difficult for an<br />
end-user during installation. Configure it with:<br />
<br />
./configure --enable-static --disable-shared<br />
<br />
== [[GlibMM]] ==<br />
<br />
Source: http://ftp.gnome.org/pub/GNOME/sources/glibmm/2.8/<br />
<br />
== [[GtkMM]] ==<br />
<br />
Source: http://ftp.gnome.org/pub/GNOME/sources/gtkmm/2.8/<br />
<br />
== caiormm ==<br />
<br />
if you got prompted about cairomm, try first solve your cairo version, so you can grab [http://www.cairographics.org/releases/ there] a compatible version.<br />
<br />
<br />
== Boost ==<br />
<br />
Many users have reported when building from source that after installing the above dependencies, the configure script still requires a "boost" package. It can be found below, but even after installing, you will need to create a symlink to allow the configure script to find it:<br />
<br />
'''ln -s /usr/local/include/boost_1_xx_x/boost /usr/local/include/boost'''<br />
<br />
Source: http://www.boost.org/users/download/<br />
<br />
= Developer Compilation =<br />
<br />
Plain vanilla compilation is done as documented in INSTALL; ./autogen.sh (optionally); ./configure; make; su && make test; make install (optional). See INSTALL for more on that.<br />
<br />
But if you're going to be doing a lot of development, there's some tricks and techniques you should know,<br />
to get best results.<br />
<br />
# Turn off optimization<br />
# Use ccache for faster compilation<br />
# Set up a separate build directory (nice for testing both gcc and g++, or cross compiling)<br />
# Use the -j N flag to optimize for the number of processors in your machine, with N = 1 + no. proc's<br />
<br />
Example: Setting up both gcc and g++ build environments (in separate tree), and using ccache for faster<br />
compilations on a dual-processor machine, with no optimization, assuming /bin/bash:<br />
<br />
mkdir build-gcc build-g++<br />
cvs checkout inkscape<br />
cd inkscape<br />
libtoolize --copy --force<br />
./autogen.sh<br />
cd ../build-gcc<br />
CFLAGS='-g -O0 -Wall' CC='ccache gcc' ../inkscape/configure<br />
cd ../build-g++<br />
CXXFLAGS='-g -O0 -Wall' CXX='ccache g++' ../inkscape/configure<br />
cd ../build-gcc && make -j 3<br />
cd ../build-g++ && make -j 3<br />
<br />
<br />
Turning off just optimization (which can produce strange results in debuggers):<br />
<br />
export CXXFLAGS='-g -O0 -Wall'<br />
export CFLAGS='-g -O0 -Wall'<br />
./configure<br />
<br />
See [[TestingInkscape]] for information on building and executing (unit) tests.<br />
<br />
[[Category:Developer Documentation]]</div>Sombriks