Compile error in OSX

74 views
Skip to first unread message

Timothy Chen

unread,
Mar 28, 2013, 4:42:25 AM3/28/13
to supersonic-...@googlegroups.com
Hi all,

I'm hitting a make error with latest code in OSX:

In file included from supersonic/utils/atomicops-internals-x86.cc:25:
./supersonic/utils/atomicops.h:76:57: error: supersonic/utils/atomicops-internals-macosx.h: No such file or directory
make[1]: *** [libsupersonic_la-atomicops-internals-x86.lo] Error 1
make: *** [all] Error 2

How can I fix this?

Tim

Zhichao Liang

unread,
Mar 28, 2013, 10:41:11 PM3/28/13
to supersonic-...@googlegroups.com
Hi Tim!

    I never tried to build supersonic in OSX, but maybe the make error you encountered is not hard to fix. In the file /supersonic/utils/atomicops.h there are some code lines as follows to include different atomic operation implementations according to the OS type. For the __APPLE_, as we can see, it includes the file "supersonic/utils/atomicops-internals-macosx.h".

#if defined(THREAD_SANITIZER)
#include "supersonic/utils/atomicops-internals-tsan.h"
#elif defined(__APPLE__)
#include "supersonic/utils/atomicops-internals-macosx.h"
#elif defined(__GNUC__) && defined(ARMV6)
#include "supersonic/utils/atomicops-internals-arm-v6plus.h"
#elif defined(ARMV3)
#include "supersonic/utils/atomicops-internals-arm-generic.h"
#elif defined(__GNUC__) && (defined(__i386) || defined(__x86_64__))
#include "supersonic/utils/atomicops-internals-x86.h"
#elif defined(__GNUC__) && defined(ARCH_POWERPC64)
#include "supersonic/utils/atomicops-internals-powerpc.h"
#elif defined(OS_WINDOWS)
#include "supersonic/utils/atomicops-internals-windows.h"
#else
#error You need to implement atomic operations for this architecture
#endif

 However, if we browse the source files, we can't find the file "atomicops-internals-macosx.h" in the directory "supersonic/utils", which i believe causes the make error. Actually, the file "atomicops-internals-macosx.h" does exsit, we can see it in the directory "supersonic/utils/auxiliary/". So maybe you need to modify the codes given above as follows. Have a try, may it can help you!

#if defined(THREAD_SANITIZER)
#include "supersonic/utils/atomicops-internals-tsan.h"
#elif defined(__APPLE__)
#include "supersonic/utils/auxiliary/atomicops-internals-macosx.h"
#elif defined(__GNUC__) && defined(ARMV6)
#include "supersonic/utils/atomicops-internals-arm-v6plus.h"
#elif defined(ARMV3)
#include "supersonic/utils/atomicops-internals-arm-generic.h"
#elif defined(__GNUC__) && (defined(__i386) || defined(__x86_64__))
#include "supersonic/utils/atomicops-internals-x86.h"
#elif defined(__GNUC__) && defined(ARCH_POWERPC64)
#include "supersonic/utils/atomicops-internals-powerpc.h"
#elif defined(OS_WINDOWS)
#include "supersonic/utils/atomicops-internals-windows.h"
#else
#error You need to implement atomic operations for this architecture
#endif

在 2013年3月28日星期四UTC+8下午4时42分25秒,Timothy Chen写道:

Timothy Chen

unread,
Mar 29, 2013, 4:00:02 AM3/29/13
to supersonic-...@googlegroups.com
Just realized I wasn't posting on the group when I was chatting with Zhichao.

Just fixing the header doesn't fix the problem, as it's having function redefintions problem.

Full log here:

The complete make log:

make  all-am
/bin/sh ./libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I.  -Wno-deprecated -DNDEBUG -DSUPERSONIC_FORCE_FAILURE_CHECK=1 -I../glog/src -I../gflags-2.0/src -I../protobuf/src -D_THREAD_SAFE  -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -I../gflags-2.0/src -I../glog/src -I../protobuf/src  -I/include/boost-0 -I./gmock/include -I./gmock -I./gmock/gtest/include -I./gmock/gtest -funsigned-char -O3 -mmmx -msse -msse2 -MT libsupersonic_la-atomicops-internals-x86.lo -MD -MP -MF .deps/libsupersonic_la-atomicops-internals-x86.Tpo -c -o libsupersonic_la-atomicops-internals-x86.lo `test -f 'supersonic/utils/atomicops-internals-x86.cc' || echo './'`supersonic/utils/atomicops-internals-x86.cc
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -Wno-deprecated -DNDEBUG -DSUPERSONIC_FORCE_FAILURE_CHECK=1 -I../glog/src -I../gflags-2.0/src -I../protobuf/src -D_THREAD_SAFE -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -I../gflags-2.0/src -I../glog/src -I../protobuf/src -I/include/boost-0 -I./gmock/include -I./gmock -I./gmock/gtest/include -I./gmock/gtest -funsigned-char -O3 -mmmx -msse -msse2 -MT libsupersonic_la-atomicops-internals-x86.lo -MD -MP -MF .deps/libsupersonic_la-atomicops-internals-x86.Tpo -c supersonic/utils/atomicops-internals-x86.cc  -fno-common -DPIC -o .libs/libsupersonic_la-atomicops-internals-x86.o
make: *** [all] Error 2


--------------------------------------

I cannot just strip the x86 header from the cc since then it cannot find function definitions, do you know how to fix this?

Tim

Baskar Duraikannu

unread,
Jul 20, 2013, 11:27:38 AM7/20/13
to supersonic-...@googlegroups.com
Hello -
I am trying to compile on OS X and I am hitting the same exact error below. Please help
Reply all
Reply to author
Forward
0 new messages