AcademySoftwareFoundation / OpenShadingLanguage

Advanced shading language for production GI renderers
BSD 3-Clause "New" or "Revised" License
2.05k stars 348 forks source link

Fails to build with OIIO 2.4.14.0 + FMT 10.0.0 #1720

Closed eclipseo closed 11 months ago

eclipseo commented 11 months ago

Problem

OSL 1.12.13.0 fails to build with OIIO 2.4.14.0 + FMT 10.0.0, the same happened before with 1.12.6.2 + OIIO 2.4.14.0 + FMT 10.0.0

Expected behavior:

To build successfully with the latest packages

Actual behavior:

[50/138] : && ccache /usr/lib64/ccache/g++ -fPIC -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64   -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -DNDEBUG  -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes -shared  -o lib/python/site-packages/oslquery.so src/liboslquery/CMakeFiles/pyoslquery.dir/py_osl.cpp.o -L/usr/lib64/llvm15/lib -Wl,-rpath,/usr/lib64/llvm15/lib:/builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/redhat-linux-build/lib:  /usr/lib64/libpython3.12.so  lib/liboslquery.so.1.12.13  /usr/lib64/libOpenImageIO.so.2.4.14  /usr/lib64/libOpenImageIO_Util.so.2.4.14  /usr/lib64/libImath-3_1.so.29.8.0  -lm && :
[51/138] : && ccache /usr/lib64/ccache/g++ -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64   -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -DNDEBUG -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes src/oslinfo/CMakeFiles/oslinfo.dir/oslinfo.cpp.o -o bin/oslinfo -L/usr/lib64/llvm15/lib -Wl,-rpath,/usr/lib64/llvm15/lib:/builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/redhat-linux-build/lib:  lib/liboslquery.so.1.12.13  /usr/lib64/libboost_filesystem.so  /usr/lib64/libboost_system.so  -lboost_thread  /usr/lib64/libboost_chrono.so  /usr/lib64/libboost_atomic.so  -lrt  -ldl  /usr/lib64/libOpenImageIO.so.2.4.14  /usr/lib64/libOpenImageIO_Util.so.2.4.14  /usr/lib64/libImath-3_1.so.29.8.0  -lm && :
[52/138] cd /builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/src/liboslexec && /usr/bin/clang++ -DOSL_FAST_MATH=1 -DOSL_INTERNAL=1 -DOIIO_DISABLE_DEPRECATED=1 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DOIIO_HIDE_FORMAT=1 -DOSL_LLVM_VERSION=150 -DOSL_LLVM_FULL_VERSION="15.0.7" -Dosoparse=OSL_v1_12_osoparse -Doslparse=OSL_v1_12_oslparse -std=c++17 -fno-use-cxa-atexit -Xclang -no-opaque-pointers -I/builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/src/liboslexec -I/builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/src/include -I/builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/redhat-linux-build/include -I/usr/include -I/usr/include -I/usr/include -DOSL_COMPILING_TO_BITCODE=1 -Wno-deprecated-register -Wno-ignored-attributes -Wno-unknown-attributes -O3 -fno-math-errno -S -emit-llvm -o /builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/redhat-linux-build/src/liboslexec/llvm_ops_host.s llvm_ops.cpp && /usr/lib64/llvm15/bin/llvm-as -f -o /builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/redhat-linux-build/src/liboslexec/llvm_ops_host.bc /builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/redhat-linux-build/src/liboslexec/llvm_ops_host.s
FAILED: src/liboslexec/llvm_ops_host.bc /builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/redhat-linux-build/src/liboslexec/llvm_ops_host.bc 
cd /builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/src/liboslexec && /usr/bin/clang++ -DOSL_FAST_MATH=1 -DOSL_INTERNAL=1 -DOIIO_DISABLE_DEPRECATED=1 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DOIIO_HIDE_FORMAT=1 -DOSL_LLVM_VERSION=150 -DOSL_LLVM_FULL_VERSION="15.0.7" -Dosoparse=OSL_v1_12_osoparse -Doslparse=OSL_v1_12_oslparse -std=c++17 -fno-use-cxa-atexit -Xclang -no-opaque-pointers -I/builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/src/liboslexec -I/builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/src/include -I/builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/redhat-linux-build/include -I/usr/include -I/usr/include -I/usr/include -DOSL_COMPILING_TO_BITCODE=1 -Wno-deprecated-register -Wno-ignored-attributes -Wno-unknown-attributes -O3 -fno-math-errno -S -emit-llvm -o /builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/redhat-linux-build/src/liboslexec/llvm_ops_host.s llvm_ops.cpp && /usr/lib64/llvm15/bin/llvm-as -f -o /builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/redhat-linux-build/src/liboslexec/llvm_ops_host.bc /builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/redhat-linux-build/src/liboslexec/llvm_ops_host.s
/usr/lib64/llvm15/bin/llvm-as: /builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/redhat-linux-build/src/liboslexec/llvm_ops_host.s:13308:79: error: unterminated attribute group
attributes #0 = { alwaysinline mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
                                                                              ^
[53/138] cd /builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/src/liboslexec && /usr/bin/clang++ -DOSL_FAST_MATH=1 -DOSL_INTERNAL=1 -DOIIO_DISABLE_DEPRECATED=1 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DOIIO_HIDE_FORMAT=1 -DOSL_LLVM_VERSION=150 -DOSL_LLVM_FULL_VERSION="15.0.7" -Dosoparse=OSL_v1_12_osoparse -Doslparse=OSL_v1_12_oslparse -std=c++17 -fno-use-cxa-atexit -Xclang -no-opaque-pointers -DOSL_FAST_MATH=1 -DOSL_INTERNAL=1 -DOIIO_DISABLE_DEPRECATED=1 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DOIIO_HIDE_FORMAT=1 -DOSL_LLVM_VERSION=150 -DOSL_LLVM_FULL_VERSION="15.0.7" -Dosoparse=OSL_v1_12_osoparse -Doslparse=OSL_v1_12_oslparse -std=c++17 -fno-use-cxa-atexit -Xclang -no-opaque-pointers -I/builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/src/liboslexec -I/builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/src/include -I/builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/redhat-linux-build/include -I/usr/include -I/usr/include -I/usr/include -DOSL_COMPILING_TO_BITCODE=1 -Wno-deprecated-register -Wno-ignored-attributes -Wno-unknown-attributes -O3 -fno-math-errno -S -emit-llvm -o /builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/redhat-linux-build/src/liboslexec/llvm_ops_host_rs.s llvm_ops.cpp && /usr/lib64/llvm15/bin/llvm-as -f -o /builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/redhat-linux-build/src/liboslexec/llvm_ops_host_rs.bc /builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/redhat-linux-build/src/liboslexec/llvm_ops_host_rs.s
FAILED: src/liboslexec/llvm_ops_host_rs.bc /builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/redhat-linux-build/src/liboslexec/llvm_ops_host_rs.bc 
cd /builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/src/liboslexec && /usr/bin/clang++ -DOSL_FAST_MATH=1 -DOSL_INTERNAL=1 -DOIIO_DISABLE_DEPRECATED=1 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DOIIO_HIDE_FORMAT=1 -DOSL_LLVM_VERSION=150 -DOSL_LLVM_FULL_VERSION="15.0.7" -Dosoparse=OSL_v1_12_osoparse -Doslparse=OSL_v1_12_oslparse -std=c++17 -fno-use-cxa-atexit -Xclang -no-opaque-pointers -DOSL_FAST_MATH=1 -DOSL_INTERNAL=1 -DOIIO_DISABLE_DEPRECATED=1 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DOIIO_HIDE_FORMAT=1 -DOSL_LLVM_VERSION=150 -DOSL_LLVM_FULL_VERSION="15.0.7" -Dosoparse=OSL_v1_12_osoparse -Doslparse=OSL_v1_12_oslparse -std=c++17 -fno-use-cxa-atexit -Xclang -no-opaque-pointers -I/builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/src/liboslexec -I/builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/src/include -I/builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/redhat-linux-build/include -I/usr/include -I/usr/include -I/usr/include -DOSL_COMPILING_TO_BITCODE=1 -Wno-deprecated-register -Wno-ignored-attributes -Wno-unknown-attributes -O3 -fno-math-errno -S -emit-llvm -o /builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/redhat-linux-build/src/liboslexec/llvm_ops_host_rs.s llvm_ops.cpp && /usr/lib64/llvm15/bin/llvm-as -f -o /builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/redhat-linux-build/src/liboslexec/llvm_ops_host_rs.bc /builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/redhat-linux-build/src/liboslexec/llvm_ops_host_rs.s
/usr/lib64/llvm15/bin/llvm-as: /builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/redhat-linux-build/src/liboslexec/llvm_ops_host_rs.s:13308:79: error: unterminated attribute group
attributes #0 = { alwaysinline mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
                                                                              ^
[54/138] cd /builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/src/liboslexec && /usr/bin/clang++ -DOSL_FAST_MATH=1 -DOSL_INTERNAL=1 -DOIIO_DISABLE_DEPRECATED=1 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DOIIO_HIDE_FORMAT=1 -DOSL_LLVM_VERSION=150 -DOSL_LLVM_FULL_VERSION="15.0.7" -Dosoparse=OSL_v1_12_osoparse -Doslparse=OSL_v1_12_oslparse -std=c++17 -fno-use-cxa-atexit -Xclang -no-opaque-pointers -I/builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/src/liboslexec -I/builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/src/include -I/builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/redhat-linux-build/include -I/usr/include -I/usr/include -I/usr/include -DOSL_COMPILING_TO_BITCODE=1 -Wno-deprecated-register -Wno-ignored-attributes -Wno-unknown-attributes -O3 -fno-math-errno -S -emit-llvm -o /builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/redhat-linux-build/src/liboslexec/opmatrix_host_rs.s opmatrix.cpp && /usr/lib64/llvm15/bin/llvm-as -f -o /builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/redhat-linux-build/src/liboslexec/opmatrix_host_rs.bc /builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/redhat-linux-build/src/liboslexec/opmatrix_host_rs.s
FAILED: src/liboslexec/opmatrix_host_rs.bc /builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/redhat-linux-build/src/liboslexec/opmatrix_host_rs.bc 
cd /builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/src/liboslexec && /usr/bin/clang++ -DOSL_FAST_MATH=1 -DOSL_INTERNAL=1 -DOIIO_DISABLE_DEPRECATED=1 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DOIIO_HIDE_FORMAT=1 -DOSL_LLVM_VERSION=150 -DOSL_LLVM_FULL_VERSION="15.0.7" -Dosoparse=OSL_v1_12_osoparse -Doslparse=OSL_v1_12_oslparse -std=c++17 -fno-use-cxa-atexit -Xclang -no-opaque-pointers -I/builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/src/liboslexec -I/builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/src/include -I/builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/redhat-linux-build/include -I/usr/include -I/usr/include -I/usr/include -DOSL_COMPILING_TO_BITCODE=1 -Wno-deprecated-register -Wno-ignored-attributes -Wno-unknown-attributes -O3 -fno-math-errno -S -emit-llvm -o /builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/redhat-linux-build/src/liboslexec/opmatrix_host_rs.s opmatrix.cpp && /usr/lib64/llvm15/bin/llvm-as -f -o /builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/redhat-linux-build/src/liboslexec/opmatrix_host_rs.bc /builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/redhat-linux-build/src/liboslexec/opmatrix_host_rs.s
/usr/lib64/llvm15/bin/llvm-as: /builddir/build/BUILD/OpenShadingLanguage-1.12.13.0/redhat-linux-build/src/liboslexec/opmatrix_host_rs.s:35871:66: error: unterminated attribute group
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
                                                                 ^
ninja: build stopped: subcommand failed.

STOP_ON_WARNING is off.

Versions

eclipseo commented 11 months ago

It doesn't work with latest commit a4e779c44fbbc12f16bc2bcd9972af97022e2341 either.

eclipseo commented 11 months ago

So apparently you can't use Clang 16 with LLVM 15: https://discourse.llvm.org/t/using-clang-16-with-llvm-15-to-emit-ir/73037

The thing is, in the INSTALL.md you said you had tested Clang 16, so how did you build it?

lgritz commented 11 months ago

I think you can build (i.e. compile) the OSL software distribution with the clang16 compiler just fine.

But we can't use llvm >= 16 library to JIT, nor clang >= 16 to generate bitcode IR that will be fed into the JIT.

Those are two separate things.

eclipseo commented 11 months ago

Ok thanks. I'll try to find some kind of solution.