Re: [poppler] Static build

2018-12-14 Thread Ranjan Ghosh
Wow. What a wild ride. Once you type "ldd pdf2svg" and you really see 
"Not a dynamic executable" after literally days of work you almost 
cannot believe it's true. Thank you so much, Jeroen! It took me a while 
to finally figure it all out, but I eventually managed to build a static 
pdf2svg binary. The single sentence below from you was very short and 
(for me) initially *extremely* cryptic (I'm no expert on all this stuff, 
mind you) but turned out to be one of the wisest tips I ever got in IT. 
So much cleverness crammed into one single sentence. I just had to trust 
exactly what you said and diligently follow through and solve every 
single compilation error and consequence that resulted out of it.


I posted on the relevant pdf2svg issue how I've finally managed to put 
everything together in case some else finds it useful:


https://github.com/dawbarton/pdf2svg/issues/5

Am 05.12.18 um 17:53 schrieb Jeroen Ooms:


When static linking you need to include the linker flags for all the
dependencies.

___
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler


[poppler] Static build

2018-12-04 Thread Ranjan Ghosh

Hi all,

I'm desperately trying to create a fully static build without any 
dependencies. I already got pretty far (IMHO) and build lots and lots of 
other dependent libaries statically (cairo, freetype etc.) without 
encountering any major problems.


Now, with poppler, I got a first compilation error but could solve it as 
discussed here:


https://www.mail-archive.com/poppler@lists.freedesktop.org/msg10543.html

With this patch:

https://github.com/mpsuzuki/poppler/commit/3f944ed5dee3496e7a7c661eabc3b16448316d13

Which worked fabulously. This should definitely be included in the main 
poppler branch, I guess, as it looks like it doesnt hurt anyone who isnt 
compiling statically - but OTOH is hugely helpful for those like me who 
dare to try it.


After that, make continues up until 71%:

[ 71%] Linking CXX executable pdftocairo
/usr/bin/ld: /usr/local/lib/libcairo.a(cairo-image-surface.o): in 
function `_cairo_image_surface_finish':
/usr/src/cairo/src/cairo-image-surface.c:846: undefined reference to 
`pixman_image_unref'
/usr/bin/ld: /usr/local/lib/libcairo.a(cairo-image-surface.o): in 
function `_cairo_image_surface_init':
/usr/src/cairo/src/cairo-image-surface.c:164: undefined reference to 
`pixman_image_get_data'
/usr/bin/ld: /usr/src/cairo/src/cairo-image-surface.c:169: undefined 
reference to `pixman_image_get_width'
/usr/bin/ld: /usr/src/cairo/src/cairo-image-surface.c:170: undefined 
reference to `pixman_image_get_height'
/usr/bin/ld: /usr/src/cairo/src/cairo-image-surface.c:171: undefined 
reference to `pixman_image_get_stride'
/usr/bin/ld: /usr/src/cairo/src/cairo-image-surface.c:172: undefined 
reference to `pixman_image_get_depth'
/usr/bin/ld: /usr/local/lib/libcairo.a(cairo-image-surface.o): in 
function `_pixman_format_from_masks':


Any help on how to overcome this problem would be much appreciated.

Thank you / BR

Ranjan



___
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler


Re: [poppler] Static build

2018-12-05 Thread Ranjan Ghosh
Hmm. I think it doesnt work that easily. Actually, I'm trying to build a 
static pdf2svg which users poppler in turn. I tried to follow your 
advice and installed libcairo-dev, libopenjp2-7-dev, libjpeg-dev, etc. 
and then simply compiled poppler with -DBUILD_SHARED_LIBS=OFF. When I 
subsequently tried to compile pdf2svg as static with the static poppler 
I get:


/usr/bin/ld: /usr/local/lib/libpoppler-glib.a(CairoFontEngine.cc.o): 
undefined reference to symbol 'FT_Library_Version'
/usr/bin/ld: //usr/lib/x86_64-linux-gnu/libfreetype.so.6: error adding 
symbols: DSO missing from command line


I think the reason is that I actually must compile every single 
contributing library that is used by poppler as fully static beforehand 
instead of just installing them with apt, right?



Am 04.12.18 um 23:11 schrieb Jeroen Ooms:

On Tue, Dec 4, 2018 at 4:44 PM Ranjan Ghosh  wrote:

Hi all,

I'm desperately trying to create a fully static build without any
dependencies. I already got pretty far (IMHO) and build lots and lots of
other dependent libaries statically (cairo, freetype etc.) without
encountering any major problems.

Have a look at the homebrew formulae, I use those to statically build
packages on MacOS. Afaik it works by default in the latest releases,
just use cmake -DBUILD_SHARED_LIBS=OFF like here:
https://github.com/Homebrew/homebrew-core/blob/master/Formula/poppler.rb#L67

___
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler


Re: [poppler] Static build

2018-12-05 Thread Ranjan Ghosh
sr/local/lib/libpoppler-glib.a(CairoOutputDev.cc.o): in 
function `get_singular_values(_cairo_matrix const*, double*, double*)':

CairoOutputDev.cc:(.text+0xebd): undefined reference to `sqrt'
/usr/bin/ld: CairoOutputDev.cc:(.text+0xeed): undefined reference to `sqrt'


Am 05.12.18 um 17:53 schrieb Jeroen Ooms:

On Wed, Dec 5, 2018 at 5:12 PM Ranjan Ghosh  wrote:

Hmm. I think it doesnt work that easily. Actually, I'm trying to build a
static pdf2svg which users poppler in turn. I tried to follow your
advice and installed libcairo-dev, libopenjp2-7-dev, libjpeg-dev, etc.
and then simply compiled poppler with -DBUILD_SHARED_LIBS=OFF. When I
subsequently tried to compile pdf2svg as static with the static poppler
I get:

/usr/bin/ld: /usr/local/lib/libpoppler-glib.a(CairoFontEngine.cc.o):
undefined reference to symbol 'FT_Library_Version'
/usr/bin/ld: //usr/lib/x86_64-linux-gnu/libfreetype.so.6: error adding
symbols: DSO missing from command line

I think the reason is that I actually must compile every single
contributing library that is used by poppler as fully static beforehand
instead of just installing them with apt, right?

Your linking error occurs because you're missing -lfreetype. When
static linking you need to include the linker flags for all the
dependencies. Unfortunately poppler does not correctly record it's
private dependencies in the pkg-config file, but try linking with
these flags:

pkg-config --libs --static poppler-cpp cairo lcms2 libopenjp2 libtiff-4

___
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler