Skip to content

[BUILD] libbsdl missing include path for Imath #2080

@jfpanisset

Description

@jfpanisset

Describe the bug

libbsdl in OSL 1.15.1.0 fails to build in an environment where Imath is not installed in a standard location, for instance when building as a Conan package. In src/libbsdl/bsdl.cmake there is no mention of ${IMATH_INCLUDES}

The following patch allows it to build in my Conan environment:

diff --git src/libbsdl/bsdl.cmake src/libbsdl/bsdl.cmake
index d99dd79ac..bfda2778a 100644
--- src/libbsdl/bsdl.cmake
+++ src/libbsdl/bsdl.cmake
@@ -8,7 +8,7 @@
     cmake_parse_arguments(PARSE_ARGV 1 bsdl "" "SUBDIR" "SPECTRAL_COLOR_SPACES")
     # Bootstrap version of BSDL (without luts)
     add_library(BSDL_BOOTSTRAP INTERFACE)
-    target_include_directories(BSDL_BOOTSTRAP INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/${bsdl_SUBDIR}/include)
+    target_include_directories(BSDL_BOOTSTRAP INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/${bsdl_SUBDIR}/include ${IMATH_INCLUDES})
     target_link_libraries(BSDL_BOOTSTRAP INTERFACE ${ARNOLD_IMATH_TARGETS})

     # LUT generation tool

But this may or may not be the best way to do this in the context of OSL.

Also note on line 12 the reference to ${ARNOLD_IMATH_TARGETS} which doesn't appear anywhere else in the code base and is possibly specific to an internal version?

OSL version and dependencies

  • OSL branch/version: 1.15.1.0
  • OS: Rocky Linux 8.10
  • C++ compiler: 14
  • LLVM version: 19
  • OIIO version: 3.1.10.0

To Reproduce

Try to build OSL in an environment where Imath includes cannot be readily found by the compiler.

Evidence

  • Error messages (paste them here exactly)
  • Example shader code (if applicable)

IF YOU ALREADY HAVE A CODE FIX: There is no need to file a separate issue,
please just go straight to making a pull request.

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