libcurl.so.4: version `CURL_OPENSSL_4' not found

2,223 views
Skip to first unread message

TmOnlineMapper

unread,
Dec 19, 2018, 9:11:05 AM12/19/18
to mongodb-dev
Hi. I'm not sure if this is the right place to talk about issues with running custom builds of MongoDB.
If it's not, it would be very nice if someone can point me to the right place.

Well, as mentioned several times before I'm building MongoDB 4.0 (currently 4.0.5-rc1) for arm64/aarch64. I have deployed the the binaries to a debian stretch system. But when I try to run it I get this error:

/usr/local/bin/mongod: /usr/lib/aarch64-linux-gnu/libcurl.so.4: version `CURL_OPENSSL_4' not found (required by /usr/local/bin/mongod)

Now it certainly worked under a previous Debian buster environment. But since I changed a lot since I last confirmed it working and noticing it broke, I cannot say with certainty that this is what broke it. Also I was using 4.0.4 back then.

Now chances are there's just a package missing. The base image I'm working off is very minimal, so it could be that I'm missing a very basic package.
I searched a little but could not find out which package is missing exactly. Also installing libcurl4-openssl-dev did not fix it.

Any help is apprechiated and I'm more than happy to provide more info.

Best Regards

TmOnlineMapper

unread,
Dec 19, 2018, 9:39:15 AM12/19/18
to mongodb-dev
Digging a little deeper it seem like (lib)curl4 is not available at all on Debian Stretch. Because I'm crosscompiling on Ubuntu LTS 18.04 I'm guessing it's built with the version 4. Can I force it to build with/link against libcurl3 in a cross-compiling process?

Best Regards

Andrew Morrow

unread,
Dec 19, 2018, 9:51:18 AM12/19/18
to mongodb-dev

Hi -

I think you can drop the curl requirement entirely by building with --enable-free-mon=off --enable-http-client=off. Note that this will disable the free monitoring feature in your build, so if you were hoping to use that feature we should try another way.

In general though, you are setting yourself up for some difficulty by building on one "Debian" (Ubuntu 18.04) to target another (Stretch). The MongoDB build system generally believes that it can probe the local system to learn about what libraries and features are available, and often forms hard dependencies. If you are using 18.04 because it is your development environment, you might do better to set up a Debian Stretch chroot with debootstrap or similar, and do your cross compile within the chroot.

Hope this helps.

Thanks,
Andrew

--
You received this message because you are subscribed to the Google Groups "mongodb-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-dev...@googlegroups.com.
To post to this group, send email to mongo...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-dev.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-dev/a5364e0e-61c9-4fb8-9078-aa3710ab407d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

TmOnlineMapper

unread,
Dec 19, 2018, 10:11:55 AM12/19/18
to mongodb-dev
Hi!

Thanks for that information. To my knowlege the free monitoring feature will not be in use, so it's fine to disable it.

The reason I'm building on Ubuntu is because it is our CI server. I was thinking about containerizing the build process anyways (the build system can use docker containers), so now I have even more reason to do that.

And I'll let you know if that worked once the build process finishes and I had a chance to test it. Which will be in a couple hours.

Best Regards

TmOnlineMapper

unread,
Dec 19, 2018, 11:14:26 AM12/19/18
to mongodb-dev
Ok. Now while compiling this error happens:

[2018-12-19 16:00:16 (00:43:46.416716)] + buildscripts/scons.py AR=aarch64-linux-gnu-ar CC=ccache aarch64-linux-gnu-gcc CXX=ccache aarch64-linux-gnu-g++ HOST_ARCH=x86_64 TARGET_ARCH=aarch64 CCFLAGS=-march=armv8-a+crc MAXLINELENGTH=2097152 --ssl --enable-free-mon=off --enable-http-client=off --disable-warnings-as-errors -j 6 --prefix /var/lib/gitlab-runner/builds/32e764b8/0/ServiceCockpit/debian-images/rpi23-gen-image/images/stretch/build/chroot/usr/local mongod install
[2018-12-19 16:00:17 (00:43:46.997862)] scons: Reading SConscript files ...
[2018-12-19 16:00:18 (00:43:47.880829)] Mkdir("build/scons")
[2018-12-19 16:00:18 (00:43:47.887707)] scons version: 2.5.0
[2018-12-19 16:00:18 (00:43:47.887887)] python version: 2 7 15 'candidate' 1
[2018-12-19 16:00:18 (00:43:48.175162)] Checking whether the C compiler works... yes
[2018-12-19 16:00:18 (00:43:48.222642)] Checking whether the C++ compiler works... yes
[2018-12-19 16:00:19 (00:43:49.037313)] Checking that the C++ compiler can link a C++ program... yes
[2018-12-19 16:00:19 (00:43:49.085079)] Checking if C++ compiler "ccache aarch64-linux-gnu-g++" is GCC... yes
[2018-12-19 16:00:19 (00:43:49.136539)] Checking if C compiler "ccache aarch64-linux-gnu-gcc" is GCC... yes
[2018-12-19 16:00:19 (00:43:49.182561)] Checking if target processor is aarch64 (cached) yes
[2018-12-19 16:00:19 (00:43:49.223513)] Checking if target OS linux is supported by the toolchain... yes
[2018-12-19 16:00:19 (00:43:49.406158)] Checking if C compiler is GCC 5.3.0 or newer...yes
[2018-12-19 16:00:19 (00:43:49.435691)] Checking if C++ compiler is GCC 5.3.0 or newer...yes
[2018-12-19 16:00:19 (00:43:49.485150)] Checking if C compiler supports -Wno-unused-local-typedefs... yes
[2018-12-19 16:00:19 (00:43:49.521590)] Checking if C compiler supports -Wno-unused-function... yes
[2018-12-19 16:00:19 (00:43:49.597131)] Checking if C compiler supports -Wno-unused-private-field... no
[2018-12-19 16:00:19 (00:43:49.634534)] Checking if C compiler supports -Wno-deprecated-declarations... yes
[2018-12-19 16:00:19 (00:43:49.718988)] Checking if C compiler supports -Wno-tautological-constant-out-of-range-compare... no
[2018-12-19 16:00:20 (00:43:49.794734)] Checking if C compiler supports -Wno-tautological-constant-compare... no
[2018-12-19 16:00:20 (00:43:49.880305)] Checking if C compiler supports -Wno-tautological-unsigned-zero-compare... no
[2018-12-19 16:00:20 (00:43:49.964564)] Checking if C compiler supports -Wno-tautological-unsigned-enum-zero-compare... no
[2018-12-19 16:00:20 (00:43:50.006071)] Checking if C compiler supports -Wno-unused-const-variable... yes
[2018-12-19 16:00:20 (00:43:50.043962)] Checking if C compiler supports -Wno-unused-but-set-variable... yes
[2018-12-19 16:00:20 (00:43:50.090809)] Checking if C compiler supports -Wno-missing-braces... yes
[2018-12-19 16:00:20 (00:43:50.181881)] Checking if C compiler supports -Wno-inconsistent-missing-override... no
[2018-12-19 16:00:20 (00:43:50.286589)] Checking if C compiler supports -Wno-potentially-evaluated-expression... no
[2018-12-19 16:00:20 (00:43:50.367023)] Checking if C++ compiler supports -Wpessimizing-move... no
[2018-12-19 16:00:20 (00:43:50.423954)] Checking if C++ compiler supports -Wredundant-move... no
[2018-12-19 16:00:20 (00:43:50.461863)] Checking if C++ compiler supports -Wno-maybe-uninitialized... yes
[2018-12-19 16:00:20 (00:43:50.541727)] Checking if C++ compiler supports -Wno-undefined-var-template... no
[2018-12-19 16:00:20 (00:43:50.632288)] Checking if C++ compiler supports -Wno-instantiation-after-specialization... no
[2018-12-19 16:00:20 (00:43:50.711143)] Checking if C compiler supports -Wno-unused-lambda-capture... no
[2018-12-19 16:00:21 (00:43:50.758970)] Checking if C compiler supports -Wno-exceptions... no
[2018-12-19 16:00:21 (00:43:51.457375)] Checking -Wnon-virtual-dtor for false positives... no
[2018-12-19 16:00:21 (00:43:51.585611)] Checking if C compiler supports -fstack-protector-strong... yes
[2018-12-19 16:00:21 (00:43:51.712653)] Checking if we are using libstdc++... yes
[2018-12-19 16:00:22 (00:43:51.780354)] Checking if C++ compiler supports -std=c++14... yes
[2018-12-19 16:00:22 (00:43:51.818947)] Checking if C compiler supports -std=c11... yes
[2018-12-19 16:00:22 (00:43:51.855938)] Checking for C++14... yes
[2018-12-19 16:00:22 (00:43:52.015504)] Checking for memset_s... no
[2018-12-19 16:00:22 (00:43:52.187826)] Checking for C function strnlen()... yes
[2018-12-19 16:00:22 (00:43:52.261558)] Checking for libstdc++ 5.3.0 or better... yes
[2018-12-19 16:00:22 (00:43:52.306880)] Checking if we are on a POSIX system... yes
[2018-12-19 16:00:22 (00:43:52.342446)] Checking if the POSIX monotonic clock is supported... yes
[2018-12-19 16:00:22 (00:43:52.389096)] Checking off_t is 8 bytes... yes
[2018-12-19 16:00:22 (00:43:52.660472)] Checking if linker supports -fuse-ld=gold... yes
[2018-12-19 16:00:23 (00:43:52.787815)] Checking if linker supports -Wl,--build-id... yes
[2018-12-19 16:00:23 (00:43:52.898732)] Checking if linker supports -Wl,--hash-style=gnu... yes
[2018-12-19 16:00:23 (00:43:53.013478)] Checking if linker supports -Wl,-z,noexecstack... yes
[2018-12-19 16:00:23 (00:43:53.130338)] Checking if linker supports -Wl,--warn-execstack... yes
[2018-12-19 16:00:23 (00:43:53.244871)] Checking if linker supports -Wl,-z,relro... yes
[2018-12-19 16:00:23 (00:43:53.288606)] Checking for glibc with non-broken _FORTIFY_SOURCE...yes
[2018-12-19 16:00:23 (00:43:53.343853)] Checking if C compiler supports -fno-builtin-memcmp... yes
[2018-12-19 16:00:23 (00:43:53.464052)] Checking for storage class thread_local yes
[2018-12-19 16:00:23 (00:43:53.513909)] Checking for C++14 std::enable_if_t support...yes
[2018-12-19 16:00:23 (00:43:53.657452)] Checking for C++14 std::make_unique support... yes
[2018-12-19 16:00:23 (00:43:53.719429)] Checking if pthread_setname_np is supported... yes
[2018-12-19 16:00:24 (00:43:54.226145)] Checking for SSLeay_version(0) in C library crypto... no
[2018-12-19 16:00:24 (00:43:54.227334)] Couldn't find OpenSSL crypto.h header and library

Any idea what I can do about that?

Best Regards

TmOnlineMapper

unread,
Dec 19, 2018, 11:29:18 AM12/19/18
to mongodb-dev
Turns out that was unrelated. Caused by adding the --ssl flag and not having libssl-dev.

Andrew Morrow

unread,
Dec 19, 2018, 11:29:37 AM12/19/18
to mongodb-dev

Did this work for you before? Or did it only stop working after you added the new build flags? Do you have the OpenSSL development libraries for ARM installed? There should be a file build/scons/config.log that should show you the compiler invocation and result for each of these checks; does it say anything interesting for the check about OpenSSL?

TmOnlineMapper

unread,
Dec 20, 2018, 3:16:48 AM12/20/18
to mongodb-dev
Yeah. As I figured out it was caused by adding the --ssl flag and not having libssl-dev for arm64 installed. I missed that because the previous build where I added it hadn't failed yet.

Now back to the curl requirement:
SCons complains that the flag --enable-http-client is unknown. Knowing that for 4.1 quite a few flags got renamed I'm guessing the flag has a different name on 4.0(.5-rc1). Do you happen to know the correct name of the flag for that version?

Best Regards

Andrew Morrow

unread,
Dec 20, 2018, 11:17:57 AM12/20/18
to mongodb-dev
On Thu, Dec 20, 2018 at 3:16 AM TmOnlineMapper <brains...@gmail.com> wrote:
Yeah. As I figured out it was caused by adding the --ssl flag and not having libssl-dev for arm64 installed. I missed that because the previous build where I added it hadn't failed yet.

Now back to the curl requirement:
SCons complains that the flag --enable-http-client is unknown. Knowing that for 4.1 quite a few flags got renamed I'm guessing the flag has a different name on 4.0(.5-rc1). Do you happen to know the correct name of the flag for that version?


My fault on that one. The --enable-http-client flag only exists on master. You shouldn't need it on the 4.0 branch. I think just saying --enable-free-mon=off should be sufficient on the v4.0 branch to eliminate the need for libcurl.

 

TmOnlineMapper

unread,
Dec 21, 2018, 4:40:49 AM12/21/18
to mongodb-dev
I tested that and it works flawlessly!

Thank you for your help. It's much apprechiated!

Andrew Morrow

unread,
Dec 21, 2018, 10:04:12 AM12/21/18
to mongodb-dev
On Fri, Dec 21, 2018 at 4:40 AM TmOnlineMapper <brains...@gmail.com> wrote:
I tested that and it works flawlessly!

Great! I'm happy to hear you got it working.
 

Thank you for your help. It's much apprechiated!

You're welcome. I'm always happy to see developers taking advantage of the multi-architecture support in the server. 


Reply all
Reply to author
Forward
0 new messages