Open3D icon indicating copy to clipboard operation
Open3D copied to clipboard

0.15.1 build fails with 'fatal error: unzip.h: No such file' on Archlinux

Open WysokiStudent opened this issue 2 years ago • 8 comments

Checklist

Describe the issue

I was trying to build 0.15.1 on Archlinux however the build failed due to not finding unzip.h.

/home/zannzetsu/open3d/open3d/src/open3d/cpp/open3d/utility/ExtractZIP.cpp:34:10: fatal error: unzip.h: Nie ma takiego pliku ani katalogu
   34 | #include <unzip.h>

I know that Archlinux support is on a best effort basis, please consider looking into this in a spare moment.

Steps to reproduce the bug

git clone https://github.com/intel-isl/Open3D.git#tag=v0.15.1
cd open3d
git submodule update --init --recursive
mkdir -p build
cd build
find ../ -name "CMakeLists.txt" -exec sed -i 's/-Werror//g' {} \;
cmake .. \
       -DBUILD_SHARED_LIBS=ON \
       -DCMAKE_BUILD_TYPE=Release \
       -DUSE_SYSTEM_GLEW=ON \
       -DUSE_SYSTEM_GLFW=ON \
       -DUSE_SYSTEM_JPEG=ON \
       -DUSE_SYSTEM_PNG=ON \
       -DUSE_SYSTEM_PYBIND11=ON
make -j 1

Error message

[ build git:(makepkg) |2] LANG=en_US make -j 1 [ 1%] Built target ext_assimp [ 2%] Built target ext_eigen [ 3%] Built target ext_nanoflann [ 4%] Built target ext_jsoncpp [ 4%] Built target open3d_downloads [ 4%] Built target 3rdparty_liblzf [ 5%] Built target ext_boringssl [ 6%] Built target ext_curl [ 6%] Built target 3rdparty_rply [ 7%] Built target 3rdparty_tinyfiledialogs [ 8%] Built target ext_tinygltf [ 9%] Built target ext_tinyobjloader [ 10%] Built target ext_qhull [ 13%] Built target 3rdparty_qhull_r [ 15%] Built target 3rdparty_qhullcpp [ 16%] Built target ext_fmt [ 17%] Built target ext_poisson [ 18%] Built target ext_imgui [ 18%] Built target 3rdparty_imgui [ 19%] Built target ext_filament [ 20%] Built target ext_zeromq [ 21%] Built target ext_cppzmq [ 22%] Built target ext_msgpack-c [ 23%] Built target ext_tbb [ 24%] Built target ext_parallelstl [ 25%] Built target ext_mkl_include [ 26%] Built target ext_mkl [ 27%] Built target ext_ippicv [ 28%] Built target ext_embree [ 29%] Built target ext_webrtc [ 30%] Built target ext_civetweb [ 30%] Built target copy_html_dir [ 30%] Built target ext_webrtc_all [ 31%] Built target webrtc_server [ 32%] Built target camera [ 39%] Built target core [ 39%] Built target data [ 43%] Built target geometry [ 48%] Built target io [ 49%] Built target ml_contrib [ 51%] Built target pipelines [ 52%] Built target tgeometry [ 53%] Built target tgeometry_kernel [ 55%] Built target tio [ 55%] Built target tpipelines [ 56%] Built target tpipelines_kernel [ 56%] Building CXX object cpp/open3d/utility/CMakeFiles/utility.dir/ExtractZIP.cpp.o /home/zannzetsu/open3d/open3d/src/open3d/cpp/open3d/utility/ExtractZIP.cpp:34:10: fatal error: unzip.h: No such file or directory 34 | #include <unzip.h> | ^~~~~~~~~ compilation terminated. make[2]: *** [cpp/open3d/utility/CMakeFiles/utility.dir/build.make:167: cpp/open3d/utility/CMakeFiles/utility.dir/ExtractZIP.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:2652: cpp/open3d/utility/CMakeFiles/utility.dir/all] Error 2 make: *** [Makefile:156: all] Error 2

Expected behavior

open3d should build without errors.

Open3D, Python and System information

- Operating system: Archlinux
- Python version: 3.10.2 (main, Jan 15 2022, 19:56:27) [GCC 11.1.0]
- Open3D version: Not applicable
- System architecture: x86
- Is this a remote workstation?: no
- How did you install Open3D?: build from source
- Compiler version (if built from source): gcc (GCC) 11.2.0

Additional information

Here is a list of 'unzip.h' on my box

[ build git:(makepkg) |130] find / -name unzip.h 2>/dev/null
/home/zannzetsu/open3d/open3d/src/open3d/build/webrtc/src/ext_webrtc/include/third_party/zlib/contrib/minizip/unzip.h
/home/zannzetsu/open3d/open3d/src/open3d/build/webrtc/src/ext_webrtc/include/build/linux/debian_sid_amd64-sysroot/usr/include/minizip/unzip.h
/home/zannzetsu/open3d/open3d/src/open3d/build/webrtc/src/ext_webrtc/include/build/linux/debian_sid_i386-sysroot/usr/include/minizip/unzip.h
/home/zannzetsu/open3d/open3d/src/open3d/build/assimp/src/ext_assimp/contrib/zlib/contrib/minizip/unzip.h
/home/zannzetsu/open3d/open3d/src/open3d/build/assimp/src/ext_assimp/contrib/unzip/unzip.h
/usr/include/minizip/unzip.h
/usr/include/bullet/ThirdPartyLibs/minizip/unzip.h

Here is a compile_commands.json for ExtractZIP with paths that were searched. compile_commands.txt

Cmake output

[ build git:(makepkg) |0] cmake .. \
       -DBUILD_SHARED_LIBS=ON \
       -DCMAKE_BUILD_TYPE=Release \
       -DUSE_SYSTEM_GLEW=ON \
       -DUSE_SYSTEM_GLFW=ON \
       -DUSE_SYSTEM_JPEG=ON \
       -DUSE_SYSTEM_PNG=ON \
       -DUSE_SYSTEM_PYBIND11=ON
-- CMAKE_BUILD_TYPE is set to Release.
-- Downloading 3rdparty dependencies to /home/zannzetsu/open3d/open3d/src/open3d/3rdparty_downloads
-- Open3D 0.15.1+ed30e3b61
-- Using security hardening compiler flags: $<$<COMPILE_LANGUAGE:CUDA>:-Xcompiler=-fstack-protector-strong,-Wformat,-Wformat-security>;$<$<COMPILE_LANGUAGE:CXX>:-fstack-protector-strong;-Wformat;-Wformat-security>
-- Using security hardening linker flags: $<$<COMPILE_LANGUAGE:CUDA>:-Xcompiler=-Wl,-z,noexecstack,-Wl,-z,relro,-z,now,$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:-pie>,$<$<CONFIG:Release>:LINKER:--strip-debug>>;$<$<COMPILE_LANGUAGE:CXX>:-Wl,-z,noexecstack;-Wl,-z,relro,-z,now;$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:-pie>;$<$<CONFIG:Release>:LINKER:--strip-debug>>
-- Using security hardening compiler definitions: _FORTIFY_SOURCE=2
-- Fetching ISPC compiler
-- Building with detected instruction sets
-- Using ISPC instruction sets: avx2-i32x8
-- Using installed third-party library 3rdparty_threads 
-- Using installed third-party library 3rdparty_openmp 
-- Building with OpenMP
-- Using installed third-party library 3rdparty_x11 
-- Using installed third-party library 3rdparty_glew 2.2.0
-- Using installed third-party library 3rdparty_glfw 3.3.6
-- Using installed third-party library 3rdparty_jpeg 80
-- Using installed third-party library 3rdparty_png 
-- Found pybind11: /usr/include (found version "2.9.1")
-- Using prebuilt third-party library Filament
-- GLIBC version 2.35 found: Using Open3D Filament binary.
-- Filament is located at /home/zannzetsu/open3d/open3d/src/open3d/build/filament/src/ext_filament
-- CLANG_LIBDIR: /usr/lib
-- CPP_LIBRARY: /usr/lib/libc++.so
-- CPPABI_LIBRARY: /usr/lib/libc++abi.so
-- Using installed third-party library 3rdparty_opengl 
-- Using MKL to support BLAS and LAPACK functionalities.
-- IPP-ICV 2020.0.0 Gold available. Building interface wrappers IPP-IW.
-- Copying /home/zannzetsu/open3d/open3d/src/open3d/cpp/open3d/visualization/webrtc_server/html to /home/zannzetsu/open3d/open3d/src/open3d/build/bin/resources.
-- PYPI_PACKAGE_NAME: open3d
-- ================================================================================
-- Open3D 0.15.1 Configuration Summary
-- ================================================================================
-- Enabled Features:
--   OpenMP .................................. ON
--   Headless Rendering ...................... OFF
--   Azure Kinect Support .................... OFF
--   Intel RealSense Support ................. OFF
--   CUDA Support ............................ OFF
--   ISPC Support ............................ ON
--   Build GUI ............................... ON
--   Build WebRTC visualizer ................. ON
--   Build Shared Library .................... ON
--   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= ............ 1
-- ================================================================================
-- Third-Party Dependencies:
--   Assimp .................................. yes (build from source)
--   BLAS .................................... yes
--   Eigen3 .................................. yes (build from source)
--   filament ................................ yes (build from source)
--   fmt ..................................... yes (build from source)
--   GLEW .................................... yes (v2.2.0)
--   GLFW .................................... yes (v3.3.6)
--   googletest .............................. no
--   imgui ................................... yes (build from source)
--   ippicv .................................. yes (build from source)
--   JPEG .................................... yes (v80)
--   jsoncpp ................................. yes (build from source)
--   liblzf .................................. yes (build from source)
--   msgpack ................................. yes (build from source)
--   nanoflann ............................... yes (build from source)
--   OpenGL .................................. yes
--   PNG ..................................... yes (v1.6.37)
--   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)
--   WebRTC .................................. yes (build from source)
--   ZeroMQ .................................. yes (build from source)
-- ================================================================================
-- Configuring done
-- Generating done
-- Build files have been written to: /home/zannzetsu/open3d/open3d/src/open3d/build

WysokiStudent avatar Mar 13 '22 08:03 WysokiStudent

Try setting USE_SYSTEM_PNG=OFF. We use a custom patched zlib, which is then used by libpng. If you use the system libpng, the custom patched zlib will not be used.

In fact, try to build with the default option first, without using any system libs.

cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release ..

We cannot guarantee the USE_SYSTEM_XXXX=ON to work on every system, since each system may have different system dependencies installed. If you have to use USE_SYSTEM_XXXX=ON, you may enable them one by one and test along the way to make sure that they are compatible.

The unzip.h should be located in build/zlib/include/unzip.h. The patch file is 3rdparty/zlib/0001-patch-zlib-to-enable-unzip.patch.

yxlao avatar Mar 15 '22 06:03 yxlao

@yxlao What is the advantage of your zlib over the official zlib?

jiapei-nexera avatar Jun 10 '22 18:06 jiapei-nexera

similar for clean build on win10 now... ExtractZIP.cpp(34,10): fatal error C1083: Cannot open include file: 'unzip.h': No such file or directory

bartholmberg avatar Aug 28 '22 22:08 bartholmberg

Has this problem been resolved?

HwanWoongLee avatar Sep 07 '22 00:09 HwanWoongLee

Cannot build on Windows 10 due to this fatal error. Can you please fix it?

xiaolong7 avatar Sep 26 '22 20:09 xiaolong7

I tried to avoid building zlib by enable USE_SYSTEM_PNG, because building zlib brings multiple defined symbol error.

Without building zlib, then has this cannot find "unzip.h" error.

1939938853 avatar Oct 21 '22 19:10 1939938853

I installed minizip using vspkg and follow all the CMAKE configs that official Open3D repository and @yxlao suggest, but doesn't work. Anyone fix it? Thank you :(

I'm using Windows 11 and VS 2022

dlhr06 avatar Feb 20 '24 14:02 dlhr06

@dlhr06 It's at /usr/include/minizip/unzip.h .

jiapei100 avatar May 08 '24 15:05 jiapei100