Skip to content

Conversation

@lji-ilm
Copy link
Contributor

@lji-ilm lji-ilm commented Nov 15, 2025

Description

Recently, when building OIIO using OpenImageIO_BUILD_LOCAL_DEPS=all cmake option, I noticed a reference to lerc that fails during the linker stage, when compiling the simd tests:

[ 71%] Building CXX object src/libutil/CMakeFiles/simd_test.dir/simd_test.cpp.o
[ 71%] Linking CXX executable ../../bin/simd_test
/usr/bin/ld: ../../lib/libOpenImageIO.so.3.1.7: undefined reference to `lerc_decode'
/usr/bin/ld: ../../lib/libOpenImageIO.so.3.1.7: undefined reference to `lerc_encodeForVersion'
/usr/bin/ld: ../../lib/libOpenImageIO.so.3.1.7: undefined reference to `lerc_getBlobInfo'
collect2: error: ld returned 1 exit status
gmake[2]: *** [src/libutil/CMakeFiles/simd_test.dir/build.make:100: bin/simd_test] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:2158: src/libutil/CMakeFiles/simd_test.dir/all] Error 2
gmake: *** [Makefile:166: all] Error 2

lerc is an image compression library from ESRI: https://github.com/Esri/lerc

A deeper dive of this reference to lerc shows that it is referred in libtiff. libtiff, however, did not seem to correctly export this dependency to OIIO when being built locally.

If someone was building OIIO with a system-installed libtiff, this error is unlikely to happen.

By disabling lerc in libTiff, the local build scripts ( OpenImageIO_BUILD_LOCAL_DEPS=all ) runs without a problem.

Tests

Tested build OIIO with OpenImageIO_BUILD_LOCAL_DEPS=all with this patch and was successful in finishing the build.

Checklist:

  • I have read the contribution guidelines.
  • I have updated the documentation, if applicable. (Check if there is no
    need to update the documentation, for example if this is a bug fix that
    doesn't change the API.)
  • I have ensured that the change is tested somewhere in the testsuite
    (adding new test cases if necessary).
  • If I added or modified a C++ API call, I have also amended the
    corresponding Python bindings (and if altering ImageBufAlgo functions, also
    exposed the new functionality as oiiotool options).
  • My code follows the prevailing code style of this project. If I haven't
    already run clang-format before submitting, I definitely will look at the CI
    test that runs clang-format and fix anything that it highlights as being
    nonconforming.

@lji-ilm lji-ilm force-pushed the libtiff_disable_lerc branch from f295fc0 to 510dcf3 Compare November 15, 2025 02:42
@lgritz lgritz changed the title Disable LERC in libTIFF local build script build: Disable LERC in libTIFF local build script Nov 15, 2025
@lgritz lgritz added the build / testing / port / CI Affecting the build system, tests, platform support, porting, or continuous integration. label Nov 15, 2025
@lgritz
Copy link
Collaborator

lgritz commented Nov 15, 2025

The icx/icc failures are unrelated to your changes.

@lgritz lgritz merged commit 8887077 into AcademySoftwareFoundation:main Nov 15, 2025
59 of 61 checks passed
lgritz pushed a commit to lgritz/OpenImageIO that referenced this pull request Nov 17, 2025
…ndation#4957)

Recently, when building OIIO using `OpenImageIO_BUILD_LOCAL_DEPS=all` cmake option, I noticed a reference to `lerc` that fails during the linker stage, when compiling the simd tests:

```
[ 71%] Building CXX object src/libutil/CMakeFiles/simd_test.dir/simd_test.cpp.o
[ 71%] Linking CXX executable ../../bin/simd_test
/usr/bin/ld: ../../lib/libOpenImageIO.so.3.1.7: undefined reference to `lerc_decode'
/usr/bin/ld: ../../lib/libOpenImageIO.so.3.1.7: undefined reference to `lerc_encodeForVersion'
/usr/bin/ld: ../../lib/libOpenImageIO.so.3.1.7: undefined reference to `lerc_getBlobInfo'
collect2: error: ld returned 1 exit status
gmake[2]: *** [src/libutil/CMakeFiles/simd_test.dir/build.make:100: bin/simd_test] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:2158: src/libutil/CMakeFiles/simd_test.dir/all] Error 2
gmake: *** [Makefile:166: all] Error 2
```
`lerc` is an image compression library from ESRI: https://github.com/Esri/lerc

A deeper dive of this reference to lerc shows that it is referred in `libtiff`. `libtiff`, however, did not seem to correctly export this dependency to OIIO when being built locally. 

If someone was building OIIO with a system-installed `libtiff`, this error is unlikely to happen.

By disabling `lerc` in `libTiff`, the local build scripts ( `OpenImageIO_BUILD_LOCAL_DEPS=all` ) runs without a problem.

Tested build OIIO with  `OpenImageIO_BUILD_LOCAL_DEPS=all` with this patch and was successful in finishing the build.
lgritz pushed a commit to lgritz/OpenImageIO that referenced this pull request Nov 17, 2025
…ndation#4957)

Recently, when building OIIO using `OpenImageIO_BUILD_LOCAL_DEPS=all` cmake option, I noticed a reference to `lerc` that fails during the linker stage, when compiling the simd tests:

```
[ 71%] Building CXX object src/libutil/CMakeFiles/simd_test.dir/simd_test.cpp.o
[ 71%] Linking CXX executable ../../bin/simd_test
/usr/bin/ld: ../../lib/libOpenImageIO.so.3.1.7: undefined reference to `lerc_decode'
/usr/bin/ld: ../../lib/libOpenImageIO.so.3.1.7: undefined reference to `lerc_encodeForVersion'
/usr/bin/ld: ../../lib/libOpenImageIO.so.3.1.7: undefined reference to `lerc_getBlobInfo'
collect2: error: ld returned 1 exit status
gmake[2]: *** [src/libutil/CMakeFiles/simd_test.dir/build.make:100: bin/simd_test] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:2158: src/libutil/CMakeFiles/simd_test.dir/all] Error 2
gmake: *** [Makefile:166: all] Error 2
```
`lerc` is an image compression library from ESRI: https://github.com/Esri/lerc

A deeper dive of this reference to lerc shows that it is referred in `libtiff`. `libtiff`, however, did not seem to correctly export this dependency to OIIO when being built locally. 

If someone was building OIIO with a system-installed `libtiff`, this error is unlikely to happen.

By disabling `lerc` in `libTiff`, the local build scripts ( `OpenImageIO_BUILD_LOCAL_DEPS=all` ) runs without a problem.

Tested build OIIO with  `OpenImageIO_BUILD_LOCAL_DEPS=all` with this patch and was successful in finishing the build.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build / testing / port / CI Affecting the build system, tests, platform support, porting, or continuous integration.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants