Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#2649 closed defect (fixed)

cu_varint.o: undefined reference to symbol 'lround@@GLIBC_2.2.5'

Reported by: strk Owned by: nicklas
Priority: medium Milestone: PostGIS 2.2.0
Component: build/upgrade/install Version: master
Keywords: Cc:

Description

As of r12201 I'm getting an error on "make check" under liblwgeom/cunit

Change History (13)

comment:1 Changed 8 years ago by strk

I suspect Jenkins is also unhappy, but can't tell as it asks me for a username/password :( http://debbie.postgis.net:8080/login?from=%2Fjob%2FPostGIS_2.2%2Fws%2F

comment:2 Changed 8 years ago by nicklas

About Jenkins What address did you use? with http://debbie.postgis.net:8080/ I get in without password.

From what I see Jenkins don't have trouble with that commit. 4 hours ago all test passed. But now it gets stuck when loading raster sql http://debbie.postgis.net:8080/job/PostGIS_Regress/3305/console

But about the error you get, do you know what can cause it?

For me all builds and passes make check locally with latest trunk.

comment:3 Changed 8 years ago by strk

Owner: changed from pramsey to nicklas

No idea where the error comes from, here's the full context:

make[2]: Entering directory `/usr/src/postgis/postgis/liblwgeom/cunit'
gcc -g -O2  -Wall -Wmissing-prototypes -I/usr/local/include   -I.. -c -o cu_varint.o cu_varint.c
/bin/bash ../../libtool --mode=link gcc -g -O2  -Wall -Wmissing-prototypes -I/usr/local/include   -o cu_tester cu_algorithm.o cu_buildarea.o cu_clean.o cu_print.o cu_misc.o cu_ptarray.o cu_geodetic.o cu_geos.o cu_tree.o cu_measures.o cu_node.o cu_libgeom.o cu_split.o cu_stringbuffer.o cu_triangulate.o cu_homogenize.o cu_force_sfs.o cu_out_wkt.o cu_out_wkb.o cu_out_gml.o cu_out_kml.o cu_out_geojson.o cu_out_svg.o cu_surface.o cu_out_x3d.o cu_in_geojson.o cu_in_wkb.o cu_in_wkt.o cu_varint.o cu_tester.o  ../liblwgeom.la -lcunit
libtool: link: gcc -g -O2 -Wall -Wmissing-prototypes -I/usr/local/include -o .libs/cu_tester cu_algorithm.o cu_buildarea.o cu_clean.o cu_print.o cu_misc.o cu_ptarray.o cu_geodetic.o cu_geos.o cu_tree.o cu_measures.o cu_node.o cu_libgeom.o cu_split.o cu_stringbuffer.o cu_triangulate.o cu_homogenize.o cu_force_sfs.o cu_out_wkt.o cu_out_wkb.o cu_out_gml.o cu_out_kml.o cu_out_geojson.o cu_out_svg.o cu_surface.o cu_out_x3d.o cu_in_geojson.o cu_in_wkb.o cu_in_wkt.o cu_varint.o cu_tester.o  ../.libs/liblwgeom.so -lcunit
/usr/bin/ld: cu_varint.o: undefined reference to symbol 'lround@@GLIBC_2.2.5'
/lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

If I remove cu_varint.o from the commanline (after rebuilding cu_tester.o to avoid its references) the build passes.

comment:4 Changed 8 years ago by strk

Component: postgisbuild/upgrade/install

comment:5 Changed 8 years ago by strk

Is it normal for the cu_varint.c file to include "lwout_twkb.c" ?

#include "lwout_twkb.c"

comment:6 Changed 8 years ago by strk

lwout_twkb.c uses round(3) which requires -lm I'll try that...

comment:7 Changed 8 years ago by strk

Sorry, obviously libm is already included, given the error comes from that file..

comment:8 Changed 8 years ago by nicklas

Yes the code that the test is testing is creating varInt https://developers.google.com/protocol-buffers/docs/encoding which is the way the integers is packed in the twkb-format.

But I can recall having some trouble with this round command. I think I was suspecting some conflicting round command in the postgres universe. Can it be that the postgres header should be included in the test to? or it is through "liblwgeom.h" isn't it?

Little strange that I or Jenkins don't get the same error.

comment:9 Changed 8 years ago by nicklas

A stackexchange post discussing reasons for those errors: http://stackoverflow.com/questions/9934549/very-strange-linker-behavior

comment:10 Changed 8 years ago by nicklas

The round command is not used for the part of "lwout_twkb.c" that is used in the cunit test.

comment:11 Changed 8 years ago by strk

r12249 fixed it for me. I wonder if it's a libtool version issue... I have 2.4.2 here

comment:12 Changed 8 years ago by strk

Resolution: fixed
Status: newclosed

comment:13 Changed 8 years ago by nicklas

# libtool --version ltmain.sh (GNU libtool) 2.2.6b

But I also see that I probably should have used lround instead of round since I expect a long integer in return. Maybe that is what makes things go wrong.

It is two occasions in "lwout_twkb.c" where round is used. Maybe you could test by changing to lround?

I was also wrong earlier about that all tests passes locally. I get the same error as Jenkins. But it builds and all cunit tests passes

Note: See TracTickets for help on using tickets.