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

Install openexr 3.2.4 to macOS Big Sur 11.7.10 #1761

Open
vvivanov9 opened this issue May 25, 2024 · 9 comments
Open

Install openexr 3.2.4 to macOS Big Sur 11.7.10 #1761

vvivanov9 opened this issue May 25, 2024 · 9 comments

Comments

@vvivanov9
Copy link

I tryed install openexr in Homebrew 4.3.1 on MacOS 11.7.10, but get error:

`brew install --verbose openexr
Warning: You are using macOS 11.
We (and Apple) do not provide support for this old version.
It is expected behaviour that some formulae will fail to build in this old version.
It is expected behaviour that Homebrew will be buggy and slow.
Do not create any issues about this on Homebrew's GitHub repositories.
Do not create any issues even if you think this message is unrelated.
Any opened issues will be immediately closed without response.
Do not ask for help from Homebrew or its maintainers on social media.
You may ask for help in Homebrew's discussions but are unlikely to receive a response.
Try to figure out the problem yourself and submit a fix as a pull request.
We will review it but may or may not accept it.

==> Fetching openexr
==> Downloading https://raw.githubusercontent.com/Homebrew/homebrew-core/bb06b1d6bf66b74f5da8b704c95631a5bac9c13a/Formula/o/openexr.rb
Already downloaded: /Users/vvivanov/Library/Caches/Homebrew/downloads/ac28439dfab63aad0a37f80a99ef84340d40c648299e3ddc09bc13fe89db8530--openexr.rb
==> Verifying checksum for 'ac28439dfab63aad0a37f80a99ef84340d40c648299e3ddc09bc13fe89db8530--openexr.rb'
==> Downloading https://github.com/AcademySoftwareFoundation/openexr-images/raw/f17e353fbfcde3406fe02675f4d92aeae422a560/TestImages/AllHalfValues.exr
Already downloaded: /Users/vvivanov/Library/Caches/Homebrew/downloads/ba0da2a31c9ecfc80347695d4b2135fbec9f60358d1029a5402cfffb64a38ebf--AllHalfValues.exr
==> Verifying checksum for 'ba0da2a31c9ecfc80347695d4b2135fbec9f60358d1029a5402cfffb64a38ebf--AllHalfValues.exr'
==> Downloading https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v3.2.4.tar.gz
Already downloaded: /Users/vvivanov/Library/Caches/Homebrew/downloads/5c1b6fb3948c7430a5ed5806a0c7de2d4b01cec4546cb212611e6842e61e7eca--openexr-3.2.4.tar.gz
==> Verifying checksum for '5c1b6fb3948c7430a5ed5806a0c7de2d4b01cec4546cb212611e6842e61e7eca--openexr-3.2.4.tar.gz'
/usr/bin/env tar --extract --no-same-owner --file /Users/vvivanov/Library/Caches/Homebrew/downloads/5c1b6fb3948c7430a5ed5806a0c7de2d4b01cec4546cb212611e6842e61e7eca--openexr-3.2.4.tar.gz --directory /private/tmp/homebrew-unpack20240525-57186-12ghlg
/usr/bin/env cp -pR /private/tmp/homebrew-unpack20240525-57186-12ghlg/openexr-3.2.4/. /private/tmp/openexr-20240525-57186-ol9apr/openexr-3.2.4
==> cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/openexr/3.2.4 -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=/usr/local/Homebrew/Library/Homebrew/cmake/trap_fetchcontent_provider.cmake -Wno-dev -DBUILD_TESTING=OFF -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk
-- The C compiler identification is AppleClang 13.0.0.13000029
-- The CXX compiler identification is AppleClang 13.0.0.13000029
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang - 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: /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Using libdeflate from /usr/local/lib/cmake/libdeflate
-- Using Imath from /usr/local/lib/cmake/Imath
-- Performing Test OPENEXR_IMF_HAVE_SYSCONF_NPROCESSORS_ONLN
-- Performing Test OPENEXR_IMF_HAVE_SYSCONF_NPROCESSORS_ONLN - Success
-- Performing Test OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX
-- Performing Test OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX - Success
-- Looking for include file ucontext.h
-- Looking for include file ucontext.h - not found
CMake Error at cmake/CMakeLists.txt:159 (add_library):
add_library cannot create ALIAS target "OpenEXR::Config" because another
target with the same name already exists.

CMake Error at cmake/CMakeLists.txt:170 (add_library):
add_library cannot create ALIAS target "OpenEXR::Config" because another
target with the same name already exists.

-- OpenEXR pkg-config generation enabled
-- Configure OpenEXR 3.2.4, library API version: 31.3.2.4
-- Building OpenEXR libraries
-- Building OpenEXR tools
-- Building OpenEXR examples
-- clang-format not found.
-- Configuring incomplete, errors occurred!

==> Formula
Path: /Users/vvivanov/Library/Caches/Homebrew/downloads/ac28439dfab63aad0a37f80a99ef84340d40c648299e3ddc09bc13fe89db8530--openexr.rb
==> Configuration
HOMEBREW_VERSION: 4.3.1
ORIGIN: https://github.com/Homebrew/brew
HEAD: e0bc557e7b991cb23583679e1cf1c8a92b793aeb
Last commit: 5 days ago
Core tap JSON: 25 May 02:59 UTC
Core cask tap JSON: 25 May 02:59 UTC
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 4
Homebrew Ruby: 3.3.1 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.1/bin/ruby
CPU: quad-core 64-bit haswell
Clang: 13.0.0 build 1300
Git: 2.45.1 => /usr/local/bin/git
Curl: 8.1.2 => /usr/bin/curl
macOS: 11.7.10-x86_64
CLT: 13.2.0.0.1.1638488800
Xcode: 13.2.1
==> ENV
HOMEBREW_CC: clang
HOMEBREW_CXX: clang++
MAKEFLAGS: -j4
CMAKE_PREFIX_PATH: /usr/local
CMAKE_INCLUDE_PATH: /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers
CMAKE_LIBRARY_PATH: /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries
PKG_CONFIG_PATH: /usr/local/opt/imath/lib/pkgconfig
PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/11
HOMEBREW_GIT: git
HOMEBREW_SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk
ACLOCAL_PATH: /usr/local/share/aclocal
PATH: /usr/local/Homebrew/Library/Homebrew/shims/mac/super:/usr/local/opt/cmake/bin:/usr/local/opt/pkg-config/bin:/usr/bin:/bin:/usr/sbin:/sbin

Error: openexr 3.2.4 did not build
Logs:
/Users/vvivanov/Library/Logs/Homebrew/openexr/00.options.out
/Users/vvivanov/Library/Logs/Homebrew/openexr/01.cmake
/Users/vvivanov/Library/Logs/Homebrew/openexr/01.cmake.cc
/Users/vvivanov/Library/Logs/Homebrew/openexr/build
Do not report this issue to Homebrew/brew or Homebrew/homebrew-core!

Error: You are using macOS 11.
We (and Apple) do not provide support for this old version.
It is expected behaviour that some formulae will fail to build in this old version.
It is expected behaviour that Homebrew will be buggy and slow.
Do not create any issues about this on Homebrew's GitHub repositories.
Do not create any issues even if you think this message is unrelated.
Any opened issues will be immediately closed without response.
Do not ask for help from Homebrew or its maintainers on social media.
You may ask for help in Homebrew's discussions but are unlikely to receive a response.
Try to figure out the problem yourself and submit a fix as a pull request.
We will review it but may or may not accept it.

Do not report this issue: you are running in an unsupported configuration.`

I have package libdeflate
brew info libdeflate ==> libdeflate: stable 1.20 Heavily optimized DEFLATE/zlib/gzip compression and decompression https://github.com/ebiggers/libdeflate Installed /usr/local/Cellar/libdeflate/1.20 (17 files, 361.3KB) * Built from source on 2024-05-24 at 19:33:33 From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/lib/libdeflate.rb License: MIT ==> Dependencies Build: cmake ✔ ==> Analytics install: 331 (30 days), 1,233 (90 days), 3,705 (365 days) install-on-request: 141 (30 days), 367 (90 days), 800 (365 days)

@lgritz
Copy link
Contributor

lgritz commented May 25, 2024

There is this message from OpenEXR's build in your log:

CMake Error at cmake/CMakeLists.txt:159 (add_library):
add_library cannot create ALIAS target "OpenEXR::Config" because another
target with the same name already exists.

It's hard to tell what's going wrong here, I don't believe this is a problem we've encountered before. It is likely specific to building on your old OS and toolchain, which homebrew itself says are no longer supported:

Error: You are using macOS 11.
We (and Apple) do not provide support for this old version.
It is expected behaviour that some formulae will fail to build in this old version.

These are messages from Homebrew itself. The OpenEXR project team does not maintain Homebrew itself, nor even the Homebrew recipe for building OpenEXR.

I doubt that any of us have a way to reproduce the problem given that we don't have any OS installs that old that we can run CI on.

@uiryuu
Copy link

uiryuu commented Jun 3, 2024

Recently I tried to compile OpenEXR on macOS 10.15 using Homebrew as well, and I encountered the exact same problem ("add_library cannot create ALIAS target"). Then I suspect it was due to the old version of my system. I tried compile it using my macOS 14 machine using brew reinstall openexr --build-from-source, this problem still happened. Hopefully this will help.

@AzraelWarrior
Copy link

Recently I tried to compile OpenEXR on macOS 10.15 using Homebrew as well, and I encountered the exact same problem ("add_library cannot create ALIAS target"). Then I suspect it was due to the old version of my system. I tried compile it using my macOS 14 machine using brew reinstall openexr --build-from-source, this problem still happened. Hopefully this will help.

This issue might be related to Homebrew, not OpenEXR. You can use the command brew --version to check the version of Homebrew installed on your system. If you have the latest version, you can try downgrading Homebrew to version 4.2.18 before proceeding with the compilation and installation of OpenEXR.

@whitslack
Copy link

whitslack commented Jun 7, 2024

OpenEXR is relying on the OLD behavior of CMake policy CMP0107, which is deprecated by definition. Homebrew inadvertently switches CMP0107 to the NEW behavior, which breaks OpenEXR, by calling cmake_minimum_required(VERSION 3.24) in ${HOMEBREW_LIBRARY}/Homebrew/cmake/trap_fetchcontent_provider.cmake.

You can restore the OLD behavior (and suppress the error) by adding the following line to OpenEXR's CMakeLists.txt:

cmake_policy(SET CMP0107 OLD)

However, realize that OpenEXR's CMakeLists.txt is apparently expecting CMake to behave in a way that it does not (and apparently never has). Calling add_library() multiple times with the same <name> but different ALIAS <target>s does not accumulate those targets under the aliased name but rather either silently overwrites(!) the alias (the OLD behavior) or raises an error (the NEW behavior).

I started a discussion of the problem at Homebrew.

@uiryuu
Copy link

uiryuu commented Jun 8, 2024

Tested with the latest homebrew, confirmed that the problem no longer exists. This issue could be closed.

@BurkeyLai
Copy link

BurkeyLai commented Jun 9, 2024

Tested with the latest homebrew, confirmed that the problem no longer exists. This issue could be closed.

Hi, may I ask the latest homebrew version you used? Mine is 4.3.3. Also my OS version is Big Sur 11.7.10. Still same error showed. Thanks!

@uiryuu
Copy link

uiryuu commented Jun 9, 2024

Hi, may I ask the latest homebrew version you used? Mine is 4.3.3. Also my OS version is Big Sur 11.7.10. Still same error showed. Thanks!

I'm also using 4.3.3 on macOS 14.5. Did you run something like brew upgrade to pull the latest commits which contain the fix for this?

@BurkeyLai
Copy link

I'm also using 4.3.3 on macOS 14.5. Did you run something like brew upgrade to pull the latest commits which contain the fix for this?

Sure, I use brew cleanup, brew update, brew upgrade to update. There is no any error. Once use brew install openexr to install, error show up:

Last 15 lines from /Users/bur/Library/Logs/Homebrew/openexr/01.cmake:
  target with the same name already exists.


CMake Error at cmake/CMakeLists.txt:170 (add_library):
  add_library cannot create ALIAS target "OpenEXR::Config" because another
  target with the same name already exists.

@BurkeyLai
Copy link

Sure, I use brew cleanup, brew update, brew upgrade to update. There is no any error. Once use brew install openexr to install, error show up:

Last 15 lines from /Users/bur/Library/Logs/Homebrew/openexr/01.cmake:
  target with the same name already exists.


CMake Error at cmake/CMakeLists.txt:170 (add_library):
  add_library cannot create ALIAS target "OpenEXR::Config" because another
  target with the same name already exists.

Solve this problem by checkout previous commit of Homebrew.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants