Skip to content

Commit

Permalink
disable optimizations for geometry.cpp if compiler is not intel
Browse files Browse the repository at this point in the history
  • Loading branch information
program-- committed Jul 10, 2023
1 parent ccbb579 commit f2671da
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions src/geopackage/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
cmake_minimum_required(VERSION 3.10)


string(COMPARE EQUAL "${CMAKE_CXX_COMPILER_ID}" "IntelLLVM" _cmp)
if (NOT _cmp)
message(WARNING "[NGen::geopackage] geometry.cpp cannot be optimized with "
"${CMAKE_CXX_COMPILER_ID} due to a suspected compiler/boost issue. "
"Use IntelLLVM if optimization for this source file is required.")
# !! Required due to optimizer issue with either clang or
# !! boost::geometry::srs::transformation
set_source_files_properties(geometry.cpp PROPERTIES COMPILE_FLAGS -O0)
endif()

add_library(geopackage STATIC geometry.cpp
properties.cpp
feature.cpp
Expand Down
2 changes: 1 addition & 1 deletion src/geopackage/geometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ geojson::geometry geopackage::build_geometry(
utils::copy_from(geometry_blob, index, srs_id, endian);

const auto epsg = wkb::get_prj(srs_id);
const auto prj = bg::srs::transformation<>(epsg, wkb::get_prj(4326));
const bg::srs::transformation<> prj{epsg, wkb::get_prj(4326)};
wkb::wgs84 pvisitor{srs_id, prj};

if (indicator > 0 & indicator < 5) {
Expand Down
2 changes: 1 addition & 1 deletion src/geopackage/sqlite/iterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ int sqlite_iter::num_columns() const noexcept

int sqlite_iter::column_index(const std::string& name) const noexcept
{
const ptrdiff_t pos =
const size_t pos =
std::distance(this->column_names.begin(), std::find(this->column_names.begin(), this->column_names.end(), name));

return pos >= this->column_names.size() ? -1 : pos;
Expand Down

0 comments on commit f2671da

Please sign in to comment.