[gdal-dev] gdal on OS X
Ken Mankoff
mankoff at gmail.com
Fri Jun 18 15:42:28 EDT 2010
Hi List,
I'm trying to get gdal working on OS X 10.6. I'm have tried a
variety of ways with varying success.
I installed GDAL 1.7 Complete from
http://www.kyngchaos.com/software:frameworks
If I go to /Library/Frameworks/GDAL.framework/unix/bin I can seem to
run the unix binaries. For example, "./gdal_info" provides usage
instructions. I cannot run the Python programs. If I launch my
Python and type "from osgeo import gdal" it doesn't work because I
run the EPD Python not the OS X default. That command *does* work,
and the Python binaries do run (or at least print usage info) if I
comment out the EPD section in my .bash_profile and run using the
system Python.
Any ideas how to run GDAL with EPD?
My second attempt was to build gdal from source.
export MACOSX_DEPLOYMENT_TARGET=10.5
export ARCHFLAGS="-arch i386"
./configure --prefix=/Users/mankoff/local/gdal-1.7.2
--with-macosx-framework --with-python CFLAGS=-m32 CPPFLAGS=-m32
CXXFLAGS=-m32
make
The make command crashes with
/bin/sh /Users/mankoff/local/src/gdal-1.7.2/libtool --mode=link g++
gdalinfo.lo /Users/mankoff/local/src/gdal-1.7.2/libgdal.la -o
gdalinfo
libtool: link: g++ .libs/gdalinfo.o -o .libs/gdalinfo
/Users/mankoff/local/src/gdal-1.7.2/.libs/libgdal.dylib -L/usr/lib
-lsqlite3 -lexpat -lz -ldl -lcurl
ld: warning: in .libs/gdalinfo.o, file was built for i386 which is
not the architecture being linked (x86_64)
ld: warning: in
/Users/mankoff/local/src/gdal-1.7.2/.libs/libgdal.dylib, file was
built for i386 which is not the architecture being linked (x86_64)
Undefined symbols:
"_main", referenced from:
start in crt1.10.5.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[1]: *** [gdalinfo] Error 1
make: *** [apps-target] Error 2
Clearly a 32/64 bit issue. I think I'm missing some simple link flag
to tell it what architecture I'm aiming for. Does anyone know what
it is?
I'd love to type "fink install gdal" but for some reason it depends
on and also installs qt, python, etc. There seem to be an awful lot
of dependencies that the raw source compilation doesn't use.
Thanks for any help you can provide,
-k.
More information about the gdal-dev
mailing list