


Setting stdlib should help clang find the correct C++11 libraries, if used. This sets ARCHFLAGS to blank rather than '-Wunused-command-line-argument-hard-error-in-future', as the latter is incompatible with gcc. Next, make the following modifications to the setup.py file: cxx11_flag='-std=c++11 -stdlib=libc++' Gdal-config contains all of the information needed to link to include and library files. Then, make the following change to the setup.cfg file: gdal_config=/usr/local/bin/gdal-config Next, install gcc-8 with Homebrew if not currently installed: brew install gcc. To install gdal for your existing Python (e.g., Anaconda Python 3.6) and link to GDAL, follow the method of but with the below modifications. As of June 2018 this provides the development branch of GDAL 2.3.0. If you try to build GDAL with gcc-8 instead, it will throw syntax errors.

Set your CC and CXX environmental variables to clang and clang++, then install using Homebrew: brew install gdal -HEAD In order to get all of the required headers, you need to use the latest development branch of GDAL, as it added another header ~3 weeks ago. You received the error because the header file was not included in your GDAL build.
#Mac python install gcc how to#
Ld: warning: directory not found for option '-L/Library/Frameworks/amework/Versions/2.1/lib'Ĭlang: error: linker command failed with exit code 1 (use -v to see invocation)Įrror: command 'clang++' failed with exit status 1Īny idea how to fix the errors and get a working installation? Then I tried following this solution: Python GDAL package missing header file when installing via pip although I do not want to install it in a virtualenv.Īfter setting CPLUS_INCLUDE_PATH and C_INCLUDE_PATH I ran into following error: clang++ -bundle -undefined dynamic_lookup -Wno-error=unused-command-line-argument-hard-error-in-future build/temp.macosx-10.11-x86_64-2.7/extensions/gdal_wrap.o -L/usr/local/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/sqlite/lib -L/Library/Frameworks/amework/Versions/2.1/lib -lgdal -o build/lib.macosx-10.11-x86_64-2.7/osgeo/_gdal.so bash_profile now looks like this export PATH=$PATH:/Library/Frameworks/amework/ProgramsĮxport PATH=$PATH:/Library/Frameworks/amework/Headers When I try to install gdal (on OSX 10.11.6) with pip install gdal (or easy_install) the installation fails with following error extensions/gdal_wrap.cpp:3085:10: fatal error: 'cpl_port.h' file not foundĪccording to this thread I added the location of the header file to my path variable.
