jstjohn / SeqPrep

Tool for stripping adaptors and/or merging paired reads with overlap into single reads.
MIT License
140 stars 51 forks source link

Build error on MacOSX 10.9 #15

Open genomematt opened 10 years ago

genomematt commented 10 years ago

$ make gcc -c -Wall -Werror -O0 -g SeqPrep.c -o SeqPrep.o gcc -c -Wall -Werror -O0 -g utils.c -o utils.o utils.c:1062:3: error: non-constant static local variable in inline function may be different in different files [-Werror,-Wstatic-local-in-inline] static bool warned = false; ^ ./utils.h:79:1: note: use 'static' to give inline function 'revcom_char' internal linkage inline char revcom_char(const char base); ^ static 1 error generated. make: *\ [utils.o] Error 1

$ gcc --version Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) Target: x86_64-apple-darwin13.0.0 Thread model: posix

LordGenome commented 10 years ago

Thanks :-)

Graham

gr_taylor@me.com 0448 852 432

On 4/12/2013, at 7:14 pm, Matthew Wakefield notifications@github.com wrote:

$ make gcc -c -Wall -Werror -O0 -g SeqPrep.c -o SeqPrep.o gcc -c -Wall -Werror -O0 -g utils.c -o utils.o utils.c:1062:3: error: non-constant static local variable in inline function may be different in different files [-Werror,-Wstatic-local-in-inline] static bool warned = false; ^ ./utils.h:79:1: note: use 'static' to give inline function 'revcom_char' internal linkage inline char revcom_char(const char base); ^ static 1 error generated. make: *\ [utils.o] Error 1

$ gcc --version Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) Target: x86_64-apple-darwin13.0.0 Thread model: posix

— Reply to this email directly or view it on GitHub.

jstjohn commented 10 years ago

Hmm.. there seems to have been a change in compilers going to 10.9 that broke things. Remove “-Werror” from the makefile, install macports, install gcc version 4.7 in there, and use that by doing make clean && make CC=gcc-mp-4.7 (or whatever the version of gcc you installed is). Just did that and it worked for me. Sorry for the pain, but OSX is really getting non-compiling friendly these days :-(

On Dec 4, 2013, at 12:33 AM, LordGenome notifications@github.com wrote:

Thanks :-)

Graham

gr_taylor@me.com 0448 852 432

On 4/12/2013, at 7:14 pm, Matthew Wakefield notifications@github.com wrote:

$ make gcc -c -Wall -Werror -O0 -g SeqPrep.c -o SeqPrep.o gcc -c -Wall -Werror -O0 -g utils.c -o utils.o utils.c:1062:3: error: non-constant static local variable in inline function may be different in different files [-Werror,-Wstatic-local-in-inline] static bool warned = false; ^ ./utils.h:79:1: note: use 'static' to give inline function 'revcom_char' internal linkage inline char revcom_char(const char base); ^ static 1 error generated. make: *\ [utils.o] Error 1

$ gcc --version Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) Target: x86_64-apple-darwin13.0.0 Thread model: posix

— Reply to this email directly or view it on GitHub. — Reply to this email directly or view it on GitHub.

bjpop commented 10 years ago

I had a go at getting SeqPrep to compile on OS X with the newer compiler.

It seems to have been choking on the inline annotations. I was able to build it by removing the inlines that it was complaining about. I'm not sure this is the ultimate solution, but it might be worth investigating why it is failing on those inlines.

Unfortunately I cannot send a patch because I don't have regular access to a machine with the newer compiler.

levskaya commented 10 years ago

This just bit me as well. Removing the inlines is in fact the correct thing to do for OS X. Starting with 10.9 OS X just simlinks gcc to clang. Clang is more rigorous about implementing language standards than gcc:

"inline" means something quite different in the C99 standard to what gcc interprets. Basically, you're always supposed to have a functionally equivalent non-inlined version of the function, and if it's missing, then trying to call it from another translation unit will result in missing symbols. Besides, in clang the inline directive is at best a suggestion and generally irrelevant.

http://clang.llvm.org/compatibility.html#inline

jstjohn commented 9 years ago

Thanks for the info! I will go through and do that unless someone beats me to it with a pull request ( I will not have time to do this until at least mid October ).

On Wed, Sep 24, 2014 at 12:29 PM, Anselm Levskaya notifications@github.com wrote:

This just bit me as well. Removing the inlines is in fact the correct thing to do for OS X. Starting with 10.9 OS X just simlinks gcc to clang. Clang is more rigorous about implementing language standards than gcc:

"inline" means something quite different in the C99 standard to what gcc interprets. Basically, you're always supposed to have a functionally equivalent non-inlined version of the function, and if it's missing, then trying to call it from another translation unit will result in missing symbols. Besides, in clang the inline directive is at best a suggestion and generally irrelevant.

http://clang.llvm.org/compatibility.html#inline

— Reply to this email directly or view it on GitHub https://github.com/jstjohn/SeqPrep/issues/15#issuecomment-56645973.

ctekellogg commented 9 years ago

Hi, I am also having problems with SeqPrep running on a Mac with OSX 10.9. I installed macports and also gcc v. 4.7 and compiled using make CC=gcc-mp-4.7. Everything seemed to work fine when compiling. But now, when I run SeqPrep, either on my data or using the test set, each output file is only 20 bytes and is empty. Has anyone else experienced this issue? Thanks!