SoftCreatR / imei

IMEI - ImageMagick Easy Install
ISC License
309 stars 36 forks source link

Provide statically linked binaries #100

Closed suntong closed 11 months ago

suntong commented 1 year ago

Tring to compile imei to be used in aws lambda, and I'm getting:

$ ldd /opt/bin/identify
/opt/bin/identify: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /opt/lib/libMagickCore-7.Q16HDRI.so.10)

It turns out that the AWS provided.al2 Lambda is using glibc 2.26. Yet, I was building with 3+ years old ubuntu:20.04 and am still unable to satisfy its glibc requirement. And even the 5+ years old ubuntu:18.04 still unable to satisfy its glibc requirement.

When trying to build with ubuntu:16.04, the build failed:

MagickCore/.libs/libMagickCore-7.Q16HDRI.so: undefined reference to `FT_Set_Default_Properties'
collect2: error: ld returned 1 exit status
Makefile:8196: recipe for target 'utilities/magick' failed

So, please provide flags to support building statically linked binaries. thanks.

SoftCreatR commented 1 year ago

You mean, you need a flag that modifies the --disable-static flag while building IM?

suntong commented 1 year ago

Ah, found what you meant, and yes, that should do it. But,

Let me try it out first... will get back to you next week or the week after next.

suntong commented 1 year ago

So I removed the --disable-static flag while building IM, but this is what I get:

/tmp/ime $ ldd bin/magick
        linux-vdso.so.1 (0x00007ffc49f23000)
        libMagickCore-7.Q16HDRI.so.10 => not found
        libMagickWand-7.Q16HDRI.so.10 => not found
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9d7fd87000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f9d7ff8a000)

I.e., if libMagickXxx are not found then the above are the only libs needed.

$ ldd bin/magick
        linux-vdso.so.1 (0x00007ffdd37cf000)
        libMagickCore-7.Q16HDRI.so.10 => /tmp/ime/lib/libMagickCore-7.Q16HDRI.so.10 (0x00007f92cba00000)
        libMagickWand-7.Q16HDRI.so.10 => /tmp/ime/lib/libMagickWand-7.Q16HDRI.so.10 (0x00007f92cb8ba000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f92cb6c8000)
        liblcms2.so.2 => /lib/x86_64-linux-gnu/liblcms2.so.2 (0x00007f92cbe20000)
        libraqm.so.0 => not found
        liblqr-1.so.0 => not found
        libfftw3.so.3 => not found
        libxml2.so.2 => /lib/x86_64-linux-gnu/libxml2.so.2 (0x00007f92cb50e000)
        libfontconfig.so.1 => /lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f92cbdd7000)
        libfreetype.so.6 => /lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f92cb44f000)
        libXext.so.6 => /lib/x86_64-linux-gnu/libXext.so.6 (0x00007f92cbdc2000)
        libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6 (0x00007f92cb312000)
        libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x00007f92cbdad000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f92cb2f6000)
        libltdl.so.7 => /lib/x86_64-linux-gnu/libltdl.so.7 (0x00007f92cbda2000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f92cb1a7000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f92cb184000)
        libgomp.so.1 => /lib/x86_64-linux-gnu/libgomp.so.1 (0x00007f92cb142000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f92cb127000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f92cbe8c000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f92cbd9a000)
        libicuuc.so.66 => /lib/x86_64-linux-gnu/libicuuc.so.66 (0x00007f92caf41000)
        liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f92caf18000)
        libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f92caeea000)
        libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f92caee1000)
        libpng16.so.16 => /lib/x86_64-linux-gnu/libpng16.so.16 (0x00007f92caea9000)
        libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f92cae7f000)
        libicudata.so.66 => /lib/x86_64-linux-gnu/libicudata.so.66 (0x00007f92c93be000)
        libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f92c91dc000)
        libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6 (0x00007f92c91d6000)
        libXdmcp.so.6 => /lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f92c91ce000)
        libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f92c91b4000)

I.e., if libMagickXxx are found, then all the above extra libs seems to be needed by them.

All in all, would you try removing the --disable-static flag while building IM at your end and see what you get please?