Hi,

I have hit the same issue (with GDAL 2.2.1), but in a different way:

running build_ext
building 'osgeo._gdal' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/extensions
/bin/bash /home/otbval/Dashboard/build/OTB-SuperBuild-stable/GDAL/src/GDAL/libtool --mode=compile --tag=CC /usr/bin/gcc-4.9 -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I../../port -I../../gcore -I../../alg -I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps -I/usr/include/python2.7 -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/home/otbval/Dashboard/build/OTB-SuperBuild-stable/GDAL/src/GDAL/include -c extensions/gdal_wrap.cpp -o build/temp.linux-x86_64-2.7/extensions/gdal_wrap.o
libtool: compile:  /usr/bin/gcc-4.9 -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I../../port -I../../gcore -I../../alg -I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps -I/usr/include/python2.7 -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/home/otbval/Dashboard/build/OTB-SuperBuild-stable/GDAL/src/GDAL/include -c extensions/gdal_wrap.cpp  -fPIC -DPIC -o build/temp.linux-x86_64-2.7/extensions/.libs/gdal_wrap.o
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
In file included from /usr/include/python2.7/Python.h:133:0,
                 from extensions/gdal_wrap.cpp:173:
extensions/gdal_wrap.cpp: In function 'PyObject* _wrap_MajorObject_SetMetadata__SWIG_0(PyObject*, PyObject*)':
/usr/include/python2.7/abstract.h:1354:62: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
 #define PyMapping_Items(O) PyObject_CallMethod(O,"items",NULL)
                                                              ^
extensions/gdal_wrap.cpp:9743:31: note: in expansion of macro 'PyMapping_Items'
         PyObject *item_list = PyMapping_Items( obj1 );
                               ^
c++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/extensions/gdal_wrap.o -L../../.libs -L../../ -L/home/otbval/Dashboard/build/OTB-SuperBuild-stable/GDAL/src/GDAL/lib -lgdal -o build/lib.linux-x86_64-2.7/osgeo/_gdal.so
c++: error: build/temp.linux-x86_64-2.7/extensions/gdal_wrap.o: Aucun fichier ou dossier de ce type
error: command 'c++' failed with exit status 1
make: *** [build] Erreur 1

If I understand right:
  • the compilation step of the extension is done using CC (that is not filtered from the environment by setup.py)
  • somehow distutils is not crashing and takes the full multi-word compiler command
  • the linking step is done using c++ (because CXX is filtered by setup.py)
  • since libtool produces ".lo" files, and c++ expects a ".o" file -> error
I have tried to filter CC using the same logic and it solves the error.

On 11/02/2016 12:50 PM, Even Rouault wrote:
I don't think so. We could also apply the same logic for CC as the one I added 
for CXX if it proved to be needed.
Yes!

Regards,
Guillaume

--
Guillaume PASERO
Responsable technique
Business Unit ESPACE & GeoInformation - Département Payload Data & Applications

CS Systèmes d'Information
Parc de la Grande Plaine - 5, Rue Brindejonc des Moulinais - BP 15872
31506 Toulouse Cedex 05 - FRANCE
+33 561 17 64 21 - [email protected]

_______________________________________________
gdal-dev mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to