<div dir="ltr">Hi<div><br></div><div>I'm building gdal on linux (64bit ubuntu 16) with python bindings, and I'm coming across a strange error right at the end of the python build steps where exactly 4 commands which *should* be run with `x86_64-linux-gnu-gcc` are instead run as `/bin/bash`.</div><div><br></div><div>Here are the last few lines of output before the error is encountered (look for /bin/bash -pthread ... command after the python header warnings:</div><div><br></div><div><div>make[1]: Entering directory '/home/james/src/gdal/gdal/swig'</div><div>for dir in python ; do (cd $dir; make build) || exit; done</div><div>make[2]: Entering directory '/home/james/src/gdal/gdal/swig/python'</div><div>rm -f setup_vars.ini</div><div>echo 'GNM_ENABLED=no' >> setup_vars.ini</div><div>python setup.py build</div><div>running build</div><div>running build_py</div><div>creating build</div><div>creating build/lib.linux-x86_64-2.7</div><div>copying gdal.py -> build/lib.linux-x86_64-2.7</div><div>copying ogr.py -> build/lib.linux-x86_64-2.7</div><div>copying osr.py -> build/lib.linux-x86_64-2.7</div><div>copying gdalconst.py -> build/lib.linux-x86_64-2.7</div><div>copying gdalnumeric.py -> build/lib.linux-x86_64-2.7</div><div>creating build/lib.linux-x86_64-2.7/osgeo</div><div>copying osgeo/gnm.py -> build/lib.linux-x86_64-2.7/osgeo</div><div>copying osgeo/gdalnumeric.py -> build/lib.linux-x86_64-2.7/osgeo</div><div>copying osgeo/gdal_array.py -> build/lib.linux-x86_64-2.7/osgeo</div><div>copying osgeo/gdalconst.py -> build/lib.linux-x86_64-2.7/osgeo</div><div>copying osgeo/osr.py -> build/lib.linux-x86_64-2.7/osgeo</div><div>copying osgeo/__init__.py -> build/lib.linux-x86_64-2.7/osgeo</div><div>copying osgeo/gdal.py -> build/lib.linux-x86_64-2.7/osgeo</div><div>copying osgeo/ogr.py -> build/lib.linux-x86_64-2.7/osgeo</div><div>running build_ext</div><div>building 'osgeo._gdal' extension</div><div>creating build/temp.linux-x86_64-2.7</div><div>creating build/temp.linux-x86_64-2.7/extensions</div><div>x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector -Wformat -Werror=format-security -fPIC -I../../port -I../../gcore -I../../alg -I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps -I/usr/include/python2.7 -I/home/james/local/farmenv/local/lib/python2.7/site-packages/numpy/core/include -I/home/james/src/gdal/gdal/include -c extensions/gdal_wrap.cpp -o build/temp.linux-x86_64-2.7/extensions/gdal_wrap.o</div><div>cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++</div><div>In file included from /usr/include/python2.7/Python.h:133:0,</div><div>                 from extensions/gdal_wrap.cpp:155:</div><div>extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_MajorObject_SetMetadata__SWIG_0(PyObject*, PyObject*)’:</div><div>/usr/include/python2.7/abstract.h:1354:62: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]</div><div> #define PyMapping_Items(O) PyObject_CallMethod(O,"items",NULL)</div><div>                                                              ^</div><div>extensions/gdal_wrap.cpp:9115:31: note: in expansion of macro ‘PyMapping_Items’</div><div>         PyObject *item_list = PyMapping_Items( obj1 );</div><div>                               ^</div><div>/bin/bash -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/extensions/gdal_wrap.o -L../../.libs -L../../ -L/home/james/src/gdal/gdal/lib -lgdal -o build/lib.linux-x86_64-2.7/osgeo/_gdal.so</div><div>/bin/bash: -d: invalid option</div><div>error: command '/bin/bash' failed with exit status 1</div><div>GNUmakefile:74: recipe for target 'build' failed</div><div>make[2]: *** [build] Error 1</div><div>make[2]: Leaving directory '/home/james/src/gdal/gdal/swig/python'</div><div>GNUmakefile:30: recipe for target 'build' failed</div><div>make[1]: *** [build] Error 2</div><div>make[1]: Leaving directory '/home/james/src/gdal/gdal/swig'</div><div>GNUmakefile:104: recipe for target 'swig-modules' failed</div><div>make: *** [swig-modules] Error 2</div></div><div><br></div><div><br></div><div>If I manually re-run the failing commands replacing `/bin/bash` with `x86_64-linux-gnu-gcc`, the entire build eventually succeeds.</div><div><br></div><div><br></div><div>Can anyone shed light on why the command is being replaced?</div><div><br></div><div><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div>Regards</div><div><br></div><div>James</div></div></div></div>
</div></div>