cole-trapnell-lab / cufflinks

Boost Software License 1.0
310 stars 116 forks source link

cufflinks fails to build from source with GCC-7 #89

Closed mestia closed 7 years ago

mestia commented 7 years ago

In file included from gff.h:12:0, from gtf_tracking.h:12, from bundles.h:22, from replicates.h:10, from common.cpp:28: GHash.hh: In member function 'GHash::GHashEntry GHash::NextEntry()': GHash.hh:91:44: error: type/value mismatch at argument 1 in template parameter list for 'template struct std::hash' while (pos<fCapacity && hash[pos].hash<0) pos++; ^ GHash.hh:91:44: note: expected a type, got '0' GHash.hh: In member function 'char GHash::NextKey()': GHash.hh:415:41: error: type/value mismatch at argument 1 in template parameter list for 'template struct std::hash' while (pos<fCapacity && hash[pos].hash<0) pos++; ^ GHash.hh:415:41: note: expected a type, got '0' GHash.hh: In member function 'OBJ GHash::NextData()': GHash.hh:428:41: error: type/value mismatch at argument 1 in template parameter list for 'template struct std::hash' while (pos<fCapacity && hash[pos].hash<0) pos++; ^ GHash.hh:428:41: note: expected a type, got '0' GHash.hh: In member function 'OBJ GHash::NextData(char*&)': GHash.hh:442:41: error: type/value mismatch at argument 1 in template parameter list for 'template struct std::hash' while (pos<fCapacity && hash[pos].hash<0) pos++; ^ GHash.hh:442:41: note: expected a type, got '0'

See also: Debian bug: 871234

mestia commented 7 years ago

The issue is solved by adding parentheses around (hash[pos].hash), see this link for more details: https://lists.debian.org/debian-med/2017/09/msg00021.html

gpertea commented 7 years ago

Thank you for finding the cause and posting a solution. This seems to be a silly issue with that gcc-7 parser as it's unreasonable to treat that "hash" field as some sort of sacred keyword, enforcing a [std::]hash template there just because of its name and the "less than" operator ('<') following it !

This was actually fixed in gcc 7.1.1 -- so the fix you posted seems to be only needed for older versions of gcc 7 (?), as I was just able to compile cufflinks (without applying the proposed fix) with no such error using gcc 7.1.1 on Arch Linux (I only had to apply the lemon/error.h patch).

SamBioinformatics commented 3 years ago

I'm having the same issue using gcc version 10 - you said the solution is to add parentheses, which file should I be adding them to? Thanks