Skip to content

Commit cbef4cd

Browse files
committed
Added Houdini 20 CI for old and new CXX ABI and improved CXX11 ABI logic
Signed-off-by: Nick Avramoussis <4256455+Idclip@users.noreply.github.com>
1 parent 9153c12 commit cbef4cd

File tree

5 files changed

+159
-107
lines changed

5 files changed

+159
-107
lines changed

.github/workflows/houdini.yml

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
${{ needs.checksecret.outputs.HOUDINI_SECRETS == 'true' ||
6565
github.repository_owner == 'AcademySoftwareFoundation' }}
6666
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-20.04-8c-32g-300h') || 'ubuntu-latest' }}
67-
name: hou:${{ matrix.config.hou }}-vfx:${{ matrix.config.image }}-cxx:${{ matrix.config.cxx }}
67+
name: hou:${{ matrix.config.hou_hash }}-vfx:${{ matrix.config.image }}-cxx:${{ matrix.config.cxx }}
6868
container:
6969
image: aswf/ci-base:${{ matrix.config.image }}
7070
env:
@@ -73,12 +73,18 @@ jobs:
7373
strategy:
7474
matrix:
7575
config:
76-
#- { cxx: clang++, image: '2022', hou: '20_0', build: 'Release', components: 'core,hou,bin,view,render,python,test,axcore,axbin,axtest' }
77-
- { cxx: clang++, image: '2021', hou: '19_5', build: 'Release', components: 'core,hou,bin,view,render,python,test,axcore,axbin,axtest' }
78-
#- { cxx: clang++, image: '2022', hou: '20_0', build: 'Debug', components: 'core,hou' }
79-
#- { cxx: g++, image: '2022', hou: '20_0', build: 'Release', components: 'core,hou' }
76+
- { cxx: clang++, image: '2023.0', hou_hash: '20_0-newabi', build: 'Release', components: 'core,hou,bin,view,render,python,test,axcore,axbin,axtest' }
77+
- { cxx: clang++, image: '2022', hou_hash: '20_0-oldabi', build: 'Release', components: 'core,hou' }
78+
- { cxx: clang++, image: '2021', hou_hash: '19_5', build: 'Release', components: 'core,hou' }
79+
- { cxx: clang++, image: '2023.0', hou_hash: '20_0-newabi', build: 'Debug', components: 'core,hou,bin,view,render,python,test,axcore,axbin,axtest' }
80+
- { cxx: g++, image: '2023.0', hou_hash: '20_0-newabi', build: 'Release', components: 'core,hou,bin,view,render,python,test,axcore,axbin,axtest' }
81+
- { cxx: g++, image: '2022', hou_hash: '20_0-oldabi', build: 'Release', components: 'core,hou' }
8082
fail-fast: false
8183
steps:
84+
# See note on this step in the Houdini weekly.yml job
85+
# We can remove this when we no longer use < 2023 images
86+
- name: remove zstd
87+
run: yum -y remove zstd
8288
- uses: actions/checkout@v3
8389
- name: pybind11
8490
#if: contains(matrix.config.image, '2023') == false
@@ -93,14 +99,14 @@ jobs:
9399
uses: actions/cache@v3
94100
with:
95101
path: /tmp/ccache
96-
key: linux-vfx-hou${{ matrix.config.hou }}-${{ matrix.config.image }}-${{ matrix.config.cxx }}-${{ steps.timestamp.outputs.timestamp }}
97-
restore-keys: linux-vfx-hou${{ matrix.config.hou }}-${{ matrix.config.image }}-${{ matrix.config.cxx }}-
102+
key: linux-vfx-hou${{ matrix.config.hou_hash }}-${{ matrix.config.image }}-${{ matrix.config.cxx }}-${{ steps.timestamp.outputs.timestamp }}
103+
restore-keys: linux-vfx-hou${{ matrix.config.hou_hash }}-${{ matrix.config.image }}-${{ matrix.config.cxx }}-
98104
- name: fetch_houdini
99105
uses: actions/cache/restore@v3
100106
with:
101107
path: hou
102-
key: dummy-houdini${{ matrix.config.hou }}-${{ steps.timestamp.outputs.timestamp }}
103-
restore-keys: vdb-v5-houdini${{ matrix.config.hou }}-
108+
key: dummy-houdini${{ matrix.config.hou_hash }}-${{ steps.timestamp.outputs.timestamp }}
109+
restore-keys: vdb-v5-houdini${{ matrix.config.hou_hash }}-
104110
- name: validate_houdini
105111
run: test -f "hou/hou.tar.gz"
106112
# Make sure the cache is copied, not moved, as the cache action always posts the cache.
@@ -113,10 +119,16 @@ jobs:
113119
cd $HOME/houdini_install && tar -xzf hou.tar.gz && cd -
114120
- name: build
115121
run: |
116-
export HFS="$HOME/houdini_install/hou"
117-
export HDSO="${HFS}/dsolib"
118-
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/lib64:${HDSO}"
119-
./ci/build.sh -v --build-type=Release --components="core,hou" --cargs=\"-DDISABLE_DEPENDENCY_VERSION_CHECKS=ON -DDISABLE_CMAKE_SEARCH_PATHS=ON -DOPENVDB_BUILD_HOUDINI_ABITESTS=OFF -DOPENVDB_HOUDINI_INSTALL_PREFIX=/tmp\ -DTBB_INCLUDEDIR=/usr/local/include -DTBB_LIBRARYDIR=/usr/local/lib\"
122+
./ci/build.sh -v \
123+
--build-type=Release \
124+
--components="${{ matrix.config.components }}" \
125+
--cargs=\" \
126+
-DHOUDINI_ROOT=$HOME/houdini_install/hou \
127+
-DOPENVDB_BUILD_HOUDINI_ABITESTS=OFF \
128+
-DOPENVDB_HOUDINI_INSTALL_PREFIX=/tmp \
129+
-DDISABLE_CMAKE_SEARCH_PATHS=ON \
130+
-DDISABLE_DEPENDENCY_VERSION_CHECKS=ON \
131+
\"
120132
- name: test
121133
run: cd build && ctest -V
122134
# Keep ccache light by stripping out any caches not accessed in the last day

.github/workflows/weekly.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,17 @@ jobs:
5959
github.event.inputs.type == 'all' ||
6060
github.event.inputs.type == 'houdini')
6161
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-20.04-8c-32g-300h') || 'ubuntu-latest' }}
62-
name: linux-houdini:${{ matrix.config.houdini_version }}
62+
name: linux-houdini:${{ matrix.config.hou_hash }}
6363
env:
6464
CXX: clang++
6565
HOUDINI_CLIENT_ID: ${{ secrets.HOUDINI_CLIENT_ID }}
6666
HOUDINI_SECRET_KEY: ${{ secrets.HOUDINI_SECRET_KEY }}
6767
strategy:
6868
matrix:
6969
config:
70-
- { houdini_version: '19.5', houdini_version_str: '19_5' }
71-
#- { houdini_version: '20.0', houdini_version_str: '20_0' }
70+
- { houdini_version: '19.5', platform: 'linux_x86_64_gcc9.3', hou_hash: '19_5' }
71+
- { houdini_version: '20.0', platform: 'linux_x86_64_gcc9.3', hou_hash: '20_0-oldabi' }
72+
- { houdini_version: '20.0', platform: 'linux_x86_64_gcc11.2', hou_hash: '20_0-newabi' }
7273
fail-fast: false
7374
container:
7475
image: aswf/ci-base:2023
@@ -88,7 +89,7 @@ jobs:
8889
id: timestamp
8990
run: echo "timestamp=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
9091
- name: download_houdini
91-
run: ./ci/download_houdini.sh ${{ matrix.config.houdini_version }} ON
92+
run: ./ci/download_houdini.sh ${{ matrix.config.houdini_version }} ${{ matrix.config.platform }} --prod
9293
- name: install_houdini
9394
run: |
9495
mkdir $HOME/houdini_install
@@ -98,7 +99,7 @@ jobs:
9899
uses: actions/cache/save@v3
99100
with:
100101
path: hou
101-
key: vdb-v5-houdini${{ matrix.config.houdini_version_str }}-${{ steps.timestamp.outputs.timestamp }}
102+
key: vdb-v5-houdini${{ matrix.config.hou_hash }}-${{ steps.timestamp.outputs.timestamp }}
102103

103104
#############################################################################
104105
########################### Core Library Extras #############################

ci/download_houdini.py

100644100755
Lines changed: 75 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/local/bin/python
1+
#!/usr/bin/env python3
22
#
33
# Copyright Contributors to the OpenVDB Project
44
# SPDX-License-Identifier: MPL-2.0
@@ -19,16 +19,16 @@
1919
import requests
2020
import hashlib
2121
import os
22+
import argparse
23+
import copy
2224

23-
# this argument is for the major.minor version of Houdini to download (such as 15.0, 15.5, 16.0)
24-
version = sys.argv[1]
25-
only_production = True if sys.argv[2] == 'ON' else False
26-
user_client_id = os.getenv('HOUDINI_CLIENT_ID')
27-
user_client_secret_key = os.getenv('HOUDINI_SECRET_KEY')
28-
29-
if not re.match('[0-9][0-9]\.[0-9]$', version):
30-
raise IOError('Invalid Houdini Version "%s", expecting in the form "major.minor" such as "16.0"' % version)
31-
25+
# For progress bar printing
26+
try:
27+
from tqdm import tqdm
28+
has_tqdm = True
29+
except:
30+
has_tqdm = False
31+
pass
3232

3333
# Code that provides convenient Python wrappers to call into the API:
3434

@@ -138,33 +138,72 @@ def __init__(self, http_code, message):
138138
self.http_code = http_code
139139

140140

141-
service = service(
142-
access_token_url="https://www.sidefx.com/oauth2/application_token",
143-
client_id=user_client_id,
144-
client_secret_key=user_client_secret_key,
145-
endpoint_url="https://www.sidefx.com/api/",
146-
)
141+
if __name__ == "__main__":
142+
143+
parser = argparse.ArgumentParser(description='Download a Houdini Installation')
144+
parser.add_argument('version', type=str, help='Major.Minor version of Houdini to download')
145+
parser.add_argument('platform', type=str, help='Platform target')
146+
parser.add_argument('--prod', action='store_true', help='Only download production builds')
147+
parser.add_argument('--list', action='store_true', help='Just list the available builds and exit.')
148+
args = parser.parse_args()
149+
150+
version = args.version
151+
platform = args.platform
152+
only_production = args.prod
153+
154+
user_client_id = os.getenv('HOUDINI_CLIENT_ID')
155+
user_client_secret_key = os.getenv('HOUDINI_SECRET_KEY')
156+
157+
if not re.match('[0-9][0-9]\.[0-9]$', version):
158+
raise IOError('Invalid Houdini Version "%s", expecting in the form "major.minor" such as "16.0"' % version)
147159

148-
releases_list = service.download.get_daily_builds_list(
149-
product='houdini', version=version, platform='linux', only_production=only_production)
160+
service = service(
161+
access_token_url="https://www.sidefx.com/oauth2/application_token",
162+
client_id=user_client_id,
163+
client_secret_key=user_client_secret_key,
164+
endpoint_url="https://www.sidefx.com/api/",
165+
)
150166

151-
latest_release = service.download.get_daily_build_download(
152-
product='houdini', version=version, platform='linux', build=releases_list[0]['build'])
167+
releases_list = service.download.get_daily_builds_list(
168+
product='houdini', version=version, platform=platform, only_production=only_production)
153169

154-
# Download the file as hou.tar.gz
155-
local_filename = 'hou.tar.gz'
156-
response = requests.get(latest_release['download_url'], stream=True)
157-
if response.status_code == 200:
158-
with open(local_filename, 'wb') as f:
170+
print('Available builds:')
171+
for rel in releases_list:
172+
rel = copy.deepcopy(rel)
173+
if 'third_party_libraries' in rel:
174+
# Don't print these
175+
del rel['third_party_libraries']
176+
print(rel)
177+
178+
if args.list:
179+
sys.exit(0)
180+
181+
print('Selecting build: ' + releases_list[0]['build'])
182+
183+
latest_release = service.download.get_daily_build_download(
184+
product='houdini', version=version, platform=platform, build=releases_list[0]['build'])
185+
186+
# Download the file as hou.tar.gz
187+
local_filename = 'hou.tar.gz'
188+
response = requests.get(latest_release['download_url'], stream=True)
189+
if response.status_code == 200:
159190
response.raw.decode_content = True
160-
shutil.copyfileobj(response.raw, f)
161-
else:
162-
raise Exception('Error downloading file!')
163-
164-
# Verify the file checksum is matching
165-
file_hash = hashlib.md5()
166-
with open(local_filename, 'rb') as f:
167-
for chunk in iter(lambda: f.read(4096), b''):
168-
file_hash.update(chunk)
169-
if file_hash.hexdigest() != latest_release['hash']:
170-
raise Exception('Checksum does not match!')
191+
if has_tqdm:
192+
file_size = int(response.headers.get('Content-Length', 0))
193+
desc = "(Unknown total file size)" if file_size == 0 else ""
194+
with tqdm.wrapattr(response.raw, "read", total=file_size, desc=desc) as r_raw:
195+
with open(local_filename, 'wb') as f:
196+
shutil.copyfileobj(r_raw, f)
197+
else:
198+
with open(local_filename, 'wb') as f:
199+
shutil.copyfileobj(response.raw, f)
200+
else:
201+
raise Exception('Error downloading file!')
202+
203+
# Verify the file checksum is matching
204+
file_hash = hashlib.md5()
205+
with open(local_filename, 'rb') as f:
206+
for chunk in iter(lambda: f.read(4096), b''):
207+
file_hash.update(chunk)
208+
if file_hash.hexdigest() != latest_release['hash']:
209+
raise Exception('Checksum does not match!')

cmake/OpenVDBHoudiniSetup.cmake

Lines changed: 52 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -335,68 +335,67 @@ if(NOT OPENVDB_HOUDINI_ABI)
335335
endif()
336336

337337
# ------------------------------------------------------------------------
338-
# Configure GCC CXX11 ABI
338+
# Configure libstc++ CXX11 ABI
339339
# ------------------------------------------------------------------------
340340

341-
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
342-
if((CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 5.1) OR
343-
(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 5.1))
344-
message(STATUS "GCC >= 5.1 detected. Configuring GCC CXX11 ABI for Houdini compatibility...")
345-
346-
execute_process(COMMAND echo "#include <string>"
347-
COMMAND ${CMAKE_CXX_COMPILER} "-x" "c++" "-E" "-dM" "-"
348-
COMMAND grep "-F" "_GLIBCXX_USE_CXX11_ABI"
349-
TIMEOUT 10
350-
RESULT_VARIABLE QUERIED_GCC_CXX11_ABI_SUCCESS
351-
OUTPUT_VARIABLE _GCC_CXX11_ABI)
352-
353-
set(GLIBCXX_USE_CXX11_ABI "UNKNOWN")
354-
355-
if(NOT QUERIED_GCC_CXX11_ABI_SUCCESS)
356-
string(FIND ${_GCC_CXX11_ABI} "_GLIBCXX_USE_CXX11_ABI 0" GCC_OLD_CXX11_ABI)
357-
string(FIND ${_GCC_CXX11_ABI} "_GLIBCXX_USE_CXX11_ABI 1" GCC_NEW_CXX11_ABI)
358-
if(NOT (${GCC_OLD_CXX11_ABI} EQUAL -1))
359-
set(GLIBCXX_USE_CXX11_ABI 0)
360-
endif()
361-
if(NOT (${GCC_NEW_CXX11_ABI} EQUAL -1))
362-
set(GLIBCXX_USE_CXX11_ABI 1)
363-
endif()
364-
endif()
341+
if(UNIX AND NOT APPLE)
342+
# Assume we're using libstdc++
343+
message(STATUS "Configuring CXX11 ABI for Houdini compatibility...")
344+
345+
execute_process(COMMAND echo "#include <string>"
346+
COMMAND ${CMAKE_CXX_COMPILER} "-x" "c++" "-E" "-dM" "-"
347+
COMMAND grep "-F" "_GLIBCXX_USE_CXX11_ABI"
348+
TIMEOUT 10
349+
RESULT_VARIABLE QUERIED_GCC_CXX11_ABI_SUCCESS
350+
OUTPUT_VARIABLE _GCC_CXX11_ABI)
351+
352+
set(GLIBCXX_USE_CXX11_ABI "UNKNOWN")
365353

366-
# Try and query the Houdini CXX11 ABI. Allow it to be provided by users to
367-
# override this logic should Houdini's CMake ever change
368-
369-
if(NOT DEFINED HOUDINI_CXX11_ABI)
370-
get_target_property(houdini_interface_compile_options
371-
Houdini INTERFACE_COMPILE_OPTIONS)
372-
set(HOUDINI_CXX11_ABI "UNKNOWN")
373-
if("-D_GLIBCXX_USE_CXX11_ABI=0" IN_LIST houdini_interface_compile_options)
374-
set(HOUDINI_CXX11_ABI 0)
375-
elseif("-D_GLIBCXX_USE_CXX11_ABI=1" IN_LIST houdini_interface_compile_options)
376-
set(HOUDINI_CXX11_ABI 1)
377-
endif()
354+
if(NOT QUERIED_GCC_CXX11_ABI_SUCCESS)
355+
string(FIND ${_GCC_CXX11_ABI} "_GLIBCXX_USE_CXX11_ABI 0" GCC_OLD_CXX11_ABI)
356+
string(FIND ${_GCC_CXX11_ABI} "_GLIBCXX_USE_CXX11_ABI 1" GCC_NEW_CXX11_ABI)
357+
if(NOT (${GCC_OLD_CXX11_ABI} EQUAL -1))
358+
set(GLIBCXX_USE_CXX11_ABI 0)
378359
endif()
360+
if(NOT (${GCC_NEW_CXX11_ABI} EQUAL -1))
361+
set(GLIBCXX_USE_CXX11_ABI 1)
362+
endif()
363+
endif()
379364

380-
message(STATUS " GCC CXX11 ABI : ${GLIBCXX_USE_CXX11_ABI}")
381-
message(STATUS " Houdini CXX11 ABI : ${HOUDINI_CXX11_ABI}")
365+
# Try and query the Houdini CXX11 ABI. Allow it to be provided by users to
366+
# override this logic should Houdini's CMake ever change
382367

383-
if(${HOUDINI_CXX11_ABI} STREQUAL "UNKNOWN")
384-
message(WARNING "Unable to determine Houdini CXX11 ABI. Assuming newer ABI "
385-
"has been used.")
368+
if(NOT DEFINED HOUDINI_CXX11_ABI)
369+
get_target_property(houdini_interface_compile_options
370+
Houdini INTERFACE_COMPILE_OPTIONS)
371+
set(HOUDINI_CXX11_ABI "UNKNOWN")
372+
if("-D_GLIBCXX_USE_CXX11_ABI=0" IN_LIST houdini_interface_compile_options)
373+
set(HOUDINI_CXX11_ABI 0)
374+
elseif("-D_GLIBCXX_USE_CXX11_ABI=1" IN_LIST houdini_interface_compile_options)
386375
set(HOUDINI_CXX11_ABI 1)
387376
endif()
377+
endif()
388378

389-
if(${GLIBCXX_USE_CXX11_ABI} EQUAL ${HOUDINI_CXX11_ABI})
390-
message(STATUS " Current CXX11 ABI matches Houdini configuration "
391-
"(_GLIBCXX_USE_CXX11_ABI=${HOUDINI_CXX11_ABI}).")
392-
else()
393-
message(WARNING "A potential mismatch was detected between the CXX11 ABI "
394-
"of GCC and Houdini. The following ABI configuration will be used: "
395-
"-D_GLIBCXX_USE_CXX11_ABI=${HOUDINI_CXX11_ABI}. See: "
396-
"https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html and "
397-
"https://vfxplatform.com/#footnote-gcc6 for more information.")
398-
endif()
379+
message(STATUS " GNU CXX11 ABI : ${GLIBCXX_USE_CXX11_ABI}")
380+
message(STATUS " Houdini CXX11 ABI : ${HOUDINI_CXX11_ABI}")
381+
382+
if(${HOUDINI_CXX11_ABI} STREQUAL "UNKNOWN")
383+
message(WARNING "Unable to determine Houdini CXX11 ABI. Assuming newer ABI "
384+
"has been used.")
385+
set(HOUDINI_CXX11_ABI 1)
386+
endif()
399387

400-
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=${HOUDINI_CXX11_ABI})
388+
if(${GLIBCXX_USE_CXX11_ABI} EQUAL ${HOUDINI_CXX11_ABI})
389+
message(STATUS " Current CXX11 ABI matches Houdini configuration "
390+
"(_GLIBCXX_USE_CXX11_ABI=${HOUDINI_CXX11_ABI}).")
391+
else()
392+
message(WARNING "A potential mismatch was detected between the CXX11 ABI "
393+
"of libstdc++ and Houdini. The following ABI configuration will be used: "
394+
"-D_GLIBCXX_USE_CXX11_ABI=${HOUDINI_CXX11_ABI}. See: "
395+
"https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html and "
396+
"https://vfxplatform.com/#footnote-gcc6 for more information.")
401397
endif()
398+
399+
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=${HOUDINI_CXX11_ABI})
402400
endif()
401+

openvdb_houdini/openvdb_houdini/GeometryUtil.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <openvdb/util/Util.h> // for openvdb::util::COORD_OFFSETS
1616

1717
#include <GU/GU_Detail.h>
18+
#include <GEO/GEO_Primitive.h>
1819

1920
#include <algorithm> // for std::max/min()
2021
#include <memory>

0 commit comments

Comments
 (0)