Cannot compile unittests
Opened this issue · 2 comments
youngar commented
When running make unitttests
there is a compilation failure:
make unittests
g++ -std=c++11 -m64 -Wno-endif-labels -DDEBUG -O0 -g -DUNITTESTS -DGC_TYPE=GENERATIONAL -I/home/aryoung/wsp/SOMpp/src -fno-PIC -mcmodel=large -c /home/aryoung/wsp/SOMpp/src/unitTests/CloneObjectsTest.cpp -o /home/aryoung/wsp/SOMpp/src/unitTests/CloneObjectsTest.o
g++ -std=c++11 -m64 -Wno-endif-labels -DDEBUG -O0 -g -DUNITTESTS -DGC_TYPE=GENERATIONAL -I/home/aryoung/wsp/SOMpp/src -fno-PIC -mcmodel=large -c /home/aryoung/wsp/SOMpp/src/unitTests/WalkObjectsTest.cpp -o /home/aryoung/wsp/SOMpp/src/unitTests/WalkObjectsTest.o
In file included from /usr/include/cppunit/portability/Stream.h:283:0,
from /usr/include/cppunit/TestAssert.h:7,
from /usr/include/cppunit/TestCase.h:6,
from /usr/include/cppunit/TestCaller.h:5,
from /usr/include/cppunit/extensions/HelperMacros.h:9,
from /home/aryoung/wsp/SOMpp/src/unitTests/WalkObjectsTest.h:27,
from /home/aryoung/wsp/SOMpp/src/unitTests/WalkObjectsTest.cpp:11:
/usr/include/c++/7.2.0/sstream:300:7: error: ‘struct std::__cxx11::basic_stringbuf<_CharT, _Traits, _Alloc>::__xfer_bufptrs’ redeclared with different access
struct __xfer_bufptrs
^~~~~~
make: *** [/home/aryoung/wsp/SOMpp/build/Linux.make:76: /home/aryoung/wsp/SOMpp/src/unitTests/WalkObjectsTest.o] Error 1
I believe it is caused by the following macros definitions, which are used in the unit tests.
src/unitTests/CloneObjectsTest.cpp:10:#define private public
src/unitTests/WalkObjectsTest.cpp:10:#define private public
src/unitTests/WriteBarrierTest.cpp:6:#define private public
Using
Arch Linux
Linux aryoung-tp 4.13.11-1-ARCH #1 SMP PREEMPT Thu Nov 2 10:25:56 CET 2017 x86_64 GNU/Linux
gcc (GCC) 7.2.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
smarr commented
Hi, thanks for the report.
Is this in some way urgent? I suppose it's related to SOM++ OMR?
Without looking into it, my guess would be the easiest work around is to remove these hacky macros, and make the relevant things public so that it compiles.
There is likely a better solution though.
youngar commented
Hi, It's not urgent; I just started looking at SOM today and I couldn't run the unit tests. It's not really relevant to SOM++ OMR.