Closed asterikx closed 4 years ago
@asterikx did you try with setting LD_LIBRARY_PATH
to $LAMBDA_TASK_ROOT/lib:$LAMBDA_TASK_ROOT/lib64:$LAMBDA_RUNTIME_DIR:$LAMBDA_RUNTIME_DIR/lib:$LAMBDA_TASK_ROOT:/opt/lib:/opt/lib64:/lib64:/usr/lib64
Hey @pavinthan, I solved the problem by adding the option -DCMAKE_PREFIX_PATH=${INSTALL_DIR}
to any cmake invocation (see this discussion).
By default cmake does not use pkg-config
so it's not aware of any non-default installations. I would recommend adding it to you compiler.Dockerfile
as well.
Hi @pavinthan!
First, I want to second #2. Thank you for open-sourcing this lambda-layer!
I need to build libvips with poppler support. I'm using the
lambci/lambda:build-go1.x
as base image as it matches the lambda environment very closely.The lambda environment includes old versions of libraries such as
libpng
(which are not included in theamazonlinux:2018.03
image). Still, I'm building the newest version of those libraries from source as the older ones have known security problems (see https://github.com/libvips/libvips/issues/1749#issuecomment-666606745).However, Poppler picks up the pre-installed (old) versions
/usr/lib64/
instead of the new version from/opt/lib
during the build, e.g. it uses/usr/lib64/libpng.so
instead of/opt/lib/libpng.so
.I can reproduce this issue using the Dockerfile from this repository by adding
libpng
andlibpng-devel
viayum
to the image.https://github.com/jeylabs/aws-lambda-poppler-layer/blob/50e6d79d83b7ac28029f138db420f479fb953d2b/compiler.Dockerfile#L31
Original output of Poppler build:
Output of Poppler build after installing
libpng
andlibpng-devel
viayum
:Question: How can I "force" Poppler to build with a custom (new) version of a library instead of the default (old) one?
I appreciate any help on this