GATB / bcalm

compacted de Bruijn graph construction in low memory
MIT License
99 stars 20 forks source link

error: 'predecessors' following the 'template' keyword does not refer to a template #54

Closed sjackman closed 4 years ago

sjackman commented 4 years ago

Bcalm 2.2.1 fails to build with clang on macOS 10.15.

In file included from /tmp/bcalm-20200120-5545-zrb02j/build/ext/gatb-core/src/gatb/template/TemplateSpecialization5.cpp.in_128.cpp:5:
1373
/tmp/bcalm-20200120-5545-zrb02j/gatb-core/gatb-core/src/gatb/debruijn/impl/BranchingAlgorithm.cpp:155:58: error: 'predecessors' following the 'template' keyword does not refer to a template
1374
        GraphVector<Node> predecessors = graph->template predecessors (node);
1375
                                                         ^
1376

See https://github.com/brewsci/homebrew-bio/pull/870/checks?check_run_id=399734948#step:3:1373 and https://github.com/brewsci/homebrew-bio/pull/870

rchikhi commented 4 years ago

thanks for the report! I don't own a Mac. Any idea what's a simple fix here?

sjackman commented 4 years ago

I suspect (but haven't tried) that you could reproduce this error with clang on Linux.

rchikhi commented 4 years ago

Worth a try !

(base) [rayan@blok-bok bcalm]$ mkdir buildclang
(base) [rayan@blok-bok bcalm]$ cd buildclang
(base) [rayan@blok-bok buildclang]$ export CC=/usr/bin/clang
(base) [rayan@blok-bok buildclang]$ export CXX=/usr/bin/clang++
(base) [rayan@blok-bok buildclang]$  cmake .. && make -j8
-- The C compiler identification is Clang 9.0.0
-- The CXX compiler identification is Clang 9.0.0
[..]
6 warnings generated.
6 warnings generated.
[100%] Linking CXX executable bcalm
[100%] Built target bcalm

"unfortunately" it works with clang 9.0.0 on Linux

sjackman commented 4 years ago

Do you have CI set up for this repository? I'm really liking GitHub Actions for CI. It has both Linux and macOS runners.

rchikhi commented 4 years ago

yes in fact there's Travis (with clang 3.7) that generates Mac binaries every release. Good to know about Github Actions!

sjackman commented 4 years ago

The error is from this line

GraphVector<Node> predecessors = graph->template predecessors (node);

error: 'predecessors' following the 'template' keyword does not refer to a template

In the current gatb-core that line removes the template word:

        GraphVector<Node> predecessors = graph->predecessors (node);

https://github.com/GATB/gatb-core/blob/1dc23ffdba8e53b6f8b13973f3e74b519fb7b5d1/gatb-core/src/gatb/debruijn/impl/BranchingAlgorithm.cpp#L155

I have no idea which one it should be.

rchikhi commented 4 years ago

ha thanks for the investigation! according to https://github.com/GATB/gatb-core/issues/28#issuecomment-497351218 it should be the latter! so problem should go away in next release

sjackman commented 4 years ago

Glad to hear it. Thanks, Rayan!