qmarcou / IGoR

IGoR is a C++ software designed to infer V(D)J recombination related processes from sequencing data. Find full documentation at:
https://qmarcou.github.io/IGoR/
GNU General Public License v3.0
47 stars 25 forks source link

Compilation issue with GCC 8.1 on Mac OS X #22

Open zacmon opened 6 years ago

zacmon commented 6 years ago

Hi,

I'm having a problem installing the software on a MacBook Pro 17" (late 2011, OS X version 10.10.5). I have GCC 8.1 installed via Homebrew. To begin I run ./configure CC=gcc-8 CXX=g++-8 and then I run make. During the make process, however, I receive the following error, causing the process to crash:

Undefined symbols for architecture x86_64: "comp_nt_int(int const&, int const&)", referenced from: Deletion::iterate(double&, Enum_fast_memory_map<Seq_type, double>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Int_Str const&, Enum_fast_memory_map<int, unsigned long>&, std::uno rdered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<std::pair<std::shared_ptr<Rec_Event const>, int>, std::allocator<std::pair<std::shared_ptr<Rec_Event const>, int> > >, std::h ash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_ string<char, std::char_traits<char>, std::allocator<char> > const, std::vector<std::pair<std::shared_ptr<Rec_Event const>, int>, std::allocator<std::pair<std::shared_ptr<Rec_Event const>, int> > > > > > const&, std::shared_ptr<Re c_Event*>&, std::unique_ptr<long double [], std::default_delete<long double []> >&, std::unique_ptr<long double [], std::default_delete<long double []> > const&, std::unordered_map<Gene_class, std::vector<Alignment_data, std::all ocator<Alignment_data> >, std::hash<Gene_class>, std::equal_to<Gene_class>, std::allocator<std::pair<Gene_class const, std::vector<Alignment_data, std::allocator<Alignment_data> > > > > const&, Enum_fast_memory_map<Seq_type, Int_ Str*>&, Enum_fast_memory_dual_key_map<Seq_type, Seq_side, int>&, std::shared_ptr<Error_rate>&, std::map<unsigned long, std::shared_ptr<Counter>, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, std::shared_ ptr<Counter> > > >&, std::unordered_map<std::tuple<Event_type, Gene_class, Seq_side>, std::shared_ptr<Rec_Event>, std::hash<std::tuple<Event_type, Gene_class, Seq_side> >, std::equal_to<std::tuple<Event_type, Gene_class, Seq_side > >, std::allocator<std::pair<std::tuple<Event_type, Gene_class, Seq_side> const, std::shared_ptr<Rec_Event> > > > const&, Enum_fast_memory_map<Event_safety, bool>&, Enum_fast_memory_map<Seq_type, std::vector<int, std::allocator< int> >*>&, double&, double&) in igor-Deletion.o ld: symbol(s) not found for architecture x86_64 collect2: error: ld returned 1 exit status make[2]: *** [igor] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2

I've also attached the entire make log in case this snippet isn't satisfactory. make.log

qmarcou commented 6 years ago

Hi @zacmontague , Thank your for submitting a bug report. It's the second time this error is reported and I was not able to diagnose the exact reason the first time. Last time the user also had a Mac (although more recent) and GCC 8.1. I had asked whether downgrading to a more ancient version of, e.g GCC 7.3 (the one I'm personally using) solved the problem and did not hear back from the problem. Could you try downgrading your GCC see if this solves your problem?

Also: does your make.log file also contain the error stream? If not could you create a log file containing both the stdout and error stream using: make >>make.log 2>&1

Thanks!

zacmon commented 6 years ago

Hi,

I attached two logs, one using GCC 8.1 and one using GCC 7.3, using the command you instructed me to use. I think the make and make install have been successful now by using GCC 7.3. Executing make check gives an error, however:

Making check in cdf /Library/Developer/CommandLineTools/usr/bin/make test gcc-7 -DHAVE_CONFIG_H -I. -I.. -I.. -g -O2 -MT test.o -MD -MP -MF .deps/test.Tpo -c -o test.o test.c mv -f .deps/test.Tpo .deps/test.Po make[4]: *** No rule to make target../randist/libgslrandist.la', needed by test'. Stop. make[3]: *** [check-am] Error 2 make[2]: *** [check-recursive] Error 1 make[1]: *** [check-recursive] Error 1 make: *** [check-recursive] Error 1

Navigating to igor_src and doing igor -help returns the manual and igor run_demo executes fine. So I'm guessing that, despite the make check error, things will work.

Therefore, I suppose it's the new GCC that causes whatever not to be linked correctly.

Thanks, Zach

makeGCC-8.log makeGCC-7.log

qmarcou commented 6 years ago

Great to hear that changing your compiler did "solve" your problem! I had a quick look at the new logs, I'm still not sure why this compilation fails with GCC 8, i'll try and look into it, I'll leave this issue open meanwhile. Thanks! Quentin

wenjie1991 commented 4 years ago

I tried gcc-7 (Homebrew GCC 7.5.0_1) 7.5.0, it also works.

jtextor commented 3 years ago

Hi, thanks again for this amazing software. I also ran into this problem and I believe it is because you defined an inline function in a .cpp file, which I think is not supposed to be done this way. See here:

https://stackoverflow.com/questions/5057021/why-are-c-inline-functions-in-the-header

For me, simply removing the "inline" keyword from the definition of the function "comp_nt_int" fixed this issue, and I was able to compile Igor without having to downgrade my compiler. (This was on a Linux system.)

I think the compiler can decide for itself whether or not to inline this function, so it's not too bad to remove this keyword. Another solution would be to move the definition of this function too Aligner.h, and then include that in Deletion.h

pdtrang commented 2 years ago

I got the same error and was able to fix it with @jtextor suggestion. Thank you!

gszep commented 1 year ago

I got the same error with gcc-11 would be great to update the code for modern compilers