Skip to content

Adding libheif support breaks build #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ericdevries opened this issue Jan 29, 2020 · 7 comments
Closed

Adding libheif support breaks build #23

ericdevries opened this issue Jan 29, 2020 · 7 comments

Comments

@ericdevries
Copy link

I tried adding HEIF/HEIC support to the build process, the library itself builds fine but when you start building the imagemagick binaries it complains about not having any references to basic c++ libraries. See a sample below.

I am no expert on this matter, but when building this stuff in a different environment it just seems to work, so I wonder if there could be given any pointers on how to make it build correctly with libheif support built in?

Some output from the build process:

/usr/include/c++/7/bits/stl_tree.h:302: undefined reference to `std::_Rb_tree_decrement(std::_Rb_tree_node_base*)'
/var/task/build/cache/lib/libheif.a(libheif_la-heif_image.o): In function `std::_Rb_tree_iterator<std::pair<heif_channel const, heif::HeifPixelImage::ImagePlane> >::operator++()':
/usr/include/c++/7/bits/stl_tree.h:287: undefined reference to `std::_Rb_tree_increment(std::_Rb_tree_node_base*)'
/var/task/build/cache/lib/libheif.a(libheif_la-heif_image.o):(.eh_frame+0x1eb): undefined reference to `__gxx_personality_v0'
collect2: error: ld returned 1 exit status

My additions to the Makefile_Imagemagick file:

## libheic
LIBHEIF_SOURCE=libheif-$(LIBHEIF_VERSION).tar.gz

$(LIBHEIF_SOURCE):
        curl -LO https://github.com/strukturag/libheif/releases/download/v$(LIBHEIF_VERSION)/$(LIBHEIF_SOURCE)

$(CACHE_DIR)/lib/libheif.a: $(LIBHEIF_SOURCE)
        tar xf $<
        cd libheif*
        ./autogen.sh
        # also tried $(CONFIGURE), same result
        ./configure
        make
        make install
@gojko
Copy link
Contributor

gojko commented Jan 29, 2020

I'm not an expert in libheif so not sure if this will help, but to me this looks like you're using a version of libheif that is not compatible with that particular standard library. to me it seems that it's not complaining about a missing library, but that the library it links to does not have __gxx_personality_v0. Try finding the libheif version that is compatible with AWS Linux 2

@ericdevries
Copy link
Author

I will try this out later, but this was just one of the many errors. A lot of them included missing references to operator new and other basic language features that should be in there.

@gojko
Copy link
Contributor

gojko commented Jan 29, 2020

try building imagemagick using https://github.com/lambci/yumda instead - that uses RPM packages for that specific version of Linux, so it is likely to work smoother

@ericdevries
Copy link
Author

I gave it another shot, turns out I forgot to add the quotes around the -lstdc++ parameter. Managed to get it working. For anybody who is interested, check out my fork: https://github.com/ericdevries/imagemagick-aws-lambda-2

@gojko gojko closed this as completed Jan 30, 2020
@ben-manes
Copy link

It would be nice if @ericdevries' additions were merged into the mainline. Really helpful!

@ericdevries
Copy link
Author

I noticed somebody else forked my version, so I made a pull request on this repo so that the fragmentation of implementations can be reduced

@mdoyle13
Copy link

I noticed somebody else forked my version, so I made a pull request on this repo so that the fragmentation of implementations can be reduced

I forked your repo with HEIF support. Would be great to get it into this repo to keep things clean!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants