Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#645 closed defect (fixed)

Linux compile errors with GEOS 3.4.0 bzip2 release

Reported by: Mike Taves Owned by: robe
Priority: blocker Milestone: 3.4.0
Component: Build/Install Version: 3.4.0
Severity: Critical Keywords:
Cc:

Description

Testing with both Debian squeeze (with g++ 4.4.5) and Ubuntu 13.04 (with g++ 4.7.3) yield similar errors. Here are the commands to raise the error:

sudo apt-get install build-essential
wget http://download.osgeo.org/geos/geos-3.4.0.tar.bz2
tar xfj geos-3.4.0.tar.bz2
cd geos-3.4.0
./configure
make

Here is an excerpt of the output

Making all in locate
make[4]: Entering directory `/home/mwtoews/geos-3.4.0/src/algorithm/locate'
make[5]: Entering directory `/home/mwtoews/geos-3.4.0/src/algorithm/locate'
/bin/bash ../../../libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../../include -I../../../include/geos -I../../../include    -DGEOS_INLINE  -pedantic -Wall -ansi -Wno-long-long  -ffloat-store -g -O2 -MT IndexedPointInAreaLocator.lo -MD -MP -MF .deps/IndexedPointInAreaLocator.Tpo -c -o IndexedPointInAreaLocator.lo IndexedPointInAreaLocator.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../../include -I../../../include/geos -I../../../include -DGEOS_INLINE -pedantic -Wall -ansi -Wno-long-long -ffloat-store -g -O2 -MT IndexedPointInAreaLocator.lo -MD -MP -MF .deps/IndexedPointInAreaLocator.Tpo -c IndexedPointInAreaLocator.cpp  -fPIC -DPIC -o .libs/IndexedPointInAreaLocator.o
In file included from ../../../include/geos/geom/Geometry.h:25:0,
                 from IndexedPointInAreaLocator.cpp:17:
../../../include/geos/platform.h:71:5: warning: #warning is a GCC extension [enabled by default]
../../../include/geos/platform.h:71:5: warning: #warning "Could not find 64bit integer definition!" [-Wcpp]
../../../include/geos/platform.h:110:2: error: #error "Can not compile without isnan function or macro"
In file included from ../../../include/geos/geom/Coordinate.h:158:0,
                 from ../../../include/geos/geom/Envelope.h:25,
                 from ../../../include/geos/geom/Geometry.h:27,
                 from IndexedPointInAreaLocator.cpp:17:
../../../include/geos/geom/Coordinate.inl: In member function 'bool geos::geom::Coordinate::isNull() const':
../../../include/geos/geom/Coordinate.inl:38:17: error: 'ISNAN' was not declared in this scope
../../../include/geos/geom/Coordinate.inl: In member function 'bool geos::geom::Coordinate::equals3D(const geos::geom::Coordinate&) const':
../../../include/geos/geom/Coordinate.inl:77:28: error: 'ISNAN' was not declared in this scope
../../../include/geos/geom/Coordinate.inl: In static member function 'static int geos::geom::Coordinate::hashCode(double)':
../../../include/geos/geom/Coordinate.inl:103:21: warning: right shift count >= width of type [enabled by default]
make[5]: *** [IndexedPointInAreaLocator.lo] Error 1
make[5]: Leaving directory `/home/mwtoews/geos-3.4.0/src/algorithm/locate'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/home/mwtoews/geos-3.4.0/src/algorithm/locate'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/mwtoews/geos-3.4.0/src/algorithm'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/mwtoews/geos-3.4.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/mwtoews/geos-3.4.0'
make: *** [all] Error 2

Change History (18)

comment:1 by Mike Taves, 11 years ago

Summary: Linux 32-bit compile errors with GEOS 3.4.0 releaseLinux compile errors with GEOS 3.4.0 release

Ok, not a 32-bit issue. Similar errors with Debian sid 64-bit with g++ 4.8.1

In file included from ../../../include/geos/geom/Geometry.h:25:0,
                 from IndexedPointInAreaLocator.cpp:17:
../../../include/geos/platform.h:71:5: warning: #warning is a GCC extension [enabled by default]
 #   warning "Could not find 64bit integer definition!"
     ^
../../../include/geos/platform.h:71:5: warning: #warning "Could not find 64bit integer definition!" [-Wcpp]
../../../include/geos/platform.h:110:2: error: #error "Can not compile without isnan function or macro"
 #error "Can not compile without isnan function or macro"
  ^
In file included from ../../../include/geos/geom/Coordinate.h:158:0,
                 from ../../../include/geos/geom/Envelope.h:25,
                 from ../../../include/geos/geom/Geometry.h:27,
                 from IndexedPointInAreaLocator.cpp:17:
../../../include/geos/geom/Coordinate.inl: In member function 'bool geos::geom::Coordinate::isNull() const':
../../../include/geos/geom/Coordinate.inl:38:17: error: 'ISNAN' was not declared in this scope
  return (ISNAN(x) && ISNAN(y) && ISNAN(z));
                 ^
../../../include/geos/geom/Coordinate.inl: In member function 'bool geos::geom::Coordinate::equals3D(const geos::geom::Coordinate&) const':
../../../include/geos/geom/Coordinate.inl:77:28: error: 'ISNAN' was not declared in this scope
   ((z == other.z)||(ISNAN(z) && ISNAN(other.z)));
                            ^
make[5]: *** [IndexedPointInAreaLocator.lo] Error 1
make[5]: Leaving directory `/home/mwtoews/src/geos-3.4.0/src/algorithm/locate'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/home/mwtoews/src/geos-3.4.0/src/algorithm/locate'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/mwtoews/src/geos-3.4.0/src/algorithm'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/mwtoews/src/geos-3.4.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/mwtoews/src/geos-3.4.0'
make: *** [all] Error 2

comment:2 by Mike Taves, 11 years ago

Component: DefaultBuild/Install
Owner: changed from geos-devel@… to strk
Summary: Linux compile errors with GEOS 3.4.0 releaseLinux compile errors with GEOS 3.4.0 bzip2 release

This looks like it could be a packaging error. I've packaged my own bzip2 distribution of the svn-3.4 branch on Debian sid using:

svn checkout http://svn.osgeo.org/geos/tags/3.4.0/ geos-3.4.0
cd geos-3.4.0/
./autogen.sh
./configure
make dist-bzip2

First, if I repeat the steps in the ticket using my geos-3.4.0.tar.bz2 archive, there are no errors with either "make" or "make check". So the source itself is fine.

I've compared the contents of the two bzip2 archives, and there are many differences. The most obvious one is that the archive posted online has CRLF line terminators for some files, which tells me that it was packed on a Windows computer.

Ignoring whitespace, there are differences in the following files: aclocal.m4, config.guess, config.sub, configure, ltmain.sh, Makefile.in

These differences are related to the versions of the tools used to generate them.

comment:3 by strk, 11 years ago

Owner: changed from strk to robe

I've just sent a mail to geos-devel about this. The problem is with platform.h.in containing carriage-return line endings. Drop them and re-run configure and you should be fine.

This is a packaging error.

comment:4 by strk, 11 years ago

NOTE: I haven't really checked CR in other files, like aclocal.m4, but the platform.h.in is the most likely culprit. Let me know if stripping CRs there fixes it for you.

comment:5 by Mike Taves, 11 years ago

Yes, changing the line endings of platform.h.in was the fix.

svn propset svn:eol-style LF include/geos/platform.h.in

comment:6 by Mike Taves, 11 years ago

Sorry, I should have clarified more. Removing CR from the platform.h.in from the bzip2 archive using:

sed -ie 's/\r//' ./include/geos/platform.h.in

fixed the build of this release.

The svn propset command in my previous comment was a suggestion to tell SVN to keep the line-endings as LF only.

comment:7 by Mike Taves, 11 years ago

Another CRLF snag:

$ file tests/xmltester/testrunner.sh
./tests/xmltester/testrunner.sh: POSIX shell script, ASCII text executable, with CRLF line terminators

technically there is no such file type, and "make check" does not go far.

comment:8 by strk, 11 years ago

platform.h.in prop fixed in trunk with r3878. The testrunner.sh can't be set line ending because a property sets it as binary. I don't know if binary property is needed to retain the executable bit (the Makefile doesn't need the execute bit)

comment:9 by jatorre, 11 years ago

The

sed -ie 's/\r//' ./include/geos/platform.h.in

Trick worked for me. But now running

/usr/local/bin/geos-config
-bash: /usr/local/bin/geos-config: /bin/sh^M: bad interpreter: No such file or directory

So seems there is more problems with line breaks

in reply to:  8 comment:10 by Mike Taves, 11 years ago

Replying to strk:

platform.h.in prop fixed in trunk with r3878. The testrunner.sh can't be set line ending because a property sets it as binary.

For testrunner.sh, it has svn:mime-type set to application/x-sh, which is inappropriate. Here is a fix:

svn propdel svn:mime-type tests/xmltester/testrunner.sh
svn propset svn:eol-style LF tests/xmltester/testrunner.sh

comment:11 by strk, 11 years ago

Props for testrunner.sh and geos-config fixed with r3879 in trunk. r3880 backports all props fixes to 3.4 branch and r3881 does so in 3.3 branch.

Anything else left ?

Homework for Regina: write 100 times on the blackboard

  I shall not use proprietary software to package free software

comment:12 by darkblueb, 11 years ago

Priority: majorblocker
Severity: UnassignedCritical

confirmed on x86_64 "Ubuntu 12.04.2 LTS" precise

in reply to:  11 comment:13 by Mike Taves, 11 years ago

Replying to strk:

Anything else left ?

Yeah, there are a few odd svn properties left, but these are generally not a problem if packaged on a POSIX system. I'll open another ticket with suggested svn property changes. I've also spotted a regression test on Ubuntu 13.10 and Debian squeeze (but not sid) somewhere between r3846 and r3866, which has a slight precision differences in the expected WKT. These two future tickets are not critical, and can wait (nor do I have much time in the near future).

I would prioritize re-releasing this version as the same version and archive filename, just provide a md5sum of the repackaged one. It's only been a few hours since the release, so it's no biggie to swap in another repackaged version.

Replying to strk:

Homework for Regina: write 100 times on the blackboard "I shall not use proprietary software to package free software"

My laptop uses the same Windows OS that was installed on it, but I do most of my development and testing stuff on VirtualBox with several different systems, normally Debian. It's a pretty fantastic setup.

comment:14 by gdt, 11 years ago

I am also seeing DOS line endings on

SHA1 (/usr/pkgsrc/distfiles/geos-3.4.0.tar.bz2) = 2226a58db44d485d0a4de96a5f2081e62d0624c2

(This is an example of why changing content without changing the number is bad; it makes it harder to refer to a file.)

I would also suggest that a new ticket be opened that causes the build machinery to refuse to generate tarballs on windows, or runs some check for not having damaged line endings, or something like that. If people are using svn to change to DOS line endings on checkout, those checkouts seem unlikely to be able to produce correct tarballs without significant pain.

comment:15 by robe, 11 years ago

okay okay I'll have debbie regenerate the tar balls. I feel so oppressed by Linux folks as a windows user.

comment:16 by robe, 11 years ago

In my defense I consider mingw Open Source so ergo it is not proprietary :)

comment:17 by robe, 11 years ago

Milestone: 3.4.0
Resolution: fixed
Status: newclosed

Mike,

I have setup a job on debbie to build the tar ball and executed it. Now it is built with debian. Can you repull the tar ball and see if it works for you. I'll close out but feel free to reopen if its still an issue.

comment:18 by robe, 11 years ago

"Homework for Regina: write 100 times on the blackboard "I shall not use proprietary software to package free software"

Strk you know I can write with both hands simultaneously, but my left writes reverse of right. I'll do this if you allow me to write 50 times left to right and 50 times right to left. You may have to hold this up to a mirror to read half of it, just in case I'm hiding something.

Note: See TracTickets for help on using tickets.