Skip to content

Commit f6c7390

Browse files
committed
OpenSubDiv Conan recipe and TBB
- OpenSubDiv Conan recipe was incorrectly specifying that clients needed to link against libtbbmalloc and libtbbmalloc_proxy, which could cause mixing of TBB and glibc malloc. Fixes [#371 usdview core dump](#371). - docker-builds.yml missing line continuation, would abort trying to build base2 Conan packages due to missing options. - clean up some bare URLs in README.md - clean up references to internal Conan paths in installed CPython and USD scripts. Fixes [#370](#370). Signed-off-by: Jean-Francois Panisset <panisset@gmail.com>
1 parent 33ce5f9 commit f6c7390

4 files changed

Lines changed: 49 additions & 10 deletions

File tree

.github/workflows/docker-builds.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ jobs:
204204
--verbose \
205205
build \
206206
--ci-image-type PACKAGE \
207-
--group base2-1
207+
--group base2-1 \
208208
--version ${{ matrix.version_noclang }} \
209209
--build-missing \
210210
--push NO

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ The container images include CUDA, OptiX, OpenGL and Vulkan libraries and can be
336336

337337
The host system must have the [NVIDIA Container Toolkit](https://github.com/NVIDIA/nvidia-container-toolkit) installed to allow GPU devices to be mapped into the container and accessible by a binary running inside it. The NVIDIA GPU driver also needs to be installed on the host: the Container Toolkit will map the hardware specific shared libraries into the container at startup time. There is no need to install the GPU driver in the container itself.
338338

339-
Academy Software Foundation projects running their CI in the context of the [https://github.com/AcademySoftwareFoundation/] GitHub organization have access to GPU accelerated hosted runners where the NVIDIA Container Toolkit is already installed.
339+
Academy Software Foundation projects running their CI in the context of the [ASWF GitHub organization](https://github.com/AcademySoftwareFoundation/) have access to GPU accelerated hosted runners where the NVIDIA Container Toolkit is already installed.
340340

341341
#### CUDA CI Workloads
342342

@@ -352,7 +352,7 @@ container:
352352

353353
The[Open Shading Language](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage) optionally uses NVIDIA OptiX for ray tracing acceleration. This requires additional [driver capabilities](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/1.10.0/user-guide.html#driver-capabilities) to be mapped into the container at startup time:
354354

355-
[https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/blob/main/.github/workflows/ci.yml]
355+
[OpenShadingLanguage .github/workflows/ci.yml](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/blob/main/.github/workflows/ci.yml)
356356

357357
```
358358
container:

packages/conan/recipes/opensubdiv/conanfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def package_info(self):
190190
self.cpp_info.components["osdcpu"].set_property("cmake_target_name", f"OpenSubdiv::osdcpu{target_suffix}")
191191
self.cpp_info.components["osdcpu"].libs = ["osdCPU"]
192192
if self.options.with_tbb:
193-
self.cpp_info.components["osdcpu"].requires = ["onetbb::onetbb"]
193+
self.cpp_info.components["osdcpu"].requires = ["onetbb::libtbb"] # ASWF: only need libtbb, NOT tbbmalloc/tbbmalloc_proxy
194194

195195
if self._osd_gpu_enabled:
196196
self.cpp_info.components["osdgpu"].set_property("cmake_target_name", f"OpenSubdiv::osdgpu{target_suffix}")

scripts/common/install_conanpackages.sh

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ if (( $VFXYEAR < 2023 )); then
2828
conan config set general.default_profile=$2
2929
conan install .
3030
else
31-
# Escape / or & in install dir for use in regexp
32-
ESCAPED_PATH=$(printf '%s' "$1" | sed 's/[\/&]/\\&/g')
31+
# Escape & in install dir for use in regexp
32+
ESCAPED_PATH=$(printf '%s' "$1" | sed 's/[&]/\\&/g')
3333
# In case we don't actually install anything
3434
mkdir -p $1/full_deploy/host
3535
# Extract references from conanfile.txt and install them by reference
@@ -47,11 +47,12 @@ else
4747
# conan cache clean "*" --download
4848
rm -rf /tmp/downloads/*
4949

50-
# The full_deploy generator just copies over generated CMake files which may contain absolute paths pointing inside the Conan cache
50+
# The full_deploy generator copies over generated package files which may contain absolute paths pointing inside the Conan cache
5151
# in the format:
52-
# /opt/conan_home/d/b/boost64b7fc4516f80/p/...
52+
# /opt/conan_home/d/b/cpyth64b7fc4516f80/p/...
53+
# /opt/conan_home/d/cpyth/64b7fc4516f80/p/...
5354
# Replace those by our installation prefix.
54-
find $1/full_deploy -name '*.cmake' -exec sed -i -E 's/\/opt\/conan_home\/d\/b\/[^/]+\/p/'$ESCAPED_PATH'/g' {} \;
55+
find $1/full_deploy -name '*.cmake' -exec sed -i -E 's#/opt/conan_home/d/b/[^/]+/p#'"$ESCAPED_PATH"'#g' {} \;
5556

5657
for INSTALLED_PACKAGE in $(find $1/full_deploy/host -mindepth 1 -maxdepth 1 -printf "%f\n"); do
5758
# Don't relocate the excluded package
@@ -74,15 +75,53 @@ else
7475
fi
7576

7677
# Currently cannot build a relocatable CPython package, conan_home paths are hardcoded in sysconfig
78+
# Also python scripts should not hardcode the Conan package path in their shebang
7779
if [[ $INSTALLED_PACKAGE == cpython ]]; then
78-
find $1/full_deploy/host/cpython -name '_sysconfigdata__linux_x86_64-linux-gnu.py' -exec sed -i -E 's/\/opt\/conan_home\/d\/b\/[^/]+\/p/'$ESCAPED_PATH'/g' {} \;
80+
find $1/full_deploy/host/cpython/${INSTALLED_PACKAGE_VERSION}/${RELEASE_DIR} -name '_sysconfigdata__linux_x86_64-linux-gnu.py' -exec sed -i -E 's#/opt/conan_home/d(/b)?/[^/]+/p#'"$ESCAPED_PATH"'#g' {} \;
81+
find $1/full_deploy/host/cpython/${INSTALLED_PACKAGE_VERSION}/${RELEASE_DIR}/lib -name '*.py' -exec sed -i -E '1s@^#!/opt/conan_home/d/b/cpyth.*/bin/(.*)$@#!/usr/bin/env \1@' {} \;
82+
for f in $1/full_deploy/host/cpython/${INSTALLED_PACKAGE_VERSION}/${RELEASE_DIR}/bin/*; do
83+
[[ -f $f ]] || continue
84+
read -r first < "$f" || continue
85+
case "$first" in
86+
"#!"*python*) # any python* interpreter
87+
sed -i -E '1s@^#!/opt/conan_home/d/b/cpyth.*/bin/(.*)$@#!/usr/bin/env \1@' "$f"
88+
;;
89+
*)
90+
: # not a Python script; skip
91+
;;
92+
esac
93+
done
7994
fi
8095

8196
# One off patch for pybind11 : overwrite pybind11Common.cmake with un-modified version
8297
if [[ $INSTALLED_PACKAGE == pybind11 ]]; then
8398
mv $1/full_deploy/host/pybind11/${INSTALLED_PACKAGE_VERSION}/lib/cmake/pybind11/pybind11Common.{cmake_NO_CONAN,cmake}
8499
fi
85100

101+
# Qt has scripts which bake in cmake binary location
102+
if [[ $INSTALLED_PACKAGE == qt ]]; then
103+
for f in $1/full_deploy/host/qt/${INSTALLED_PACKAGE_VERSION}/${RELEASE_DIR}/bin/{qt-cmake,qt-cmake-create}; do
104+
[[ -f $f ]] || continue
105+
sed -i -E 's#/opt/conan_home/d/b/cmake[^/]+/p#'"$ESCAPED_PATH"'#g' $f
106+
done
107+
fi
108+
109+
# OpenUSD installs a number of Python scripts and bakes in the conan cache path in the shebang
110+
if [[ $INSTALLED_PACKAGE == openusd ]]; then
111+
for f in $1/full_deploy/host/openusd/${INSTALLED_PACKAGE_VERSION}/${RELEASE_DIR}/bin/*; do
112+
[[ -f $f ]] || continue
113+
read -r first < "$f" || continue
114+
case "$first" in
115+
"#!"*python*) # any python* interpreter
116+
sed -i -E '1s@^#!/opt/conan_home/d/b/cpyth.*/bin/(.*)$@#!/usr/bin/env \1@' "$f"
117+
;;
118+
*)
119+
: # not a Python script; skip
120+
;;
121+
esac
122+
done
123+
fi
124+
86125
rsync --remove-source-files --exclude conaninfo.txt --exclude conanmanifest.txt -a $1/full_deploy/host/${INSTALLED_PACKAGE}/${INSTALLED_PACKAGE_VERSION}/${RELEASE_DIR}/ $1/
87126
done
88127

0 commit comments

Comments
 (0)