Build Rasterlite on Mac OSX 10.6

11 views
Skip to first unread message

Massimo Di Stefano

unread,
Sep 21, 2010, 9:30:03 AM9/21/10
to spatiali...@googlegroups.com
Hello All,


on mac osx using sqlite.frameworks [1]

# adding the following line in .bash_profile :
export PATH=/Library/Frameworks/SQLite3.framework/Versions/3/Programs/:$PATH

inside qgis-svn i can succesfull use sqlite+libspatialite
also pyspatialite works great!

:-)

tring to install librasterlite i got this error :

which sqlite3
/Library/Frameworks/SQLite3.framework/Versions/3/Programs/sqlite3

cd librasterlite-1.0
./configure
make
...
....

n/sh ../libtool --tag=CC --mode=link gcc -D_LARGE_FILE=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -g -O2 -version-info 1:0:0 -no-undefined -o librasterlite.la -rpath /usr/local/lib rasterlite_io.lo rasterlite_image.lo rasterlite_gif.lo rasterlite_png.lo rasterlite_jpeg.lo rasterlite_tiff.lo rasterlite_wavelet.lo rasterlite.lo ../epsilon/libepsilon.la -lgeotiff -ltiff -ljpeg -lpng -lspatialite -lproj
rm -fr .libs/librasterlite.lax
mkdir .libs/librasterlite.lax
rm -fr .libs/librasterlite.lax/libepsilon.a
mkdir .libs/librasterlite.lax/libepsilon.a
Extracting /Users/sasha/gis/librasterlite-1.0/lib/../epsilon/.libs/libepsilon.a
(cd .libs/librasterlite.lax/libepsilon.a && ar x /Users/sasha/gis/librasterlite-1.0/lib/../epsilon/.libs/libepsilon.a)
gcc -dynamiclib -o .libs/librasterlite.1.0.0.dylib .libs/rasterlite_io.o .libs/rasterlite_image.o .libs/rasterlite_gif.o .libs/rasterlite_png.o .libs/rasterlite_jpeg.o .libs/rasterlite_tiff.o .libs/rasterlite_wavelet.o .libs/rasterlite.o .libs/librasterlite.lax/libepsilon.a/bit_io.o .libs/librasterlite.lax/libepsilon.a/checksum.o .libs/librasterlite.lax/libepsilon.a/cobs.o .libs/librasterlite.lax/libepsilon.a/color.o .libs/librasterlite.lax/libepsilon.a/common.o .libs/librasterlite.lax/libepsilon.a/dc_level.o .libs/librasterlite.lax/libepsilon.a/filter.o .libs/librasterlite.lax/libepsilon.a/filterbank.o .libs/librasterlite.lax/libepsilon.a/libmain.o .libs/librasterlite.lax/libepsilon.a/list.o .libs/librasterlite.lax/libepsilon.a/mem_alloc.o .libs/librasterlite.lax/libepsilon.a/merge_split.o .libs/librasterlite.lax/libepsilon.a/pad.o .libs/librasterlite.lax/libepsilon.a/resample.o .libs/librasterlite.lax/libepsilon.a/speck.o -lgeotiff -ltiff -ljpeg -lpng /usr/local/lib/libspatialite.dylib /usr/local/lib/libgeos.dylib /usr/local/lib/libgeos_c.dylib /usr/local/lib/libproj.dylib -lproj -install_name /usr/local/lib/librasterlite.1.dylib -compatibility_version 2 -current_version 2.0 -Wl,-single_module
Undefined symbols:
"_png_check_sig", referenced from:
_xgdImageCreateFromPngCtx in rasterlite_png.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[1]: *** [librasterlite.la] Error 1
make: *** [all-recursive] Error 1
MacBook-Pro-15-di-sasha:librasterlite-1.0 sasha$ pwd
/Users/sasha/gis/librasterlite-1.0


i also tried to start a fresh build for all the sqlite3 library on my system,

cd sqlite-3.7.2
make distclean
./configure --prefix=/usr/local/sqlite3
make
sudo make install

### changes in .bash_pofile

#export PATH=/Library/Frameworks/SQLite3.framework/Versions/3/Programs/:$PATH
export PATH=/usr/local/sqlite3/bin/:$PATH

source .bash_profile
which sqlite3
/usr/local/sqlite3/bin/sqlite3

cd libspatialite-amalgamation-2.4.0
make distclean
./configure --prefix=/usr/local/
make
sudo make install


cd librasterlite-1.0
./configure
make
..

but i got the same error.


Thanks for any help!

Massimo

a.furieri

unread,
Sep 21, 2010, 9:44:58 AM9/21/10
to SpatiaLite Users
Caro Massimo,

as your errorlog clearly shows, this one is
a libpng related issue:

a) earlier libpng versions supported png_check_sig()
b) but the most recent ones not only declare this
function to be deprecated: they miss at all
to implement this obsolete function call.
and this explains why you get an unresolved
symbol reference

solution:
=========

a) manually edit the rasterlite_png.c source
b) search for:
png_check_sig(...)
c) and replace with:
png_sig_cmp (sig, 0, 8)

this must solve your issue.

tanti saluti,
Sandro

Massimo Di Stefano

unread,
Sep 21, 2010, 9:58:48 AM9/21/10
to spatiali...@googlegroups.com
Sandro :-)



i changed the line 127 in librasterlite-1.0/lib/rasterlite_png.c to :
 
    if (!png_sig_cmp (sig, 0, 8))


the build goes ahead, the make process ends at this step :


Extracting /Users/sasha/gis/librasterlite-1.0/lib/../epsilon/.libs/libepsilon.a
(cd .libs/librasterlite.lax/lt1-libepsilon.a && ar x /Users/sasha/gis/librasterlite-1.0/lib/../epsilon/.libs/libepsilon.a)
ar cru .libs/librasterlite.a  rasterlite_io.o rasterlite_image.o rasterlite_gif.o rasterlite_png.o rasterlite_jpeg.o rasterlite_tiff.o rasterlite_wavelet.o rasterlite.o  .libs/librasterlite.lax/lt1-libepsilon.a/bit_io.o .libs/librasterlite.lax/lt1-libepsilon.a/checksum.o .libs/librasterlite.lax/lt1-libepsilon.a/cobs.o .libs/librasterlite.lax/lt1-libepsilon.a/color.o .libs/librasterlite.lax/lt1-libepsilon.a/common.o .libs/librasterlite.lax/lt1-libepsilon.a/dc_level.o .libs/librasterlite.lax/lt1-libepsilon.a/filter.o .libs/librasterlite.lax/lt1-libepsilon.a/filterbank.o .libs/librasterlite.lax/lt1-libepsilon.a/libmain.o .libs/librasterlite.lax/lt1-libepsilon.a/list.o .libs/librasterlite.lax/lt1-libepsilon.a/mem_alloc.o .libs/librasterlite.lax/lt1-libepsilon.a/merge_split.o .libs/librasterlite.lax/lt1-libepsilon.a/pad.o .libs/librasterlite.lax/lt1-libepsilon.a/resample.o .libs/librasterlite.lax/lt1-libepsilon.a/speck.o 
ranlib .libs/librasterlite.a
rm -fr .libs/librasterlite.lax .libs/librasterlite.lax
(cd .libs && rm -f librasterlite.la && ln -s ../librasterlite.la librasterlite.la)
Making all in src
gcc -DPACKAGE_NAME=\"librasterlite\" -DPACKAGE_TARNAME=\"librasterlite\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"librasterlite\ 1.0\" -DPACKAGE_BUGREPORT=\"a.furieri\ @\ lqt.it\" -DPACKAGE=\"librasterlite\" -DVERSION=\"1.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STDIO_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_MATH_H=1 -DHAVE_FLOAT_H=1 -DHAVE_FCNTL_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDDEF_H=1 -DHAVE_STDINT_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_STRFTIME=1 -DHAVE_MEMSET=1 -DHAVE_SQRT=1 -DHAVE_STRCASECMP=1 -DHAVE_STRERROR=1 -DHAVE_STRNCASECMP=1 -DHAVE_STRSTR=1 -DHAVE_FDATASYNC=1 -DHAVE_FTRUNCATE=1 -DHAVE_GETCWD=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_LOCALTIME_R=1 -DHAVE_MEMMOVE=1 -DHAVE_STRERROR=1 -I. -g -O2 -I../headers -I../epsilon   -D_LARGE_FILE=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -g -O2 -MT rasterlite_load.o -MD -MP -MF .deps/rasterlite_load.Tpo -c -o rasterlite_load.o rasterlite_load.c
rasterlite_load.c: In function ‘load_file’:
rasterlite_load.c:889: error: ‘GAIA_WAVELET_BLOB’ undeclared (first use in this function)
rasterlite_load.c:889: error: (Each undeclared identifier is reported only once
rasterlite_load.c:889: error: for each function it appears in.)
rasterlite_load.c: In function ‘main’:
rasterlite_load.c:1502: error: ‘GAIA_WAVELET_BLOB’ undeclared (first use in this function)
make[1]: *** [rasterlite_load.o] Error 1
make: *** [all-recursive] Error 1


Thanks!!!

Massimo



--
You received this message because you are subscribed to the Google Groups "SpatiaLite Users" group.
To post to this group, send email to spatiali...@googlegroups.com.
To unsubscribe from this group, send email to spatialite-use...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/spatialite-users?hl=en.


a.furieri

unread,
Sep 21, 2010, 10:21:07 AM9/21/10
to SpatiaLite Users
Ciao Massimo,

GAIA_WAVELET_BLOB is declared in spatialite
headers: which one splite's version are you
currently using ?

In order to build librasterlite you must
not use the latest v.2.4.0-RC3.
This is because I'm going to release
very soon a brand new RasterLite-2,
wich is quite different from the 'old'
RasterLite.

A good candidate to be used for building 'old' rasterlite is:
http://www.gaia-gis.it/spatialite/libspatialite-amalgamation-2.3.1.tar.gz

saluti,
Sandro

Massimo Di Stefano

unread,
Sep 21, 2010, 12:22:28 PM9/21/10
to Massimo Di Stefano, spatiali...@googlegroups.com
.

Il giorno 21/set/2010, alle ore 18.05, Massimo Di Stefano ha scritto:

> i'm using the latest : v.2.4.0-RC3.

i means "I was .."

now, switch to the famework version, all seems to work.

Massimo Di Stefano

unread,
Sep 21, 2010, 12:05:18 PM9/21/10
to spatiali...@googlegroups.com
Thanks Sandro !

i'm using the latest : v.2.4.0-RC3.


export "LDFLAGS=-L//Library/Frameworks/SQLite3.framework/Versions/3/unix/lib"
export "CFLAGS=-I/Library/Frameworks/SQLite3.framework/Versions/3/Headers/"

and rasterlite build without problems using the framework versions for both "sqlite3 and spatialite"

i'll build qgis-svn now and point it the external spatialite libs and see what hapens :-)

.. is the " (rasterlite+spatialite)-gdal " support, needed in order to have rasterlite support in qgis ?


Thanks for your great support !!!

Ciao :-)


Massimo.

a.fu...@lqt.it

unread,
Sep 24, 2010, 3:20:48 AM9/24/10
to spatiali...@googlegroups.com
On Tue, 21 Sep 2010 18:05:18 +0200, Massimo Di Stefano wrote

> .. is the " (rasterlite+spatialite)-gdal " support, needed in order
> to have rasterlite support in qgis ?
>

yes, for QGis I suppose it's strictly required

bye Sandro

Reply all
Reply to author
Forward
0 new messages