Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error on MacOSX 10.9 #15

Open
genomematt opened this issue Dec 4, 2013 · 6 comments
Open

Build error on MacOSX 10.9 #15

genomematt opened this issue Dec 4, 2013 · 6 comments

Comments

@genomematt
Copy link

$ 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
Copy link

Thanks :-)

Graham

[email protected]
0448 852 432

On 4/12/2013, at 7:14 pm, Matthew Wakefield [email protected] 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
Copy link
Owner

jstjohn commented Dec 4, 2013

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 [email protected] wrote:

Thanks :-)

Graham

[email protected]
0448 852 432

On 4/12/2013, at 7:14 pm, Matthew Wakefield [email protected] 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
Copy link

bjpop commented Dec 4, 2013

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
Copy link

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
Copy link
Owner

jstjohn commented Sep 29, 2014

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 [email protected]
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
#15 (comment).

@ctekellogg
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants