isciences / exactextract

Fast and accurate raster zonal statistics
Apache License 2.0
255 stars 33 forks source link

Linker error "undefined reference" on Linux #16

Open yash-jain16 opened 4 years ago

yash-jain16 commented 4 years ago

[ 75%] Linking CXX executable exactextract libexactextract.a(geos_utils.cpp.o): In function exactextract::segment_intersection(GEOSContextHandle_HS*, exactextract::Coordinate const&, exactextract::Coordinate const&, exactextract::Coordinate const&, exactextract::Coordinate const&, exactextract::Coordinate&)': geos_utils.cpp:(.text+0x41c): undefined reference toGEOSSegmentIntersection_r' libexactextract.a(geos_utils.cpp.o): In function exactextract::geos_get_box(GEOSContextHandle_HS*, GEOSGeom_t const*)': geos_utils.cpp:(.text+0x4ad): undefined reference toGEOSGeom_getXMin_r' geos_utils.cpp:(.text+0x4c5): undefined reference to GEOSGeom_getYMin_r' geos_utils.cpp:(.text+0x4d9): undefined reference toGEOSGeom_getXMax_r' geos_utils.cpp:(.text+0x4ed): undefined reference to GEOSGeom_getYMax_r' libexactextract.a(geos_utils.cpp.o): In functionexactextract::geos_is_ccw(GEOSContextHandle_HS, GEOSCoordSeq_t const)': geos_utils.cpp:(.text+0x5ac): undefined reference to GEOSCoordSeq_isCCW_r' libexactextract.a(geos_utils.cpp.o): In functionexactextract::geos_get_component_boxes(GEOSContextHandle_HS, GEOSGeom_t const)': geos_utils.cpp:(.text+0x92a): undefined reference to GEOSGeom_getXMin_r' geos_utils.cpp:(.text+0x93e): undefined reference toGEOSGeom_getYMin_r' geos_utils.cpp:(.text+0x952): undefined reference to GEOSGeom_getXMax_r' geos_utils.cpp:(.text+0x966): undefined reference toGEOSGeom_getYMax_r' /usr/lib/libgdal.so: undefined reference to TIFFReadDirectory@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference toTIFFClientdata@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to kmlengine::Href::Parse(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /usr/lib/libgdal.so: undefined reference toxercesc_3_2::DOMImplementationRegistry::getDOMImplementation(char16_t const)' /usr/lib/libgdal.so: undefined reference to TIFFLastDirectory@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference toTIFFReadRGBAStripExt@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFWriteEncodedStrip@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference toTIFFSwabArrayOfShort@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFIsTiled@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference toTIFFIsByteSwapped@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to `kmlengine::KmzFile::ReadKmlAndGetPath(std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::cxx11::basic_string<char, std::char_traits, std::allocator >) const' /usr/lib/libgdal.so: undefined reference to TIFFFlushData@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference toTIFFWriteCheck@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFSetWriteOffset@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference toTIFFDefaultStripSize@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFScanlineSize64@LIBTIFF_4.0' //usr/lib/x86_64-linux-gnu/libpoppler.so.73: undefined reference toTIFFFdOpen@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to `kmldom::ParseNS(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::cxx11::basic_string<char, std::char_traits, std::allocator >)' /usr/lib/libgdal.so: undefined reference to TIFFIsBigEndian@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference toTIFFWriteScanline@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to xercesc_3_2::XSModel::getComponentsByNamespace(xercesc_3_2::XSConstants::COMPONENT_TYPE, char16_t const*)' /usr/lib/libgdal.so: undefined reference to_TIFFfree@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to kmlengine::KmzFile::OpenFromString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /usr/lib/libgdal.so: undefined reference toTIFFSwabShort@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFFreeDirectory@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference toTIFFGetField@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFNumberOfStrips@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference toTIFFWriteBufferSetup@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFScanlineSize@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference toTIFFWriteEncodedTile@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to xercesc_3_2::InputSource::setEncoding(char16_t const*)' /usr/lib/libgdal.so: undefined reference toTIFFSwabLong@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFTileSize@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference toTIFFWriteDirectory@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFReadEncodedTile@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference toxercesc_3_2::XMLString::transcode(char16_t const, xercesc_3_2::MemoryManager)' /usr/lib/libgdal.so: undefined reference to TIFFClose@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference toTIFFFlush@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFSetTagExtender@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference toTIFFRGBAImageOK@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFWriteRawStrip@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference toTIFFErrorExt@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to kmldom::SerializePretty[abi:cxx11](boost::intrusive_ptr<kmldom::Element> const&)' /usr/lib/libgdal.so: undefined reference toTIFFGetFieldDefaulted@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFSwabArrayOfLong@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference tokmldom::Parse(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::cxx11::basic_string<char, std::char_traits, std::allocator >)' /usr/lib/libgdal.so: undefined reference to TIFFNumberOfDirectories@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference toTIFFTileSize64@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to `xercesc_3_2::XSModel::getElementDeclaration(char16_t const, char16_t const*)' /usr/lib/libgdal.so: undefined reference to libdap::Connect::Connect(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)' /usr/lib/libgdal.so: undefined reference toTIFFWriteRawTile@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to xercesc_3_2::XMLString::release(char16_t**, xercesc_3_2::MemoryManager*)' /usr/lib/libgdal.so: undefined reference toTIFFStripSize64@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFCreateDirectory@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference toxercesc_3_2::InputSource::setPublicId(char16_t const)' /usr/lib/libgdal.so: undefined reference to TIFFSetSubDirectory@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference toxercesc_3_2::InputSource::setSystemId(char16_t const)' /usr/lib/libgdal.so: undefined reference to TIFFStripSize@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference toTIFFSwabArrayOfDouble@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFReadRGBATileExt@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference toTIFFReadEncodedStrip@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFUnlinkDirectory@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference toTIFFUnsetField@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFSetField@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference toTIFFMergeFieldInfo@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFCurrentDirOffset@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference toTIFFIsCODECConfigured@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to `kmlengine::KmzFile::ReadFile(char const*, std::cxx11::basic_string<char, std::char_traits, std::allocator >*) const' /usr/lib/libgdal.so: undefined reference to TIFFDataWidth@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference toTIFFSetWarningHandler@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFGetConfiguredCODECs@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference toTIFFSetErrorHandler@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFGetSizeProc@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference toTIFFRewriteDirectory@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to TIFFSetDirectory@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference toTIFFReadScanline@LIBTIFF_4.0' /usr/lib/libgdal.so: undefined reference to `TIFFNumberOfTiles@LIBTIFF_4.0' collect2: error: ld returned 1 exit status CMakeFiles/exactextract_bin.dir/build.make:181: recipe for target 'exactextract' failed make[2]: [exactextract] Error 1 CMakeFiles/Makefile2:155: recipe for target 'CMakeFiles/exactextract_bin.dir/all' failed make[1]: [CMakeFiles/exactextract_bin.dir/all] Error 2 Makefile:149: recipe for target 'all' failed make: *** [all] Error 2

dbaston commented 4 years ago

Not sure what would cause this, though you previously built it successfully, no? Can you describe your build environment?

yash-jain16 commented 4 years ago

Yes, it is working for me inside Docker, but I want to execute it directly on my machine. So I am using a Linux machine on AWS EC2 (Linux 5.3.0-1019-aws x86_64) I have gdal and CMake(3.17) already installed there

dbaston commented 4 years ago

Which Linux distribution? How were GDAL and GEOS installed?

yash-jain16 commented 4 years ago

Linux is Ubuntu bionic Ubuntu 18.04 LTS

GDAL and GEOS installed using anaconda env in python

dbaston commented 4 years ago

Ah, the conda env is probably screwing with the linking. Why not just install GDAL and GEOS via apt?

yash-jain16 commented 4 years ago

Hey, so I tried this way and it executed properly till "make" but on "sudo make install" I have the following error: image