ExCiteS / geokey

Platform for participatory mapping
http://geokey.org.uk
Other
55 stars 29 forks source link

Error when running with Docker #403

Closed matheusbsilva closed 6 years ago

matheusbsilva commented 6 years ago

I tried to run the geokey using docker as explained on Readme, but I got the following error when I run docker-compose up --build. The error occur when the package gdal is being installed.

Step 6/12 : RUN pip install --global-option=build_ext --global-option="-I/usr/include/gdal" gdal==1.10
 ---> Running in 79dc063912b3
/usr/local/lib/python2.7/site-packages/pip/_internal/commands/install.py:206: UserWarning: Disabling all use of wheels due to the use of --build-options / --global-options / --install-options.
  cmdoptions.check_install_build_global(options)
Collecting gdal==1.10
  Downloading https://files.pythonhosted.org/packages/e6/b5/346cbd96837f5ed525d0460090d24e8cfb31ad805c6d5297ee4998eb81b6/GDAL-1.10.0.tar.gz (449kB)
Skipping bdist_wheel for gdal, due to binaries being disabled for it.
Installing collected packages: gdal
  Running setup.py install for gdal: started
    Running setup.py install for gdal: finished with status 'error'
    Complete output from command /usr/local/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-e_p8an/gdal/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" build_ext -I/usr/include/gdal install --record /tmp/pip-record-gzKei7/install-record.txt --single-version-externally-managed --compile:
Command "/usr/local/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-e_p8an/gdal/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" build_ext -I/usr/include/gdal install --record /tmp/pip-record-gzKei7/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-e_p8an/gdal/
    running build_ext
    building 'osgeo._gdal' extension
    creating build
    creating build/temp.linux-x86_64-2.7
    creating build/temp.linux-x86_64-2.7/extensions
    gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/gdal -I/usr/local/include/python2.7 -I. -I/usr/include -c extensions/gdal_wrap.cpp -o build/temp.linux-x86_64-2.7/extensions/gdal_wrap.o
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
    extensions/gdal_wrap.cpp: In function ‘CPLErr GDALRasterBandShadow_GetHistogram(GDALRasterBandShadow*, double, double, int, int*, int, int, GDALProgressFunc, void*)’:
    extensions/gdal_wrap.cpp:4419:18: warning: ‘CPLErr GDALGetRasterHistogram(GDALRasterBandH, double, double, int, int*, int, int, GDALProgressFunc, void*)’ is deprecated [-Wdeprecated-declarations]
         CPLErr err = GDALGetRasterHistogram( self, min, max, buckets, panHistogram,
                      ^~~~~~~~~~~~~~~~~~~~~~
    In file included from extensions/gdal_wrap.cpp:2858:0:
    /usr/include/gdal/gdal.h:757:28: note: declared here
     CPLErr CPL_DLL CPL_STDCALL GDALGetRasterHistogram( GDALRasterBandH hBand,
                                ^~~~~~~~~~~~~~~~~~~~~~
    extensions/gdal_wrap.cpp:4421:66: warning: ‘CPLErr GDALGetRasterHistogram(GDALRasterBandH, double, double, int, int*, int, int, GDALProgressFunc, void*)’ is deprecated [-Wdeprecated-declarations]
                                              callback, callback_data );
                                                                      ^
    In file included from extensions/gdal_wrap.cpp:2858:0:
    /usr/include/gdal/gdal.h:757:28: note: declared here
     CPLErr CPL_DLL CPL_STDCALL GDALGetRasterHistogram( GDALRasterBandH hBand,
                                ^~~~~~~~~~~~~~~~~~~~~~
    extensions/gdal_wrap.cpp: In function ‘CPLErr GDALRasterBandShadow_GetDefaultHistogram(GDALRasterBandShadow*, double*, double*, int*, int**, int, GDALProgressFunc, void*)’:
    extensions/gdal_wrap.cpp:4425:12: warning: ‘CPLErr GDALGetDefaultHistogram(GDALRasterBandH, double*, double*, int*, int**, int, GDALProgressFunc, void*)’ is deprecated [-Wdeprecated-declarations]
         return GDALGetDefaultHistogram( self, min_ret, max_ret, buckets_ret,
                ^~~~~~~~~~~~~~~~~~~~~~~
    In file included from extensions/gdal_wrap.cpp:2858:0:
    /usr/include/gdal/gdal.h:769:28: note: declared here
     CPLErr CPL_DLL CPL_STDCALL GDALGetDefaultHistogram( GDALRasterBandH hBand,
                                ^~~~~~~~~~~~~~~~~~~~~~~
    extensions/gdal_wrap.cpp:4427:61: warning: ‘CPLErr GDALGetDefaultHistogram(GDALRasterBandH, double*, double*, int*, int**, int, GDALProgressFunc, void*)’ is deprecated [-Wdeprecated-declarations]
                                         callback, callback_data );
                                                                 ^
    In file included from extensions/gdal_wrap.cpp:2858:0:
    /usr/include/gdal/gdal.h:769:28: note: declared here
     CPLErr CPL_DLL CPL_STDCALL GDALGetDefaultHistogram( GDALRasterBandH hBand,
                                ^~~~~~~~~~~~~~~~~~~~~~~
    extensions/gdal_wrap.cpp: In function ‘CPLErr GDALRasterBandShadow_SetDefaultHistogram(GDALRasterBandShadow*, double, double, int, int*)’:
    extensions/gdal_wrap.cpp:4430:12: warning: ‘CPLErr GDALSetDefaultHistogram(GDALRasterBandH, double, double, int, int*)’ is deprecated [-Wdeprecated-declarations]
         return GDALSetDefaultHistogram( self, min, max,
                ^~~~~~~~~~~~~~~~~~~~~~~
    In file included from extensions/gdal_wrap.cpp:2858:0:
    /usr/include/gdal/gdal.h:781:28: note: declared here
     CPLErr CPL_DLL CPL_STDCALL GDALSetDefaultHistogram( GDALRasterBandH hBand,
                                ^~~~~~~~~~~~~~~~~~~~~~~
    extensions/gdal_wrap.cpp:4431:44: warning: ‘CPLErr GDALSetDefaultHistogram(GDALRasterBandH, double, double, int, int*)’ is deprecated [-Wdeprecated-declarations]
                    buckets_in, panHistogram_in );
                                                ^
    In file included from extensions/gdal_wrap.cpp:2858:0:
    /usr/include/gdal/gdal.h:781:28: note: declared here
     CPLErr CPL_DLL CPL_STDCALL GDALSetDefaultHistogram( GDALRasterBandH hBand,
                                ^~~~~~~~~~~~~~~~~~~~~~~
    In file included from /usr/local/include/python2.7/Python.h:136:0,
                     from extensions/gdal_wrap.cpp:149:
    extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_MajorObject_SetMetadata__SWIG_0(PyObject*, PyObject*)’:
    /usr/local/include/python2.7/abstract.h:1354:62: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
     #define PyMapping_Items(O) PyObject_CallMethod(O,"items",NULL)
                                                                  ^
    extensions/gdal_wrap.cpp:7501:31: note: in expansion of macro ‘PyMapping_Items’
             PyObject *item_list = PyMapping_Items( obj1 );
                                   ^~~~~~~~~~~~~~~
    extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_Band_ComputeStatistics(PyObject*, PyObject*)’:
    extensions/gdal_wrap.cpp:14249:10: warning: variable ‘result’ set but not used [-Wunused-but-set-variable]
       CPLErr result;
              ^~~~~~
    creating build/lib.linux-x86_64-2.7
    creating build/lib.linux-x86_64-2.7/osgeo
    g++ -pthread -shared build/temp.linux-x86_64-2.7/extensions/gdal_wrap.o -L../../.libs -L../../ -L/usr/local/lib -L/usr/lib -lpython2.7 -lgdal -o build/lib.linux-x86_64-2.7/osgeo/_gdal.so
    building 'osgeo._gdalconst' extension
    gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/gdal -I/usr/local/include/python2.7 -I. -I/usr/include -c extensions/gdalconst_wrap.c -o build/temp.linux-x86_64-2.7/extensions/gdalconst_wrap.o
    gcc -pthread -shared build/temp.linux-x86_64-2.7/extensions/gdalconst_wrap.o -L../../.libs -L../../ -L/usr/local/lib -L/usr/lib -lpython2.7 -lgdal -o build/lib.linux-x86_64-2.7/osgeo/_gdalconst.so
    building 'osgeo._osr' extension
    gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/gdal -I/usr/local/include/python2.7 -I. -I/usr/include -c extensions/osr_wrap.cpp -o build/temp.linux-x86_64-2.7/extensions/osr_wrap.o
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
    extensions/osr_wrap.cpp: In function ‘OGRErr OSRSpatialReferenceShadow_ImportFromOzi(OSRSpatialReferenceShadow*, const char*, const char*, const char*)’:
    extensions/osr_wrap.cpp:3727:59: error: cannot convert ‘const char*’ to ‘const char* const*’ for argument ‘2’ to ‘OGRErr OSRImportFromOzi(OGRSpatialReferenceH, const char* const*)’
         return OSRImportFromOzi( self, datum, proj, projParms );
                                                               ^
    extensions/osr_wrap.cpp: At global scope:
    extensions/osr_wrap.cpp:3011:13: warning: ‘void GDALPythonFreeCStr(void*, int)’ defined but not used [-Wunused-function]
     static void GDALPythonFreeCStr(void* ptr, int bToFree)
                 ^~~~~~~~~~~~~~~~~~
    extensions/osr_wrap.cpp:2981:14: warning: ‘char* GDALPythonObjectToCStr(PyObject*, int*)’ defined but not used [-Wunused-function]
     static char* GDALPythonObjectToCStr(PyObject* pyObject, int* pbToFree)
                  ^~~~~~~~~~~~~~~~~~~~~~
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
ERROR: Service 'geokey' failed to build: The command '/bin/sh -c pip install --global-option=build_ext --global-option="-I/usr/include/gdal" gdal==1.10' returned a non-zero code: 1
JamesBradbury commented 6 years ago

Hello Mattheus. I have seen some issues with gdal before, but not sure what is going wrong here. You could try installing gdal manually first. What versions of Linux and docker compose are you using?

andrebargas commented 6 years ago

Hello @JamesBradbury. I'm having the same problem @matheusbsilva , i'm using Linux 16.04 with Docker version 17.05.0-ce . I've tried to modify the dockerfile.yml with some suggestions that i got in this post : https://gist.github.com/cspanring/5680334 , but still couldn't resolve the problem.

matheusbsilva commented 6 years ago

@JamesBradbury I'm running Arch Linux, with docker compose version 1.22.0. I tried to install the packages gdal-bin and python-gdal on the image but didn't work.

josokinas commented 6 years ago

I've made a PR https://github.com/ExCiteS/geokey/pull/404 now to resolve this issue.

matheusbsilva commented 6 years ago

@JamesBradbury @josokinas Still didn't work, I got a new error:

Step 4/9 : ADD /geokey/local_settings /app/local_settings
ERROR: Service 'geokey' failed to build: ADD failed: stat /var/lib/docker/tmp/docker-builder722469538/geokey/local_settings: no such file or directory
josokinas commented 6 years ago

@matheusbsilva Copy "local_settings.example" to "local_settings" - this is where you'd add custom configuration to the app.