Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make install fails on gcc 7.1.1-64bit #416

Closed
furkanusta opened this issue Jun 28, 2017 · 6 comments
Closed

make install fails on gcc 7.1.1-64bit #416

furkanusta opened this issue Jun 28, 2017 · 6 comments
Labels
Milestone

Comments

@furkanusta
Copy link
Contributor

Hi, I've just learned about this library and decided to try. However, 'make install' failed in various occasions

First:
cereal/archives/json.hpp:211:33: warning: this statement may fall through [-Wimplicit-fallthrough=]
and failed because CMake sets -Werror by default.

After disabling it, it couldn't find <gnu/stubs-32.h> in cereal/unittests/memory.cpp:28
After installing 32-bit development libraries for glibc (I am on a 64-bit system), it passed that one and failed at

Linking CXX executable test_memory_32:
cannot find -lgcc

I suppose I need to recompile gcc with multilib support to fix this because I couldn't find gcc-multilib in openSuse repositories. It would be quite useful if cereal didn't require 32-bit libraries in an 64-bit system.

I've installed the library and skipped tests for now, but I thought it would be useful to share my experience.

If any more information is needed to reproduce, I can provide

@erichkeane
Copy link
Contributor

Are you attempting to compile 'master' or a different directory? The 28th line of memory.cpp is "#include "memory.hpp", which includes "common.hpp", but a grep of the source base doesn't show a single reference to stubs-32.h.

As far as the fallthrough, it seems that we disable it in rapidjson/internal/regex.h (possibly not re-enabling it?), but a fresh compile of cereal seems to work for me. However, it DOES seem that we still have the problem in the code, so perhaps the disable is working?

@erichkeane
Copy link
Contributor

Additionally, I note the disable in regex.h is only #ifdef clang.

@furkanusta
Copy link
Contributor Author

First of all I am sorry that I got the stacktrace backwards and it looks like gnu/stubs came from type_traits in libstdc++, but 32-bit libraries still were a problem. I am not sure if it is a compiler, cmake or library bug but it required 32-bit libstdc++ and 32-bit gcc. After installing both of those, now make works fine.

I'll update here after make and the tests finish

@AzothAmmo
Copy link
Contributor

Apparently the fallthrough warning is new in GCC 7 (https://dzone.com/articles/implicit-fallthrough-in-gcc-7). We actually do want the switch statement to fall through here - since the [[fallthrough]] attribute is c++17, it looks like the easiest fix is to add a /* fall through */ comment before appropriate cases.

cereal doesn't actually require 32 bit to work, we just try to build unit tests for both 32 and 64 bit. You can disable the 32 bit tests with the CMAKE flag SKIP_PORTABILITY_TEST.

@AzothAmmo AzothAmmo added the bug label Jun 28, 2017
@AzothAmmo AzothAmmo added this to the v1.2.3 milestone Jun 28, 2017
@furkanusta
Copy link
Contributor Author

furkanusta commented Jun 28, 2017

It looks like 32-bit library thing is related to gcc and reported Bug 54444, and I am supposing gcc-32 bit is necessary for linkers (though not sure). However, after installing both it now completed all of the tests without an error

AzothAmmo added a commit that referenced this issue Sep 7, 2017
Fix for #416, Implicit falltrough warning on GCC7.1 (Re-sending)
@AzothAmmo
Copy link
Contributor

merged PR to fix

WSoptics pushed a commit to WSoptics/cereal that referenced this issue Mar 15, 2018
Instead of adding std::fallthrough, this one disables
implicit-fallthrough warnings via pragma push/pop mechanism
WSoptics pushed a commit to WSoptics/cereal that referenced this issue Mar 15, 2018
Also, this one fixes the forgotten pragma pop at the end of the header file
jrmadsen pushed a commit to jrmadsen/cereal that referenced this issue Jul 7, 2019
Instead of adding std::fallthrough, this one disables
implicit-fallthrough warnings via pragma push/pop mechanism
jrmadsen pushed a commit to jrmadsen/cereal that referenced this issue Jul 7, 2019
Also, this one fixes the forgotten pragma pop at the end of the header file
jrmadsen pushed a commit to jrmadsen/cereal that referenced this issue Jul 7, 2019
Instead of adding std::fallthrough, this one disables
implicit-fallthrough warnings via pragma push/pop mechanism
jrmadsen pushed a commit to jrmadsen/cereal that referenced this issue Jul 7, 2019
Also, this one fixes the forgotten pragma pop at the end of the header file
JerryRyan pushed a commit to JerryRyan/cereal that referenced this issue Jan 6, 2020
Instead of adding std::fallthrough, this one disables
implicit-fallthrough warnings via pragma push/pop mechanism
JerryRyan pushed a commit to JerryRyan/cereal that referenced this issue Jan 6, 2020
Also, this one fixes the forgotten pragma pop at the end of the header file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants