Difference between revisions of "Dev:Build Instructions"

From Synfig Studio :: Documentation
Jump to: navigation, search
(updated forum link)
(Link to new build instructions)
 
Line 4: Line 4:
 
<!-- Page info end -->
 
<!-- Page info end -->
  
Some information may be outdated, please have a look in the forums at the [https://forums.synfig.org/c/development/building-synfig build thread] to get fresh data...
+
See https://synfig-docs-dev.readthedocs.io/en/latest/common/building.html
 
+
== Scripts provided with the source code ==
+
 
+
Within the source code we provide two automatic package scripts. They are used to generate the library independent packages for Linux or Mac OSX. Since the scripts ship all the needed libraries in a single package the size of the packages are higher compared to the typical deb or rpm package. That's not the case for dmg package for OSX because in general they bundle all needed libraries in the dmg image.
+
 
+
You can find those scripts under the ''autobuild'' folder from the source code. There are usage instruction inside each script allowing resuming builds (reusing the current downloaded libraries) and specific options to just compile and build the binaries without package them.
+
 
+
Note that <u>for Fedora 24 (at least), you must define a password for root user</u> in order to run ''synfigstudio-linux-build.sh'', otherwise su authentication failure will occur.
+
If needed add it with ''sudo su -'' then ''passwd''
+
 
+
===Staged boost library===
+
To use the autobuild scripts with a staged boost library, you will need to define environment variables:
+
  $ export BOOST_ROOT=/my/boost/path
+
  $ export CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:$BOOST_ROOT/include"
+
  $ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$BOOST_ROOT/lib"
+
 
+
===Debug build===
+
Consider, that you can run in the following way to enable debug:
+
  $ DEBUG=1 ./synfigstudio-linux-build.sh
+
 
+
In this case you can combine debug with other modes:
+
  $ DEBUG=1 ./synfigstudio-linux-build.sh quick # just invokes "make install" for every component
+
  $ DEBUG=1 ./synfigstudio-linux-build.sh synfig # builds synfig-core only
+
  $ DEBUG=1 ./synfigstudio-linux-build.sh synfigstudio # builds synfig-studio only
+
 
+
== Notes ==
+
 
+
* If you are using the released versions instead of GIT, none of the libtoolize or autoreconf steps are necessary. For released versions, "./configure && make && sudo make install" should be enough.
+
 
+
* If you are using packages for synfig's dependencies, you want the '''development packages''' not the main packages. Check below for your distribution's packages.
+
 
+
* Please read the {{l|Dev:Source code|source code}} page to check out the latest code. Please also check the {{l|Download|download page}} and the {{l|FAQ}} to find out about any issues that you may run into along the way.
+
 
+
* Some Linux/BSD distros (Like Gentoo Linux) have a pkg-config that doesn't look in /usr/local/lib/pkgconfig by default. So if you are installing in anywhere other than the system pkg-config path, please run "export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig" or similar before building or installing anything.
+
 
+
* Don't use automake 1.4, there are problems with it.
+
 
+
* Using automake 1.9, 'make install' seems to re-link and re-install all the synfig core modules every time whether they have changed or not. If you intend to build code repetitively you can export export CXX="/usr/bin/ccache /usr/bin/g++". This allows to not rebuild the already build modules so they taken from the cache.
+
 
+
* After you obtain the source code using the git repository, you obtain a single 'synfig' folder where the three main modules (etl, synfig-core and synfig-studio) are up to date. '''The trunk folder has been removed in the git tree'''. Please modify the build instructions for other platforms.
+
 
+
* If you want to test a particular branch of the repository do the following:
+
<pre>
+
~/synfig$ git branch -r
+
</pre>
+
You'll obtain a list of the remote branches that exists in the repo. For example:
+
<pre>
+
  origin/HEAD
+
  origin/genete_bones
+
  origin/genete_canvasview
+
  origin/genete_master
+
  origin/genete_onionskin
+
  origin/genete_scale_reverse
+
  origin/genete_setup_dialog
+
  origin/genete_svg
+
  origin/gerco_opengl
+
  origin/master
+
  origin/uiomae_opengl
+
  origin/zelgadis_cia
+
  origin/zelgadis_master
+
</pre>
+
 
+
Then to properly checkout a remote branch you have to create a local branch to track a particular remote branch and checkout it. For example:
+
<pre>
+
~/synfig$ git branch --track test_canvas origin/genete_canvasview
+
~/synfig$ git checkout test_canvas
+
</pre>
+
 
+
Your code is ready to be built on that branch.
+
 
+
* The CVS requirement is only because the autopoint program run by autoreconf needs CVS. You can avoid the need for CVS by disabling the translation/gettext stuff in configure.ac.
+
 
+
* If you don't want to install to a system-wide directory using sudo, run something like these commands before starting:
+
 
+
<pre>
+
prefix=$(pwd)/install
+
export PKG_CONFIG_PATH="$prefix/lib/pkgconfig"
+
export PATH=$(pwd)/synfig-core/src/tool/.libs:$PATH
+
export CXX="/usr/bin/ccache /usr/bin/g++"
+
</pre>
+
 
+
** export PKG_CONFIG_PATH="$prefix/lib/pkgconfig" allows to find the linking libraries.
+
** export PATH=$(pwd)/synfig-core/src/tool/.libs:$PATH allows synfigstudio find the correct * libraries to render the icons for the toolbox etc.
+
** export CXX="/usr/bin/ccache /usr/bin/g++" allows to use the cache to avoid rebuilding.
+
 
+
And when you run ./configure, run it with <pre>--prefix $prefix</pre> and don't use sudo when you do make install.
+
 
+
* See the automatic building script attached.
+
 
+
== System-specific instructions ==
+
Please update them including the new GIT repo.
+
 
+
* Gentoo: {{l|Dev:Gentoo Ebuilds|ebuilds}} are available for both release versions and GIT
+
* MacOS X: {{l|Dev:Building_On_Mac_OS_X|instructions for building}} with the GTK+ Aqua port are available.
+
* PCLinuxOS: {{l|Dev:PCLinuxOS build instructions|build instructions}}
+
* Windows: {{l|Dev:Building on Windows|instructions for building}} with {{l|Dev:Mingw_installation|mingw}} in {{l|Dev:MSYS2_Build|MSYS2}} are available.
+
 
+
==System wide build Instructions==
+
 
+
=== ETL ===
+
 
+
ETL is a template library, there is nothing to build really, it just needs to be installed.
+
 
+
'''Requires''': autoconf automake<br>
+
* Debian: build-essential autoconf automake libtool
+
* OS X:  already included with Mac OS X
+
 
+
''Type the following commands at the directory where you cloned the git repo''
+
<pre>
+
$ cd synfig/ETL
+
$ autoreconf --install --force
+
$ ./configure
+
$ sudo make install
+
</pre>
+
 
+
=== synfig-core ===
+
 
+
'''Requires''': ETL (etl-dev, already installed if you successfully built etl), libxml++, libsigc++, libltdl, libtool, gettext, autopoint (part of gettext-dev), cvs, boost-program-options<br>
+
* Debian: etl-dev libxml++2.6-dev libsigc++-2.0-dev libltdl3-dev libtool gettext cvs autopoint
+
* Fedora: ETL-devel libxml++-devel libsigc++20-devel libtool-ltdl-devel libtool gettext-devel cvs
+
* Gentoo: dev-cpp/ETL dev-cpp/libxmlpp dev-libs/libsigc++ dev-util/cvs
+
** If you are using ./configure --prefix="$PREFIX" to configure synfig, do not install dev-cpp/ETL.
+
*OS X use glibtoolize instead of libtoolize, as Apple renamed it.
+
 
+
'''Note''': libpng isn't required to build synfig, but if you build synfig without PNG support and go on to build synfigstudio, that step will fail (because the build process for synfigstudio uses synfig to create .png icon files).  The package is  libpng12-dev on Debian or media-libs/libpng on Gentoo.
+
 
+
'''Note''': the 'configure.ac' file in the synfig-core directory doesn't work with libtool version 2, as shipped with ubuntu 8.10.  To work around the problem until a proper fix is found, comment out line 622 or thereabouts (it says "AC_CONFIG_SUBDIRS(libltdl)") by putting a "#" at the front of the line.  The line is required for older versions of libtool, as shipped with other distributions. DO it straight with this command:
+
<pre> sed -i 's/^AC_CONFIG_SUBDIRS/# AC_CONFIG_SUBDIRS/' synfig-core/configure.ac </pre>
+
 
+
'''Optional''': libpng, libmng, libjpeg, libfreetype, libfontconfig, libopenexr, libavcodec, libmagick++, vimage (MacOS only, proprietary)<br>
+
* Debian: libpng12-dev libmng-dev libjpeg62-dev libfreetype6-dev libfontconfig1-dev libopenexr-dev libavcodec-dev libavformat-dev libswscale-dev libmagick++9-dev
+
* Gentoo: sys-devel/libtool media-libs/libpng media-libs/libmng media-libs/jpeg media-libs/freetype media-libs/fontconfig media-libs/openexr media-libs/tiff
+
*Ubuntu (since Jaunty): Same libraries as Debian but do not use libmagick++9-dev, use graphicsmagick-libmagick-dev-compat instead.
+
 
+
'''Runtime''': encodedv (from libdv), ffmpeg, convert (from imagemagick)
+
* Debian: libdv-bin ffmpeg imagemagick
+
* Gentoo: media-libs/libdv media-video/ffmpeg media-gfx/imagemagick
+
 
+
''Type the following commands at the directory where you cloned the git repo''
+
<pre>
+
$ cd synfig/synfig-core
+
$ ./bootstrap.sh
+
$ ./configure
+
$ make
+
$ sudo make install
+
</pre>
+
 
+
''Note'':
+
 
+
* Don't use --enable-half, it is slow.
+
* If ETL was installed in a non-standard directory using --prefix=<location>, it suffices to run the configure script with an updated PKG_CONFIG_PATH environment variable. E.g.:<br>PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/my/install/prefix/lib/pkgconfig ./configure --prefix=/my/install/prefix
+
 
+
=== synfig-studio ===
+
 
+
''Requires'': ETL (etl-dev, already installed if you successfully built etl), synfig (libsynfig-dev, already installed if you successfully built synfig-core), gtkmm >= 2.4, gtk >= 2.0, glibmm, libsigc++, libltdl, libtool, gettext, cvs, intltool, libboost >= 1.53, libcairo >= 1.12<br>
+
* Debian: etl-dev libsynfig-dev libgtkmm-2.4-dev libgtk2.0-dev libglibmm-2.4-dev libsigc++-2.0-dev libltdl3-dev libtool gettext cvs
+
* Gentoo: virtual/ETL virtual/synfig dev-cpp/gtkmm-2.4 dev-libs/libsigc++ sys-devel/libtool
+
** If you are using ./configure --prefix="$PREFIX" to configure synfigstudio, do not install virtual/ETL or virtual/synfig.
+
''Optional'': fonts (for the images), [http://www.fmod.org FMOD] (version 3.x, proprietary)
+
* Debian: ttf-freefont ttf-dejavu ttf-dustin
+
* Gentoo: freefonts dejavu
+
 
+
''Type the following commands at the directory where you cloned the git repo''
+
<pre>
+
$ cd synfig/synfig-studio
+
$ ./bootstrap.sh
+
$ ./configure
+
$ make
+
$ sudo make install
+
</pre>
+
 
+
<!--
+
 
+
== synfig-docs ==
+
 
+
(This step isn't required to run synfig or synfigstudio, and the documents it gets you are really quite out of date)
+
 
+
This is basically a copy of what is on this wiki.
+
 
+
Requires: sgml processor, ldp docbook stylesheets, db2ps, db2pdf
+
* Debian: openjade ldp-docbook-dsssl docbook-utils
+
 
+
<pre>
+
make multiple-html
+
make ps
+
make pdf
+
</pre>
+
 
+
-->
+
 
+
== finalizing ==
+
 
+
Depending on where you installed synfig to, you might have to tell your system where the libraries can be found.  That can be done via the following command:
+
 
+
<pre>
+
$ sudo ldconfig
+
</pre>
+
 
+
 
+
== Build script examples ==
+
 
+
If you want to build a binary for testing or debugging proposes you can run one of the following scripts:
+
 
+
The binaries are installed at $(pwd)/install/bin. Alter the script according to your preferences.
+
 
+
Your system must satisfy synfig's build requirements, the script won't do it for you. Also be sure what git branch are you building each time. In some cases you'll need to make clean on each folder first.
+
 
+
Be sure that '''you have ccache installed''' on your system because you will get errors otherwise.
+
 
+
=== Linux ===
+
<pre>
+
#!/bin/sh
+
CPUS=4
+
prefix=$(pwd)/install
+
export PKG_CONFIG_PATH="$prefix/lib/pkgconfig"
+
export PATH=$(pwd)/synfig-core/src/tool/.libs:$PATH
+
export CXX="/usr/bin/ccache /usr/bin/g++"
+
# Uncomment this line if you want to use ccache
+
# export CXX="/usr/bin/ccache g++-snapshot"
+
 
+
cd ETL &&
+
autoreconf --install --force &&
+
./configure --prefix $prefix &&
+
make --debug=b install &&
+
\
+
cd ../synfig-core &&
+
./bootstrap.sh                  &&
+
./configure --prefix $prefix --enable-optimization=0 --enable-debug &&
+
make --debug=b -j $CPUS install         &&
+
      \
+
cd ../synfig-studio &&
+
./bootstrap.sh &&
+
./configure --prefix $prefix --enable-optimization=0 --enable-debug &&
+
make --debug=b -j $CPUS install
+
</pre>
+
 
+
With libboost no standard installation to /personal/boost/install/path/ :
+
 
+
<pre>
+
#!/bin/sh
+
#move to synfig folder (to get the script out from git)
+
cd synfig
+
CPUS=2
+
prefix=$(pwd)/install
+
export PKG_CONFIG_PATH="$prefix/lib/pkgconfig"
+
export PATH=$(pwd)/synfig-core/src/tool/.libs:$PATH
+
export CXX="/usr/bin/ccache /usr/bin/g++"
+
 
+
cd ETL &&
+
autoreconf --install --force &&
+
./configure --prefix $prefix &&
+
make install &&
+
\
+
cd ../synfig-core &&
+
./bootstrap.sh                  &&
+
./configure --with-boost=/personal/boost/install/path/boost_1_55_0 --enable-optimization=0 --prefix $prefix --enable-debug &&
+
make -j $CPUS install &&
+
\
+
cd ../synfig-studio &&
+
autoreconf --install --force &&
+
intltoolize --force --copy &&
+
./configure --enable-optimization=0 --prefix $prefix --enable-debug &&
+
make -j $CPUS install
+
</pre>
+
 
+
=== Mac OSX ===
+
<pre>
+
#!/bin/sh
+
CPUS=4
+
prefix=$(pwd)/install
+
export PKG_CONFIG_PATH="$prefix/lib/pkgconfig"
+
export ACLOCAL_FLAGS="-I $prefix/share/aclocal"
+
export PATH=$(pwd)/synfig-core/src/tool/.libs:$PATH
+
# Uncomment those line if you want to use g++ instead of the native clang
+
# compiler and preprocessor
+
#export CXX="/opt/local/bin/ccache /usr/bin/g++"
+
#export CPP="/usr/bin/cpp"
+
export CPPFLAGS="-I/opt/local/include"
+
export LDFLAGS="-L/opt/local/lib"
+
 
+
cd ETL &&
+
autoreconf --install --force &&
+
./configure --prefix $prefix &&
+
make --debug=b install &&
+
\
+
cd ../synfig-core &&
+
./bootstrap.sh                  &&
+
./configure --prefix $prefix --enable-optimization=0 --enable-debug &&
+
make --debug=b -j $CPUS install         &&
+
      \
+
cd ../synfig-studio &&
+
./bootstrap.sh &&
+
./configure --prefix $prefix --enable-optimization=0 --enable-debug &&
+
make --debug=b -j $CPUS install
+
</pre>
+

Latest revision as of 11:34, 12 February 2019

See https://synfig-docs-dev.readthedocs.io/en/latest/common/building.html