gmarcais / Jellyfish

A fast multi-threaded k-mer counter
Other
471 stars 136 forks source link

[2.2.3] error during make check, struct std::basic_stringbuf<_CharT, _Traits, _Alloc>::__xfer_bufptrs’ redeclared with different access #36

Closed wookietreiber closed 9 years ago

wookietreiber commented 9 years ago
$ make check
make  check-recursive
make[1]: Entering directory '/tmp/makepkg/jellyfish/src/jellyfish-2.2.3'
Making check in .
make[2]: Entering directory '/tmp/makepkg/jellyfish/src/jellyfish-2.2.3'
make  libgtest.la libgtest_main.la bin/generate_sequence bin/test_all
make[3]: Entering directory '/tmp/makepkg/jellyfish/src/jellyfish-2.2.3'
  CXXLD  libgtest.la
  CXXLD  libgtest_main.la
  CXXLD  bin/generate_sequence
  CXX    unit_tests/bin_test_all-test_main.o
In file included from ./unit_tests/gtest/gtest.h:308:0,
                 from unit_tests/test_main.cc:20:
/usr/include/c++/5.1.0/sstream:335:7: error: ‘struct std::basic_stringbuf<_CharT, _Traits, _Alloc>::__xfer_bufptrs’ redeclared with different access
       struct __xfer_bufptrs
       ^
Makefile:1264: recipe for target 'unit_tests/bin_test_all-test_main.o' failed
make[3]: *** [unit_tests/bin_test_all-test_main.o] Error 1
make[3]: Leaving directory '/tmp/makepkg/jellyfish/src/jellyfish-2.2.3'
Makefile:2234: recipe for target 'check-am' failed
make[2]: *** [check-am] Error 2
make[2]: Leaving directory '/tmp/makepkg/jellyfish/src/jellyfish-2.2.3'
Makefile:1774: recipe for target 'check-recursive' failed
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory '/tmp/makepkg/jellyfish/src/jellyfish-2.2.3'
Makefile:2237: recipe for target 'check' failed
make: *** [check] Error 2
wookietreiber commented 9 years ago

This error occurs on an up-to-date Arch Linux with both gcc 5.1.0 and clang 3.6.1. Note that on a CentOS 6 with gcc 4.9.2 there is no error.

wookietreiber commented 9 years ago

After enabling the verbose mode I think I know what the problem is:

With clang:

$ make V=1 check
...
clang++ -DHAVE_CONFIG_H -I.  -Dprotected=public -Dprivate=public -DJSON_IS_AMALGAMATION=1 -D_FORTIFY_SOURCE=2 -std=c++0x -g -O3 -I./unit_tests/gtest/include -I./unit_tests -I./include -std=c++0x -march=native -mfpmath=sse -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -MT unit_tests/bin_test_all-test_main.o -MD -MP -MF unit_tests/.deps/bin_test_all-test_main.Tpo -c -o unit_tests/bin_test_all-test_main.o `test -f 'unit_tests/test_main.cc' || echo './'`unit_tests/test_main.cc
In file included from unit_tests/test_main.cc:20:
In file included from ./unit_tests/gtest/gtest.h:308:
/usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/5.1.0/../../../../include/c++/5.1.0/sstream:335:14: error: '__xfer_bufptrs' redeclared with 'public' access
      struct __xfer_bufptrs
             ^
/usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/5.1.0/../../../../include/c++/5.1.0/sstream:67:14: note: previously declared 'private' here
      struct __xfer_bufptrs;
             ^
1 error generated.
Makefile:1264: recipe for target 'unit_tests/bin_test_all-test_main.o' failed
...

With gcc:

$ make V=1 check
...
g++ -DHAVE_CONFIG_H -I.  -Dprotected=public -Dprivate=public -DJSON_IS_AMALGAMATION=1 -D_FORTIFY_SOURCE=2 -std=c++0x -g -O3 -I./unit_tests/gtest/include -I./unit_tests -I./include -std=c++0x -march=native -mfpmath=sse -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -MT unit_tests/bin_test_all-test_main.o -MD -MP -MF unit_tests/.deps/bin_test_all-test_main.Tpo -c -o unit_tests/bin_test_all-test_main.o `test -f 'unit_tests/test_main.cc' || echo './'`unit_tests/test_main.cc
In file included from ./unit_tests/gtest/gtest.h:308:0,
                 from unit_tests/test_main.cc:20:
/usr/include/c++/5.1.0/sstream:335:7: error: ‘struct std::basic_stringbuf<_CharT, _Traits, _Alloc>::__xfer_bufptrs’ redeclared with different access
       struct __xfer_bufptrs
       ^
Makefile:1264: recipe for target 'unit_tests/bin_test_all-test_main.o' failed

Why is this set in Makefile.am:

bin_test_all_CPPFLAGS = -Dprotected=public -Dprivate=public -DJSON_IS_AMALGAMATION=1

I think, this rewrites somehow the stuff from the std c++ lib.

gmarcais commented 9 years ago

Hi,

this -Dprivate=public was a kludge I used at one point to test private methods of some of my classes. It always looked bad to me and it is not used anymore. I had forgotten that these flags were still in the Makefile.am.

It is fixed in the development branch. I'll make a new bugfix release tomorrow if nothing else comes up.

Thank you for the bug report.