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

import_tiger gives "undefined symbol: ceil..." & missing functions #16

Open
jlpoolen opened this issue Mar 24, 2010 · 4 comments
Open

Comments

@jlpoolen
Copy link

Using the modified code per my previous post in the Google groups: "my DIFFS to build on AMD64/Quadcore Gentoo", I performed a "make clean" and then "make". The "make" sessions are at the end of this posting.

When I try to build the database against the Napa County set of TIGER2009 files, there are errors:

hermes geocoder # bin/tiger_import /var/work/tiger/geocoder3.db /var/work/tiger/tiger
--- /var/work/tiger/tiger/06_CALIFORNIA/06055_Napa_County
Error: bin/../lib/geocoder/us/sqlite3.so: undefined symbol: ceil
memory
Error: near line 50696: no such function: metaphone
Error: near line 50724: no such function: digit_suffix
hermes geocoder #


Here are my make sessions:

hermes geocoder # make clean
make -C src clean
make[1]: Entering directory /var/work/geocoder/src' make -C libsqlite3_geocoder clean make[2]: Entering directory/var/work/geocoder/src/libsqlite3_geocoder'
Makefile:21: warning: overriding commands for target libsqlite3_geocoder.so' Makefile:11: warning: ignoring old commands for targetlibsqlite3_geocoder.so'
Makefile:32: warning: overriding commands for target clean' Makefile:15: warning: ignoring old commands for targetclean'
rm -f _.o *.so wkb_compress levenshtein
make[2]: Leaving directory /var/work/geocoder/src/libsqlite3_geocoder' make -C liblwgeom clean make[2]: Entering directory/var/work/geocoder/src/liblwgeom'
rm -f measures.o box2d.o ptarray.o lwgeom_api.o lwgeom.o lwpoint.o lwline.o lwpoly.o lwmpoint.o lwmline.o lwmpoly.o lwcollection.o lwcircstring.o lwcompound.o lwcurvepoly.o lwmcurve.o lwmsurface.o lwutil.o lwalgorithm.o lwgunparse.o lwgparse.o lwsegmentize.o wktparse.tab.o lex.yy.o vsprintf.o
rm -f liblwgeom.a
make[2]: Leaving directory /var/work/geocoder/src/liblwgeom' make -C shp2sqlite clean make[2]: Entering directory/var/work/geocoder/src/shp2sqlite'
make[2]: Leaving directory /var/work/geocoder/src/shp2sqlite' make[1]: Leaving directory/var/work/geocoder/src'
rm *.gem
hermes geocoder # make
make -C src install
make[1]: Entering directory /var/work/geocoder/src' make -C libsqlite3_geocoder make[2]: Entering directory/var/work/geocoder/src/libsqlite3_geocoder'
Makefile:21: warning: overriding commands for target libsqlite3_geocoder.so' Makefile:11: warning: ignoring old commands for targetlibsqlite3_geocoder.so'
Makefile:32: warning: overriding commands for target clean' Makefile:15: warning: ignoring old commands for targetclean'
gcc -fPIC -c -o extension.o extension.c
gcc -fPIC -c -o wkb_compress.o wkb_compress.c
gcc -fPIC -c -o util.o util.c
gcc -fPIC -c -o metaphon.o metaphon.c
metaphon.c: In function 'metaphone':
metaphon.c:47: warning: cast to pointer from integer of different size
gcc -fPIC -c -o levenshtein.o levenshtein.c
gcc -fPIC -lsqlite3 -I/usr/include -shared extension.o wkb_compress.o util.o metaphon.o levenshtein.o -o libsqlite3_geocoder.so
make[2]: Leaving directory /var/work/geocoder/src/libsqlite3_geocoder' make -C liblwgeom make[2]: Entering directory/var/work/geocoder/src/liblwgeom'
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o measures.o measures.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o box2d.o box2d.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o ptarray.o ptarray.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwgeom_api.o lwgeom_api.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwgeom.o lwgeom.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwpoint.o lwpoint.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwline.o lwline.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwpoly.o lwpoly.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwmpoint.o lwmpoint.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwmline.o lwmline.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwmpoly.o lwmpoly.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwcollection.o lwcollection.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwcircstring.o lwcircstring.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwcompound.o lwcompound.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwcurvepoly.o lwcurvepoly.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwmcurve.o lwmcurve.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwmsurface.o lwmsurface.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwutil.o lwutil.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwalgorithm.o lwalgorithm.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwgunparse.o lwgunparse.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwgparse.o lwgparse.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwsegmentize.o lwsegmentize.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o wktparse.tab.o wktparse.tab.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lex.yy.o lex.yy.c
lex.yy.c: In function 'lwg_parse_yylex':
wktparse.lex:73: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
wktparse.lex: At top level:
lex.yy.c:4126: warning: 'yyunput' defined but not used
lex.yy.c:4167: warning: 'input' defined but not used
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o vsprintf.o vsprintf.c
ar rs liblwgeom.a measures.o box2d.o ptarray.o lwgeom_api.o lwgeom.o lwpoint.o lwline.o lwpoly.o lwmpoint.o lwmline.o lwmpoly.o lwcollection.o lwcircstring.o lwcompound.o lwcurvepoly.o lwmcurve.o lwmsurface.o lwutil.o lwalgorithm.o lwgunparse.o lwgparse.o lwsegmentize.o wktparse.tab.o lex.yy.o vsprintf.o
ar: creating liblwgeom.a
make[2]: Leaving directory /var/work/geocoder/src/liblwgeom' make -C shp2sqlite make[2]: Entering directory/var/work/geocoder/src/shp2sqlite'
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o shpopen.o shpopen.c
shpopen.c: In function 'SHPWriteHeader':
shpopen.c:315: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
shpopen.c:325: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
shpopen.c:340: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
shpopen.c: In function 'SHPOpen':
shpopen.c:455: warning: ignoring return value of 'fread', declared with attribute warn_unused_result
shpopen.c:465: warning: ignoring return value of 'fread', declared with attribute warn_unused_result
shpopen.c:544: warning: ignoring return value of 'fread', declared with attribute warn_unused_result
shpopen.c: In function 'SHPCreate':
shpopen.c:713: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
shpopen.c:722: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
shpopen.c: In function 'SHPReadObject':
shpopen.c:1325: warning: ignoring return value of 'fread', declared with attribute warn_unused_result
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o dbfopen.o dbfopen.c
dbfopen.c: In function 'DBFWriteHeader':
dbfopen.c:283: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
dbfopen.c:284: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
dbfopen.c:294: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
dbfopen.c: In function 'DBFFlushRecord':
dbfopen.c:317: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
dbfopen.c: In function 'DBFUpdateHeader':
dbfopen.c:337: warning: ignoring return value of 'fread', declared with attribute warn_unused_result
dbfopen.c:345: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
dbfopen.c: In function 'DBFClose':
dbfopen.c:519: warning: ignoring return value of 'fread', declared with attribute warn_unused_result
dbfopen.c:523: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
dbfopen.c: In function 'DBFWriteAttribute':
dbfopen.c:1112: warning: ignoring return value of 'fread', declared with attribute warn_unused_result
dbfopen.c: In function 'DBFWriteAttributeDirectly':
dbfopen.c:1281: warning: ignoring return value of 'fread', declared with attribute warn_unused_result
dbfopen.c: In function 'DBFWriteTuple':
dbfopen.c:1427: warning: ignoring return value of 'fread', declared with attribute warn_unused_result
dbfopen.c: In function 'DBFReadTuple':
dbfopen.c:1471: warning: ignoring return value of 'fread', declared with attribute warn_unused_result
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o getopt.o getopt.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o shp2sqlite.o shp2sqlite.c
gcc -Iiconv -I/usr/include -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes shpopen.o dbfopen.o getopt.o shp2sqlite.o ../liblwgeom/liblwgeom.a -lc -lm -o shp2sqlite
make[2]: Leaving directory /var/work/geocoder/src/shp2sqlite' cp libsqlite3_geocoder/_.so ../lib/geocoder/us/sqlite3.so make -C shp2sqlite install make[2]: Entering directory /var/work/geocoder/src/shp2sqlite'
make[2]: Leaving directory/var/work/geocoder/src/shp2sqlite' make[1]: Leaving directory /var/work/geocoder/src'
gem build gemspec
WARNING: no rubyforge_project specified
WARNING: description and summary are identical
Successfully built RubyGem
Name: Geocoder-US
Version: 2.0.0
File: Geocoder-US-2.0.0.gem
hermes geocoder #

@jlpoolen
Copy link
Author

My system is Gentoo and I installed dev-db/sqlite with extensions turned on. However, I've determined that the function "ceil" does not exist in my version:

hermes sqlite-3.6.22 # grep ceil .h
hermes sqlite-3.6.22 # grep ceil *.c
sqlite3.c:
* Return the ceiling of the logarithm base 2 of iValue.
sqlite3.c: /* Use the ceiling() function to convert real->int */
hermes sqlite-3.6.22 #

hermes sqlite-3.6.22 # eix -I dev-db/sqlite
[I] dev-db/sqlite
Available versions:
(0) 2.8.16-r4!t
(3) 3.6.19!t ~3.6.20!t 3.6.20-r1!t ~3.6.21 ~3.6.22 ~3.6.22-r1 3.6.22-r2 ~3.6.23
{debug doc extensions (+)fts3 icu nls +readline secure-delete soundex tcl test +threadsafe}
Installed versions: 3.6.22-r2(3)(11:32:22 03/25/10)(extensions fts3 readline threadsafe -debug -doc -icu -secure-delete -soundex -tcl -test)
Homepage: http://www.sqlite.org/
Description: A SQL Database Engine in a C Library

@jlpoolen
Copy link
Author

The use of the ceil function occurs at line 84 of extension.c in this project's code:
unsigned long output_len = ceil((input_len-9)/8.0) * 4;

@peterlandry
Copy link

ceil() is part of math.h, in the c standard library. I'm seeing the same error on Ubuntu 9.10.

@peterlandry
Copy link

Including -lm in your makefile should properly link the math library.

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

2 participants