facebookresearch / ocean

Ocean is the in-house framework for Computer Vision (CV) and Augmented Reality (AR) applications at Meta. It is platform independent and is mainly implemented in C/C++.
https://facebookresearch.github.io/ocean/
MIT License
642 stars 58 forks source link

Build and install Ocean failing due to missing dependencies (MacOS) #15

Closed pawarmanasi07 closed 4 months ago

pawarmanasi07 commented 4 months ago

Build and install Ocean output (MacOS)

./build/cmake/build_ocean_linuxunix.sh -c release -l static -b "${HOME}/build_ocean" -i "${HOME}/install_ocean" -t "${HOME}/install_ocean_thirdparty"
Building Ocean ...:

The third-party libraries will be build for the following combinations:
 * release + static
Build directory: /Users/manasipawar/install_ocean
Installation directory: /Users/manasipawar/install_ocean

BUILD_CONFIG: Release
LINKING_TYPE: static

BUILD_DIR: /Users/manasipawar/build_ocean/macos_static_Release
INSTALL_DIR: /Users/manasipawar/install_ocean/macos_static_Release

THIRD_PARTY_DIR: /Users/manasipawar/install_ocean_thirdparty/macos_static_Release

CMAKE_CONFIGURE_COMMAND = cmake \
    -S "/Users/manasipawar/Desktop/Open_Source/ocean" \
    -B "/Users/manasipawar/build_ocean/macos_static_Release" \
    -DCMAKE_INSTALL_PREFIX="/Users/manasipawar/install_ocean/macos_static_Release" \
    -DCMAKE_BUILD_TYPE="Release" \
    -DBUILD_SHARED_LIBS="OFF"  \
    -DCMAKE_PREFIX_PATH="/Users/manasipawar/install_ocean_thirdparty/macos_static_Release"
-- The C compiler identification is AppleClang 15.0.0.15000309
-- The CXX compiler identification is AppleClang 15.0.0.15000309
-- 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
-- The OBJC compiler identification is AppleClang 15.0.0.15000309
-- The OBJCXX compiler identification is AppleClang 15.0.0.15000309
-- Detecting OBJC compiler ABI info
-- Detecting OBJC compiler ABI info - done
-- Check for working OBJC compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang - skipped
-- Detecting OBJCXX compiler ABI info
-- Detecting OBJCXX compiler ABI info - done
-- Check for working OBJCXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ - skipped
--  
-- BUILD_SHARED_LIBS = OFF
-- CMAKE_BUILD_TYPE = Release
-- CMAKE_CXX_STANDARD = 20
-- CMAKE_INSTALL_PREFIX = /Users/manasipawar/install_ocean/macos_static_Release
-- OCEAN_COMPILER_FLAGS = ""
-- OCEAN_ENABLE_MESSENGER = ON
-- OCEAN_HOST_PROCESSOR_TYPE = arm64
-- OCEAN_HOST_SYSTEM_NAME = macos
-- OCEAN_IMPL_DIR = /Users/manasipawar/Desktop/Open_Source/ocean/impl
-- OCEAN_PREPROCESSOR_FLAGS = "-DOCEAN_ACTIVATE_MESSENGER=1;-DOCEAN_RUNTIME_STATIC"
-- OCEAN_TARGET_PROCESSOR_TYPE = arm64
-- OCEAN_TARGET_SYSTEM_NAME = macos
--  
-- Found Freetype: /Users/manasipawar/install_ocean_thirdparty/macos_static_Release/lib/libfreetype.a (found version "2.13.2")
-- Found the following HarfBuzz libraries:
--  HarfBuzz (required): /Users/manasipawar/install_ocean_thirdparty/macos_static_Release/lib/libharfbuzz.a
-- Found HarfBuzz: /Users/manasipawar/install_ocean_thirdparty/macos_static_Release/include/harfbuzz (found version "8.4.0")
-- Found ZLIB: /Users/manasipawar/install_ocean_thirdparty/macos_static_Release/lib/libz.a (found version "1.3.1")
-- Found PNG: /Users/manasipawar/install_ocean_thirdparty/macos_static_Release/lib/libpng.a (found version "1.6.43")
-- Found JPEG: /Users/manasipawar/install_ocean_thirdparty/macos_static_Release/lib/libjpeg.a (found version "90")
-- Found TIFF: /Users/manasipawar/install_ocean_thirdparty/macos_static_Release/lib/cmake/tiff (found version "4.6.0")
-- Found wxWidgets: -L/Users/manasipawar/install_ocean_thirdparty/macos_static_Release/lib;-pthread;/Users/manasipawar/install_ocean_thirdparty/macos_static_Release/lib/libwx_osx_cocoau_xrc-3.2.a;/Users/manasipawar/install_ocean_thirdparty/macos_static_Release/lib/libwx_osx_cocoau_qa-3.2.a;/Users/manasipawar/install_ocean_thirdparty/macos_static_Release/lib/libwx_baseu_net-3.2.a;/Users/manasipawar/install_ocean_thirdparty/macos_static_Release/lib/libwx_osx_cocoau_html-3.2.a;/Users/manasipawar/install_ocean_thirdparty/macos_static_Release/lib/libwx_osx_cocoau_core-3.2.a;/Users/manasipawar/install_ocean_thirdparty/macos_static_Release/lib/libwx_baseu_xml-3.2.a;/Users/manasipawar/install_ocean_thirdparty/macos_static_Release/lib/libwx_baseu-3.2.a;-lwx_osx_cocoau_core-3.2;-lwxjpeg-3.2;-lwxpng-3.2;-lwxtiff-3.2;-framework AudioToolbox;-framework WebKit;-lwx_baseu-3.2;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/lib/libexpat.tbd;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/lib/libz.tbd;-lwxregexu-3.2;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/lib/libiconv.tbd;-framework CoreFoundation;-framework Security;-framework Carbon;-framework Cocoa;-framework IOKit;-framework QuartzCore (found version "3.2.4")
CMake Warning (dev) at /opt/homebrew/Cellar/cmake/3.30.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:441 (message):
  The package name passed to `find_package_handle_standard_args` (LIBUSB_1)
  does not match the name of the calling package (libusb-1.0).  This can lead
  to problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  build/cmake/Findlibusb-1.0.cmake:65 (find_package_handle_standard_args)
  impl/ocean/system/usb/video/CMakeLists.txt:12 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.
-- Found LIBUSB_1: /Users/manasipawar/install_ocean_thirdparty/macos_static_Release/lib/libusb.a
CMake Warning (dev) at /opt/homebrew/Cellar/cmake/3.30.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:441 (message):
  The package name passed to `find_package_handle_standard_args` (LIBUSB_1)
  does not match the name of the calling package (libusb-1.0).  This can lead
  to problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  build/cmake/Findlibusb-1.0.cmake:65 (find_package_handle_standard_args)
  impl/ocean/system/usb/CMakeLists.txt:15 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.
-- Excluding 'application_ocean_demo_misc_imageannotator_osx' because OpenCV hasn't been found.
-- Found GTest: /Users/manasipawar/install_ocean_thirdparty/macos_static_Release/lib/cmake/GTest/GTestConfig.cmake (found version "1.14.0")
-- Excluding 'ocean_test_testcv_testopencv' because OpenCV hasn't been found.
-- Excluding 'application_ocean_test_cv_testcv_testopencv' because its dependency 'ocean_test_testcv_testopencv' is missing.
-- Configuring done (298.9s)
CMake Error at /Users/manasipawar/install_ocean_thirdparty/macos_static_Release/lib/cmake/tiff/TiffTargets.cmake:61 (set_target_properties):
  The link interface of target "TIFF::tiff" contains:
    liblzma::liblzma
  but the target was not found.  Possible reasons include:
    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.
Call Stack (most recent call first):

  /Users/manasipawar/install_ocean_thirdparty/macos_static_Release/lib/cmake/tiff/TiffConfig.cmake:24 (include)
  /opt/homebrew/Cellar/cmake/3.30.0/share/cmake/Modules/FindTIFF.cmake:104 (find_package)
  impl/ocean/media/openimagelibraries/CMakeLists.txt:17 (find_package)
-- Generating done (1.4s)
CMake Generate step failed.  Build files cannot be regenerated correctly.

Instructions to reproduce the problem:

Run the following commands:

cd ${OCEAN_DEVELOPMENT_PATH}

# Build the third-party libraries
./build/cmake/build_thirdparty_linuxunix.sh -c release -l static -b "${HOME}/build_ocean_thirdparty" -i "${HOME}/install_ocean_thirdparty"

# Build and install Ocean
./build/cmake/build_ocean_linuxunix.sh -c release -l static -b "${HOME}/build_ocean" -i "${HOME}/install_ocean" -t "${HOME}/install_ocean_thirdparty"

Reference (Steps 1,2,3):

https://github.com/facebookresearch/ocean/blob/main/building_for_macos.md

Configs:

Mac Sonoma, Apple M2

enpe commented 4 months ago

This might be related to or a duplicate of issue https://github.com/facebookresearch/ocean/issues/9

enpe commented 4 months ago

What version of XCode does this happen with? 15.4?

enpe commented 4 months ago

Or is this coming from CMake 3.30? Both #9 and this issue have this warning:

/Applications/CMake.app/Contents/share/cmake-3.30/Modules/FindTIFF.cmake:104 (find_package)

and

/opt/homebrew/Cellar/cmake/3.30.0/share/cmake/Modules/FindTIFF.cmake:104 (find_package)
pawarmanasi07 commented 4 months ago

Yes, Xcode 15.4 and cmake version 3.30.0

enpe commented 4 months ago

We landed some changes. @pawarmanasi07, can you retry building the above? And if everything works, please close this issue.

pawarmanasi07 commented 4 months ago

Okay thanks!

enpe commented 4 months ago

Closing for now. Please re-open if the problem persists.