From 5c96a6195c6685cf3f6850fffa459d96a90c3623 Mon Sep 17 00:00:00 2001 From: Andrew Bell Date: Fri, 30 Jun 2017 09:33:02 -0400 Subject: [PATCH] More build stuff. --- io/GeotiffSupport.cpp | 2 +- vendor/kazhdan/CMakeLists.txt | 3 +++ vendor/kazhdan/MultiGridOctreeData.System.inl | 7 +++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/io/GeotiffSupport.cpp b/io/GeotiffSupport.cpp index a4ac65672a..7650547a21 100644 --- a/io/GeotiffSupport.cpp +++ b/io/GeotiffSupport.cpp @@ -99,7 +99,7 @@ GeotiffSrs::GeotiffSrs(const std::vector& directoryRec, }; #pragma pack(pop) - const ShortKeyHeader *header = (ShortKeyHeader *)directoryRec.data(); + ShortKeyHeader *header = (ShortKeyHeader *)directoryRec.data(); size_t declaredSize = (header->numKeys + 1) * 4; if (directoryRec.size() < declaredSize) return; diff --git a/vendor/kazhdan/CMakeLists.txt b/vendor/kazhdan/CMakeLists.txt index c6efe51231..2cd857cc3f 100644 --- a/vendor/kazhdan/CMakeLists.txt +++ b/vendor/kazhdan/CMakeLists.txt @@ -8,6 +8,9 @@ PDAL_ADD_FREE_LIBRARY(${PDAL_KAZHDAN_LIB_NAME} STATIC Geometry.cpp MarchingCubes.cpp ) +if (UNIX) + target_compile_options(${PDAL_KAZHDAN_LIB_NAME} PRIVATE -fPIC) +endif() target_link_libraries(${PDAL_KAZHDAN_LIB_NAME}) set_property(GLOBAL PROPERTY _PDAL_KAZHDAN_INCLUDED TRUE) diff --git a/vendor/kazhdan/MultiGridOctreeData.System.inl b/vendor/kazhdan/MultiGridOctreeData.System.inl index 373d91fa8b..ee10aaaa95 100644 --- a/vendor/kazhdan/MultiGridOctreeData.System.inl +++ b/vendor/kazhdan/MultiGridOctreeData.System.inl @@ -1737,7 +1737,6 @@ DenseNodeData< Real > Octree< Real >::solveSystem( const FEMSystemFunctor& F , I BSplineData< FEMDegree , BType > bsData( maxSolveDepth ); maxSolveDepth = std::min< LocalDepth >( maxSolveDepth , _maxDepth ); - int iter = 0; const int _iters = std::max< int >( 0 , solverInfo.iters ); DenseNodeData< Real > solution( _sNodesEnd( _maxDepth ) ); @@ -1749,11 +1748,11 @@ DenseNodeData< Real > Octree< Real >::solveSystem( const FEMSystemFunctor& F , I { int iters = (int)ceil( _iters * pow( solverInfo.lowResIterMultiplier , maxSolveDepth-d ) ); _SolverStats sStats; - if( !d ) iter = _solveSystemCG( F , bsData , interpolationInfo , d , solution , constraints , metSolution , _sNodesSize(d) , true , sStats , solverInfo.showResidual , 0 ); + if( !d ) _solveSystemCG( F , bsData , interpolationInfo , d , solution , constraints , metSolution , _sNodesSize(d) , true , sStats , solverInfo.showResidual , 0 ); else { - if( d>solverInfo.cgDepth ) iter = _solveSystemGS( F , bsData , interpolationInfo , d , solution , constraints , metSolution , iters , true , sStats , solverInfo.showResidual ); - else iter = _solveSystemCG( F , bsData , interpolationInfo , d , solution , constraints , metSolution , iters , true , sStats , solverInfo.showResidual , solverInfo.cgAccuracy ); + if( d>solverInfo.cgDepth ) _solveSystemGS( F , bsData , interpolationInfo , d , solution , constraints , metSolution , iters , true , sStats , solverInfo.showResidual ); + else _solveSystemCG( F , bsData , interpolationInfo , d , solution , constraints , metSolution , iters , true , sStats , solverInfo.showResidual , solverInfo.cgAccuracy ); } int femNodes = 0; #pragma omp parallel for reduction( + : femNodes )