problems building inkscape in os x yosemite

Asked by german

I would like help improving inkscape, specially in os x, but I'm having troubles with the first step, which is compiling it.
I compiled it without any problem in ubuntu following the instructions, but I can't figure the tweaks in mac.
When running the script "packaging/macosx/osx-build.sh", I see many warnings like this one:

In file included from /opt/local/include/gc.h:2:
/opt/local/include/gc/gc.h:787:46: warning: unknown attribute '__alloc_size__'
      ignored [-Wattributes]
                        /* 'realloc' attr */ GC_ATTR_ALLOC_SIZE(2);

Then errors similar to these ones:
/path/src/ege-color-prof-tracker.cpp:522:17: error:
      use of undeclared identifier 'XInternAtom'
    Atom atom = XInternAtom(xdisplay, name, True);

I'm familiar with Qt so I tried to load it there with the cmakefile and I saw the problem with the hashtable, so I installed the gcc49 from macports. I also selected that one as the current gcc. My current "gcc --version" is "gcc (MacPorts gcc49 4.9.1_1) 4.9.1" but that doesn't fix the problem when running the script. On the other hand, Qt (with a kit that uses the gcc from macports) still can't see the "tr1/unordered_set".

I also tried to replace the file hashtable, but the link is broken in the wiki so I'm not sure how to do it.

If someone can help me with this I would appreciate it since I'm not experienced with this kind of project. I tried for the last two days, but I think I'm stuck.

Question information

Language:
English Edit question
Status:
Solved
For:
Inkscape Edit question
Assignee:
No assignee Edit question
Solved by:
su_v
Solved:
Last query:
Last reply:
Revision history for this message
Best su_v (suv-lp) said :
#1

See this recent thread on the mailing list:
http://thread.gmane.org/gmane.comp.graphics.inkscape.devel/44615

On 2014-10-23 07:51 (+0200), german wrote:
> so I installed the gcc49 from macports. I also selected that one as
> the current gcc. My current "gcc --version" is "gcc (MacPorts gcc49
> 4.9.1_1) 4.9.1" but that doesn't fix the problem when running the
> script.

This won't produce a stable binary unless all other C++ bindings in MacPorts are compiled with the same custom compiler (not supported by MacPorts). Please stick with the system compiler (clang from Xcode).

Revision history for this message
su_v (suv-lp) said :
#2

On 2014-10-23 07:51 (+0200), german wrote:
> When running the script "packaging/macosx/osx-build.sh", I see many
> warnings like this one:

1) You don't mention whether you are trying to build current trunk (from
bzr), or are using the latest stable tarball as source - just a quick note:

- The packaging scripts in the tarball (0.48.5) and the stable release
branch 0.48.x are broken and outdated.
- The packaging scripts in current trunk and in the just created release
branch for 0.91.x have recently been updated, but never tested on Yosemite.

Also, by default, the packaging scripts are intended for packagers to
produce the OS X application bundle and the DMG - you don't need to do
this if you intend to work on core inkscape features (using
'--enable-osxapp' in the build configuration only makes recompiling and
debugging more difficult since the 'osxapp-enabled' binary can't be
launched directly (due to current solution for relocation support): one
first has to recreate the application bundle too).

2) if you build inkscape directly (i.e. not using the scripts in
'packaging/macosx'), you have to make sure to add '-std=c++11
-stdlib=libc++' to $CXXFLAGS (IIRC this applies to clang from Xcode >=
5). These flags are currently not set explictly (depending on OS X and
Xcode version) by Inkscape's autoconf-based build system.

> I'm familiar with Qt so I tried to load it there with the cmakefile

The official build system is the autoconf-based one. Cmake (as optional
build system) is not really well-maintained (e.g. support for building
with poppler 0.26 seems broken at the moment), and untested on many
platforms. AFAIK it requires using cmake/ninja, and lacks installation
routines (?).

Revision history for this message
german (german-capuano) said :
#3

Thanks ~suv, that solved my question.

Revision history for this message
german (german-capuano) said :
#4

Thanks for the help. I just did what was written in the mailing list and now the script works perfect. I didn't even need to do the hashtable thing. Just in case anyone read this, I did the following:

sudo port install gettext
sudo port install boost
sudo port install libsigcxx2
sudo port install cairo +quartz -x11
sudo port install cairomm +quartz -x11
sudo port install pango +quartz -x11
sudo port install pangomm +quartz -x11
sudo port install gdk-pixbuf2 -x11
sudo port install gtk2 +quartz -x11
sudo port install atkmm
sudo port install gtkmm +quartz -x11
sudo port install boehmgc gsl bzr lcms

mkdir Inkscape
cd Inkscape
bzr branch lp:inkscape trunk
mkdir trunk_build
cd trunk_build
../trunk/autogen.sh
../trunk/configure --prefix=$(PWD) --disable-static --enable-shared CC="clang" CXX="clang++" CXXFLAGS="-std=c++11 -stdlib=libc++ -I/opt/local/include" CPPFLAGS="-I/opt/local/include -U__STRICT_ANSI__"

make -j 4
make install