Describe the bug
build of OpenEXR fails to find -lImath2_4
To Reproduce
$ nix-build . -A openexr
Expected behavior
Successful build.
Screenshots
clang++ -DHAVE_CONFIG_H -I. -I../config -D_THREAD_SAFE -I/nix/store/yzdk3am5jpm0g87mzm513jzj1w4mp12v-ilmbase-2.4.1-dev/include -I/nix/store/yzdk3am5jpm0g87mzm513jzj1w4mp12v-ilmbase-2.4.1-dev/include/OpenEXR -D_THREAD_SAFE -I.. -I../config -I/nix/store/wkz4cs14c5dsfi86q3zw8nayfii1lckr-zlib-1.2.11-dev/include -pipe -g -O2 -std=c++14 -D_THREAD_SAFE -c -o dwaLookups.o dwaLookups.cpp
/nix/store/pd2xsac3kz5ziskb5x90cm9jcjk2xcc6-bash-4.4-p23/bin/bash ../libtool --tag=CXX --mode=link clang++ -pipe -g -O2 -std=c++14 -D_THREAD_SAFE -o dwaLookups dwaLookups.o -L/nix/store/gjj7ka209rfdr4fsryjfx16if4bk74qa-ilmbase-2.4.1/lib -L/nix/store/gjj7ka209rfdr4fsryjfx16if4bk74qa-ilmbase-2.4.1/lib -lImath-2_4 -lHalf-2_4 -lIex-2_4 -lIexMath-2_4 -lIlmThread-2_4 -D_THREAD_SAFE
libtool: link: clang++ -pipe -g -O2 -std=c++14 -D_THREAD_SAFE -o dwaLookups dwaLookups.o -D_THREAD_SAFE -L/nix/store/gjj7ka209rfdr4fsryjfx16if4bk74qa-ilmbase-2.4.1/lib -lImath-2_4 -lHalf-2_4 -lIex-2_4 -lIexMath-2_4 -lIlmThread-2_4
ld: library not found for -lImath-2_4
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [Makefile:762: dwaLookups] Error 1
make[1]: *** Waiting for unfinished jobs....
/nix/store/pd2xsac3kz5ziskb5x90cm9jcjk2xcc6-bash-4.4-p23/bin/bash ../libtool --tag=CXX --mode=link clang++ -pipe -g -O2 -std=c++14 -D_THREAD_SAFE -o b44ExpLogTable b44ExpLogTable.o -L/nix/store/gjj7ka209rfdr4fsryjfx16if4bk74qa-ilmbase-2.4.1/lib -L/nix/store/gjj7ka209rfdr4fsryjfx16if4bk74qa-ilmbase-2.4.1/lib -lImath-2_4 -lHalf-2_4 -lIex-2_4 -lIexMath-2_4 -lIlmThread-2_4 -D_THREAD_SAFE
libtool: link: clang++ -pipe -g -O2 -std=c++14 -D_THREAD_SAFE -o b44ExpLogTable b44ExpLogTable.o -D_THREAD_SAFE -L/nix/store/gjj7ka209rfdr4fsryjfx16if4bk74qa-ilmbase-2.4.1/lib -lImath-2_4 -lHalf-2_4 -lIex-2_4 -lIexMath-2_4 -lIlmThread-2_4
ld: library not found for -lImath-2_4
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [Makefile:758: b44ExpLogTable] Error 1
make[1]: Leaving directory '/private/tmp/nix-build-openexr-2.4.1.drv-0/source/OpenEXR/IlmImf'
make: *** [Makefile:502: all-recursive] Error 1
builder for '/nix/store/3qp40w14j9x0rf9kh58j6mxah4829mz5-openexr-2.4.1.drv' failed with exit code 2
error: build of '/nix/store/3qp40w14j9x0rf9kh58j6mxah4829mz5-openexr-2.4.1.drv' failed
Additional context
Add any other context about the problem here.
Notify maintainers
@lovesegfault
Metadata
"x86_64-darwin"Darwin 19.2.0, macOS 10.15.2yesnonix-env (Nix) 2.3.4"nixpkgs-20.09pre221715.5f814bf9cc4""darwin"/nix/var/nix/profiles/per-user/root/channels/nixpkgsMaintainer information:
attribute:
- openexr
- ilmbase
Something seems to be mangling the library names incorrectly?
The ilmbase package contains:
libHalf-2_4.24.dylib libIex-2_4.24.dylib libIexMath-2_4.24.dylib libIlmThread-2_4.24.dylib libImath-2_4.24.dylib
libHalf.dylib libIex.dylib libIexMath.dylib libIlmThread.dylib libImath.dylib
libHalf.la libIex.la libIexMath.la libIlmThread.la libImath.la
Notice the periods.
cc. @flokli
I lack the hardware to debug this. @LnL7, any ideas?
Repro'd on 10.14
https://github.com/AcademySoftwareFoundation/openexr/blob/master/INSTALL.md#configuring-via-autoconf seems to indicate that autoconf-based builds are only supported on linux - we may want to switch this to cmake. Building outside of nix via cmake is working fine for me.
@eraserhd can you give https://github.com/glittershark/nixpkgs/commit/00ab0f45b7665cbc396c3d54c079664055390fc3 a try?
I can confirm this still builds on x86_64-linux at least.