Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot compile filament from the source on macOS 13.3.1 (M1 macOS) #6147

Closed
3 tasks done
hiroyuki-sato opened this issue May 14, 2023 · 18 comments · Fixed by #6695
Closed
3 tasks done

Cannot compile filament from the source on macOS 13.3.1 (M1 macOS) #6147

hiroyuki-sato opened this issue May 14, 2023 · 18 comments · Fixed by #6695
Labels
build/install Build or installation issue

Comments

@hiroyuki-sato
Copy link

Checklist

Steps to reproduce the issue

I first cloned Open3D by:

git clone https://github.com/isl-org/Open3D.git
cd Open3D

Then, I build Open3D (on macOS 13.3.1) with:

mkdir build
cd build
cmake ..
make -j$(sysctl -n hw.physicalcpu)

Execute cmake

cmake ..
-- Setting build type to Release as none was specified.
-- CMAKE_BUILD_TYPE is set to Release.
-- ccache found at /opt/homebrew/bin/ccache
-- Downloading third-party dependencies to /Users/user/OpenProjects/open3d/Open3D/3rdparty_downloads
CMake Deprecation Warning at CMakeLists.txt:189 (cmake_policy):
  The OLD behavior for policy CMP0072 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


-- The C compiler identification is AppleClang 14.0.3.14030022
-- The CXX compiler identification is AppleClang 14.0.3.14030022
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Open3D 0.17.0+a5be78cfe
-- Found Python3: /Users/user/.pyenv/shims/python3.9 (found suitable version "3.9.15", minimum required is "3.6") found components: Interpreter Development Development.Module Development.Embed
-- Performing Test FLAG_fstack_protector
-- Performing Test FLAG_fstack_protector - Success
-- Performing Test FLAG_Wformat
-- Performing Test FLAG_Wformat - Success
-- Performing Test FLAG_Wformat_security
-- Performing Test FLAG_Wformat_security - Success
-- Performing Test FLAGLINKER__dead_strip
-- Performing Test FLAGLINKER__dead_strip - Success
-- Performing Test FLAG____CONFIG_Release__LINKER__S__x_
-- Performing Test FLAG____CONFIG_Release__LINKER__S__x_ - Success
-- Using security hardening compiler flags: $<$<COMPILE_LANGUAGE:CUDA>:-Xcompiler=-fstack-protector,-Wformat,-Wformat-security>;$<$<COMPILE_LANGUAGE:CXX>:-fstack-protector;-Wformat;-Wformat-security>
-- Using security hardening linker flags: $<$<COMPILE_LANGUAGE:CUDA>:-Xcompiler=LINKER:-dead_strip,$<$<CONFIG:Release>:LINKER:-S,-x>>;$<$<COMPILE_LANGUAGE:CXX>:LINKER:-dead_strip;$<$<CONFIG:Release>:LINKER:-S,-x>>
-- Using security hardening compiler definitions: _FORTIFY_SOURCE=2
-- Performing Test FLAG_load_hidden
-- Performing Test FLAG_load_hidden - Success
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Using installed third-party library 3rdparty_threads
-- Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES)
-- Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES)
-- Could NOT find OpenMP (missing: OpenMP_C_FOUND OpenMP_CXX_FOUND)
-- Unable to find installed third-party library 3rdparty_openmp
-- Building library 3rdparty_glfw from source
-- Could NOT find Vulkan (missing: VULKAN_LIBRARY VULKAN_INCLUDE_DIR)
-- Using Cocoa for window creation
-- Building third-party library JPEG from source
-- Looking for a ASM_NASM compiler
-- Looking for a ASM_NASM compiler - NOTFOUND
-- NASM assembler not found - libjpeg-turbo performance may suffer
-- libturbojpeg: WITH_CRT_DLL=OFF
-- pybind11 v2.6.2
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
-- Performing Test HAS_FLTO_THIN
-- Performing Test HAS_FLTO_THIN - Success
-- Building third-party library Filament from source
-- Found OpenGL: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/System/Library/Frameworks/OpenGL.framework
-- Using installed third-party library 3rdparty_opengl
-- Building OpenBLAS with LAPACK from source
-- gfortran found at
-- OPENBLAS_INCLUDE_DIR: /Users/user/OpenProjects/open3d/Open3D/build/openblas/include/openblas/
-- OPENBLAS_LIB_DIR /Users/user/OpenProjects/open3d/Open3D/build/openblas/lib
-- OPENBLAS_LIBRARIES: openblas
CMake Warning at 3rdparty/find_dependencies.cmake:1672 (message):
  All link warnings have been disabled on Apple Silicon builds due to the
  large number of spurious warnings that are generated.  If you need to see
  link warnings please build with -DCMAKE_BUILD_TYPE=Debug.
Call Stack (most recent call first):
  CMakeLists.txt:496 (include)


CMake Warning at 3rdparty/find_dependencies.cmake:1809 (message):
  IPP-ICV disabled: Unsupported Platform.
Call Stack (most recent call first):
  CMakeLists.txt:496 (include)


-- open3d_sycl_target_sources(core): PRIVATE
-- PYPI_PACKAGE_NAME: open3d
-- ================================================================================
-- Open3D 0.17.0 Configuration Summary
-- ================================================================================
-- Enabled Features:
--   OpenMP .................................. OFF
--   Headless Rendering ...................... OFF
--   Azure Kinect Support .................... OFF
--   Intel RealSense Support ................. OFF
--   CUDA Support ............................ OFF
--   SYCL Support ............................ OFF
--   ISPC Support ............................ OFF
--   Build GUI ............................... ON
--   Build WebRTC visualizer ................. OFF
--   Build Shared Library .................... OFF
--   Build Unit Tests ........................ OFF
--   Build Examples .......................... ON
--   Build Python Module ..................... ON
--   Build Jupyter Extension ................. OFF
--   Build TensorFlow Ops .................... OFF
--   Build PyTorch Ops ....................... OFF
--   Build Benchmarks ........................ OFF
--   Bundle Open3D-ML ........................ OFF
--   Force GLIBCXX_USE_CXX11_ABI= ............ 0
-- ================================================================================
-- Third-Party Dependencies:
--   Assimp .................................. yes (build from source)
--   BLAS .................................... yes (build from source)
--   curl .................................... yes (build from source)
--   Eigen3 .................................. yes (build from source)
--   filament ................................ yes (build from source)
--   fmt ..................................... yes (build from source)
--   GLEW .................................... yes (build from source)
--   GLFW .................................... yes (build from source)
--   googletest .............................. no
--   imgui ................................... yes (build from source)
--   ippicv .................................. no
--   JPEG .................................... yes (build from source)
--   jsoncpp ................................. yes (build from source)
--   liblzf .................................. yes (build from source)
--   msgpack ................................. yes (build from source)
--   nanoflann ............................... yes (build from source)
--   OpenGL .................................. yes
--   PNG ..................................... yes (build from source)
--   qhullcpp ................................ yes (build from source)
--   librealsense ............................ no
--   TBB ..................................... yes (build from source)
--   tinyfiledialogs ......................... yes (build from source)
--   TinyGLTF ................................ yes (build from source)
--   tinyobjloader ........................... yes (build from source)
--   VTK ..................................... yes (build from source)
--   WebRTC .................................. no
--   ZeroMQ .................................. yes (build from source)
-- ================================================================================
-- Configuring done (9.6s)
-- Generating done (0.3s)
-- Build files have been written to: /Users/user/OpenProjects/open3d/Open3D/build

First error (fixed)

I got the following error, at the first.

1 error generated.
make[5]: *** [third_party/spirv-tools/source/opt/CMakeFiles/SPIRV-Tools-opt.dir/basic_block.cpp.o] Error 1
In file included from /Users/user/OpenProjects/open3d/Open3D/build/filament/src/ext_filament/third_party/spirv-tools/source/opt/aggressive_dead_code_elim_pass.cpp:18:
In file included from /Users/user/OpenProjects/open3d/Open3D/build/filament/src/ext_filament/third_party/spirv-tools/source/opt/aggressive_dead_code_elim_pass.h:30:
In file included from /Users/user/OpenProjects/open3d/Open3D/build/filament/src/ext_filament/third_party/spirv-tools/source/opt/basic_block.h:30:
In file included from /Users/user/OpenProjects/open3d/Open3D/build/filament/src/ext_filament/third_party/spirv-tools/source/opt/instruction_list.h:28:
/Users/user/OpenProjects/open3d/Open3D/build/filament/src/ext_filament/third_party/spirv-tools/source/util/ilist.h:341:7: error: variable 'sentinel_count' set but not used [-Werror,-Wunused-but-set-variable]
  int sentinel_count = 0;

I fixed this error for adding (void)sentinel_count; like the below.

void IntrusiveList<NodeType>::Check(NodeType* start) {
  int sentinel_count = 0;
  NodeType* p = start;
  do {
    assert(p != nullptr);
    assert(p->next_node_->previous_node_ == p);
    assert(p->previous_node_->next_node_ == p);
    if (p->is_sentinel_) sentinel_count++;
    p = p->next_node_;
  } while (p != start);
  assert(sentinel_count == 1 && "List should have exactly 1 sentinel node.");
  (void)sentinel_count;

Error message

In file included from /Users/user/OpenProjects/open3d/Open3D/build/filament/src/ext_filament/third_party/spirv-tools/source/opt/merge_return_pass.cpp:15:
/Users/user/OpenProjects/open3d/Open3D/build/filament/src/ext_filament/third_party/spirv-tools/source/opt/merge_return_pass.h:121:5: error: definition of implicit copy assignment operator for 'StructuredControlState' is deprecated because it has a user-declared copy constructor [-Werror,-Wdeprecated-copy]
    StructuredControlState(const StructuredControlState&) = default;
    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__algorithm/move.h:34:15: note: in implicit copy assignment operator for 'spvtools::opt::MergeReturnPass::StructuredControlState' first required here
    *__result = _IterOps<_AlgPolicy>::__iter_move(__first);
              ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__algorithm/move.h:54:17: note: in instantiation of function template specialization 'std::__move_impl<std::_ClassicAlgPolicy, spvtools::opt::MergeReturnPass::StructuredControlState *, spvtools::opt::MergeReturnPass::StructuredControlState *, spvtools::opt::MergeReturnPass::StructuredControlState *>' requested here
    return std::__move_impl<_AlgPolicy, _InType*, _InType*, _OutType*>(__first, __last, __result);
                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__algorithm/move.h:87:8: note: in instantiation of function template specialization 'std::__move_impl<std::_ClassicAlgPolicy, spvtools::opt::MergeReturnPass::StructuredControlState, spvtools::opt::MergeReturnPass::StructuredControlState, void>' requested here
  std::__move_impl<_AlgPolicy>(__last_base, __first_base, __result_first);
       ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__algorithm/move.h:97:21: note: in instantiation of function template specialization 'std::__move_impl<std::_ClassicAlgPolicy, spvtools::opt::MergeReturnPass::StructuredControlState *, spvtools::opt::MergeReturnPass::StructuredControlState *, 0>' requested here
  auto __ret = std::__move_impl<_AlgPolicy>(
                    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__algorithm/move.h:114:15: note: in instantiation of function template specialization 'std::__move<std::_ClassicAlgPolicy, std::reverse_iterator<spvtools::opt::MergeReturnPass::StructuredControlState *>, std::reverse_iterator<spvtools::opt::MergeReturnPass::StructuredControlState *>, std::reverse_iterator<spvtools::opt::MergeReturnPass::StructuredControlState *>>' requested here
  return std::__move<_ClassicAlgPolicy>(__first, __last, __result).second;
              ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__memory/uninitialized_algorithms.h:635:17: note: in instantiation of function template specialization 'std::move<std::reverse_iterator<spvtools::opt::MergeReturnPass::StructuredControlState *>, std::reverse_iterator<spvtools::opt::MergeReturnPass::StructuredControlState *>>' requested here
    return std::move(__first1, __last1, __first2);
                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/vector:914:27: note: in instantiation of function template specialization 'std::__uninitialized_allocator_move_if_noexcept<std::allocator<spvtools::opt::MergeReturnPass::StructuredControlState>, std::reverse_iterator<spvtools::opt::MergeReturnPass::StructuredControlState *>, std::reverse_iterator<spvtools::opt::MergeReturnPass::StructuredControlState *>, spvtools::opt::MergeReturnPass::StructuredControlState, void>' requested here
    __v.__begin_   = std::__uninitialized_allocator_move_if_noexcept(
                          ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/vector:1581:5: note: in instantiation of member function 'std::vector<spvtools::opt::MergeReturnPass::StructuredControlState>::__swap_out_circular_buffer' requested here
    __swap_out_circular_buffer(__v);
    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/vector:1600:9: note: in instantiation of function template specialization 'std::vector<spvtools::opt::MergeReturnPass::StructuredControlState>::__emplace_back_slow_path<spvtools::opt::Instruction *&, spvtools::opt::Instruction *&>' requested here
        __emplace_back_slow_path(_VSTD::forward<_Args>(__args)...);
        ^
/Users/user/OpenProjects/open3d/Open3D/build/filament/src/ext_filament/third_party/spirv-tools/source/opt/merge_return_pass.cpp:79:14: note: in instantiation of function template specialization 'std::vector<spvtools::opt::MergeReturnPass::StructuredControlState>::emplace_back<spvtools::opt::Instruction *&, spvtools::opt::Instruction *&>' requested here
      state_.emplace_back(mergeInst, mergeInst);
             ^
1 error generated.
make[5]: *** [third_party/spirv-tools/source/opt/CMakeFiles/SPIRV-Tools-opt.dir/merge_return_pass.cpp.o] Error 1
make[5]: *** Waiting for unfinished jobs....
make[4]: *** [third_party/spirv-tools/source/opt/CMakeFiles/SPIRV-Tools-opt.dir/all] Error 2
make[3]: *** [all] Error 2
make[2]: *** [filament/src/ext_filament-stamp/ext_filament-build] Error 2
make[1]: *** [CMakeFiles/ext_filament.dir/all] Error 2
make: *** [all] Error 2

Open3D, Python and System information

- Operating system: macOS 13.3.1 (M1/Arm64)
- Python version: 3.8.10 (default, Jul 14 2021, 22:33:06)
- Open3D version: a5be78cfe3da627ce6a38a7905e3e5cd6a64d811
- System architecture: apple-silicon
- Is this a remote workstation?: no
- How did you install Open3D?: build from source
- Compiler version (if built from source): Apple clang version 14.0.3 (clang-1403.0.22.14.1)

Additional information

It seems the filament is old. Is it possible to use the latest versions?

Best regards.

@hiroyuki-sato hiroyuki-sato added the build/install Build or installation issue label May 14, 2023
@ManuelSenge
Copy link

I've got exactly the same error. Also using macOS 13.3.1 on an M1 chip.

@megatran
Copy link

megatran commented Jun 9, 2023

can also confirm I'm getting this on M2 chip

@nbkhuong
Copy link

I'm getting the same issue on MB M1 Pro.

@Crear12
Copy link

Crear12 commented Aug 6, 2023

M1 Max

@michaelschleiss
Copy link

This fix in the affected 3rd party library helped me getting rid of the error:

Suppress -Wunused-but-set-variable on variable #4777

@hiroyuki-sato
Copy link
Author

@michaelschleiss Thank you for your reply. I already fixed that part and I can't fix the attached error.
(Copied my original post (Error message part))

In file included from /Users/user/OpenProjects/open3d/Open3D/build/filament/src/ext_filament/third_party/spirv-tools/source/opt/merge_return_pass.cpp:15:
/Users/user/OpenProjects/open3d/Open3D/build/filament/src/ext_filament/third_party/spirv-tools/source/opt/merge_return_pass.h:121:5: error: definition of implicit copy assignment operator for 'StructuredControlState' is deprecated because it has a user-declared copy constructor [-Werror,-Wdeprecated-copy]
    StructuredControlState(const StructuredControlState&) = default;
    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__algorithm/move.h:34:15: note: in implicit copy assignment operator for 'spvtools::opt::MergeReturnPass::StructuredControlState' first required here
    *__result = _IterOps<_AlgPolicy>::__iter_move(__first);
              ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__algorithm/move.h:54:17: note: in instantiation of function template specialization 'std::__move_impl<std::_ClassicAlgPolicy, spvtools::opt::MergeReturnPass::StructuredControlState *, spvtools::opt::MergeReturnPass::StructuredControlState *, spvtools::opt::MergeReturnPass::StructuredControlState *>' requested here
    return std::__move_impl<_AlgPolicy, _InType*, _InType*, _OutType*>(__first, __last, __result);
                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__algorithm/move.h:87:8: note: in instantiation of function template specialization 'std::__move_impl<std::_ClassicAlgPolicy, spvtools::opt::MergeReturnPass::StructuredControlState, spvtools::opt::MergeReturnPass::StructuredControlState, void>' requested here
  std::__move_impl<_AlgPolicy>(__last_base, __first_base, __result_first);
       ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__algorithm/move.h:97:21: note: in instantiation of function template specialization 'std::__move_impl<std::_ClassicAlgPolicy, spvtools::opt::MergeReturnPass::StructuredControlState *, spvtools::opt::MergeReturnPass::StructuredControlState *, 0>' requested here
  auto __ret = std::__move_impl<_AlgPolicy>(
                    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__algorithm/move.h:114:15: note: in instantiation of function template specialization 'std::__move<std::_ClassicAlgPolicy, std::reverse_iterator<spvtools::opt::MergeReturnPass::StructuredControlState *>, std::reverse_iterator<spvtools::opt::MergeReturnPass::StructuredControlState *>, std::reverse_iterator<spvtools::opt::MergeReturnPass::StructuredControlState *>>' requested here
  return std::__move<_ClassicAlgPolicy>(__first, __last, __result).second;
              ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__memory/uninitialized_algorithms.h:635:17: note: in instantiation of function template specialization 'std::move<std::reverse_iterator<spvtools::opt::MergeReturnPass::StructuredControlState *>, std::reverse_iterator<spvtools::opt::MergeReturnPass::StructuredControlState *>>' requested here
    return std::move(__first1, __last1, __first2);
                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/vector:914:27: note: in instantiation of function template specialization 'std::__uninitialized_allocator_move_if_noexcept<std::allocator<spvtools::opt::MergeReturnPass::StructuredControlState>, std::reverse_iterator<spvtools::opt::MergeReturnPass::StructuredControlState *>, std::reverse_iterator<spvtools::opt::MergeReturnPass::StructuredControlState *>, spvtools::opt::MergeReturnPass::StructuredControlState, void>' requested here
    __v.__begin_   = std::__uninitialized_allocator_move_if_noexcept(
                          ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/vector:1581:5: note: in instantiation of member function 'std::vector<spvtools::opt::MergeReturnPass::StructuredControlState>::__swap_out_circular_buffer' requested here
    __swap_out_circular_buffer(__v);
    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/vector:1600:9: note: in instantiation of function template specialization 'std::vector<spvtools::opt::MergeReturnPass::StructuredControlState>::__emplace_back_slow_path<spvtools::opt::Instruction *&, spvtools::opt::Instruction *&>' requested here
        __emplace_back_slow_path(_VSTD::forward<_Args>(__args)...);
        ^
/Users/user/OpenProjects/open3d/Open3D/build/filament/src/ext_filament/third_party/spirv-tools/source/opt/merge_return_pass.cpp:79:14: note: in instantiation of function template specialization 'std::vector<spvtools::opt::MergeReturnPass::StructuredControlState>::emplace_back<spvtools::opt::Instruction *&, spvtools::opt::Instruction *&>' requested here
      state_.emplace_back(mergeInst, mergeInst);
             ^
1 error generated.
make[5]: *** [third_party/spirv-tools/source/opt/CMakeFiles/SPIRV-Tools-opt.dir/merge_return_pass.cpp.o] Error 1
make[5]: *** Waiting for unfinished jobs....
make[4]: *** [third_party/spirv-tools/source/opt/CMakeFiles/SPIRV-Tools-opt.dir/all] Error 2
make[3]: *** [all] Error 2
make[2]: *** [filament/src/ext_filament-stamp/ext_filament-build] Error 2
make[1]: *** [CMakeFiles/ext_filament.dir/all] Error 2
make: *** [all] Error 2

@michaelschleiss
Copy link

Based on the error message I commented out line 121 in:

/Users/user/OpenProjects/open3d/Open3D/build/filament/src/ext_filament/third_party/spirv-tools/source/opt/merge_return_pass.h

Worked for me.

@hiroyuki-sato
Copy link
Author

hiroyuki-sato commented Aug 16, 2023

@michaelschleiss Thank you for your comment.

You means comment out like //StructuredControlState(const StructuredControlState&) = default;

It passed the error onto my environment.

filament/src/ext_filament/third_party/spirv-tools/source/opt/merge_return_pass.h

 private:
  // This class is used to store the a break merge instruction and a current
  // merge instruction.  The intended use is to keep track of the block to
  // break to and the current innermost control flow construct merge block.
  class StructuredControlState {
   public:
    StructuredControlState(Instruction* break_merge, Instruction* merge)
        : break_merge_(break_merge), current_merge_(merge) {}

    //StructuredControlState(const StructuredControlState&) = default; // <-- HERE

    bool InBreakable() const { return break_merge_; }
    bool InStructuredFlow() const { return CurrentMergeId() != 0; }

    uint32_t CurrentMergeId() const {
      return current_merge_ ? current_merge_->GetSingleWordInOperand(0u) : 0u;
    }

But I got another error like the one below.

[ 77%] Building CXX object cpp/open3d/visualization/CMakeFiles/visualization.dir/app/Viewer.cpp.o
[ 77%] Built target visualization
make: *** [all] Error 2

Please tell me your compile option and source version (commit id).

Thanks

@qkr10
Copy link

qkr10 commented Sep 26, 2023

filament/src/ext_filament/third_party/spirv-tools/source/opt/merge_return_pass.h

add this code
#pragma clang diagnostic ignored "-Wdeprecated"

Worked for me.

@qkr10
Copy link

qkr10 commented Sep 26, 2023

cpp/open3d/pipelines/registration/Feature.cpp
cpp/open3d/pipelines/registration/GeneralizedICP.cpp
cpp/open3d/t/pipelines/registration/Feature.cpp
above 3 files

add this code
#pragma clang diagnostic ignored "-Wunused-variable"

I finally did it!

@dustykeyboard1
Copy link

@qkr10 did you just add it at the end of each file?

@qkr10
Copy link

qkr10 commented Nov 6, 2023

@dustykeyboard1
I put it above the error code.

filament/src/ext_filament/third_party/spirv-tools/source/opt/merge_return_pass.h

#ifndef SOURCE_OPT_MERGE_RETURN_PASS_H_
#define SOURCE_OPT_MERGE_RETURN_PASS_H_

#include <unordered_map>
#include <unordered_set>
#include <vector>

#include "source/opt/basic_block.h"
#include "source/opt/function.h"
#include "source/opt/mem_pass.h"

#pragma clang diagnostic ignored "-Wdeprecated"

@SungminLee0810
Copy link

@qkr10 Thank you. I did it as you commented and it works well. 😀

@adizhol
Copy link

adizhol commented Dec 8, 2023

why is it not enought to set -Wno-unused-variable flag?

cmake -D CMAKE_CXX_FLAGS="-Wno-unused-variable" --compile-no-warning-as-error ..

@MrBenGriffin
Copy link

why is it not enought to set -Wno-unused-variable flag?

cmake -D CMAKE_CXX_FLAGS="-Wno-unused-variable" --compile-no-warning-as-error ..

I tried this and it does not work. The following still appears.

In file included from Open3D/build/filament/src/ext_filament/third_party/spirv-tools/source/opt/merge_return_pass.cpp:15:
Open3D/build/filament/src/ext_filament/third_party/spirv-tools/source/opt/merge_return_pass.h:121:5: error: definition of implicit copy assignment operator for 'StructuredControlState' is deprecated because it has a user-declared copy constructor [-Werror,-Wdeprecated-copy]
    StructuredControlState(const StructuredControlState&) = default;
    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/__algorithm/move.h:41:17: note: in implicit copy assignment operator for 'spvtools::opt::MergeReturnPass::StructuredControlState' first required here
      *__result = _IterOps<_AlgPolicy>::__iter_move(__first);

@MrBenGriffin
Copy link

@dustykeyboard1 I put it above the error code.

filament/src/ext_filament/third_party/spirv-tools/source/opt/merge_return_pass.h

#ifndef SOURCE_OPT_MERGE_RETURN_PASS_H_
#define SOURCE_OPT_MERGE_RETURN_PASS_H_

#include <unordered_map>
#include <unordered_set>
#include <vector>

#include "source/opt/basic_block.h"
#include "source/opt/function.h"
#include "source/opt/mem_pass.h"

#pragma clang diagnostic ignored "-Wdeprecated"

This is good, but it's a monkey-patch.

@zzigee
Copy link

zzigee commented Jan 19, 2024

Thank you. I solved it.

M1 Max , Sonoma 14.2.1
Python 3.11.5
Open3D 0.18.0

@frank770504
Copy link

In the build folder
I went to filament/src/ext_filament/third_party/spirv-tools/CMakeLists.txt
And changed the line set(SPIRV_WARNINGS ${SPIRV_WARNINGS} -Werror) to set(SPIRV_WARNINGS ${SPIRV_WARNINGS} -Werror -Wno-unused-but-set-variable -Wno-deprecated-copy)

And I can build it.

However, we should pass the option from the outter CMakeLists.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build/install Build or installation issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.