libatomic is missing on macOS Mojave 10.14.2 - mongodb

Trying to build mongodb 4.1.6 (the latest) from source on macOS Mojave (10.14.2) is giving configuration error. Some libatomic is missing. I tried searching for the solution on the web but none has worked so far.
Solution that looked most promising was from here: Can't compile C program on a Mac after upgrade to Mojave
But it didn't solve my problem either.
Here is the configuration outout:
scons: Reading SConscript files ...
scons version: 3.0.1
python version: 2 7 10 'final' 0
Checking whether the C compiler works... yes
Checking whether the C++ compiler works... yes
Checking that the C++ compiler can link a C++ program... yes
Checking if C++ compiler "g++" is GCC... no
Checking if C++ compiler "g++" is clang... yes
Checking if C compiler "gcc" is clang... yes
Detected a x86_64 processor
Checking if target OS macOS is supported by the toolchain... yes
Checking if C compiler is clang 3.8 (or Apple XCode 8.3.2) or newer...yes
Checking if C++ compiler is clang 3.8 (or Apple XCode 8.3.2) or newer...yes
Checking for sufficient macOS target version minimum... yes
Checking if C compiler supports -Wno-unused-local-typedefs... yes
Checking if C compiler supports -Wno-unused-function... yes
Checking if C compiler supports -Wno-unused-private-field... yes
Checking if C compiler supports -Wno-deprecated-declarations... yes
Checking if C compiler supports -Wno-tautological-constant-out-of-range-compare... yes
Checking if C compiler supports -Wno-tautological-constant-compare... yes
Checking if C compiler supports -Wno-tautological-unsigned-zero-compare... yes
Checking if C compiler supports -Wno-tautological-unsigned-enum-zero-compare... yes
Checking if C compiler supports -Wno-unused-const-variable... yes
Checking if C compiler supports -Wno-unused-but-set-variable... no
Checking if C compiler supports -Wno-missing-braces... yes
Checking if C compiler supports -Wno-inconsistent-missing-override... yes
Checking if C compiler supports -Wno-potentially-evaluated-expression... yes
Checking if C++ compiler supports -Wpessimizing-move... yes
Checking if C++ compiler supports -Wredundant-move... yes
Checking if C++ compiler supports -Wno-maybe-uninitialized... no
Checking if C++ compiler supports -Wno-undefined-var-template... yes
Checking if C++ compiler supports -Wno-instantiation-after-specialization... yes
Checking if C compiler supports -Wno-unused-lambda-capture... yes
Checking if C compiler supports -Wno-exceptions... yes
Checking if C compiler supports -Wno-format-truncation... no
Checking if C++ compiler supports -Wno-class-memaccess... no
Checking -Wnon-virtual-dtor for false positives... no
Checking if C compiler supports -Wunguarded-availability... yes
Checking if C compiler supports -fstack-protector-strong... yes
Checking if we are using libstdc++... no
Checking if C++ compiler supports -std=c++14... yes
Checking if C compiler supports -std=c11... yes
Checking for C++14... yes
Checking for memset_s... yes
Checking for C function strnlen()... yes
Checking if we are on a POSIX system... yes
Checking if the POSIX monotonic clock is supported... no
Checking off_t is 8 bytes... yes
Checking if linker supports -fuse-ld=gold... no
Checking if linker supports -Wl,--build-id... no
Checking if linker supports -Wl,--hash-style=gnu... no
Checking if linker supports -Wl,-z,noexecstack... no
Checking if linker supports -Wl,--warn-execstack... no
Checking if linker supports -Wl,-z,relro... no
Checking if C compiler supports -fno-builtin-memcmp... yes
Checking for storage class thread_local yes
Checking for C++14 std::enable_if_t support...yes
Checking for C++14 std::make_unique support... yes
Checking if pthread_setname_np is supported... no
Using SSL Provider: apple
Checking for C library rt... no
Checking for C library dl... no
Checking for C++ header file execinfo.h... yes
Checking whether backtrace is declared... yes
Checking whether backtrace_symbols is declared... yes
Checking whether backtrace_symbols_fd is declared... yes
Checking for C library pcap... no
Checking for C library wpcap... no
Checking if std::atomic<int64_t> works... no
Checking for C library atomic... no
Some atomic ops are not intrinsically supported, but no libatomic found
See /Users/dibyendu/Downloads/build/mongo-virtual-env/mongo/build/scons/config.log for details
And here is the config.log details:
scons: Configure: Checking if std::atomic<int64_t> works...
build/scons/opt/sconf_temp/conftest_64.cpp <-
|
|#include <atomic>
|
|int main(int argc, char* argv[]) {
| std::atomic<int64_t> x;
|
| x.store(0);
| // Use argc to ensure we can't optimize everything away.
| int64_t y = argc;
| x.fetch_add(y);
| x.fetch_sub(y);
| x.exchange(y);
| if (x.compare_exchange_strong(y, x) && x.is_lock_free())
| return 0;
| return x.load();
|}
|
Compiling build/scons/opt/sconf_temp/conftest_64.o
Linking build/scons/opt/sconf_temp/conftest_64
ld: warning: text-based stub file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd and library file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//Security.framework/Security.tbd and library file /System/Library/Frameworks//Security.framework/Security are out of sync. Falling back to library file for linking.
ld: fatal warning(s) induced error (-fatal_warnings)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
scons: Configure: no
scons: Configure: Checking for C library atomic...
build/scons/opt/sconf_temp/conftest_65.c <-
|
|
|
|int
|main() {
|
|return 0;
|}
|
Compiling build/scons/opt/sconf_temp/conftest_65.o
Linking build/scons/opt/sconf_temp/conftest_65
ld: library not found for -latomic
clang: error: linker command failed with exit code 1 (use -v to see invocation)
scons: Configure: no
Any suggestion would be helpful.

The problem was not with libatomic at all. The error was coming because of this issue ld: warning: text-based stub file are out of sync. Falling back to library file for linking
Fix:
$ rm -rf /Library/Developer/CommandLineTools
$ xcode-select --install
and then executing this script: https://gist.github.com/karololszacki/dec8fd80b20e081b0e91a6bbd639c8fe

Related

Compiling Mongod with SSL Support

I am attempting to compile mongod.exe from github src but I keep running into the following error:
C:\Github\Mongo>scons --64 --ssl mongod.exe
scons: Reading SConscript files ...
scons version: 2.3.4
python version: 2 7 8 'final' 0
Checking whether the C++ compiler works... (cached) yes
Checking whether the C compiler works... (cached) yes
Checking if C++ compiler "$CC" is MSVC... (cached) yes
Checking if C compiler "cl" is MSVC... (cached) yes
Checking if C compiler is Microsoft Visual Studio 2013 Update 2 or newer...(cach
ed) yes
Checking if C++ compiler is Microsoft Visual Studio 2013 Update 2 or newer...(ca
ched) yes
Checking if target architecture is 32-bit x86...(cached) no
Checking if we are using libstdc++... (cached) no
Checking if we are on a POSIX system... (cached) no
Checking for __declspec(thread)... (cached) no
Checking for C++11 <atomic> support... (cached) no
Checking for C++ header file execinfo.h... (cached) no
Checking for C library pcap... (cached) no
Checking for C library wpcap... (cached) no
scons: done reading SConscript files.
scons: Building targets ...
cl /Fobuild\win32\64\ssl\mongo\db\db.obj /c src\mongo\db\db.cpp /TP /nologo /EHs
c /W3 /wd4355 /wd4800 /wd4267 /wd4244 /wd4290 /wd4068 /wd4351 /we4099 /Z7 /error
Report:none /MT /O2 /Oy- /Gw /Gy /Zc:inline /DBOOST_ALL_NO_LIB /D_SCONS /DMONGO_
EXPOSE_MACROS /DSUPPORT_UTF8 /DMONGO_OPTIMIZED_BUILD /DMONGO_BYTE_ORDER=1234 /D_
UNICODE /DUNICODE /D_CONSOLE /D_CRT_SECURE_NO_WARNINGS /DMONGO_SSL /D_WIN32_WINN
T=0x0502 /DNTDDI_VERSION=0x05020200 /IC:\Github\winpcap\Include /Isrc\third_part
y\s2 /Isrc\third_party\pcre-8.30 /Isrc\third_party\boost /Ibuild\win32\64\ssl /I
src /Z7
db.cpp
C:\Github\Mongo\src\mongo/platform/atomic_intrinsics.h(60) : fatal error C1189:
#error : "Windows builds must use a compiler supporting std::atomic"
scons: *** [build\win32\64\ssl\mongo\db\db.obj] Error 2
scons: building terminated because of errors.
The source code throwing the error shows a variable _WIN32 as being defined and set to True but I thought the --64 option would have set this to false?
Any suggestions on how to resolve to complete a SSL build would be appreciated:
Environment: Visual Studio 2013, Window 7, x64 latest master from github
Observation: C++11 support is available when I run scons without --ssl and the compilation proceeds, but when using --ssl options the C++11 (atomic) supported is equal to "no" and the compilation fails.
This error occurs if OpenSSL is not found during the build process.
Make sure to install the latest version of OpenSSL (Win64 OpenSSL v1.0.1j)
When compiling add the home path of OpenSSL with --extrapath
Example build command:
scons --ssl --release --64 --extrapath=<OPENSSL-HOME> core

Template match using opencv in IOS (Iphone)

I am a newbie for IOS. I am trying to search some examples written in objectiveC for template match using OpenCV. I need to capture a logo from camera and need to match with some images kept in my project. Even after trying for long i didn't find something working. I tried this Project but the compiler is giving following error:Command /usr/bin/make failed with exit code 2
I don't know how to fix this error.
I am using XCode version 4.3.3 & IOS 5 on my MAC mini.
I need your help. One thing please consider, I just started working on MAC and IOS (1-2 months). A step by step guide or some working example will be more helpful.
I am getting following text in log:
* Unpacking OpenCV (2.0.0)...
patching file src/cv/cvcalibration.cpp
*** Configuring OpenCV (2.0.0 - iPhoneSimulator)...
checking build system type... i686-apple-darwin
checking host system type... i686-apple-darwin9
checking target system type... i686-apple-darwin9
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for i686-apple-darwin9-strip... no
checking for strip... strip
configure: WARNING: using cross tools not prefixed with host triplet
checking for a thread-safe mkdir -p...
/Users/Manish/Downloads/OpenCV-iPad/OpenCV/build/iPhoneSimulator/../.././tmp/OpenCV-2.0.0/autotools/install-sh
-c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make sets $(MAKE)... (cached) yes
checking for style of include used by make... GNU
checking for C++ compiler default output file name...
configure: error: in
`/Users/Manish/Downloads/OpenCV-iPad/OpenCV/build/iPhoneSimulator':
configure: error: C++ compiler cannot create executables
See `config.log' for more details.
make: * [opencv_simulator] Error 77
Command /usr/bin/make failed with exit code 2
Thanks for your advise and support, this is the part of the project i am developing for my companies client so don't have nay choice, just to complete this task.
One more thing i have faced same problem on more than one MAC mini.. so if you download same Project you might get the same issue.
Manish

Compiling tesseract for iOS

I am trying to compile tesseract 3.01 for iOS 4.0. Config script for tesseract fails with the following error:
checking for acos... yes
checking for asin... yes
checking for leptonica... yes
checking for pixCreate in -llept... no
configure: error: leptonica library missing
make: *** [config.status] Error 1
I have leptonica 1.68 built and have set the right LDFLAGS and LIBLEPT_LIBDIR values. Am I missing something?
You can use the prebuilt library itself. Have a look at here https://stackoverflow.com/a/9124709/641062

memcached-1.4.5 compilation problem for mips architecture?

I am using memcached-1.4.5 in our project. I am new to this & trying to compile it for mips architecture. I am getting below error:
checking for egrep... /bin/grep -E
checking for icc in use... no
checking for Sun cc in use... configure: error: in `$HOME/MEMCACHED':
configure: error: cannot run test program while cross compiling
See `config.log' for more details.
configure memcached failed, bailing out
If anybody has encountered such issues can help me out to fix this problem.
There are a lot of bugs in configure.ac for 1.4.5 that prevents you from doing a successful cross compilation. I believe they are fixed in the upcoming engine branch.. you may give that a shot..

Compiling external C++ library (Octave) for iPhone (Fortran compiler missing?)

A friend of mine asked me if it would be possible to port the Octave project to the iPhone. I haven't compiled an external package for an iPhone project before, so I downloaded the source code, and then used some scripts found on a couple of different Web sites (one, two) to try and build the libraries. However, when I try either of these scripts (which are nearly identical), they eventually die during the configure phase with the following error output:
[...snip checks...]
checking whether we are using the GNU Fortran 77 compiler... no
checking whether accepts -g... no
checking how to get verbose linking output from ... configure: WARNING: compilation failed
checking for Fortran 77 libraries of ... rm: conftest.dSYM: is a directory
checking for dummy main to link with Fortran 77 libraries... rm: conftest.dSYM: is a directory
none
checking for Fortran 77 name-mangling scheme... configure: error: cannot compile a simple Fortran program
See `config.log' for more details.
Is the problem that the iPhone SDK/Xcode doesn't include a Fortran cross-compiler, or am I doing something wrong?
The iPhone SDK does not include a FORTRAN compiler. Apple's last FORTRAN product was for the Apple ][, although 3rd party and/or open source compilers have existed for most systems Apple has built.
You could configure and build gfortran, but it's going to be a PITA. You'll likely need to merge in changes from Apple's customized GCC 4.2 fork found under iPhone here with a recipe for building it for Darwin, such as this.
You might try f2c as the Octave project suggests.