Closed cwoelkers closed 4 years ago
Does git rev-parse HEAD
show 73cc0f633c8ce35a08211927faf1d18c06028f9c
?
Yes it does.
I'm not sure how to explain what you're seeing. I downloaded gcc 5.4.0 and compiled it with no warnings or errors. And the error that's causing compilation to fail:
/root/exactextract/src/grid.h:342:37: error: parameter declared ‘auto’ [](auto& acc, auto& op) {
implies compilation under C++11, not C++14.
According to the table at https://gcc.gnu.org/projects/cxx-status.html under C++14 GCC 5 and above supports it. GCC 6 and above has it set to automatically compile under C++14 but the command line flag -std=c++14 needs to be given if using GCC 5. Perhaps a change to the cmake script to detect this and add the flag for future proofing?
The flag should be set by this, though: https://github.com/isciences/exactextract/blob/master/CMakeLists.txt#L8
I think you can do make VERBOSE=1
to see what flags are actually being sent to the compiler.
The VERBOSE showed the command and a bigger issue. CMAKE was using /bin/gcc as it's compiler which is not where my GCC 5.4 compiler is located. The PATH is set correctly so BASH will find the right location, a "which gcc" gives it perfectly, but cmake seems to not be following the PATH order. I was able to fix this by declaring the CMAKE_C_COMPILER and CMAKE_CXX_COMPILER variables in the cmake command. This got things a lot farther but now I get the following:
[ 86%] Building CXX object CMakeFiles/exactextract_bin.dir/src/exactextract.cpp.o
/cm/shared/apps/gcc5/5.4.0/bin/g++ -DGEOS_USE_ONLY_R_API -I/root/exactextract/cmake-build-release/generated -I/root/exactextract/src -I/usr/include/gdal -isystem /root/exactextract/cmake-build-release/CLI11 -Werror -Wall -Wextra -Wshadow -std=c++14 -o CMakeFiles/exactextract_bin.dir/src/exactextract.cpp.o -c /root/exactextract/src/exactextract.cpp
In file included from /root/exactextract/src/exactextract.cpp:22:0:
/root/exactextract/src/gdal_dataset_wrapper.h:35:57: error: ‘OGRLayerH’ has not been declared
void copy_field(const std::string & field_name, OGRLayerH to) const;
^
/root/exactextract/src/gdal_dataset_wrapper.h:41:9: error: ‘OGRFeatureH’ does not name a type
OGRFeatureH m_feature;
^
/root/exactextract/src/gdal_dataset_wrapper.h:42:9: error: ‘OGRLayerH’ does not name a type
OGRLayerH m_layer;
^
make[2]: *** [CMakeFiles/exactextract_bin.dir/src/exactextract.cpp.o] Error 1
make[2]: Leaving directory `/root/exactextract/cmake-build-release'
make[1]: *** [CMakeFiles/exactextract_bin.dir/all] Error 2
make[1]: Leaving directory `/root/exactextract/cmake-build-release'
make: *** [all] Error 2
Are you using GDAL 1.x ?
1.11.4 Does it need to be a higher version?
I'm not sure the minimum version, but it's at least 2.0.
That makes sense. I'm working on compiling GDAL 3, and it requirements, right now so after all that is done I'm hoping it works. Although I don't code I do a lot of sys admin stuff. I would suggest lisiting the requirements in the README doc to keep more folks from bombarding you with questions. So far we know it requires GCC 5.x, GDAL 2.x(or 3.x) and CMAKE 3.x.
Using cmake 3.17.2, gcc 5.4.0, geos 3.8.1, make 3.82. cmake works fine but when I try to run the make command the following pops up.