Compilation of ABIC under Linux
Unfortunately, to compile ABIC under Linux is a bit more complicated than it should be, because:
- It depends on the newest versions of some of the libraries (wxWidgets, GraphicsMagick, OpenJPEG, WebP, LCMS2)
- Since I put two coders from GraphicsMagick into my source code, there are some files that need to be copied from the GraphicsMagick source directory (the *dev-package is not sufficient) to the installation directory.
That's why, in order to build ABIC, you must first compile wxWidgets, WebP, LCMS2, OpenJPEG and GraphicsMagick and then link the resulting libraries statically to ABIC.
At the time of writing, these were the up-to-date versions of the libraries:
- wxWidgets 3.0.0 (should also compile against 2.9.x)
- WebP 0.4.0
- OpenJPEG 2.1.0
- GraphicsMagick 1.3.19
- LCMS 2.6
Compiling these libraries is straight forward. Please make sure that you
- Build static libraries
- Install to a local directory, not /include or /usr/include
For example, the configure options for GraphicsMagick are similar to this:
./configure --prefix=/path/to/install --with-quantum-depth=16 --without-modules --disable-shared --disable-openmp CPPFLAGS=-I/path/to/lcms/install/include LDFLAGS=-L/path/to/lcms/install/lib
.
For the full functionality of WebP, you need an updated webp.c, which is not part of GraphicsMagick 1.3.19. Either get webp.c from the trunk (see GraphicsMagick homepage), or use a newer version of GraphicsMagick if there is one.
After compiling and installing, you need to copy the following files from the source directory of GraphicsMagick to the installation directory: studio.h, static.h, locale_c.h, unix_port.h
The final build script for ABIC looks similar to this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40 | #!/bin/bash
export LIBSDIR=/your/path/to/install
# wxWidgets
export wxWidgets_ROOT_DIR=$LIBSDIR
export wxWidgets_CONFIG_EXECUTABLE=$wxWidgets_ROOT_DIR/bin/wx-config
# OpenJPEG
export OPENJPEG_ROOT=$LIBSDIR
export OPENJPEG_NAMES=libopenjp2.a
export OPENJPEG_INCLUDE_DIR=$LIBSDIR/include/openjpeg-2.1
# WebP
export PC_WEBP_INCLUDE_DIRS=$LIBSDIR/include
export PC_WEBP_LIBRARY_DIRS=$LIBSDIR/lib
export WEBP_LIBRARY=$LIBSDIR/lib/libwebp.a
# LittleCMS
export PC_LCMS2_INCLUDEDIR=$LIBSDIR/include
export PC_LCMS2_LIBDIR=$LIBSDIR/lib
export LCMS2_LIBRARIES=$LIBSDIR/lib/liblcms2.a
export LCMS2_LIBRARY=$LIBSDIR/lib/liblcms2.a
# ImageMagick
export ImageMagick_ROOT=$LIBSDIR
export ImageMagick_INCLUDE_DIRS=$ImageMagick_ROOT/include/GraphicsMagick
export ImageMagick_MagickPP_LIBRARY=$ImageMagick_ROOT/lib/libGraphicsMagick++.a
export ImageMagick_MagickWand_LIBRARY=$ImageMagick_ROOT/lib/libGraphicsMagickWand.a
export ImageMagick_MagickCore_LIBRARY=$ImageMagick_ROOT/lib/libGraphicsMagick.a
export ABIC_ADDITIONAL_LINK_LIBRARIES="-lbz2 -lxml2 -lwmflite -lfreetype -llcms"
mkdir build
cd build
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_VERBOSE_MAKEFILE=FALSE -DABIC_REMOVE_ADDITIONAL_LIBRARIES=FALSE -DABIC_ADDITIONAL_LINK_LIBRARIES="$ABIC_ADDITIONAL_LINK_LIBRARIES" -DABIC_COMPILER_SUPPORTS_CXX11=ON -DOPENJPEG_ROOT=$OPENJPEG_ROOT -DOPENJPEG_NAMES=$OPENJPEG_NAMES -DLCMS2_INCLUDE_DIR=$LCMS2_INCLUDE_DIR -DLCMS2_LIBRARIES=$LCMS2_LIBRARIES -DLCMS2_LIBRARY=$LCMS2_LIBRARY -DImageMagick_INCLUDE_DIRS=$ImageMagick_INCLUDE_DIRS -DImageMagick_Magick++_INCLUDE_DIR=$ImageMagick_INCLUDE_DIRS -DImageMagick_MagickCore_INCLUDE_DIR=$ImageMagick_INCLUDE_DIRS -DImageMagick_MagickWand_INCLUDE_DIR=$ImageMagick_INCLUDE_DIRS -DImageMagick_Magick++_LIBRARY=$ImageMagick_MagickPP_LIBRARY -DImageMagick_MagickWand_LIBRARY=$ImageMagick_MagickWand_LIBRARY -DImageMagick_MagickCore_LIBRARY=$ImageMagick_MagickCore_LIBRARY -DwxWidgets_ROOT_DIR=$wxWidgets_ROOT_DIR -DwxWidgets_CONFIG_EXECUTABLE=$wxWidgets_CONFIG_EXECUTABLE ../src
make
cd ..
|
Please don't let yourself be confused by the fact that I am using the ImageMagick CMake script for GraphicsMagick. ABIC does not work with ImageMagick, only with GraphicsMagick.