From 419a2415bf7e27596f065429828ac03a346e89e0 Mon Sep 17 00:00:00 2001 From: Sameer Sheorey Date: Wed, 5 Jun 2024 15:18:42 -0700 Subject: [PATCH] IPP include dirs, test RPATH fix --- .clang-format | 2 +- cmake/Open3DSetGlobalProperties.cmake | 19 ++++++++++--------- cpp/open3d/t/geometry/kernel/IPPImage.cpp | 7 +++++++ cpp/open3d/t/geometry/kernel/IPPImage.h | 4 ++++ 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/.clang-format b/.clang-format index 63f78edb55a..e7623066a4d 100644 --- a/.clang-format +++ b/.clang-format @@ -2,7 +2,7 @@ BasedOnStyle: Google IndentWidth: 4 ColumnLimit: 80 UseTab: Never -Standard: c++14 +Standard: c++17 ContinuationIndentWidth: 8 AccessModifierOffset: -4 BinPackParameters: false diff --git a/cmake/Open3DSetGlobalProperties.cmake b/cmake/Open3DSetGlobalProperties.cmake index a87dc263af3..7a926f174bd 100644 --- a/cmake/Open3DSetGlobalProperties.cmake +++ b/cmake/Open3DSetGlobalProperties.cmake @@ -25,12 +25,20 @@ function(open3d_enable_strip target) endif() endfunction() +# RPATH handling (for TBB DSO). Check current folder, one folder above and the lib sibling folder +set(CMAKE_BUILD_RPATH_USE_ORIGIN ON) +if (APPLE) + set(CMAKE_INSTALL_RPATH "@loader_path;@loader_path/../;@loader_path/../lib/") +elseif(UNIX) + set(CMAKE_INSTALL_RPATH "$ORIGIN;$ORIGIN/../;$ORIGIN/../lib/") +endif() + # open3d_set_global_properties(target) # # Sets important project-related properties to . function(open3d_set_global_properties target) - # Tell CMake we want a compiler that supports C++14 features - target_compile_features(${target} PUBLIC cxx_std_14) + # Tell CMake we want a compiler that supports C++17 features + target_compile_features(${target} PUBLIC cxx_std_17) # Detect compiler id and version for utility::CompilerInfo # - OPEN3D_CXX_STANDARD @@ -195,11 +203,4 @@ function(open3d_set_global_properties target) target_link_options(${target} PRIVATE "$<$:${HARDENING_LDFLAGS}>") target_compile_definitions(${target} PRIVATE "$<$:${HARDENING_DEFINITIONS}>") - # RPATH handling (for TBB DSO). Check current folder, one folder above and the lib sibling folder - if (APPLE) - set_target_properties(${target} PROPERTIES INSTALL_RPATH "@loader_path;@loader_path/../;@loader_path/../lib/") - elseif(UNIX) - set_target_properties(${target} PROPERTIES INSTALL_RPATH "$ORIGIN;$ORIGIN/../;$ORIGIN/../lib/") - endif() - endfunction() diff --git a/cpp/open3d/t/geometry/kernel/IPPImage.cpp b/cpp/open3d/t/geometry/kernel/IPPImage.cpp index 27dcec8929e..b8287468cb2 100644 --- a/cpp/open3d/t/geometry/kernel/IPPImage.cpp +++ b/cpp/open3d/t/geometry/kernel/IPPImage.cpp @@ -7,10 +7,17 @@ #include "open3d/t/geometry/kernel/IPPImage.h" +#ifdef APPLE // macOS IPP <=v2021.9 uses old directory layout #include #include #include #include +#else // Linux and Windows IPP >=v2021.10 uses new directory layout +#include +#include +#include +#include +#endif #include "open3d/core/Dtype.h" #include "open3d/core/ParallelFor.h" diff --git a/cpp/open3d/t/geometry/kernel/IPPImage.h b/cpp/open3d/t/geometry/kernel/IPPImage.h index 9b62bdfd106..ef8f4d7c60b 100644 --- a/cpp/open3d/t/geometry/kernel/IPPImage.h +++ b/cpp/open3d/t/geometry/kernel/IPPImage.h @@ -11,7 +11,11 @@ #define IPP_ENABLED_THREADING_LAYER_REDEFINITIONS 1 #define IPP_CALL(ipp_function, ...) ipp_function(__VA_ARGS__); +#ifdef APPLE // macOS IPP v2021.9.11 uses old directory layout #include +#else // Linux and Windows IPP v2021.10+ uses new directory layout +#include +#endif #include "open3d/core/Dtype.h" #include "open3d/core/Tensor.h"