Skip to content

Commit

Permalink
build(deps): Raise Imath minimum to 3.1 (#1853)
Browse files Browse the repository at this point in the history
Cull a whole lot of things that were necessarily only for
older Imath/OpenEXR.

Signed-off-by: Larry Gritz <[email protected]>
  • Loading branch information
lgritz committed Aug 24, 2024
1 parent 9f4aa5e commit 2c7fbf3
Show file tree
Hide file tree
Showing 27 changed files with 85 additions and 8,522 deletions.
40 changes: 25 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,20 @@ jobs:
fail-fast: false
matrix:
include:
- desc: gcc9/C++17 llvm11 py3.7 exr2.5 oiio2.3 sse4 batch-b8avx2
- desc: gcc9/C++17 llvm11 py3.7 oiio2.3 sse4 batch-b8avx2
nametag: linux-vfx2021
runner: ubuntu-latest
container: aswftesting/ci-osl:2021-clang11
vfxyear: 2021
cxx_std: 17
openexr_ver: v3.1.3
openimageio_ver: v2.4.13.0
python_ver: 3.7
pybind11_ver: v2.7.0
simd: sse4.2
batched: b8_AVX2_noFMA
- desc: gcc9/C++17 llvm13 py3.9 exr3.1 oiio-rel avx2
setenvs: export ENABLE_OPENVDB=0
- desc: gcc9/C++17 llvm13 py3.9 oiio-rel avx2
nametag: linux-vfx2022
runner: ubuntu-latest
container: aswftesting/ci-osl:2022-clang13
Expand All @@ -60,7 +62,7 @@ jobs:
pybind11_ver: v2.9.0
simd: avx2,f16c
batched: b8_AVX2
- desc: clang12/C++17 llvm12 oiio-master exr3.1 py3.9 avx2 batch-avx512
- desc: clang12/C++17 llvm12 oiio-master py3.9 avx2 batch-avx512
nametag: linux-clang12-llvm12-batch
runner: ubuntu-latest
container: aswftesting/ci-osl:2022-clang12
Expand All @@ -72,7 +74,7 @@ jobs:
simd: avx2,f16c
batched: b8_AVX2,b8_AVX512,b16_AVX512
setenvs: USE_OPENVDB=0
- desc: icc/C++17 llvm14 py3.9 exr3.1 oiio-master avx2
- desc: icc/C++17 llvm14 py3.9 oiio-master avx2
nametag: linux-icc
runner: ubuntu-latest
container: aswftesting/ci-osl:2022-clang14
Expand All @@ -96,7 +98,7 @@ jobs:
setenvs: export OSL_CMAKE_FLAGS="-DSTOP_ON_WARNING=OFF -DEXTRA_CPP_ARGS=-fp-model=consistent"
OPENIMAGEIO_CMAKE_FLAGS=-DBUILD_FMT_VERSION=7.1.3
USE_OPENVDB=0
- desc: icx/C++17 llvm14 py3.9 exr3.1 oiio2.3 avx2
- desc: icx/C++17 llvm14 py3.9 oiio2.3 avx2
nametag: linux-icx
runner: ubuntu-latest
container: aswftesting/ci-osl:2022-clang14
Expand All @@ -112,7 +114,7 @@ jobs:
batched: b8_AVX2_noFMA
setenvs: export OSL_CMAKE_FLAGS="-DSTOP_ON_WARNING=OFF" USE_OPENVDB=0
OPENCOLORIO_VERSION=v2.3.2 OPENCOLORIO_CXX=g++
- desc: gcc11/C++17 llvm15 py3.10 exr3.1 oiio-rel avx2
- desc: gcc11/C++17 llvm15 py3.10 oiio-rel avx2
nametag: linux-vfx2023
runner: ubuntu-latest
container: aswftesting/ci-osl:2023-clang15
Expand All @@ -123,7 +125,7 @@ jobs:
pybind11_ver: v2.9.0
simd: avx2,f16c
batched: b8_AVX2
- desc: GPU Cuda11 gcc11/C++17 llvm15 py3.10 exr3.1 OIIO-master avx2
- desc: GPU Cuda11 gcc11/C++17 llvm15 py3.10 OIIO-master avx2
nametag: linux-optix7-2023
runner: ubuntu-latest
container: aswftesting/ci-osl:2023-clang15
Expand All @@ -136,19 +138,20 @@ jobs:
skip_tests: 1
setenvs: export OSL_CMAKE_FLAGS="-DOSL_USE_OPTIX=1" OPTIX_VERSION=7.0
OPENIMAGEIO_CMAKE_FLAGS=-DBUILD_FMT_VERSION=9.1.0
- desc: oldest everything gcc9/C++17 llvm9 py3.7 oiio2.3 no-simd exr2.4
- desc: oldest everything gcc9/C++17 llvm9 py3.7 oiio2.3 no-simd
nametag: linux-oldest
runner: ubuntu-latest
container: aswftesting/ci-osl:2021-clang11
vfxyear: 2021
cxx_std: 17
openexr_ver: v2.4.3
openexr_ver: v3.1.0
openimageio_ver: v2.4.13.0
python_ver: 3.7
pybind11_ver: v2.7.0
simd: 0
setenvs: export PUGIXML_VERSION=v1.8
CMAKE_VERSION=3.15.5
ENABLE_OPENVDB=0

# Address and leak sanitizers
- desc: sanitizers
Expand Down Expand Up @@ -262,6 +265,13 @@ jobs:
sudo rm -rf /usr/local/lib*/cmake/OpenImageIO
sudo rm -rf /usr/local/lib*/libOpenImageIO*
sudo rm -rf /usr/local/lib*/python3.9/site-packages/OpenImageIO*
- name: Remove existing OpenEXR
if: matrix.openexr_ver != ''
run: |
sudo rm -rf /usr/local/include/OpenEXR
sudo rm -rf /usr/local/lib*/cmake/OpenEXR
sudo rm -rf /usr/local/lib*/libOpenOpenEXR*
sudo rm -rf /usr/local/lib*/python3.9/site-packages/OpenOpenEXR*
- name: Dependencies
run: |
${{matrix.depcmds}}
Expand Down Expand Up @@ -314,7 +324,7 @@ jobs:
runner: ubuntu-20.04
cxx_compiler: g++-9
cxx_std: 17
openexr_ver: v2.4.3
openexr_ver: v3.1.11
openimageio_ver: v2.4.13.0
pybind11_ver: v2.6.2
python_ver: 2.7
Expand All @@ -323,13 +333,13 @@ jobs:
LLVM_VERSION=9.0.0
PUGIXML_VERSION=v1.9
CTEST_TEST_TIMEOUT=240
- desc: gcc10/C++17 llvm10 oiio-release exr2.5 avx2
- desc: gcc10/C++17 llvm10 oiio-release avx2
nametag: linux-2021ish-gcc10-llvm10
runner: ubuntu-20.04
cxx_compiler: g++-10
cxx_std: 17
fmt_ver: 7.0.1
openexr_ver: v2.5.6
openexr_ver: v3.1.11
openimageio_ver: release
pybind11_ver: v2.8.1
# python_ver: 2.7 FIXME
Expand Down Expand Up @@ -369,14 +379,14 @@ jobs:
LLVM_DISTRO_NAME=ubuntu-22.04
OPENCOLORIO_VERSION=main
PUGIXML_VERSION=master
- desc: clang14/C++17 llvm14 exr3.1 py3.8 avx2 batch-b16avx512
- desc: clang14/C++17 llvm14 py3.8 avx2 batch-b16avx512
nametag: linux-latest-releases-clang
runner: ubuntu-20.04
cxx_compiler: clang++
cc_compiler: clang
cxx_std: 17
fmt_ver: 8.1.1
openexr_ver: v3.1.7
openexr_ver: v3.1.11
openimageio_ver: master
pybind11_ver: v2.9.2
python_ver: 3.8
Expand All @@ -394,9 +404,9 @@ jobs:
- desc: "clang-format"
nametag: clang-format
runner: ubuntu-latest
container: aswftesting/ci-osl:2022-clang14
cxx_std: 17
extra_artifacts: "src/*.*"
openexr_ver: v3.1.11
openimageio_ver: release
python_ver: "3.10"
simd: avx2,f16c
Expand Down
5 changes: 1 addition & 4 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,7 @@ NEW or CHANGED dependencies since the last major release are **bold**.
* [Cuda](https://developer.nvidia.com/cuda-downloads) 9.0 or higher. It is
recommended that you use 11.0 or higher.

* [Ilmbase or Imath](https://github.com/AcademySoftwareFoundation/Imath) 2.4
or newer (recommended: 3.1 or higher; tested through 3.2)
NOTE: It is likely that 1.13 is the last release that will support
Imath/OpenEXR 2.x.
* [Imath](https://github.com/AcademySoftwareFoundation/Imath) 3.1 or newer.
* [Flex](https://github.com/westes/flex) 2.5.35 or newer and
[GNU Bison](https://www.gnu.org/software/bison/) 2.7 or newer.
Note that on some MacOS/xcode releases, the system-installed Bison is too
Expand Down
11 changes: 3 additions & 8 deletions src/build-scripts/gh-installdeps.bash
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ else
time sudo apt-get -q install -y \
git cmake ninja-build ccache g++ \
libboost-dev libboost-thread-dev libboost-filesystem-dev \
libilmbase-dev libopenexr-dev \
libtiff-dev libgif-dev libpng-dev \
flex bison libbison-dev \
libpugixml-dev \
Expand All @@ -102,20 +101,16 @@ else
pip3 install numpy
fi

if [[ "$CXX" == "g++-6" ]] ; then
time sudo apt-get install -y g++-6
elif [[ "$CXX" == "g++-7" ]] ; then
time sudo apt-get install -y g++-7
elif [[ "$CXX" == "g++-8" ]] ; then
time sudo apt-get install -y g++-8
elif [[ "$CXX" == "g++-9" ]] ; then
if [[ "$CXX" == "g++-9" ]] ; then
time sudo apt-get install -y g++-9
elif [[ "$CXX" == "g++-10" ]] ; then
time sudo apt-get install -y g++-10
elif [[ "$CXX" == "g++-11" ]] ; then
time sudo apt-get install -y g++-11
elif [[ "$CXX" == "g++-12" ]] ; then
time sudo apt-get install -y g++-12
elif [[ "$CXX" == "g++-13" ]] ; then
time sudo apt-get install -y g++-13
fi

if [[ "$CXX" == "icpc" || "$CC" == "icc" || "$USE_ICC" != "" || "$CXX" == "icpx" || "$CC" == "icx" || "$USE_ICX" != "" ]] ; then
Expand Down
3 changes: 1 addition & 2 deletions src/build-scripts/gh-win-installdeps.bash
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@ export PATH="$DEP_DIR/lib:$DEP_DIR/bin:$PATH:$VCPKG_INSTALLATION_ROOT/installed/
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$VCPKG_INSTALLATION_ROOT/installed/x64-windows/lib:$DEP_DIR/lib:$DEP_DIR/bin"


# source src/build-scripts/build_openexr.bash
# export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH;$ILMBASE_ROOT;$OPENEXR_ROOT"
# source src/build-scripts/build_imath.bash
# source src/build-scripts/build_opencolorio.bash


Expand Down
11 changes: 1 addition & 10 deletions src/cmake/Config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,7 @@
include(CMakeFindDependencyMacro)

# add here all the find_dependency() whenever switching to config based dependencies
if (@OpenEXR_VERSION@ VERSION_GREATER_EQUAL 3.0)
find_dependency(Imath @Imath_VERSION@)
elseif (@OpenEXR_VERSION@ VERSION_GREATER_EQUAL 2.4 AND @FOUND_OPENEXR_WITH_CONFIG@)
find_dependency(IlmBase @OpenEXR_VERSION@)
find_dependency(OpenEXR @OpenEXR_VERSION@)
find_dependency(ZLIB @ZLIB_VERSION@) # Because OpenEXR doesn't do it
find_dependency(Threads) # Because OpenEXR doesn't do it
endif ()


find_dependency(Imath @Imath_VERSION@)
find_dependency(OpenImageIO @OpenImageIO_VERSION@ REQUIRED)

# Compute the installation prefix relative to this file
Expand Down
4 changes: 0 additions & 4 deletions src/cmake/compiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -463,10 +463,6 @@ if (PROJECT_IS_TOP_LEVEL)
set (CLANG_FORMAT_INCLUDES "src/*.cpp" "src/*.h" "src/*.cu"
CACHE STRING "Glob patterns to include for clang-format")
set (CLANG_FORMAT_EXCLUDES
# Files "imported and modified" that we don't want to reformat, so
# they continue to match their upstream versions.
"src/include/OSL/Imathx/*"
"src/include/OSL/matrix22.h"
# Header files in testsuite are almost certainly osl headers, not C++
"testsuite/*.h"
# Header files in shaders are OSL, not C++
Expand Down
1 change: 0 additions & 1 deletion src/cmake/cuda_macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ function ( NVCC_COMPILE cuda_src extra_headers ptx_generated extra_nvcc_args )
"-I${PROJECT_SOURCE_DIR}/src/cuda_common"
${ALL_OpenImageIO_INCLUDES}
${ALL_IMATH_INCLUDES}
${ALL_OPENEXR_INCLUDES}
"-DFMT_DEPRECATED=\"\""
${LLVM_COMPILE_FLAGS}
-DOSL_USE_FAST_MATH=1
Expand Down
24 changes: 5 additions & 19 deletions src/cmake/externalpackages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,28 +36,14 @@ option (BUILD_MISSING_DEPS "Try to download and build any missing dependencies"
checked_find_package (ZLIB REQUIRED) # Needed by several packages

# IlmBase & OpenEXR
checked_find_package (OpenEXR REQUIRED
VERSION_MIN 2.4
RECOMMEND_MIN 2.5
RECOMMEND_MIN_REASON
"Even extremely critical patches are no longer supplied to < 2.5"
PRINT IMATH_INCLUDES
checked_find_package (Imath REQUIRED
VERSION_MIN 3.1
PRINT IMATH_INCLUDES Imath_VERSION
)
# Force Imath includes to be before everything else to ensure that we have
# the right Imath/OpenEXR version, not some older version in the system
# library. This shouldn't be necessary, except for the common case of people
# building against Imath/OpenEXR 3.x when there is still a system-level
# install version of 2.x.
# the right Imath version, not some older version in the system library.
include_directories(BEFORE ${IMATH_INCLUDES})
if (MSVC AND NOT LINKSTATIC)
add_compile_definitions (OPENEXR_DLL) # Is this needed for new versions?
endif ()

if (OPENEXR_VERSION VERSION_GREATER_EQUAL 2.5.99)
set (OSL_USING_IMATH 3)
else ()
set (OSL_USING_IMATH 2)
endif ()
set (OSL_USING_IMATH 3)


# OpenImageIO
Expand Down
36 changes: 36 additions & 0 deletions src/cmake/modules/FindImath.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage

# Module to find Imath.
#
# For Imath 3.x, this will establish the following imported
# targets:
#
# Imath::Imath
# Imath::Half
#
# and sets the following CMake variables:
#
# IMATH_FOUND true, if found
# IMATH_VERSION Imath version
# IMATH_INCLUDES directory where Imath headers are found
#

# First, try to fine just the right config files
find_package(Imath CONFIG)

if (TARGET Imath::Imath)
# Imath 3.x if both of these targets are found
if (NOT Imath_FIND_QUIETLY)
message (STATUS "Found CONFIG for Imath 3 (Imath_VERSION=${Imath_VERSION})")
endif ()

# Mimic old style variables
set (IMATH_VERSION ${Imath_VERSION})
get_target_property(IMATH_INCLUDES Imath::Imath INTERFACE_INCLUDE_DIRECTORIES)
get_target_property(IMATH_LIBRARY Imath::Imath INTERFACE_LINK_LIBRARIES)
set (IMATH_LIBRARIES ${IMATH_LIBRARY})
set (IMATH_FOUND true)

endif ()
Loading

0 comments on commit 2c7fbf3

Please sign in to comment.