Illumina / paragraph

Graph realignment tools for structural variants
Other
150 stars 28 forks source link

Issue with json when compiling #4

Closed RSherman15 closed 6 years ago

RSherman15 commented 6 years ago

I'm trying to install Paragraph on Linux CentOS 6.9. I am currently using gcc 5.4.0, though I get the same error with 5.1.0.

After running cmake (version 3.8.2) successfully, I get the following error when running 'make' to compile.

Scanning dependencies of target graphIO [ 64%] Building CXX object external/graphtools-build/src/graphIO/CMakeFiles/graphIO.dir/GraphJson.cpp.o In file included from /home-4/rsherma8@jhu.edu/bin/packages/paragraph-tools-build/external/graphtools-src/src/graphIO/../../include/graphIO/GraphJson.hh:30:0, from /home-4/rsherma8@jhu.edu/bin/packages/paragraph-tools-build/external/graphtools-src/src/graphIO/GraphJson.cpp:25:

...

/home-4/rsherma8@jhu.edu/bin/packages/paragraph-tools-build/external/graphtools-src/src/graphIO/../../external/include/nlohmann/json.hpp:17216:25: required from here /home-4/rsherma8@jhu.edu/bin/packages/paragraph-tools-build/external/graphtools-src/src/graphIO/../../external/include/nlohmann/json.hpp:8678:43: error: logical ‘and’ of mutually exclusive tests is always false [-Werror=logical-op] const bool is_negative = (x <= 0) and (x != 0); // see issue #755 ^ cc1plus: all warnings being treated as errors make[2]: [external/graphtools-build/src/graphIO/CMakeFiles/graphIO.dir/GraphJson.cpp.o] Error 1 make[1]: [external/graphtools-build/src/graphIO/CMakeFiles/graphIO.dir/all] Error 2 make: *** [all] Error 2

I found issue #755 in the json repo but they seem to have fixed the issue in release in 2017, and it seems to be related to using the Intel icpc compiler, which I am not using. It does appear that perhaps it also appears with gcc 5.2; I tried using gcc 4.9.2 instead of 5.1.0 or 5.4.0, but gcc 4.9.0 yielded other errors, before this point in the compilation process. If this is related to gcc version, what version(s) has Paragraph been successfully compiled with?

RSherman15 commented 6 years ago

Solved by making the change made in this commit to json.hpp

However, I'm leaving this open since the json.hpp file included in Paragraph should probably be updated.

egor-dolzhenko commented 6 years ago

Thank you for reporting and solving the issue! All developers are off this week but we will incorporate the fix early next week. Also, if you’d like, please feel free to make a pull request.

-Egor

fritzsedlazeck commented 6 years ago

Hi Guys, have you had a chance to fix this. I am running into the same problem on our cluster. Thx Fritz

felixschlesinger commented 6 years ago

I couldn't reproduce this build issue, even after installing gcc5 (5.5) on my system. But I made a branch with the change suggested by @RSherman15. Could you try branch 'GH4' and let me know if it works for you. If yes, we can make a hotfix release with that. Longer term, for the next paragraph release, we'll update the library or remove the dependency completely

pkrusche commented 6 years ago

Also I have created a repository that show how to compile on CentOS + has a script create a binary using Docker that can then just be unpacked + run on CentOS.

https://github.com/pkrusche/CentOS-Docker-build

Hope this is useful!

pkrusche commented 6 years ago

@RSherman15 does the last version fix this for you? I’ve tried it from scratch on Ubuntu 16.04 with gcc 5.4 and it looks fine there.

RSherman15 commented 6 years ago

Since I was able to get it compiled by modifying the included json.hpp file, I'm not sure if the Docker build works or not as I haven't tried it - sorry!

zakalibit commented 6 years ago

I changed to this and it makes compiler happy

const bool is_negative = !(x>=0);

pkrusche commented 6 years ago

I think the Docker build should be working now. I've created a PR here: #11 to fix an unrelated Docker build issue that has come up because we were using Ubuntu 17.04 as a base.