Skip to content

Commit

Permalink
Adjust CMake for Houdini 20 release
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaScheller committed Nov 8, 2023
1 parent eaa985c commit d299f8e
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 8 deletions.
9 changes: 7 additions & 2 deletions .github/scripts/houdini.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,18 @@ def install_sidefx_houdini():
releases_list = sidefx_service.download.get_daily_builds_list(product=sidefx_product,
platform=sidefx_platform,
only_production=True)
latest_production_release = releases_list[0]
# Switch to new gcc version starting with H20
for release in releases_list:
if release["version"] == "20.0":
if not release["platform"].endswith("gcc11.2"):
continue
latest_production_release = release
break
latest_production_release_download = sidefx_service.download.get_daily_build_download(product='houdini',
version=latest_production_release["version"],
build=latest_production_release["build"],
platform=sidefx_platform)


# Download latest production release
logging.info('Downloading Houdini build {version}.{build}'.format(version=latest_production_release["version"],
build=latest_production_release["build"]))
Expand Down
34 changes: 29 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ else()
endif()
# Houdini
set(AR_HOUDINI_ROOT $ENV{HFS} CACHE PATH "Houdini install directory")
set(AR_HOUDINI_LIB_DIR ${AR_HOUDINI_ROOT}/custom/houdini/dsolib)
if (WIN32)
set(AR_HOUDINI_LIB_DIR ${AR_HOUDINI_ROOT}/custom/houdini/dsolib)
else()
set(AR_HOUDINI_LIB_DIR ${AR_HOUDINI_ROOT}/dsolib)
endif()
set(AR_HOUDINI_INCLUDE_DIR ${AR_HOUDINI_ROOT}/toolkit/include)
# Usd
if (WIN32)
Expand All @@ -82,11 +86,26 @@ else()
set(AR_PXR_LIB_DIR ${AR_HOUDINI_ROOT}/dsolib)
set(AR_PXR_LIB_PREFIX "pxr_")
endif()

set(AR_PXR_INCLUDE_DIR ${AR_HOUDINI_INCLUDE_DIR})
# Python
set(AR_PYTHON_LIB python3.9)
set(AR_PYTHON_LIB_NUMBER python39)
if (WIN32)
if(EXISTS "${AR_HOUDINI_ROOT}/python310")
set(AR_PYTHON_LIB python3.10)
set(AR_PYTHON_LIB_NUMBER python310)
else()
set(AR_PYTHON_LIB python3.9)
set(AR_PYTHON_LIB_NUMBER python39)
endif()
else()
if(EXISTS "${AR_HOUDINI_ROOT}/python/bin/python3.10")
set(AR_PYTHON_LIB python3.10)
set(AR_PYTHON_LIB_NUMBER python310)
else()
set(AR_PYTHON_LIB python3.9)
set(AR_PYTHON_LIB_NUMBER python39)
endif()
endif()

if (WIN32)
set(AR_PYTHON_LIB_DIR ${AR_HOUDINI_ROOT}/${AR_PYTHON_LIB_NUMBER}/libs)
set(AR_PYTHON_LIB_SITEPACKAGES ${AR_HOUDINI_ROOT}/${AR_PYTHON_LIB_NUMBER}/lib/site-packages)
Expand All @@ -111,9 +130,14 @@ project(${AR_PROJECT_NAME} VERSION 1.0.0 LANGUAGES CXX)
### CPP Settings ###
set(BUILD_SHARED_LIBS ON)
# Preprocessor Defines (Same as #define)
add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=0 HBOOST_ALL_NO_LIB BOOST_ALL_NO_LIB)
add_compile_definitions(HBOOST_ALL_NO_LIB BOOST_ALL_NO_LIB)
if (WIN32)
add_compile_definitions(NOMINMAX)
else()
# Notes:
# Houdini 20 - Switched to the new C++11 ABI for Linux https://www.sidefx.com/docs/houdini/news/20/platforms.html
# For Houdini versions that use gcc 9.3, please set this to _GLIBCXX_USE_CXX11_ABI=0
add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=1)
endif()
# Compiler Options
# This is the same as set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHBOOST_ALL_NO_LIB -D_GLIBCXX_USE_CXX11_ABI=0")
Expand Down
11 changes: 11 additions & 0 deletions docs/src/installation/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ set RESOLVER_NAME=fileResolver
## Running the build
To run the build, run:

~~~admonish warning title="Houdini GCC ABI Change"
Starting with Houdini 20, SideFX is offering gcc 11 builds. Our automatic builds use this version.
If you still want to use gcc 9, then you'll have to set the below in our main CMakeLists.txt file.
See the official [Release Notes](https://www.sidefx.com/docs/houdini/news/20/platforms.html) for more information.
```bash
...
add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=0)
...
```
~~~

~~~admonish info title=""
```bash
# Linux
Expand Down
2 changes: 1 addition & 1 deletion setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ then
export RESOLVER_NAME=cachedResolver
export RESOLVER_NAME_UPPERCASE=$(echo ${RESOLVER_NAME} | tr '[:lower:]' '[:upper:]')
# Source Houdini (This defines what Houdini version to compile against)
pushd /opt/hfs19.5 > /dev/null
pushd /opt/hfs20.0 > /dev/null
source houdini_setup
popd > /dev/null
export HOUDINI_LMINFO_VERBOSE=1
Expand Down

0 comments on commit d299f8e

Please sign in to comment.