readbio / ea-utils

Automatically exported from code.google.com/p/ea-utils
0 stars 0 forks source link

GNU 'getline' function causes g++ to fail on OS X #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I just downloaded ea-utils.1.1.0-190.tar.gz onto my Mac (OS 10.6) and tried to 
compile it, but got this error.

$ sudo make install
grep: ea-utils.spex: No such file or directory
g++ -O3 -o fastq-clipper fastq-clipper.c
fastq-clipper.c: In function 'int main(int, char**)':
fastq-clipper.c:138: error: 'getline' was not declared in this scope
make: *** [fastq-clipper] Error 1

I'm pretty sure the getline function is GNU specific, which restricts the use 
of ea-utils to Linux. I wouldn't imagine it to be too difficult to use 
something more portable (fgets perhaps) that would also allow the code to run 
on other Unix flavors (OS X, Solaris, BSD, etc).

...unless you're choosing only to support Linux...

Original issue reported on code.google.com by dansgirl...@gmail.com on 29 Sep 2011 at 12:35

GoogleCodeExporter commented 9 years ago
fastq-join.c has a built-in getline... the rest of them *could* have it, but 
the linux builtin version is a mote faster, so i didn't want to do that by 
default.

Original comment by earone...@gmail.com on 11 Oct 2011 at 5:27

GoogleCodeExporter commented 9 years ago
Really i need something to generate a config.h ... hopefully not 
automake/autoconf because it's enormous and weird and not necessary.   Maybe a 
perl script that checks to see if you have getline?  perl configure.pl ... make?

Original comment by earone...@gmail.com on 11 Oct 2011 at 5:28

GoogleCodeExporter commented 9 years ago
Great software!  Has anyone successfully been able to run ea-utils on Mac OS X 
(10.7)?  I can't get fastq-mcf to run on my Mac Pro, but it runs just fine on a 
Linux server.  I'd rather process my files locally, though.  A port to Mac OS X 
would be very much appreciated!
Thanks!
jjw

Original comment by jjwhyt...@gmail.com on 22 Dec 2011 at 4:27

GoogleCodeExporter commented 9 years ago
Note: I would gladly port If I had a Max OSX machine to use/try out.

Original comment by earone...@gmail.com on 11 Jan 2012 at 5:42

GoogleCodeExporter commented 9 years ago
getline is now included for all non gnu 

Original comment by earone...@gmail.com on 16 Jan 2012 at 3:01

GoogleCodeExporter commented 9 years ago
I didn't see that you had updated the software.  I tried it on my Mac Pro and 
it works great now.  Excellent work!

Original comment by jjwhyt...@gmail.com on 25 Jan 2012 at 10:23

GoogleCodeExporter commented 9 years ago
I am getting the same message as the first poster:

sudo make install
grep: ea-utils.spex: No such file or directory
g++ -O3 fastq-lib.cpp -o fastq-clipper fastq-clipper.c
fastq-lib.cpp: In function ‘int read_line(FILE*, line&)’:
fastq-lib.cpp:32: error: ‘getline’ was not declared in this scope
fastq-clipper.c: In function ‘int main(int, char**)’:
fastq-clipper.c:138: error: ‘getline’ was not declared in this scope
make: *** [fastq-clipper] Error 1

I am using the latest release of ea and OSX 10.6.8. Is there any solution to 
this? thanks!

Original comment by antonio....@gmail.com on 30 Jan 2012 at 4:10

GoogleCodeExporter commented 9 years ago
Version of ea is: ea-utils.1.1.2-301.tar.gz

Original comment by antonio....@gmail.com on 30 Jan 2012 at 4:30

GoogleCodeExporter commented 9 years ago
remove these lines 

#ifndef  __GNUC__

(this is what "autoconf" is for, but autoconf overly complicates things --- if 
i had a mac shell account to tinker with, i'd probably be able to figure 
something lightweight out )

Original comment by earone...@gmail.com on 30 Jan 2012 at 5:50

GoogleCodeExporter commented 9 years ago
I tried that and now I get this:

sudo make install
grep: ea-utils.spex: No such file or directory
g++ -O3 fastq-lib.cpp -o fastq-clipper fastq-clipper.c
fastq-lib.cpp: In function ‘int read_line(FILE*, line&)’:
fastq-lib.cpp:32: error: ‘getline’ was not declared in this scope
fastq-clipper.c: In function ‘int main(int, char**)’:
fastq-clipper.c:138: error: ‘getline’ was not declared in this scope
make: *** [fastq-clipper] Error 1

The two files in which I tinker were: fastq-lib.cpp and fastq-lib.h

Thanks!

Original comment by antonio....@gmail.com on 31 Jan 2012 at 2:11

GoogleCodeExporter commented 9 years ago

Original comment by antonio....@gmail.com on 31 Jan 2012 at 2:12

Attachments:

GoogleCodeExporter commented 9 years ago
pull down a newer version of those 2, the new one contains a getline function

#ifndef  __GNUC__

...etc.

Original comment by mooncost...@gmail.com on 31 Jan 2012 at 4:34

GoogleCodeExporter commented 9 years ago
essentially you need the getline on a mac/bsd, but not on linux (or 
mingw/cygwin)

Original comment by mooncost...@gmail.com on 31 Jan 2012 at 4:37

GoogleCodeExporter commented 9 years ago
Still not working I get the getline error all the time. I think I will try in 
another machine where I have Linux. Thanks anyhow!

Original comment by antonio....@gmail.com on 1 Feb 2012 at 10:55

GoogleCodeExporter commented 9 years ago
if you can create a shell account for me, i'll fix it on your box.  i tried to 
find a company offering mac shell accounts, but there don't seem to be any.

Original comment by mooncost...@gmail.com on 1 Feb 2012 at 3:04

GoogleCodeExporter commented 9 years ago
Thanks but it´s ok, besides I cannot not do that. 

Original comment by antonio....@gmail.com on 1 Feb 2012 at 5:08