I tried to follow this on my Ubuntu 21.04, But I was getting the following error when I try to build using the Make command:
[ 39%] Downloading crypt_sharedTraceback (most recent call last):
File "/home/styles/Softwares/mongo-c-driver-1.22.0/build/mongodl.py", line 700, in
sys.exit(main())
File "/home/styles/Softwares/mongo-c-driver-1.22.0/build/mongodl.py", line 679, in main
target = args.target or infer_target()
File "/home/styles/Softwares/mongo-c-driver-1.22.0/build/mongodl.py", line 86, in infer_target
return _infer_target_os_rel()
File "/home/styles/Softwares/mongo-c-driver-1.22.0/build/mongodl.py", line 127, in _infer_target_os_rel
raise RuntimeError(
RuntimeError: We don’t know how to map ‘ubuntu’ version ‘21.10’ to a distribution download target. Please contribute!
gmake[2]: *** [src/libmongoc/CMakeFiles/get-crypt_shared.dir/build.make:80: src/libmongoc/mongo_crypt_v1.so] Error 1
gmake1: *** [CMakeFiles/Makefile2:2041: src/libmongoc/CMakeFiles/get-crypt_shared.dir/all] Error 2
gmake: *** [Makefile:182: all] Error 2
Is there a workaround to make it work or I can’t really work with mongocxx on my version of ubuntu ?
2
Answers
I faced a different error with
crypt_shared
on Ubuntu 16.04 and build operation would throw error in downloading crypt_shared. So I used-DMONGOC_TEST_USE_CRYPT_SHARED=FALSE
in cmake arguments and as per filesrc/libmongoc/CMakeLists.txt:860
ofmongodb-c-driver-1.23.0
, this means now the build will rely onmongocryptd
instead. The build went ahead from this particular error.Modify the beginning of /build/mongodl.py to add your distribution. The line I added below will build a version compatible to 20.04 but you could also try changing it to 22.04.