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

compile error on Ubuntu #22

Open
jairideout opened this issue Jan 7, 2015 · 2 comments
Open

compile error on Ubuntu #22

jairideout opened this issue Jan 7, 2015 · 2 comments

Comments

@jairideout
Copy link

After the latest pull request (#21) was merged to fix compile issues on OS X, I am unable to compile on Ubuntu:

$ make
cc  -c -Wall -O0 -g SeqPrep.c -o SeqPrep.o
SeqPrep.c: In function ‘main’:
SeqPrep.c:136:8: warning: variable ‘print_overhang’ set but not used [-Wunused-but-set-variable]
SeqPrep.c: At top level:
SeqPrep.c:108:5: warning: ‘spcount’ is static but used in inline function ‘update_spinner’ which is not static [enabled by default]
SeqPrep.c:90:12: warning: ‘spcount’ is static but used in inline function ‘update_spinner’ which is not static [enabled by default]
cc  -c -Wall -O0 -g utils.c -o utils.o
cc  -c -Wall -O0 -g stdaln.c -o stdaln.o
stdaln.c: In function ‘aln_local_core’:
stdaln.c:548:25: warning: variable ‘b’ set but not used [-Wunused-but-set-variable]
stdaln.c: In function ‘aln_extend_core’:
stdaln.c:868:16: warning: variable ‘tmp_len’ set but not used [-Wunused-but-set-variable]
cc  SeqPrep.o utils.o stdaln.o -lz -lm -o SeqPrep
SeqPrep.o: In function `main':
/home/ubuntu/SeqPrep/SeqPrep.c:350: undefined reference to `update_spinner'
collect2: ld returned 1 exit status
make: *** [SeqPrep] Error 1

It seems that the issue is the extern keyword added to update_spinner (this line). When I remove extern, I'm able to successfully compile. I'm not sure how this will affect compatibility with OS X or other systems though.

System info:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.04.2 LTS
Release:    12.04
Codename:   precise
$ uname -a
Linux ip-10-88-103-45 3.2.0-39-virtual #62-Ubuntu SMP Thu Feb 28 00:48:27 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
$ cc --version
cc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Copyright (C) 2011 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.

Please let me know if you need more info or if I can help in any way with testing/fixing this. Thanks!

jairideout added a commit to jairideout/qiime-deploy-conf that referenced this issue Jan 7, 2015
Instead of the latest development version (this doesn't compile on Ubuntu). See jstjohn/SeqPrep#22
@Cistron
Copy link

Cistron commented Feb 24, 2016

I have a very similar issue on our HPC cluster.

$make
gcc  -c -Wall -O0 -g SeqPrep.c -o SeqPrep.o
SeqPrep.c: In function ‘main’:
SeqPrep.c:137:8: warning: variable ‘print_overhang’ set but not used [-Wunused-but-set-variable]
   bool print_overhang = false;
        ^
SeqPrep.c: At top level:
SeqPrep.c:109:5: warning: ‘spcount’ is static but used in inline function ‘update_spinner’ which is not static
     spcount++;
     ^
SeqPrep.c:91:12: warning: ‘spcount’ is static but used in inline function ‘update_spinner’ which is not static
     switch(spcount % 4){
            ^
gcc  -c -Wall -O0 -g utils.c -o utils.o
gcc  -c -Wall -O0 -g stdaln.c -o stdaln.o
stdaln.c: In function ‘aln_local_core’:
stdaln.c:548:25: warning: variable ‘b’ set but not used [-Wunused-but-set-variable]
  int gap_open, gap_ext, b;
                         ^
stdaln.c: In function ‘aln_extend_core’:
stdaln.c:868:16: warning: variable ‘tmp_len’ set but not used [-Wunused-but-set-variable]
  int q, r, qr, tmp_len;
                ^
gcc  SeqPrep.o utils.o stdaln.o -lz -lm -o SeqPrep
SeqPrep.o: In function `main':
/home/sejj036/SeqPrep/SeqPrep.c:355: undefined reference to `update_spinner'
collect2: error: ld returned 1 exit status
make: *** [SeqPrep] Error 1
lsb_release -a
LSB Version:    :core-4.1-amd64:core-4.1-noarch
Distributor ID: RedHatEnterpriseServer
Description:    Red Hat Enterprise Linux Server release 7.1 (Maipo)
Release:    7.1
Codename:   Maipo

$uname -a
Linux login06 3.10.0-123.20.1.el7.x86_64 #1 SMP Wed Jan 21 09:45:55 EST 2015 x86_64 x86_64 x86_64 GNU/Linux

$cc --version
cc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-9)
Copyright (C) 2013 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.```

@samdemorest
Copy link
Contributor

@Cistron #33 should resolve this issue on your cluster. I discovered this solution while building this software for an HPC cluster I administer.

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

3 participants