Skip to content

Build Failure Due to Invalid Namespace Iex_3.4 #2025

Closed
@Treata11

Description

@Treata11

I successfully configured the project on my mac, using Apple Clang:

$ cmake -S. -B build_macOS \
-DBUILD_TESTING=OFF \
-DOPENEXR_BUILD_BOTH_STATIC_SHARED=OFF \
-DBUILD_SHARED_LIBS=ON \
-DOPENEXR_INSTALL_TOOLS=OFF
-- The C compiler identification is AppleClang 16.0.0.16000026
-- The CXX compiler identification is AppleClang 16.0.0.16000026
-- 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
-- Building against C++ Standard: 17
-- Setting build type to 'Release' as none was specified.
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Using libdeflate from /opt/homebrew/lib/cmake/libdeflate
-- Using Imath from /opt/homebrew/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 - Failed
-- Looking for include file ucontext.h
-- Looking for include file ucontext.h - not found
-- OpenEXR pkg-config generation enabled
-- Configure OpenEXR 3.4.0-dev, library API version: 99.3.4.0
-- Building OpenEXR libraries
-- Building OpenEXR tools
-- Building OpenEXR examples
-- clang-format not found.
-- Configuring done (1.2s)
-- Generating done (0.1s)
-- Build files have been written to: ~/Developer/Git/Contribution/iOS_Port/openexr/build_macOS


~/Developer/Git/Contribution/iOS_Port/openexr onmain!
$ sudo cmake --build build_macOS --target install --config Release
[  0%] Building CXX object src/lib/Iex/CMakeFiles/Iex.dir/IexBaseExc.cpp.o
In file included from ~/Developer/Git/Contribution/iOS_Port/openexr/src/lib/Iex/IexBaseExc.cpp:12:
In file included from ~/Developer/Git/Contribution/iOS_Port/openexr/src/lib/Iex/IexBaseExc.h:10:
~/Developer/Git/Contribution/iOS_Port/openexr/src/lib/Iex/IexNamespace.h:66:11: error: expected '{'
   66 | namespace IEX_INTERNAL_NAMESPACE
      |           ^
~/Developer/Git/Contribution/iOS_Port/openexr/build_macOS/cmake/IexConfig.h:22:37: note: expanded from macro 'IEX_INTERNAL_NAMESPACE'
   22 | #define IEX_INTERNAL_NAMESPACE Iex_3.4
      |                                     ^
In file included from ~/Developer/Git/Contribution/iOS_Port/openexr/src/lib/Iex/IexBaseExc.cpp:12:
In file included from ~/Developer/Git/Contribution/iOS_Port/openexr/src/lib/Iex/IexBaseExc.h:10:
...

...
IEX_INTERNAL_NAMESPACE is defined at cmake/OpenEXRSetup.cmake
https://github.com/AcademySoftwareFoundation/openexr/blob/310e3bd3ec3c8be2e123880e1bedad6c8d3862dc/cmake/OpenEXRSetup.cmake#L36C1-L36C132

I can provide a fix for it (sanitizing the version string by replacing . with _ or by completely removing the versioning from the namespace)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions