Opened 16 years ago

Closed 16 years ago

#2357 closed defect (invalid)

Building Python bindings on Mac OS X fail with libcurl errors

Reported by: Mateusz Łoskot Owned by: hobu
Priority: normal Milestone:
Component: PythonBindings Version: svn-trunk
Severity: normal Keywords: libcurl mac osx
Cc:

Description (last modified by Mateusz Łoskot)

I'm trying to build latest SVN trunk with Python bindings on Mac OS X + GCC 4.0.1. Everything (GDAL + utilities) builds with success, but the Python bindings that report undefined references in libcurl. Here are all steps I've taken:

  • configure enables Python
    ~/dev/gdal/_svn/trunk/gdal $ ./configure
    ...
    checking for Mac OS X Framework build... disabled
    checking for perl bindings... disabled
    checking for php bindings... disabled
    checking for ruby bindings... disabled
    checking for python bindings... enabled
    checking for python setuptools... found
    checking for old-gen python bindings... disabled
    ...
    
  • Compilation goes to swig and stops with errors
    (cd swig; make build)
    for dir in python ; do (cd $dir; make build) || exit; done
    python setup.py build
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.3-fat-2.5
    copying gdal.py -> build/lib.macosx-10.3-fat-2.5
    copying ogr.py -> build/lib.macosx-10.3-fat-2.5
    copying osr.py -> build/lib.macosx-10.3-fat-2.5
    copying gdalconst.py -> build/lib.macosx-10.3-fat-2.5
    creating build/lib.macosx-10.3-fat-2.5/osgeo
    copying osgeo/__init__.py -> build/lib.macosx-10.3-fat-2.5/osgeo
    copying osgeo/gdal.py -> build/lib.macosx-10.3-fat-2.5/osgeo
    copying osgeo/gdal_array.py -> build/lib.macosx-10.3-fat-2.5/osgeo
    copying osgeo/gdalconst.py -> build/lib.macosx-10.3-fat-2.5/osgeo
    copying osgeo/gdalnumeric.py -> build/lib.macosx-10.3-fat-2.5/osgeo
    copying osgeo/ogr.py -> build/lib.macosx-10.3-fat-2.5/osgeo
    copying osgeo/osr.py -> build/lib.macosx-10.3-fat-2.5/osgeo
    running build_ext
    building 'osgeo._gdal' extension
    creating build/temp.macosx-10.3-fat-2.5
    creating build/temp.macosx-10.3-fat-2.5/extensions
    gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -I../../port -I../../gcore -I../../alg -I../../ogr/ -I/usr/local/include -I/usr/include -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -I. -I/Users/mloskot/dev/gdal/_svn/trunk/gdal/include -c extensions/gdal_wrap.cpp -o build/temp.macosx-10.3-fat-2.5/extensions/gdal_wrap.o
    g++ -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -bundle -undefined dynamic_lookup build/temp.macosx-10.3-fat-2.5/extensions/gdal_wrap.o -L../../.libs -L../../ -L/usr/local/lib -L/usr/lib -L/Users/mloskot/dev/gdal/_svn/trunk/gdal/lib -lgdal -o build/lib.macosx-10.3-fat-2.5/osgeo/_gdal.so
    /usr/bin/ld: warning -L: directory name (../../.libs) does not exist
    /usr/bin/ld: warning -L: directory name (/Users/mloskot/dev/gdal/_svn/trunk/gdal/lib) does not exist
    /usr/bin/ld: for architecture ppc
    /usr/bin/ld: warning ../..//libgdal.dylib cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (file not loaded)
    /usr/bin/ld: warning -L: directory name (../../.libs) does not exist
    /usr/bin/ld: warning -L: directory name (/Users/mloskot/dev/gdal/_svn/trunk/gdal/lib) does not exist
    /usr/bin/ld: for architecture i386
    /usr/bin/ld: warning can't open dynamic library: /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/libcurl.4.dylib referenced from: ../..//libgdal.dylib (checking for undefined symbols may be affected) (No such file or directory, errno = 2)
    /usr/bin/ld: Undefined symbols:
    _curl_easy_cleanup referenced from libgdal expected to be defined in /usr/lib/libcurl.4.dylib
    _curl_easy_getinfo referenced from libgdal expected to be defined in /usr/lib/libcurl.4.dylib
    _curl_easy_init referenced from libgdal expected to be defined in /usr/lib/libcurl.4.dylib
    _curl_easy_perform referenced from libgdal expected to be defined in /usr/lib/libcurl.4.dylib
    _curl_easy_setopt referenced from libgdal expected to be defined in /usr/lib/libcurl.4.dylib
    _curl_slist_append referenced from libgdal expected to be defined in /usr/lib/libcurl.4.dylib
    _curl_slist_free_all referenced from libgdal expected to be defined in /usr/lib/libcurl.4.dylib
    _curl_multi_add_handle referenced from libgdal expected to be defined in /usr/lib/libcurl.4.dylib
    _curl_multi_cleanup referenced from libgdal expected to be defined in /usr/lib/libcurl.4.dylib
    _curl_multi_fdset referenced from libgdal expected to be defined in /usr/lib/libcurl.4.dylib
    _curl_multi_info_read referenced from libgdal expected to be defined in /usr/lib/libcurl.4.dylib
    _curl_multi_init referenced from libgdal expected to be defined in /usr/lib/libcurl.4.dylib
    _curl_multi_perform referenced from libgdal expected to be defined in /usr/lib/libcurl.4.dylib
    _curl_multi_remove_handle referenced from libgdal expected to be defined in /usr/lib/libcurl.4.dylib
    collect2: ld returned 1 exit status
    lipo: can't open input file: /var/tmp//ccCeg0By.out (No such file or directory)
    error: command 'g++' failed with exit status 1
    make[2]: *** [build] Error 1
    make[1]: *** [build] Error 2
    make: *** [swig-modules] Error 2
    
  • The libcurl binaries are available in the system
    ~/dev/gdal/_svn/trunk/gdal $ ls -l /usr/lib/libcurl*
    lrwxr-xr-x   1 root  wheel      15 Apr  8 21:08 /usr/lib/libcurl.2.dylib -> libcurl.4.dylib
    lrwxr-xr-x   1 root  wheel      15 Mar  7  2007 /usr/lib/libcurl.3.0.0.dylib -> libcurl.3.dylib
    lrwxr-xr-x   1 root  wheel      15 Apr  8 21:08 /usr/lib/libcurl.3.dylib -> libcurl.4.dylib
    lrwxr-xr-x   1 root  wheel      15 Apr  8 21:08 /usr/lib/libcurl.4.0.0.dylib -> libcurl.4.dylib
    -rwxr-xr-x   1 root  wheel  460136 Apr  8 21:09 /usr/lib/libcurl.4.dylib
    lrwxr-xr-x   1 root  wheel      15 Apr  8 21:08 /usr/lib/libcurl.dylib -> libcurl.4.dylib
    
  • libgdal and ogrinfo can find and link to libcurl
    ~/dev/gdal/_svn/trunk/gdal $ otool -L libgdal.dylib|grep curl
            /usr/lib/libcurl.4.dylib (compatibility version 5.0.0, current version 5.0.0)
    
    ~/dev/gdal/_svn/trunk/gdal $ otool -L ./apps/ogrinfo|grep curl
            /usr/lib/libcurl.4.dylib (compatibility version 5.0.0, current version 5.0.0)
    
  • I can execute ogrinfo
    ~/dev/gdal/_svn/trunk/gdal $ ./apps/ogrinfo          
    Usage: ogrinfo [--help-general] [-ro] [-q] [-where restricted_where]
                   [-spat xmin ymin xmax ymax] [-fid fid]
                   [-sql statement] [-al] [-so] [--formats]
                   datasource_name [layer [layer ...]]
    
  • drivers that depend on libcurl have been built in
    ~/dev/gdal/_svn/trunk/gdal $ ./apps/gdalinfo --formats | grep WMS
      WMS (ro): OGC Web Map Service
    ~/dev/gdal/_svn/trunk/gdal $ ./apps/gdalinfo --formats | grep -i http
      HTTP (ro): HTTP Fetching Wrapper
    

I don't understand it what's the distinction between libcurl requirements for GDAL + utilities and Python bindings. If the former can find necessary definitions, why Python bindings can not? Do they need anything extra?

Change History (2)

comment:1 by Mateusz Łoskot, 16 years ago

Description: modified (diff)

comment:2 by hobu, 16 years ago

Resolution: invalid
Status: newclosed

This is XCode's isysroot's fault.

Note: See TracTickets for help on using tickets.