dib-lab / khmer

In-memory nucleotide sequence k-mer counting, filtering, graph traversal and more
http://khmer.readthedocs.io/
Other
756 stars 296 forks source link

khmer 2.0 doesn't compile under g++ 4.4.7 #1322

Closed ctb closed 9 years ago

ctb commented 9 years ago

(This is the version of gcc/g++ installed on the MSU HPCC.)

I swapped out '-std=c++11' for '-std=gnu++0x' and got through most of the compilation, until:

lib/hashtable.cc: In member function ?void khmer::Hashtable::calc_connected_grap
h_size(khmer::Kmer, long long unsigned int&, khmer::KmerSet&, long long unsigned
 int, bool) const?:
lib/hashtable.cc:763: error: expected primary-expression before ?[? token
lib/hashtable.cc:763: error: expected primary-expression before ?]? token
lib/hashtable.cc:763: error: expected primary-expression before ?&? token
lib/hashtable.cc:763: error: ?n? was not declared in this scope
lib/hashtable.cc:763: error: unable to deduce ?auto? from ?<expression error>?
lib/hashtable.cc:763: error: expected ?,? or ?;? before ?{? token
lib/hashtable.cc: In member function ?unsigned int khmer::Hashtable::traverse_from_kmer(khmer::Kmer, unsigned int, khmer::KmerSet&, unsigned int) const?:
lib/hashtable.cc:944: error: expected primary-expression before ?[? token
lib/hashtable.cc:944: error: expected primary-expression before ?]? token
lib/hashtable.cc:944: error: expected primary-expression before ?&? token
lib/hashtable.cc:944: error: ?n? was not declared in this scope
lib/hashtable.cc:944: error: unable to deduce ?auto? from ?<expression error>?
lib/hashtable.cc:944: error: expected ?,? or ?;? before ?{? token
error: command '/usr/bin/gcc' failed with exit status 1

which seems to be having problems with this code:

    // Avoid high-circumference k-mers
    auto filter = [&] (Kmer& n) {
        return !(break_on_circum &&
                 traverser.degree(n) > 4);
    };

Can this be re-written in a more backwards-compatible way, @camillescott?

ref #1231

ctb commented 9 years ago

Turns out the HPC has a much updated version of GCC available under the GNU package --

On dev-intel14-phi, this works:

% module load GNU/4.8.3
% module load khmer/2.0

and it seems like the right version of khmer and screed, although for
some reason the version string (e.g. by execing split-paired-reads.py) doesn't
show up.  Huh.
qingpeng commented 8 years ago

I got kind of similar problem while I tried to install khmer2.0 on NERSC HPC with lower version gcc (4.6.3). (requiring C++11 feature which is not supported by gcc 4.6.x). ( see below)

It worked when I switched the gcc to 4.8.1. Hope this helps.

gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DVERSION=2.0 -DSEQAN_HAS_BZIP2=1 -DSEQAN_HAS_ZLIB=1 -UNO_UNIQUE_RC -Ilib -Ithird-party/zlib -Ithird-party/bzip2 -Ithird-party/seqan/core/include -Ithird-party/smhasher -I/global/homes/q/qpzhang/anaconda/envs/khmerEnv/include/python2.7 -c khmer/_khmer.cc -o build/temp.linux-x86_64-2.7/khmer/_khmer.o -O3 -std=c++11 -pedantic -fopenmp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for Ada/C/ObjC but not for C++ [enabled by default]
cc1plus: error: unrecognized command line option '-std=c++11'
error: command 'gcc' failed with exit status 1
camillescott commented 8 years ago

Yup, the new graph traversal features require GCC 4.7 -- there's a discussion on it somewhere from back when I was implementing them.

On Tue, Nov 17, 2015 at 8:24 PM, Qingpeng Zhang notifications@github.com wrote:

I got kind of similar problem while I tried to install khmer2.0 on NERSC HPC with lower version gcc (4.6.3). (requiring C++11 feature which is not supported by gcc 4.6.x). ( see below)

It worked when I switched the gcc to 4.8.1. Hope this helps.

gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DVERSION=2.0 -DSEQAN_HAS_BZIP2=1 -DSEQAN_HAS_ZLIB=1 -UNO_UNIQUE_RC -Ilib -Ithird-party/zlib -Ithird-party/bzip2 -Ithird-party/seqan/core/include -Ithird-party/smhasher -I/global/homes/q/qpzhang/anaconda/envs/khmerEnv/include/python2.7 -c khmer/_khmer.cc -o build/temp.linux-x86_64-2.7/khmer/_khmer.o -O3 -std=c++11 -pedantic -fopenmp cc1plus: warning: command line option '-Wstrict-prototypes' is valid for Ada/C/ObjC but not for C++ [enabled by default] cc1plus: error: unrecognized command line option '-std=c++11' error: command 'gcc' failed with exit status 1

— Reply to this email directly or view it on GitHub https://github.com/dib-lab/khmer/issues/1322#issuecomment-157601448.

Camille Scott

Department of Computer Science Lab for Data Intensive Biology University of California, Davis

camille.scott.w@gmail.com

ctb commented 8 years ago

From Chris Bills:


After doing some digging into it, I discovered RedHat's Developer     
Toolsets, which is re-packaged and available for CentOS users (like us)
by CERN for Scientific Linux. You may already be aware of it, so perhaps
old news to you, but I'm a sysadmin and not as current as I should be
about development.

Anyhow, in case other CentOS users ask, here's more information that
will get them a compiler for the 21st century. ;)

http://linux.web.cern.ch/linux/scientific6/docs/softwarecollections.shtml