torognes / swarm

A robust and fast clustering method for amplicon-based studies
GNU Affero General Public License v3.0
123 stars 23 forks source link

Compatibility with old GCC versions? #113

Closed frederic-mahe closed 6 years ago

frederic-mahe commented 6 years ago

On one of the clusters I have access to, only GCC 4.4.7 is available:

gcc --version
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

swarm's compilation fails with GCC 4.4.7:

make -j
g++ -g -Wall -Wsign-compare -Wextra -Wpedantic -Wno-long-long -O3 -msse2 -mtune=core2 -Icityhash   -c -o swarm.o swarm.cc
g++ -g -Wall -Wsign-compare -Wextra -Wpedantic -Wno-long-long -O3 -msse2 -mtune=core2 -Icityhash   -c -o db.o db.cc
g++ -g -Wall -Wsign-compare -Wextra -Wpedantic -Wno-long-long -O3 -msse2 -mtune=core2 -Icityhash   -c -o search8.o search8.cc
g++ -g -Wall -Wsign-compare -Wextra -Wpedantic -Wno-long-long -O3 -msse2 -mtune=core2 -Icityhash   -c -o search16.o search16.cc
g++ -g -Wall -Wsign-compare -Wextra -Wpedantic -Wno-long-long -O3 -msse2 -mtune=core2 -Icityhash   -c -o nw.o nw.cc
g++ -g -Wall -Wsign-compare -Wextra -Wpedantic -Wno-long-long -O3 -msse2 -mtune=core2 -Icityhash   -c -o matrix.o matrix.cc
g++ -g -Wall -Wsign-compare -Wextra -Wpedantic -Wno-long-long -O3 -msse2 -mtune=core2 -Icityhash   -c -o util.o util.cc
g++ -g -Wall -Wsign-compare -Wextra -Wpedantic -Wno-long-long -O3 -msse2 -mtune=core2 -Icityhash   -c -o scan.o scan.cc
g++ -g -Wall -Wsign-compare -Wextra -Wpedantic -Wno-long-long -O3 -msse2 -mtune=core2 -Icityhash   -c -o algo.o algo.cc
g++ -g -Wall -Wsign-compare -Wextra -Wpedantic -Wno-long-long -O3 -msse2 -mtune=core2 -Icityhash   -c -o algod1.o algod1.cc
g++ -g -Wall -Wsign-compare -Wextra -Wpedantic -Wno-long-long -O3 -msse2 -mtune=core2 -Icityhash   -c -o qgram.o qgram.cc
g++ -g -Wall -Wsign-compare -Wextra -Wpedantic -Wno-long-long -O3 -msse2 -mtune=core2 -Icityhash -mssse3 -c -o ssse3.o ssse3.cc
g++ -g -Wall -Wsign-compare -Wextra -Wpedantic -Wno-long-long -O3 -msse2 -mtune=core2 -Icityhash   -c -o derep.o derep.cc
g++ -g -Wall -Wsign-compare -Wextra -Wpedantic -Wno-long-long -O3 -msse2 -mtune=core2 -Icityhash   -c -o arch.o arch.cc
g++ -g -Wall -Wsign-compare -Wextra -Wpedantic -Wno-long-long -O3 -msse2 -mtune=core2 -Icityhash   -c -o cityhash/city.o cityhash/city.cc
cc1plus: error: unrecognized command line option "-Wpedantic"cc1plus: error: unrecognized command line option "-Wpedantic"cc1plus: error: unrecognized command line option "-Wpedantic"cc1plus: error: unrecognized command line option "-Wpedantic"cc1plus: error: unrecognized command line option "-Wpedantic"cc1plus: error: unrecognized command line option "-Wpedantic"

cc1plus: error: unrecognized command line option "-Wpedantic"

cc1plus: error: unrecognized command line option "-Wpedantic"

cc1plus: error: unrecognized command line option "-Wpedantic"cc1plus: error: unrecognized command line option "-Wpedantic"cc1plus: error: unrecognized command line option "-Wpedantic"cc1plus: error: unrecognized command line option "-Wpedantic"

cc1plus: error: unrecognized command line option "-Wpedantic"cc1plus: error: unrecognized command line option "-Wpedantic"

cc1plus: error: unrecognized command line option "-Wpedantic"
make: *** [db.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [matrix.o] Error 1
make: *** [util.o] Error 1
make: *** [scan.o] Error 1
make: *** [search8.o] Error 1
make: *** [nw.o] Error 1
make: *** [search16.o] Error 1
make: *** [algod1.o] Error 1
make: *** [qgram.o] Error 1
make: *** [ssse3.o] Error 1
make: *** [derep.o] Error 1
make: *** [arch.o] Error 1
make: *** [cityhash/city.o] Error 1
make: *** [swarm.o] Error 1
make: *** [algo.o] Error 1

As of today, GCC's supported releases are:

GCC 7.3 (changes)
    Status: 2018-01-25 (regression fixes & docs only).
    Serious regressions. All regressions.
GCC 6.4 (changes)
    Status: 2017-07-04 (regression fixes & docs only).
    Serious regressions. All regressions.
Development: GCC 8.0 (release criteria, changes)
    Status: 2018-03-27 (regression fixes & docs only).
    Serious regressions. All regressions.

Should we keep trying to get swarm to compile with older GCC releases (namely, older than 6.4)?

frederic-mahe commented 6 years ago

Today, I've written a script that automatically tests swarm's compilation with GCC 4.8.5, 4.9, 5.1, 5.2, 5.3, 5.4, 5.5, 6.1, 6.2, 6.3, 6.4, 7.1, 7.2, 7.3, and 8.0. All but 8.0 pass without errors or warnings.

I've also written a script that tests swarm's compilation with clang 3.8, 3.9, 5.0, 6.0 and 7 (packages' source). No warnings or errors.

torognes commented 6 years ago

I have access to a machine with the following gcc versions: 4.4.7, 4.7.2, 4.9.0, 5.1.0, 6.1.0, 4.8.0, 4.9.1, 5.2.0, 6.3.0, 4.8.2, 4.9.2, 5.3.0, 7.2.0. Travis CI also has support for multiple gcc versions.

I think we should continue to support all these versions.

I usually compile swarm (and vsearch) with gcc 4.9.2 for the binary releases, because it then refers to libraries that are available on all systems. Newer version will link to newer libraries that are not always available.

The only problems seems to be the warning generated by gcc 4.4.7 and 4.7.2 due to the -Wpedantic option. I can modify the Makefile to include this option only with gcc 4.8 and later.

frederic-mahe commented 6 years ago

I can modify the Makefile to include this option only with gcc 4.8 and later.

That would be the best solution (use -pedantic if $VERSION < 4.8).

torognes commented 6 years ago

It seems like the -pedantic option is supported by all versions, while -Wpedantic is only supported by 4.8 and later. The simplest solution is therefore to go for just -pedantic. That fix is now committed.

frederic-mahe commented 6 years ago

OK. We should keep an eye on that issue though. The option -pedantic is deprecated since GCC 4.8 and might disappear from future GCC versions:

The new option -Wpedantic is an alias for -pedantic, which is now deprecated.

swarm compiles without warnings with -pedantic on all GCC versions (from 4.8 to 8.0).