Skip to content

Commit

Permalink
IPP include dirs, test RPATH fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ssheorey committed Jun 5, 2024
1 parent de04b88 commit 419a241
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ BasedOnStyle: Google
IndentWidth: 4
ColumnLimit: 80
UseTab: Never
Standard: c++14
Standard: c++17
ContinuationIndentWidth: 8
AccessModifierOffset: -4
BinPackParameters: false
Expand Down
19 changes: 10 additions & 9 deletions cmake/Open3DSetGlobalProperties.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 <target>.
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
Expand Down Expand Up @@ -195,11 +203,4 @@ function(open3d_set_global_properties target)
target_link_options(${target} PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${HARDENING_LDFLAGS}>")
target_compile_definitions(${target} PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${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()
7 changes: 7 additions & 0 deletions cpp/open3d/t/geometry/kernel/IPPImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@

#include "open3d/t/geometry/kernel/IPPImage.h"

#ifdef APPLE // macOS IPP <=v2021.9 uses old directory layout
#include <iw++/iw_image_color.hpp>
#include <iw++/iw_image_filter.hpp>
#include <iw++/iw_image_op.hpp>
#include <iw++/iw_image_transform.hpp>
#else // Linux and Windows IPP >=v2021.10 uses new directory layout
#include <ipp/iw++/iw_image_color.hpp>
#include <ipp/iw++/iw_image_filter.hpp>
#include <ipp/iw++/iw_image_op.hpp>
#include <ipp/iw++/iw_image_transform.hpp>
#endif

#include "open3d/core/Dtype.h"
#include "open3d/core/ParallelFor.h"
Expand Down
4 changes: 4 additions & 0 deletions cpp/open3d/t/geometry/kernel/IPPImage.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <iw++/iw_core.hpp>
#else // Linux and Windows IPP v2021.10+ uses new directory layout
#include <ipp/iw++/iw_core.hpp>
#endif

#include "open3d/core/Dtype.h"
#include "open3d/core/Tensor.h"
Expand Down

0 comments on commit 419a241

Please sign in to comment.