psathyrella / partis

B- and T-cell receptor sequence annotation, simulation, clonal family and germline inference, and affinity prediction
GNU General Public License v3.0
55 stars 34 forks source link

installation on CentOS #222

Closed HaiaK closed 6 years ago

HaiaK commented 7 years ago

when I try ./bin/build.sh after installing all the dependences I get

building ig-sw [?1034hscons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... gcc -o ig_align.o -c -std=gnu99 -Ofast -I. -Itclap ig_align.c cc1: error: invalid option argument '-Ofast' scons: *** [ig_align.o] Error 1 scons: building terminated because of errors.

psathyrella commented 7 years ago

huh, centos must have a different gcc version or something. As a quick fix you can probably change -Ofast to -O3 in two places in packages/ham/src/SConscript. I'll do some digging to figure out if that slows us down much (probably not) or if there's another fix.

psathyrella commented 7 years ago

actually could you also post the output of gcc --version?

HaiaK commented 7 years ago

I've changed the -Ofast to -O3 and I got the same error

the gcc --version is gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-17)

psathyrella commented 7 years ago

I'm at a loss, then -- it looks like while red hat gcc doesn't have -Ofast, it has -O3:

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/4/html/Using_the_GNU_Compiler_Collection/optimize-options.html

just to make sure, that's capital letter 'O'?

If so, you'll probably have to either switch gcc versions (gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4 works, but I'm not expert enough in gcc optimization compatibility to know whether it's the 4.8 or ubuntu that is causing the problem -- or install with docker.

Irrationone commented 7 years ago

If it helps, I've been running partis on CentOS 5 -- I used the -O3 flag and gcc 5.1.0 to build. 4.4.7 is probably just too old.

Also, you need to change it within ig-sw/src/ig_align/SConstruct

HaiaK commented 7 years ago

I changed the -O3 flag in the ig-sw/src/ig_align/SConstruct and tried ./bin/build.sh again it's a progress but encountered a new error `--> running ./bin/build.sh

--> building samtools make: Nothing to be done for `all'.

--> building ig-sw scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... gcc -o ig_align.o -c -std=gnu99 -O3 -I. -Itclap ig_align.c gcc -o ksw.o -c -std=gnu99 -O3 -I. -Itclap ksw.c gcc -o kstring.o -c -std=gnu99 -O3 -I. -Itclap kstring.c g++ -o ig_align_main.o -c -I. -Itclap ig_align_main.cpp g++ -o ig-sw ig_align.o ksw.o kstring.o ig_align_main.o -lz -lpthread scons: done building targets.

--> building ham scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... g++ -o _build/bcrham.o -c -O3 -Wall -std=c++0x -DEPS=1e-6 -DPI=3.1415926535897932 -DSIZE_MAX=((size_t)-1) -DSTATE_MAX=500 -Iinclude _build/bcrham.cc In file included from include/trellis.h:10, from include/dphandler.h:12, from _build/bcrham.cc:12: include/tracebackpath.h: In constructor ‘ham::TracebackPath::TracebackPath()’: include/tracebackpath.h:18: error: ‘nullptr’ was not declared in this scope In file included from include/dphandler.h:12, from _build/bcrham.cc:12: include/trellis.h: At global scope: include/trellis.h:20: error: ‘nullptr’ was not declared in this scope include/trellis.h:21: error: ‘nullptr’ was not declared in this scope In file included from include/dphandler.h:14, from _build/bcrham.cc:12: include/bcrutils.h:57: error: expected primary-expression before ‘{’ token In file included from include/dphandler.h:14, from _build/bcrham.cc:12: include/bcrutils.h:150: error: ‘nullptr’ was not declared in this scope In file included from _build/bcrham.cc:12: include/dphandler.h:26: error: expected primary-expression before ‘{’ token In file included from _build/bcrham.cc:12: include/dphandler.h:27: error: expected primary-expression before ‘{’ token include/dphandler.h:28: error: expected primary-expression before ‘{’ token In file included from _build/bcrham.cc:16: include/glomerator.h: In constructor ‘ham::Query::Query(std::string, std::vector<ham::Sequence, std::allocator<ham::Sequence> >, bool, std::vector<std::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::basic_string<char, std::char_traits, std::allocator > > >, ham::KBounds, float, size_t, std::string, std::string)’: include/glomerator.h:40: error: expected initializer before ‘:’ token include/glomerator.h:43: error: expected primary-expression before ‘}’ token include/glomerator.h:43: error: expected ‘;’ before ‘}’ token include/glomerator.h:43: error: expected primary-expression before ‘}’ token include/glomerator.h:43: error: expected ‘)’ before ‘}’ token include/glomerator.h:43: error: expected primary-expression before ‘}’ token include/glomerator.h:43: error: expected ‘;’ before ‘}’ token include/glomerator.h: At global scope: include/glomerator.h:105: error: ‘nullptr’ was not declared in this scope include/glomerator.h:109: error: ‘nullptr’ was not declared in this scope scons: *\ [_build/bcrham.o] Error 1 scons: building terminated because of errors.`

psathyrella commented 7 years ago

Is this still with the old version of gcc? I'm looking into switching from -Ofast to -O3 to support red hat flavors, but I think nullptr is just a regular part of the c++0x standard

HaiaK commented 7 years ago

Yes I'm still trying with the old version of gcc

I added -std=gnu++0x to the ham/src/SConscript but it didnt change a thing, should I do something in between ?

matsen commented 7 years ago

I suggest that we change to -std=c++11 based on this SO post. Basically, it appears that older compilers that weren't fully C++11 compliant run fine with -std=c++0x. We need full compliance here.

psathyrella commented 7 years ago

I'm certainly happy switching to -std=c++11, so I'll do that. probably along with going to -O3.

As far as @HaiaK, there's no way to know how many more steps we have til we can get it working with the old gcc. You're welcome to keep trying things to work around that, but if it were me I might try upgrading gcc (which is quite likely to not work, since the rest of the system is probably of a similar vintage, so there's a good chance we'll run into version problems with other pieces of software.

So if upgrading to a recent overall distro isn't in the cards, I'd say this is exactly the kind of situation that'll be more efficient with Docker.

psathyrella commented 7 years ago

ok, I switched to c++11 on dev, and was going to switch to -O3, but realized -Ofast isn't a red hat/ubuntu difference, it's just a gcc 4.4 vs 4.8 thing, and rhel 7 (july 2014) has 4.8, so I think I'll leave it with -Ofast.

HaiaK commented 7 years ago

which version of python you are using ?

psathyrella commented 7 years ago

python 2.7

And just for posterity, the way to track down versions is starting here: https://hub.docker.com/r/psathyrella/partis/~/dockerfile/

which leads to here: https://github.com/matsengrp/dockerfiles/blob/master/cpp/Dockerfile

and can keep going from there if necessary.