I am trying to install the Cython package for Python 2.7.5. I am getting this output when running setup.py from the source code: (After it hits this warning it freezes)
running install
running bdist_egg
running egg_info
writing Cython.egg-info/PKG-INFO
writing top-level names to Cython.egg-info/top_level.txt
writing dependency_links to Cython.egg-info/dependency_links.txt
writing entry points to Cython.egg-info/entry_points.txt
reading manifest file 'Cython.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.pyx' under directory 'Cython/Debugger/Tests'
warning: no files found matching '*.pxd' under directory 'Cython/Debugger/Tests'
warning: no files found matching '*.h' under directory 'Cython/Debugger/Tests'
warning: no files found matching '*.pxd' under directory 'Cython/Utility'
writing manifest file 'Cython.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.9-intel/egg
running install_lib
running build_py
running build_ext
building 'Cython.Plex.Scanners' extension
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe
-fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG
-Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall
-Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386
-pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
-c Cython/Plex/Scanners.c
-o build/temp.macosx-10.9-intel-2.7/Cython/Plex/Scanners.o
Cython/Plex/Scanners.c:3105:31: warning: implicit conversion loses integer precision: 'long' to 'int'
[-Wshorten-64-to-32]
__pyx_v_self->input_state = __pyx_v_input_state;
~ ^~~~~~~~~~~~~~~~~~~
1 warning generated.
The same thing happens when I use pip to install. Any help would be greatly appreciated! Thanks
Related
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
So I got the latest python-ldap from source. I am also running the source compiled version of python 2.7.2 and I am running this on RHEL. So when I try to compile the package I get this long error message as seen below. So I installed the openldap-devel package and now it is a much smaller error. But still not compiling.
extra_compile_args: -g
extra_objects:
include_dirs: /opt/openldap-RE24/include /usr/include/sasl
library_dirs: /opt/openldap-RE24/lib
libs: ldap_r lber sasl2 ssl crypto
running install
running bdist_egg
running egg_info
writing requirements to Lib/python_ldap.egg-info/requires.txt
writing Lib/python_ldap.egg-info/PKG-INFO
writing top-level names to Lib/python_ldap.egg-info/top_level.txt
writing dependency_links to Lib/python_ldap.egg-info/dependency_links.txt
file Lib/ldap.py (for module ldap) not found
file Lib/ldap/controls.py (for module ldap.controls) not found
file Lib/ldap/extop.py (for module ldap.extop) not found
file Lib/ldap/schema.py (for module ldap.schema) not found
reading manifest file 'Lib/python_ldap.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'Makefile'
warning: no files found matching 'Modules/LICENSE'
writing manifest file 'Lib/python_ldap.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
file Lib/ldap.py (for module ldap) not found
file Lib/ldap/controls.py (for module ldap.controls) not found
file Lib/ldap/extop.py (for module ldap.extop) not found
file Lib/ldap/schema.py (for module ldap.schema) not found
file Lib/ldap.py (for module ldap) not found
file Lib/ldap/controls.py (for module ldap.controls) not found
file Lib/ldap/extop.py (for module ldap.extop) not found
file Lib/ldap/schema.py (for module ldap.schema) not found
running build_ext
building '_ldap' extension
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHAVE_LIBLDAP_R -DHAVE_SASL -DHAVE_TLS -DLDAPMODULE_VERSION=2.4.1 -IModules -I/opt/openldap-RE24/include -I/usr/include/sasl -I/opt/home/mradmin/.local/include/python2.7 -c Modules/LDAPObject.c -o build/temp.linux-x86_64-2.7/Modules/LDAPObject.o -g
In file included from Modules/LDAPObject.c:18:
/usr/include/sasl/sasl.h:349: warning: function declaration isnât a prototype
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHAVE_LIBLDAP_R -DHAVE_SASL -DHAVE_TLS -DLDAPMODULE_VERSION=2.4.1 -IModules -I/opt/openldap-RE24/include -I/usr/include/sasl -I/opt/home/mradmin/.local/include/python2.7 -c Modules/ldapcontrol.c -o build/temp.linux-x86_64-2.7/Modules/ldapcontrol.o -g
Modules/ldapcontrol.c: In function âencode_assertion_controlâ:
Modules/ldapcontrol.c:350: warning: implicit declaration of function âldap_create_assertion_control_valueâ
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHAVE_LIBLDAP_R -DHAVE_SASL -DHAVE_TLS -DLDAPMODULE_VERSION=2.4.1 -IModules -I/opt/openldap-RE24/include -I/usr/include/sasl -I/opt/home/mradmin/.local/include/python2.7 -c Modules/common.c -o build/temp.linux-x86_64-2.7/Modules/common.o -g
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHAVE_LIBLDAP_R -DHAVE_SASL -DHAVE_TLS -DLDAPMODULE_VERSION=2.4.1 -IModules -I/opt/openldap-RE24/include -I/usr/include/sasl -I/opt/home/mradmin/.local/include/python2.7 -c Modules/constants.c -o build/temp.linux-x86_64-2.7/Modules/constants.o -g
Modules/constants.c: In function âLDAPinit_constantsâ:
Modules/constants.c:153: error: âLDAP_OPT_DIAGNOSTIC_MESSAGEâ undeclared (first use in this function)
Modules/constants.c:153: error: (Each undeclared identifier is reported only once
Modules/constants.c:153: error: for each function it appears in.)
Modules/constants.c:363: error: âLDAP_CONTROL_RELAXâ undeclared (first use in this function)
error: command 'gcc' failed with exit status 1
Since this is closed because the question, this doesnt ocmpile please help me out is not a question. I figured it out. I had to manually compile the latest ldap, berkleydb, and then do a build install with it. Then it built fine
The first and second error message state that you're missing lber.h and ldap.h. This is a strong pointer to a missing or invalid openldap-devel package. Do you you have that package (or a similar one matching *ldap-dev*) installed?
Possibly a mismatch in the OpenLDAP and python-ldap versions. Try to compile the latest python-ldap version against a decent version of OpenSSL. E.g. Debian systems have notorious old versions of OpenLDAP installed...
I need to install
* Python-LDAP
to run under Ptython 2.7
I have a Centos 5.8 system (I cannot upgrade to 6.x). I currently have Python 2.4 installed and also Python 2.7. I am using Python 2.7 for development (along with Django). I have Python-LDAP installed and working under Python 2.4 (it was installed using yum). I need to install Python-LDAP for use with Python 2.7 (I will also install Django-ldap). I have been trying for days to do this. yum only runs under Python 2.4 so I cannot use that. I downloaded the Python-LDAP source (python-ldap-2.4.13.tar.gz (md5) from https://pypi.python.org/pypi/python-ldap/ but when I try to build it I get errors (see below).
Does anyone know if/how I can install Python-LDAP for Python 2.7 on Centos 5?
Error while building:
python setup.py build
defines: HAVE_SASL HAVE_TLS HAVE_LIBLDAP_R
extra_compile_args:
extra_objects:
include_dirs: /home/sfuller/python-ldap-2.4.13 /usr/lib64/evolution-openldap/include
/usr/lib/evolution-openldap/include /usr/include/sasl /usr/include
library_dirs: /home/sfuller/python-ldap-2.4.13 /usr/lib64/evolution-openldap/lib64 /usr/lib
/evolution-openldap/lib /usr/lib
libs: ldap_r
running build
running build_py
file Lib/ldap.py (for module ldap) not found
file Lib/ldap/controls.py (for module ldap.controls) not found
file Lib/ldap/extop.py (for module ldap.extop) not found
file Lib/ldap/schema.py (for module ldap.schema) not found
file Lib/ldap.py (for module ldap) not found
file Lib/ldap/controls.py (for module ldap.controls) not found
file Lib/ldap/extop.py (for module ldap.extop) not found
file Lib/ldap/schema.py (for module ldap.schema) not found
running egg_info
....
warning: no files found matching 'Makefile'
warning: no files found matching 'Modules/LICENSE'
writing manifest file 'Lib/python_ldap.egg-info/SOURCES.txt'
running build_ext
building '_ldap' extension
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes
-fPIC -DHAVE_SASL -DHAVE_TLS -DHAVE_LIBLDAP_R -DHAVE_LIBLDAP_R -DLDAPMODULE_VERSION=2.4.13
-IModules -I/home/sfuller/python-ldap-2.4.13 -I/usr/lib64/evolution-openldap/include -I/usr
/lib/evolution-openldap/include -I/usr/include/sasl -I/usr/include -I/usr/local/include/python2.7 -c Modules/LDAPObject.c -o build/temp.linux-x86_64-2.7/Modules/LDAPObject.o
In file included from Modules/LDAPObject.c:18:0:
/usr/include/sasl/sasl.h:349:5: warning: function declaration isnât a prototype [-Wstrict-prototypes]
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHAVE_SASL -DHAVE_TLS -DHAVE_LIBLDAP_R -DHAVE_LIBLDAP_R -DLDAPMODULE_VERSION=2.4.13 -IModules -I/home/sfuller/python-ldap-2.4.13 -I/usr/lib64/evolution-openldap/include -I/usr/lib/evolution-openldap/include -I/usr/include/sasl -I/usr/include -I/usr/local/include/python2.7 -c Modules/ldapcontrol.c -o build/temp.linux-x86_64-2.7/Modules/ldapcontrol.o
Modules/ldapcontrol.c: In function âencode_assertion_controlâ:
Modules/ldapcontrol.c:352:5: warning: implicit declaration of function âldap_create_assertion_control_valueâ [-Wimplicit-function-declaration]
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHAVE_SASL -DHAVE_TLS -DHAVE_LIBLDAP_R -DHAVE_LIBLDAP_R -DLDAPMODULE_VERSION=2.4.13 -IModules -I/home/sfuller/python-ldap-2.4.13 -I/usr/lib64/evolution-openldap/include -I/usr/lib/evolution-openldap/include -I/usr/include/sasl -I/usr/include -I/usr/local/include/python2.7 -c Modules/common.c -o build/temp.linux-x86_64-2.7/Modules/common.o
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHAVE_SASL -DHAVE_TLS -DHAVE_LIBLDAP_R -DHAVE_LIBLDAP_R -DLDAPMODULE_VERSION=2.4.13 -IModules -I/home/sfuller/python-ldap-2.4.13 -I/usr/lib64/evolution-openldap/include -I/usr/lib/evolution-openldap/include -I/usr/include/sasl -I/usr/include -I/usr/local/include/python2.7 -c Modules/constants.c -o build/temp.linux-x86_64-2.7/Modules/constants.o
Modules/constants.c: In function âLDAPinit_constantsâ:
Modules/constants.c:155:1: error: âLDAP_OPT_DIAGNOSTIC_MESSAGEâ undeclared (first use in
this function)
Modules/constants.c:155:1: note: each undeclared identifier is reported only once for each function it appears in
Modules/constants.c:365:29: error: âLDAP_CONTROL_RELAXâ undeclared (first use in this function)
error: command 'gcc' failed with exit status 1
I then looked over at this thread: https://mail.python.org/pipermail/python-ldap/2011q2/002937.html
So I downloaded the latest OpenLDAP and got:
./configure
Configuring OpenLDAP 2.4.38-Release ...
...
configure: error: BerkeleyDB version incompatible with BDB/HDB backends
Seems like I'm just sinking lower into a black hole...
This worked in centos 5.10 and python 2.7.6. I installed into a virtualenv.
I see mentions of evolution-openldap in your logs which were in mine when I had the same issue. Those directories are installed by openldap 2.3x.
You don't need to build openldap from source as there is a version in yum that is new enough to satisfy the version requirement by python-ldap.
openldap24-libs.i386 2.4.23-5.el5
openldap24-libs.x86_64 2.4.23-5.el5
openldap24-libs-devel.i386 2.4.23-5.el5
openldap24-libs-devel.x86_64 2.4.23-5.el5
To install you should first yum install openldap24-libs openldap24-libs-devel.
edit setup.cfg so its [_ldap] section so it contains:
library_dirs = /usr/lib/openldap24
include_dirs = /usr/include/openldap24
Run the build again. (I deleted my old build/ directory, you probably don't need to but give that a shot if the above is not working).
MySQL is installed at /usr/local/mysql
In site.cfg the path for mysql_config is /usr/local/mysql/bin/mysql_config
but when i try to build in the terminal im getting this error:
hammads-imac-2:MySQL-python-1.2.4b4 syedhammad$ sudo python setup.py build
running build
running build_py
copying MySQLdb/release.py -> build/lib.macosx-10.8-intel-2.7/MySQLdb
running build_ext
building '_mysql' extension
clang -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -Dversion_info=(1,2,4,'beta',4) -D_version_=1.2.4b4 -I/usr/local/mysql/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.8-intel-2.7/_mysql.o -Wno-null-conversion -Os -g -fno-strict-aliasing -arch x86_64
unable to execute clang: No such file or directory
error: command 'clang' failed with exit status 1
Help Please
You probably need Xcode's Command Line Tools.
Download the lastest version of Xcode, then go to "Preferences", select "Download" tab, then install Command Line Tools.
I am walking through the Cython documentation and building each of the example apps. I'm a little stuck at Using C Libraries. After successfully building the .so file and attempting to import it in a python file called test.py the following error is thrown.
$ python3.2 test.py
Traceback (most recent call last):
File "test.py", line 12, in <module>
from queue import Queue
ImportError: dlopen(/Users/jeremy/Development/labs/python/cython_lib_wrapper/queue.so, 2): Symbol not found: _queue_free
Referenced from: /Users/jeremy/Development/labs/python/cython_lib_wrapper/queue.so
Expected in: flat namespace
in /Users/jeremy/Development/labs/python/cython_lib_wrapper/queue.so
The .so file sits right next to the test.py file. So, it seems as though it should be found.
This is running the latest version of Cython, with Python 3.2 on a OSX 10.6.
Any insights?
Edit - adding build command and output
$ python3.2 setup.py build_ext --inplace
running build_ext
cythoning queue.pyx to queue.c
building 'queue' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -I/Library/Frameworks/Python.framework/Versions/3.2/include/python3.2m -c queue.c -o build/temp.macosx-10.6-intel-3.2/queue.o
queue.c: In function ‘__pyx_f_5queue_5Queue_append’:
queue.c:627: warning: cast to pointer from integer of different size
queue.c: In function ‘__pyx_f_5queue_5Queue_extend’:
queue.c:740: warning: cast to pointer from integer of different size
queue.c: In function ‘__pyx_f_5queue_5Queue_peek’:
queue.c:813: warning: cast from pointer to integer of different size
queue.c: In function ‘__pyx_f_5queue_5Queue_pop’:
queue.c:965: warning: cast from pointer to integer of different size
gcc-4.2 -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -isysroot /Developer/SDKs/MacOSX10.6.sdk -g build/temp.macosx-10.6-intel-3.2/queue.o -o
Edit 2 - adding "otool" cmd requested in comment
queue.so:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.0)
Edit 3 - adding "nm" output
U ___stack_chk_fail
U ___stack_chk_guard
U _queue_free
U _queue_is_empty
U _queue_new
U _queue_peek_head
U _queue_pop_head
U _queue_push_tail
U dyld_stub_binder
grep cmd outputs this:
(undefined) external _queue_free (dynamically looked up)
EDIT:
Ah, you didn't mention you had a dependency on the code in libcalg. That stuff needs to be compiled and included when you build the cextension.
Just modify setup.py:
# setup.py
# ...
ext_modules = [Extension("queue", ["queue.pyx", "libcalg/queue.c"])]
# ...
We could step back and see if you can build a really simple example:
I've tried the following (3 files, myext.pyx, test.py, setup.py) and it appears to work fine. Of course I'm on OS X 10.7 so it's not exactly the same as your environment. To rule out differences perhaps you can copy these and build them as a sanity check.
Contents of myext.pyx:
# myext.pyx
def square(x):
return x * x
Contents of test.py
# test.py
from myext import square
print "%d squared is %d"%(4, square(4))
Contents of setup.py:
# setup.py
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
ext_modules = [Extension("myext", ["myext.pyx"])]
setup(
name = 'Hello world app',
cmdclass = {'build_ext': build_ext},
ext_modules = ext_modules
)
I build in the directory containing these 3 files:
cython_test$ /usr/bin/python setup.py build_ext --inplace
running build_ext
cythoning myext.pyx to myext.c
building 'myext' extension
creating build
creating build/temp.macosx-10.7-intel-2.7
llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c myext.c -o build/temp.macosx-10.7-intel-2.7/myext.o
llvm-gcc-4.2 -Wl,-F. -bundle -undefined dynamic_lookup -Wl,-F. -arch i386 -arch x86_64 build/temp.macosx-10.7-intel-2.7/myext.o -o /Users/steder/SO/cython_test/myext.so
cython_test$ python test.py
4 squared is 16:
My environment has similar otool output and DYLD_LIBRARY_PATH is also unset but nm -m shows squared as defined.
Specifically:
00000000000011d0 (__DATA,__data) non-external ___pyx_k__square
00000000000011e0 (__DATA,__data) non-external ___pyx_mdef_5myext_square
0000000000001218 (__DATA,__bss) non-external ___pyx_n_s__square
0000000000000c80 (__TEXT,__text) non-external ___pyx_pf_5myext_square
Please give this a shot and see what it nm -m shows in your environment.
I'm trying to install GDAL 1.7.1 on Mac OS X Lion using:
python setup.py build
python setup.py install
and get the error:
running build
running build_py
running build_ext
building 'osgeo._gdal' extension
llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -arch i386 -arch x86_64 -I../../port -I../../gcore -I../../alg -I../../ogr/ -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/Library/Python/2.7/site-packages/numpy-2.0.0.dev_e2af7b7_20110721-py2.7-macosx-10.7-x86_64.egg/numpy/core/include -I/Library/Frameworks/GDAL.framework/Versions/1.7/include -c extensions/gdal_wrap.cpp -o build/temp.macosx-10.7-intel-2.7/extensions/gdal_wrap.o
unable to execute llvm-gcc-4.2: No such file or directory
error: command 'llvm-gcc-4.2' failed with exit status 1
Is this the right compiler? How can I get this working?
UPDATE:
I get a little further with Xcode installed:
running build
running build_py
running build_ext
building 'osgeo._gdal' extension
llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I../../port -I../../gcore -I../../alg -I../../ogr/ -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/Library/Python/2.7/site-packages/numpy-2.0.0.dev_e2af7b7_20110721-py2.7-macosx-10.7-x86_64.egg/numpy/core/include -I/Library/Frameworks/GDAL.framework/Versions/1.7/include -c extensions/gdal_wrap.cpp -o build/temp.macosx-10.7-intel-2.7/extensions/gdal_wrap.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
extensions/gdal_wrap.cpp:2813:22: error: cpl_port.h: No such file or directory
extensions/gdal_wrap.cpp:2814:24: error: cpl_string.h: No such file or directory
extensions/gdal_wrap.cpp:2815:27: error: cpl_multiproc.h: No such file or directory
extensions/gdal_wrap.cpp:2817:18: error: gdal.h: No such file or directory
extensions/gdal_wrap.cpp:2818:23: error: gdal_priv.h: No such file or directory
extensions/gdal_wrap.cpp:2819:22: error: gdal_alg.h: No such file or directory
extensions/gdal_wrap.cpp:2820:24: error: gdalwarper.h: No such file or directory
extensions/gdal_wrap.cpp:2837: error: expected initializer before ‘VeryQuietErrorHandler’
extensions/gdal_wrap.cpp:2713: warning: ‘swig_module’ defined but not used
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
extensions/gdal_wrap.cpp:2813:22: error: cpl_port.h: No such file or directory
extensions/gdal_wrap.cpp:2814:24: error: cpl_string.h: No such file or directory
extensions/gdal_wrap.cpp:2815:27: error: cpl_multiproc.h: No such file or directory
extensions/gdal_wrap.cpp:2817:18: error: gdal.h: No such file or directory
extensions/gdal_wrap.cpp:2818:23: error: gdal_priv.h: No such file or directory
extensions/gdal_wrap.cpp:2819:22: error: gdal_alg.h: No such file or directory
extensions/gdal_wrap.cpp:2820:24: error: gdalwarper.h: No such file or directory
extensions/gdal_wrap.cpp:2837: error: expected initializer before ‘VeryQuietErrorHandler’
extensions/gdal_wrap.cpp:2713: warning: ‘swig_module’ defined but not used
lipo: can't open input file: /var/tmp//ccgnLEPX.out (No such file or directory)
error: command 'llvm-gcc-4.2' failed with exit status 1
Homebrew works great for me. To install GDAL 1.9 with Homebrew all you have to do is
brew install gdal
Homebrew requires xcode, and I think commandline tools. More information can be found here
How about using the precompiled binaries available from http://www.kyngchaos.com/software/frameworks
Also, are you using 1.7.1 for a specific reason? 1.8.1 is, I believe, the current release build.
Caveat: I do not know if Lion is yet supported by the GDAL OSX binaries.
Did you actually install Xcode 4.1 on 10.7? Downloading it from the App Store is not enough; you have to manually run the Installer which it downloads to /Applications.
If you actually want to build from source, but want a convenient way to install there is a gdal package available from MacPorts - just install MacPorts, then on the command line type:
port install gdal
Macports will fetch and compile the source code for you. As of the time of writing the version in MacPorts is 1.9.0
for installing GDAL on mac:
brew install gdal
and then
pip install gdal
solved this for me