Enable backward compatibility for ABI 10

- This update fixes built for Blender with OpenVDB enabled
This commit is contained in:
Luya Tshimbalanga 2024-03-28 18:25:53 -07:00
parent b0daecbfdd
commit 0a623bb756

View File

@ -10,6 +10,12 @@
# Optional supports # Optional supports
%global with_openexr 1 %global with_openexr 1
%global with_ax 0 %global with_ax 0
%global with_nanovdb 1
# ax currently incompatible with newer llvm versions
%if 0%{?fedora} >= 38 || 0%{?rhel} >= 8
%global llvm_compat 15
%endif
Name: openvdb Name: openvdb
Version: 11.0.0 Version: 11.0.0
@ -36,7 +42,7 @@ BuildRequires: gcc-c++
BuildRequires: ghostscript >= 8.70 BuildRequires: ghostscript >= 8.70
BuildRequires: libstdc++-devel BuildRequires: libstdc++-devel
%if 0%{?with_ax} %if 0%{?with_ax}
BuildRequires: llvm-devel BuildRequires: llvm%{?llvm_compat}-devel
BuildRequires: pkgconfig(libffi) BuildRequires: pkgconfig(libffi)
%endif %endif
BuildRequires: pkgconfig(blosc) >= 1.5.0 BuildRequires: pkgconfig(blosc) >= 1.5.0
@ -129,9 +135,15 @@ sed -i \
export CXXFLAGS="%{build_cxxflags} -Wl,--as-needed" export CXXFLAGS="%{build_cxxflags} -Wl,--as-needed"
# Ignore versions (python 3, etc.) # Ignore versions (python 3, etc.)
# Set ABI version to address blender compatibility for
# Fedora 40 and onward
%cmake \ %cmake \
-DCMAKE_NO_SYSTEM_FROM_IMPORTED=TRUE \ -DCMAKE_NO_SYSTEM_FROM_IMPORTED=TRUE \
-DDISABLE_DEPENDENCY_VERSION_CHECKS=ON \ -DDISABLE_DEPENDENCY_VERSION_CHECKS=ON \
%if 0%{?fedora} > 39
-DOPENVDB_ABI_VERSION_NUMBER=10 \
-DOPENVDB_USE_DEPRECATED_ABI_10=ON \
%endif
-DOPENVDB_BUILD_DOCS=ON \ -DOPENVDB_BUILD_DOCS=ON \
%if 0%{?fedora} %if 0%{?fedora}
-DOPENVDB_BUILD_PYTHON_MODULE=ON \ -DOPENVDB_BUILD_PYTHON_MODULE=ON \
@ -145,12 +157,18 @@ export CXXFLAGS="%{build_cxxflags} -Wl,--as-needed"
%if 0%{?with_ax} %if 0%{?with_ax}
-DHAVE_FFI_CALL=ON \ -DHAVE_FFI_CALL=ON \
-DUSE_AX=ON \ -DUSE_AX=ON \
-DLLVM_STATIC=0 \
-DLLVM_CONFIG=$(which llvm-config%{?llvm_compat:-%{llvm_compat}}) \
-DLLVM=%{_bindir} \
%endif %endif
%if 0%{?with_openexr} %if 0%{?with_openexr}
-DUSE_EXR=ON \ -DUSE_EXR=ON \
%endif %endif
-DUSE_NANOVDB=ON %if 0%{?with_nanovdb}
-DUSE_NANOVDB=ON \
-DOPENVDB_BUILD_NANOVDB=ON \
-DNANOVDB_USE_OPENVDB=ON
%endif
# Increase memory reserve to 12GB per build thread for a successful build on # Increase memory reserve to 12GB per build thread for a successful build on
# ppc64le and s390x. # ppc64le and s390x.
%cmake_build %limit_build -m 12288 %cmake_build %limit_build -m 12288
@ -171,7 +189,7 @@ find %{buildroot} -name '*.a' -delete
%files %files
%{_bindir}/vdb_print %{_bindir}/vdb_print
%{_bindir}/nanovdb_{print,validate} %{_bindir}/nanovdb_{convert,print,validate}
%files libs %files libs
%license LICENSE %license LICENSE