Skip to content

Commit

Permalink
Geos 3.12 Update (#5361)
Browse files Browse the repository at this point in the history
* Geos changes from updating to 3.12

* Added missing float include

* Updated tests

* Cleaned up environment.yml

* Removed pdal dep

* Set geos dep to proper version

* Embree3 update

* Final changes to embree shape/target

* Use find package shipped with embree and link against embree target
  • Loading branch information
acpaquette authored Dec 7, 2023
1 parent 72d8bed commit 968dec6
Show file tree
Hide file tree
Showing 56 changed files with 946 additions and 948 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ print.prt
*/tsts/*/output/*
*/build/
build/
*build*/
install/

# Unignore the documentation build
Expand Down
56 changes: 29 additions & 27 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,72 +3,74 @@ channels:
- defaults

dependencies:
- kalasiris
- ale=0.9.1
- ale>=0.9.1, <1
- armadillo
- boost=1.72
- boost-cpp=1.72
- boost>=1.72.0, <2
- boost-cpp>=1.72.0, <2
- blas
- usgs-astrogeology::bullet
- bz2file
- bzip2
- cmake >=3.15
- cmake >=3.15, <4
- cspice=67
- csm>=3.0.3,<3.0.4
- curl
- cxx-compiler=1.1.2
- curl>=8.3.0,<9.0a0
- cxx-compiler>=1.1.2
- doxygen
- eigen < 3.4
- embree>=2.17,<3
- eigen>=3, <4
- embree>=3, <4
- ffmpeg
- geos =3.11.1
- geos>=3.12.1, <4
- geotiff
- gmp
- graphviz
- gsl>=2.6
- hdf5
- hdf5>=1.14.2,<1.14.3.0a0
- icu
- inja
- jama
- jpeg
- usgs-astrogeology::kakadu==1
- kalasiris
- krb5
- libopencv>=4.5.2
- libpng>=1.6.34
- libprotobuf<3.20
- libtiff>=4.0
- libboost>=1.72.0, <2
- libgdal >=3.7.2,<3.8.0a0
- libopencv>=4.5.2, <5
- libpng>=1.6.34, <2
- libprotobuf
- libtiff>=4.0, <5
- libxml2
- make
- mesalib
- mysql
- mysql-connector-c
- nanoflann<1.4
- nlohmann_json
- ninja==1.7.2
- ninja>=1.7.2, <2
- nn
- opencv>=4.5.2
- openssl>=1.1.1k
- pcl >= 1.10.0
- opencv>=4.5.2, <5
- openssl>=3.1.2,<4.0a0
- pcl >=1.10, <2
- plio
- protobuf<3.20
- python>=3.7.11
- protobuf
- python=3.12
- python_abi=3.12
- pytest
- rclone
- qhull
- qt>=5.9.6,<5.15.0
- qt-main
- qwt
- sqlite
- rclone
- sqlite>=3.43.0,<4.0a0
- suitesparse
- superlu
- swig
- texlive-core
- tnt
- x264
- xalan-c
- xerces-c=3
- xerces-c>=3.2.4,<3.3.0a0
- xorg-kbproto
- xorg-libice
- xorg-libsm
- xorg-libx11
- xorg-libxi
- zlib
- zlib>=1.2.13,<1.3.0a0
2 changes: 1 addition & 1 deletion gtest
Submodule gtest updated 291 files
14 changes: 7 additions & 7 deletions isis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ endif()
# sometimes third parties do not set their rpaths correctly
set(thirdPartyCppFlags -Wall
-fPIC
-std=c++14
-std=c++17
-DISIS_LITTLE_ENDIAN=1
-Wno-unused-parameter
-Wno-overloaded-virtual
Expand All @@ -171,7 +171,7 @@ set(thirdPartyCppFlags -Wall
-DENABLEJP2K=${JP2KFLAG}
)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)

# Append CPP flags set in the third party lib file to the string set in this file.
string(REPLACE ";" " " FLAGS_STR "${thirdPartyCppFlags}")
Expand All @@ -183,8 +183,8 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAGS_STR}" )
# Add gold linker (and therefore, phtread) to speed up linux (spec. Ubuntu18.04) builds
if(NOT APPLE)
set(thirdPartyCppFlags ${thirdPartyCppFlags} -fuse-ld=gold
-pthread
-fext-numeric-literals
-pthread
-fext-numeric-literals
-Wl,-rpath,$ENV{CONDA_PREFIX}/lib)
endif()

Expand Down Expand Up @@ -270,7 +270,7 @@ find_package(Cholmod 4.4.5 REQUIRED)
find_package(CSM 3.0.3.3 REQUIRED)
find_package(CSPICE 65 REQUIRED)
find_package(Eigen REQUIRED)
find_package(Embree 2.15.0 REQUIRED)
find_package(Embree 3.13.0 REQUIRED)
find_package(GeoTIFF 2 REQUIRED)
SET(GSL_ROOT_DIR $ENV{CONDA_PREFIX})
find_package(GSL 2.2.1 REQUIRED)
Expand All @@ -279,7 +279,7 @@ find_package(Jama 125 REQUIRED)
find_package(NN REQUIRED)
find_package(OpenCV 3.1.0 REQUIRED)
find_package(PCL REQUIRED)
find_package(Protobuf 2.6.1 REQUIRED)
find_package(protobuf REQUIRED CONFIG)
find_package(Qwt 6 REQUIRED)
find_package(SuperLU 4.3 REQUIRED)
find_package(TIFF 4.0.0 REQUIRED)
Expand Down Expand Up @@ -352,7 +352,7 @@ foreach (_variableName ${_variableNames})
endforeach()

# add target based linkages to ALLLIBS variable
list(APPEND ALLLIBS pantor::inja sensorutilities)
list(APPEND ALLLIBS pantor::inja sensorutilities protobuf::libprotobuf embree)

# Sometimes we add the same lib more than once (especially with LIBDIRS)
list(REMOVE_DUPLICATES ALLLIBDIRS)
Expand Down
20 changes: 0 additions & 20 deletions isis/cmake/FindEmbree.cmake

This file was deleted.

2 changes: 1 addition & 1 deletion isis/cmake/FindGeos.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# GEOS_LIBRARY

find_path(GEOS_INCLUDE_DIR
NAMES geos.h
NAMES geos.h geos_c.h
PATH_SUFFIXES "geos/geos${Geos_FIND_VERSION}" "geos"
)

Expand Down
2 changes: 1 addition & 1 deletion isis/cmake/FindPCL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

find_path(PCL_INCLUDE_DIR
NAME pcl_base.h
PATH_SUFFIXES "pcl-1.8/pcl" "pcl-1.9/pcl" "pcl-1.11/pcl"
PATH_SUFFIXES "pcl-1.8/pcl" "pcl-1.9/pcl" "pcl-1.11/pcl" "pcl-1.12/pcl" "pcl-1.13/pcl"
)

find_library(PCL_COMMON_LIBRARY NAMES pcl_common)
Expand Down
2 changes: 1 addition & 1 deletion isis/src/base/apps/caminfo/CamTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ namespace Isis {
vector<const geos::geom::Geometry *> polys;
polys.push_back(g);
const geos::geom::GeometryFactory *gfactory = geos::geom::GeometryFactory::getDefaultInstance();
return (gfactory->createMultiPolygon(polys));
return (gfactory->createMultiPolygon(polys).release());
}


Expand Down
21 changes: 10 additions & 11 deletions isis/src/base/apps/cubediff/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@
#include "IString.h"
#include "Pixel.h"

using namespace std;
using namespace Isis;

void compare(vector<Buffer *> &in, vector<Buffer *> &out);
void compare(std::vector<Buffer *> &in, std::vector<Buffer *> &out);

void diffTable(ofstream &target, int precision);
void diffTable(std::ofstream &target, int precision);

// This is only used for the difference table
struct Difference {
Expand All @@ -36,7 +35,7 @@ int sample, line, band, spCount, diffCount, colWidth;
Statistics stats;
bool doTable;
unsigned int sigFigAccuracy = DBL_DIG; // DBL_DIG is maximum accuracy for a double
vector<Difference> diffset;
std::vector<Difference> diffset;
int sigFigLine = 0;
int sigFigSample = 0;
int sigFigBand = 0;
Expand Down Expand Up @@ -64,7 +63,7 @@ void IsisMain() {
doTable = true;
diffCount = ui.GetInteger("COUNT");
if(!ui.WasEntered("TO")) {
string message = "A target file is required for difference output";
std::string message = "A target file is required for difference output";
throw IException(IException::User, message, _FILEINFO_);
}

Expand Down Expand Up @@ -123,15 +122,15 @@ void IsisMain() {
}
if(doTable) {
QString filename = FileName(ui.GetFileName("TO", "txt")).expanded();
ofstream ofile(filename.toLatin1().data(), ios_base::app);
std::ofstream ofile(filename.toLatin1().data(), std::ios_base::app);
diffTable(ofile, ui.GetInteger("PRECISION"));
}

p.EndProcess();
filesEqual = true;
}

void compare(vector<Buffer *> &in, vector<Buffer *> &out) {
void compare(std::vector<Buffer *> &in, std::vector<Buffer *> &out) {
Buffer &input1 = *in[0];
Buffer &input2 = *in[1];
int inputSize = input1.size();
Expand Down Expand Up @@ -252,8 +251,8 @@ void compare(vector<Buffer *> &in, vector<Buffer *> &out) {
}

//Function to prepare the table to append to the
void diffTable(ofstream &target, int precision) {
vector<int> temp;
void diffTable(std::ofstream &target, int precision) {
std::vector<int> temp;

//Make a list of all samples present
for(unsigned int i = 0; i < diffset.size(); i++) {
Expand All @@ -264,14 +263,14 @@ void diffTable(ofstream &target, int precision) {
sort(temp.begin(), temp.end());

//Remove duplicates
vector<int> samps;
std::vector<int> samps;
samps.push_back(temp[0]);
for(unsigned int i = 1; i < temp.size(); i++) {
if(temp[i] != samps.back()) {
samps.push_back(temp[i]);
}
}
vector<Column> cols;
std::vector<Column> cols;
//Add the first Column
Column first("Line#", 7, Column::Integer);
cols.push_back(first);
Expand Down
1 change: 0 additions & 1 deletion isis/src/base/apps/fakecube/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#include "ProcessByLine.h"
#include "SpecialPixel.h"

using namespace std;
using namespace Isis;

void SumLineSample(Buffer &in, Buffer &out);
Expand Down
2 changes: 1 addition & 1 deletion isis/src/base/apps/footprintmerge/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ void IsisMain() {

// Create union poly
geos::geom::GeometryCollection *polyCollection =
Isis::globalFactory->createGeometryCollection(allPolys);
Isis::globalFactory->createGeometryCollection(allPolys).release();
geos::geom::Geometry *unionPoly = polyCollection->buffer(0).release();


Expand Down
6 changes: 3 additions & 3 deletions isis/src/base/objs/Chip/Chip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -959,8 +959,8 @@ namespace Isis {
interp.Interpolate(CubeSample(), CubeLine(), port.DoubleBuffer());
}
else {
geos::geom::Point *pnt = globalFactory->createPoint(
geos::geom::Coordinate(CubeSample(), CubeLine()));
std::unique_ptr<geos::geom::Point> pnt = globalFactory->createPoint(
geos::geom::Coordinate(CubeSample(), CubeLine()));
if (pnt->within(m_clipPolygon)) {
port.SetPosition(CubeSample(), CubeLine(), band);
cube.read(port);
Expand All @@ -970,7 +970,7 @@ namespace Isis {
else {
m_buf[line-1][samp-1] = Isis::NULL8;
}
delete pnt;
pnt.reset();
}
}
}
Expand Down
20 changes: 10 additions & 10 deletions isis/src/base/objs/Chip/unitTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ find files of those names at the top level of this repository. **/
#include "Preference.h"
#include "SpecialPixel.h"
#include "geos/geom/Coordinate.h"
#include "geos/geom/CoordinateArraySequence.h"
#include "geos/geom/CoordinateSequence.h"
#include "geos/geom/GeometryFactory.h"
#include "geos/geom/Polygon.h"
#include "geos/geom/MultiPolygon.h"
Expand Down Expand Up @@ -134,16 +134,16 @@ int main() {
cout << "Test load chip from cube with rotation and clipping polygon " << endl;
chip.TackCube(26.0, 25.0);

geos::geom::CoordinateArraySequence *pts = new geos::geom::CoordinateArraySequence();
pts->add(geos::geom::Coordinate(23.0, 22.0));
pts->add(geos::geom::Coordinate(28.0, 22.0));
pts->add(geos::geom::Coordinate(28.0, 27.0));
pts->add(geos::geom::Coordinate(25.0, 28.0));
pts->add(geos::geom::Coordinate(23.0, 22.0));
vector<geos::geom::Geometry *> *polys = new vector<geos::geom::Geometry *>;
geos::geom::CoordinateSequence pts;
pts.add(geos::geom::Coordinate(23.0, 22.0));
pts.add(geos::geom::Coordinate(28.0, 22.0));
pts.add(geos::geom::Coordinate(28.0, 27.0));
pts.add(geos::geom::Coordinate(25.0, 28.0));
pts.add(geos::geom::Coordinate(23.0, 22.0));
vector <const geos::geom::Geometry *> polys;
geos::geom::GeometryFactory::Ptr gf = geos::geom::GeometryFactory::create();
polys->push_back(gf->createPolygon(gf->createLinearRing(pts), NULL));
geos::geom::MultiPolygon *mPolygon = gf->createMultiPolygon(polys);
polys.push_back(gf->createPolygon(gf->createLinearRing(pts)).release());
geos::geom::MultiPolygon *mPolygon = gf->createMultiPolygon(polys).release();

chip.SetClipPolygon(*mPolygon);
chip.Load(junk, 45.0);
Expand Down
Loading

0 comments on commit 968dec6

Please sign in to comment.