ElmerParam compilation: duplicate getline symbol

Discussion about building and installing Elmer
Post Reply
hazelsct
Posts: 153
Joined: 05 Oct 2009, 17:02
Location: Boston, MA, USA
Contact:

ElmerParam compilation: duplicate getline symbol

Post by hazelsct » 02 Nov 2009, 17:29

Greetings,

Compiling ElmerParam fails on some architectures (Debian/HPPA, maybe others) with the following message:

Code: Select all

cc -DHAVE_CONFIG_H -I. -I..   -I/build/buildd-elmerfem_5.5.0.svn.4256.dfsg-1-hppa-UWUQL8/elmerfem-5.5.0.svn.4256.dfsg/debian/tmp/usr/include -I/usr/include/freetype2  -g -O2 -I/build/buildd-elmerfem_5.5.0.svn.4256.dfsg-1-hppa-UWUQL8/elmerfem-5.5.0.svn.4256.dfsg/debian/tmp/usr/include -fPIC -MT modelline.o -MD -MP -MF .deps/modelline.Tpo -c -o modelline.o modelline.c
modelline.c:42: error: conflicting types for 'getline'
/usr/include/stdio.h:651: error: previous declaration of 'getline' was here
make[4]: *** [modelline.o] Error 1
make[4]: Leaving directory `/build/buildd-elmerfem_5.5.0.svn.4256.dfsg-1-hppa-UWUQL8/elmerfem-5.5.0.svn.4256.dfsg/elmerparam/src'
Can we change the name of getline so this conflict doesn't come up?

hazelsct
Posts: 153
Joined: 05 Oct 2009, 17:02
Location: Boston, MA, USA
Contact:

Re: ElmerParam compilation: duplicate getline symbol

Post by hazelsct » 02 Nov 2009, 22:02

Update: this is not architecture-specific, it fails on all Debian unstable architectures now, and will fail with all compilers compliant with the POSIX2008 standard. The reason is given in http://bugs.debian.org/552887 :
In eglibc <= 2.9, getline was only defined if _GNU_SOURCE was defined. In eglibc 2.10, getline is always defined (since it became a standard in POSIX2008). The problem is that your package already has a function named getline(), which now conflicts with glibc's. You need to rename your function to something else.
I'd be happy to patch this for Debian, but it's better long-term to adopt your upstream patch. If you post here when it is fixed in SVN, I will update the Debian package within a day or two.

-Adam

mal
Site Admin
Posts: 54
Joined: 21 Aug 2009, 14:21

Re: ElmerParam compilation: duplicate getline symbol

Post by mal » 03 Nov 2009, 00:47

Hi Adam,

Changed getline() -> readline() in elmerparam.

Thanks,
Mikko

hazelsct
Posts: 153
Joined: 05 Oct 2009, 17:02
Location: Boston, MA, USA
Contact:

Re: ElmerParam compilation: duplicate getline symbol

Post by hazelsct » 03 Nov 2009, 03:57

Thank you, I just uploaded revision 4262 which includes your fix for this problem.

Post Reply