handstuyennn / geo

116 stars 7 forks source link

Error compilation for Amazon Linux 2 #7

Closed blackrez closed 1 year ago

blackrez commented 1 year ago

Hello,

I'm building a layer for AWS lambda and I have a compilation error.

Scanning dependencies of target duckdb_geo_geos
gmake[3]: Leaving directory `/var/task/geo/build/release'
gmake[3]: Entering directory `/var/task/geo/build/release'
[ 55%] Building CXX object extension/geo/third_party/geos/CMakeFiles/duckdb_geo_geos.dir/geos_c.cpp.o
In file included from /var/task/geo/geo/third_party/geos/geos_c.cpp:18:0:
/var/task/geo/geo/third_party/geos/include/geos/geom/CoordinateSequence.hpp:38:15: error: ‘unique_ptr’ in namespace ‘std’ does not name a template type
  typedef std::unique_ptr<CoordinateSequence> Ptr;
               ^~~~~~~~~~
/var/task/geo/geo/third_party/geos/include/geos/geom/CoordinateSequence.hpp:123:15: error: ‘unique_ptr’ in namespace ‘std’ does not name a template type
  virtual std::unique_ptr<CoordinateSequence> clone() const = 0;
               ^~~~~~~~~~
gmake[3]: *** [extension/geo/third_party/geos/CMakeFiles/duckdb_geo_geos.dir/geos_c.cpp.o] Error 1
gmake[3]: Leaving directory `/var/task/geo/build/release'
gmake[2]: *** [extension/geo/third_party/geos/CMakeFiles/duckdb_geo_geos.dir/all] Error 2
gmake[2]: Leaving directory `/var/task/geo/build/release'
gmake[1]: *** [all] Error 2
gmake[1]: Leaving directory `/var/task/geo/build/release'
make: *** [release] Error 2

The check from cmake

cmake --build build/release
-- The C compiler identification is GNU 7.3.1
-- The CXX compiler identification is GNU 7.3.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found Git: /usr/bin/git (found version "2.38.1")
-- git hash 67dab2a30b, version v0.6.2-dev2059
CMake Warning at CMakeLists.txt:409 (message):
  Please use a recent compiler for debug builds

The Dockerfile

FROM public.ecr.aws/lambda/python:3.9
CMD yum -y groupinstall "Development Tools" &&\
    yum -y install cmake3 && \
    ln -s /usr/bin/cmake3 /usr/bin/cmake && \
    git clone https://github.com/handstuyennn/geo && \
    cd geo && \
    make release
blackrez commented 1 year ago

Fixed by https://github.com/handstuyennn/geo/pull/8. Now duckdb and its geo extension works on AWS Lambda.

Thanks.