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

Does not build using gcc 6 #106

Open
tillea opened this issue Jan 20, 2016 · 16 comments
Open

Does not build using gcc 6 #106

tillea opened this issue Jan 20, 2016 · 16 comments

Comments

@tillea
Copy link

tillea commented Jan 20, 2016

Hi,

as you can read in the Debian bug report sga does not build when using gcc 6 due to more strict type checking:

https://bugs.debian.org/811664

It results in

g++ -DHAVE_CONFIG_H -I. -I.. -I../Bigraph -I../Thirdparty -Wdate-time -D_FORTIFY_SOURCE=2 -fopenmp -I/usr//include -I/usr//include/bamtools -Wall -Wextra -Wno-unknown-pragmas -O3 -c -o libutil_a-VariantIndex.o test -f 'VariantIndex.cpp' || echo './'VariantIndex.cpp
ClusterReader.cpp: In member function 'bool ClusterReader::readCluster(ClusterRecord&)':
ClusterReader.cpp:70:41: error: cannot convert 'std::basic_istream' to 'bool' in initialization
bool good = getline(*m_pReader, line);
^

Makefile:722: recipe for target 'libutil_a-ClusterReader.o' failed
make[3]: *** [libutil_a-ClusterReader.o] Error 1
make[3]: *** Waiting for unfinished jobs....
StdAlnTools.cpp: In function 'std::__cxx11::string StdAlnTools::expandCigar(const string&)':
StdAlnTools.cpp:122:34: error: cannot convert 'std::basic_istream' to 'bool' in initialization
bool success = parser >> code;
^~~~

Makefile:750: recipe for target 'libutil_a-StdAlnTools.o' failed

Please note that there might be more issues later in the build sequence.

Kind regards

      Andreas.
@jts
Copy link
Owner

jts commented Jan 20, 2016

Thanks for the report, I will look into this.

@jts
Copy link
Owner

jts commented Jan 20, 2016

I don't have easy access to GCC 6 right now, is this reproducible with stricter flags on GCC 4.9.x?

@mateidavid
Copy link
Contributor

Wow- so gcc6 disallows implicit conversion of std::basic_istream to bool, meaning that this becomes illegal:

std::string s;
while (std::getline(std::cin, s)) process_line(s);

I haven't read about gcc6, but this seems a bit extreme. Can this be one of those things that might get tweaked before an official release?

@tillea
Copy link
Author

tillea commented Jan 20, 2016

jts: is this reproducible with stricter flags on GCC 4.9.x?

I do not think so. Otherwise the bug reporter would not have given explicit hints how to use gcc-6 from Debian experimental.

@jts
Copy link
Owner

jts commented Jan 29, 2016

Does this error occur if you pass the -std=c++03 flag to GCC 6?

@SHuang-Broad
Copy link

This is the same error as in issue #108 . Compiling with clang has the same issue.

@mateidavid
Copy link
Contributor

As explained here: #108 (comment), an easy way to add -std=c++03 is to replace make with make CXXFLAGS="-O3 -std=c++03". Please let us know if it solves the problems.

Alternatively, where can we find a docker image with gcc-6.0?

@mr-c
Copy link
Contributor

mr-c commented Feb 3, 2016

@mateidavid Here's a Debian unstable + gcc 6 docker image: https://hub.docker.com/r/biocrusoe/debian-gcc6/

docker pull biocrusoe/debian-gcc6

@mateidavid
Copy link
Contributor

@mr-c: Thanks for stepping in. But it doesn't work yet, I'm getting:

$ docker pull biocrusoe/docker-gcc6
Using default tag: latest
Pulling repository docker.io/biocrusoe/docker-gcc6
Tag latest not found in repository docker.io/biocrusoe/docker-gcc6

@mr-c
Copy link
Contributor

mr-c commented Feb 3, 2016

@mateidavid Whoops; I forgot to tag and push. I don't do this often :-) I also renamed the image (and updated my instructions above).

Does docker pull biocrusoe/debian-gcc6 work for you?

@mateidavid
Copy link
Contributor

I got it now. I needed g++ not just gcc, and the other build requirements (zlib1g-dev, etc). But I got the Dockerfile and put them in myself, thanks! I can now see the OP error.

@gerddie
Copy link

gerddie commented Jul 5, 2016

Actually, you should also be able to reproduce the error by setting -std=c++11 with any compiler that is advanced enough to support it (AFAIK that includes g++-4.9).

@mateidavid The while loop should still work, but assignment to a bool variable has to be make explicit.

@mateidavid
Copy link
Contributor

PR #110 fixes this (at least it did back when I wrote it).

@gerddie
Copy link

gerddie commented Jul 5, 2016

Great, I'll try to use it to fix the Debian package.

As a side note of personal taste I'd suggest using .good() or ! ... .fail() instead of the static_cast on the stream, because it would probably look more readable ...

@tillea
Copy link
Author

tillea commented Jul 5, 2016

Hi,

thanks for the hint. I'll integrate the patch into the Debian
package.

Kind regards

   Andreas.

On Tue, Jul 05, 2016 at 06:32:30AM -0700, Matei David wrote:

PR #110 fixes this (at least it did back when I wrote it).


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#106 (comment)

http://fam-tille.de

@jts
Copy link
Owner

jts commented Jul 5, 2016

I've merged @mateidavid's PR (thanks)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants