Skip to content

Commit

Permalink
Release v23.03 (#74)
Browse files Browse the repository at this point in the history
* Added libXt as a pre-required library on Linux

MaterialX (MaterialXRenderHw) requires libXt to build. Ubuntu 20.04 may have it installed with system installation. To be safe, I added it in the doc so users can build MaterialX without the missing libXt error.

* OGSMOD-2637: Fixed deployHdAurora of building and running usdview

* OGSMOD-2642: Improved error message on missing Windows SDK

* Fix typo in README.md

* Fix CMake error message

* Disable failed cases that cause CI/CD errors (#53)

* Disable failed cases

* Minor fixes in documentation

* Fix typos

* OGSMOD-2658: Refactored the externals to install to individual prefix location

Each and every external library will be installed to its own installation
path. This allows an easy override with <pkg>_ROOT for users to use their
own external libraries.

NOTE: this commit breaks the Aurora build

* OGSMOD-2679: Upgraded Aurora build scripts to support multi-config build in Visual Studio

- Updated cmake files to work with the new externals layout
- An externals config file is auto-generated by installExternals.py for easy
  configuration with 'cmake -S . -B Build'.
- Created patches for OpenImageIO and USD to support multi-config build.
- Created customized find modules of USD, TBB and OpenSubdiv to support
  multi-config build.

* OGSMOD-2679: Updated findNRD/NRI to support multi-config build

* OGSMOD-2679: Improved of the build scripts and the end message of the external script

* OGSMOD-2680: Fixed the Linux build with changes of the multi-config support

- Fixed the cmake files to build on Linux
- Preset the patch file to always have LF line-ending to fix the patching
  errors.
- Updated the default externals config

* OGSMOD-2681: Updated README.md to sync with the changes of the Aurora build scripts

* Windows pipeline for Aurora Build/Test in CI/CD (#55)

* Windows pipeline for Aurora Build/Test in CI/CD

* Move build instructions to a separate file

* Removed RelWithDebInfo from the build variants of installExternals.py

* Added error checking on missing the externals config file

Existing users who ran installExternals.py do not have the externals
config file. The old externals installation is not compatible to the
current build scripts. This error reminds users to re-run the install
script.

* OGSMOD-2803: Fixed the build error with ENABLE_HGI_BACKEND=ON on Windows

* OGSMOD-2704: Built usdview by installExternals.py

- Updated externals script to build USD with python
- Built usdview as well
- Updated cmake scripts to build Aurora with the updated USD build
- Deployed usdview (and other USD executables) with HdAurora after HdAurora is built.

Batch codes to build Aurora/externals and run usdview:
set BUILD_TYPE=Release
set BUILD_DIR=Build.release
set EXTERNALS_DIR=%HOME%\AuroraExternals.release
python Scripts\installExternals.py --build-variant %BUILD_TYPE% "%EXTERNALS_DIR%"
cmake -S . -B %BUILD_DIR%
cmake --build %BUILD_DIR% --config %BUILD_TYPE%
set PYTHONPATH=%cd%\%BUILD_DIR%\bin\%BUILD_TYPE%\python
set PATH=%PATH%;%cd%\%BUILD_DIR%\bin\%BUILD_TYPE%
usdview model.usd

Note usdview only works with the release build of USD. Aurora builds
the debug build USD with the 'd' suffixed to the dlls. Since usdview
hardcodes the loaded dlls without suffix 'd', it cannot load the needed
dlls.

* OGSMOD-2859: Support building on Ubuntu 22.04

With
  gcc 11.3.0
  clang 14.0.0

We need boost 1.78 to build on newer compiler.

The script to build Aurora:
```
BUILD_TYPE=Release
BUILD_DIR=Build.$BUILD_TYPE
EXTERNALS_DIR=AuroraExternals.$BUILD_TYPE

CC=gcc CXX=g++ compiler=gcc python Scripts/installExternals.py -v --build-variant $BUILD_TYPE "$EXTERNALS_DIR"
CC=clang CXX=clang++ compiler=clang cmake -S . -B $BUILD_DIR -D CMAKE_BUILD_TYPE=$BUILD_TYPE -D ENABLE_HGI_BACKEND=ON
CC=clang CXX=clang++ compiler=clang cmake --build $BUILD_DIR
```

* OGSMOD-2875: Fixed the HdAurora build on system with multiple installed Pythons

* OGSMOD-2858: updated the doc on how to run usdview within the Aurora build tree

* Fix CI/CD build errors (#64)

We get type conversion warnings treated as errors.
Its because we get the master version of STB in installExternals: 
and there was a change in STB that introduced the warning, hence the problem
So we disable the warning 4244 to fix the error

Co-authored-by: svc_ogs_td <svc_ogs_td@autodesk.com>

* OGSMOD-2616 : Windows pipeline for Aurora simple deploy in CI/CD (#63)

* Windows pipeline for Aurora simple deploy in CI/CD

* OGSMOD-3009: upgrade zlib to 1.2.13 (security patch)

* OGSMOD-2990: Clone STB using an explicit SHA

This commit fixed the issue of "changing" master HEAD of STB.

* OGSMOD-3083: Picking the correct python version from the USD/boost

This commit solve the potential version mismatching issue of python
between Aurora and USD/boost.

* Merge from main->dev to remove conflicts (#73)

Correct dev history by merging main.

* Add prerequisites to build documentation (#68)

* Add prerequisites to build documentation

* Fix typo

* Add Linux

* Add dependency checking to installExternals.py (#75)

* Fix typo

* Add versioning

* Remove spew

* Add comments

* Use hash not URL

Co-authored-by: Andy Shiue <andy.shiue@autodesk.com>
Co-authored-by: Mauricio Vives <mauricio.vives@autodesk.com>
Co-authored-by: Liwei Zhan <liwei.zhan@autodesk.com>
Co-authored-by: Andy Shiue <andy.shiue@moiggi.com>
Co-authored-by: svc_ogs_td <svc_ogs_td@autodesk.com>
  • Loading branch information
6 people authored and GitHub Enterprise committed Mar 24, 2023
1 parent acf5513 commit 5ad8c8a
Show file tree
Hide file tree
Showing 11 changed files with 433 additions and 80 deletions.
32 changes: 30 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,25 @@ project(Aurora VERSION 0.0.0.1)

set(AURORA_ROOT_DIR ${PROJECT_SOURCE_DIR})

# install path if the user did not explicitly specify one.
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "${PROJECT_BINARY_DIR}/Installed" CACHE PATH "..." FORCE)
endif()

# Set the default install directories
set(INSTALL_BIN "$<CONFIG>/bin")
set(INSTALL_LIB "$<CONFIG>/lib")
set(INSTALL_INC "$<CONFIG>/include")

# Set the default output directories
set(RUNTIME_OUTPUT_DIR "${PROJECT_BINARY_DIR}/bin/$<CONFIG>")
set(LIBRARY_OUTPUT_DIR "${PROJECT_BINARY_DIR}/lib/$<CONFIG>")

add_custom_target(MakeRuntimeDir ALL
COMMAND ${CMAKE_COMMAND} -E make_directory ${RUNTIME_OUTPUT_DIR}
)
set_property(TARGET MakeRuntimeDir PROPERTY FOLDER "Deployment")

# Set scripts folder.
set(SCRIPTS_DIR ${AURORA_ROOT_DIR}/Scripts)

Expand All @@ -25,6 +40,10 @@ list(APPEND CMAKE_MODULE_PATH
"${SCRIPTS_DIR}/cmake/modules"
)

option(ENABLE_TESTS "Build unit tests" ON)
option(ENABLE_APPLICATIONS "Build Applications" ON)
option(ENABLE_USDVIEW "Build usdview with python" ON)

# Import the cmake utility functions
include(toolbox)

Expand All @@ -51,6 +70,8 @@ if(MSVC)
add_compile_options(/W4 /WX -wd4068) # -wd4068 disables unknown-pragmas warnings
# Enable multiple-processor compilation
add_compile_options(/MP)
# Add INSTALL project to solution by default.
set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1)
else()
# Enables strict standard conformance and warning as errors
add_compile_options(-Wall -Wextra -Wpedantic -Werror -Wno-unknown-pragmas -Wno-gnu-zero-variadic-macro-arguments)
Expand Down Expand Up @@ -78,5 +99,12 @@ else()
endif()

add_subdirectory(Libraries)
add_subdirectory(Tests)
add_subdirectory(Applications)

# Unit tests
if (ENABLE_TESTS)
add_subdirectory(Tests)
endif()

if (ENABLE_APPLICATIONS)
add_subdirectory(Applications)
endif()
34 changes: 34 additions & 0 deletions Doc/Build.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,38 @@
# Building

## Prerequisites

Several prerequisites must be installed before building Aurora.

### Windows
On windows the following packages should be installed and added to the system PATH environment variable:
* Microsoft Visual Studio 2019 (https://my.visualstudio.com/Downloads?q=visual%20studio%202019)
* CMake 3.26.11 (https://github.com/Kitware/CMake/releases/download/v3.26.1/cmake-3.26.1-windows-x86_64.msi)
* Python 3.9.13 (https://www.python.org/downloads/release/python-3913/)
* PySide6 python package (install with `pip3 install pyside6`)
* PyOpenGL python package (install with `pip3 install PyOpenGL`)
* NASM 2.16 (https://www.nasm.us/pub/nasm/releasebuilds/2.16.01/win64/nasm-2.16.01-installer-x64.exe)
* Vulkan SDK (https://vulkan.lunarg.com/sdk/home#windows). Should be accessible via the VULKAN_SDK environment variable.

### Linux
The following dependencies are required on Linux. The versions listed are the recommended version for Ubuntu 20.04:
* zlib1g-dev: 1.2.11
* libjpeg-turbo8-dev: 2.0.3
* libtiff-dev: 4.1.0
* libpng-dev: 1.6.37
* libglm-dev: 0.9.9.7
* libglew-dev: 2.1.0
* libglfw3-dev: 3.3.2
* libgtest-dev: 1.10.0
* libgmock-dev: 1.10.0

On Ubuntu 20.04, these can be installed with the following Advanced Package Tool command:
```
sudo apt-get -y install zlib1g-dev libjpeg-turbo8-dev libtiff-dev libpng-dev libglm-dev libglew-dev libglfw3-dev libgtest-dev libgmock-dev
```

## Building Aurora

Aurora includes a script that retrieves and builds dependencies ("externals") from source. This script is based on the [USD build script](https://github.com/PixarAnimationStudios/USD/tree/release/build_scripts). CMake is used to build Aurora directly, or to create an IDE project which can then be used to build and debug Aurora.

1. **Download or clone** the contents of this repository to a location of your choice. Cloning with Git is not strictly necessary as Aurora does not currently use submodules. We refer to this location as *AURORA_DIR*.
Expand Down
28 changes: 24 additions & 4 deletions Doc/HdAurora.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,39 @@ Once **HdAurora** has been deployed to your USD folder you can select HdAurora i
<img src="RendererMenu.jpg" width="50%;" />

## Deploying HdAurora
In this section, we explain how to run usdview using HdAurora with the default Aurora build, and how to deploy HdAurora to a custom USD installation if it is preferred. The commands in this section require "x64 Native Tools Command Prompt for VS 2019".

The provided Python script [deployHdAurora.py](../Scripts/deployHdAurora.py) can be used to deploy **HdAurora** to a USD installation. This can also create a new USD installation if one does not exist, using the `--build` option.
### Running usdview with Default Aurora Build
If Aurora is built with the default build steps, **usdview** and required USD binaries are automatically deployed with HdAurora binaries. Assuming the root of Aurora source tree is *AURORA_ROOT*, the following build steps deploy **usdview** automatically:
```
cd %AURORA_ROOT%
python Scripts\installExternals.py --build-variant Release ..\AuroraExternals
cmake -S . -B Build
cmake --build Build --config Release
```
Before running **usdview** with **HdAurora**, you need to configure the run environment with:
```
set PYTHONPATH=%AURORA_ROOT%\Build\bin\Release\python
set PATH=%PATH%;%AURORA_ROOT%\Build\bin\Release
```
To render the [Autodesk Telescope USD model](https://drive.google.com/file/d/1RM09qDOGcRinLJTbXCsiRfQrHmKA-1aN/view?usp=share_link) with **HdAurora**, simply extract the ZIP file into *ASSET_DIR*, and run the following command.
```
usdview %ASSET_DIR%\AutodeskTelescope.usda --renderer=Aurora
```

Run the following command to create a new USD installation located at *..\USD* relative to the Aurora repository root and deploy **HdAurora** to it. Creating a new USD installation requires a command prompt with compiler tools, such as "x64 Native Tools Command Prompt for VS 2019", and should be run from the root of the Aurora repository. This will take about 30 minutes to complete and will require 10 GB of disk space.
### Deploying HdAurora to Custom USD Installation
For users who want to use their own USD build, Aurora provides [deployHdAurora.py](../Scripts/deployHdAurora.py) to deploy **HdAurora** to the custom USD installation. [deployHdAurora.py](../Scripts/deployHdAurora.py) can also create a new USD installation if one does not exist, using the `--build` option.

Run the following command to build a new USD installation located at *..\USD* relative to the the root of Aurora source tree ( *AURORA_ROOT*). This will take about 30 minutes to complete and will require 10 GB of disk space.
```
cd %AURORA_ROOT%
python Scripts\deployHdAurora.py ..\USD --externals_folder=..\AuroraExternals --config=Release --build
```

You can then run **usdview** from the *bin* subdirectory within that installed USD directory. The example command below loads the [Autodesk Telescope USD model](https://drive.google.com/file/d/1RM09qDOGcRinLJTbXCsiRfQrHmKA-1aN/view?usp=share_link); simply extract the ZIP file into a directory, referred to as *ASSET_DIR* below.
You can then run **usdview** from the *bin* subdirectory within that installed USD directory. To render the [Autodesk Telescope USD model](https://drive.google.com/file/d/1RM09qDOGcRinLJTbXCsiRfQrHmKA-1aN/view?usp=share_link) with **HdAurora**, simply extract the ZIP file into *ASSET_DIR* and run the following commands.

```
cd ..\USD\bin
python usdview {ASSET_DIR}\AutodeskTelescope.usda --renderer=Aurora
usdview %ASSET_DIR%\AutodeskTelescope.usda --renderer=Aurora
```

5 changes: 5 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ def windowsBuild() {
if not exist ${EXTERNALS_DIR}\\nasm-2.15.05 call 7z x -y -aoa ${EXTERNALS_DIR}\\nasm-2.15.05-win64.zip -o${EXTERNALS_DIR}
call set PATH=${EXTERNALS_DIR}\\nasm-2.15.05;%PATH%
:: Set up Pyside6/PyOpenGL
call python -m pip install --upgrade pip
call python -m pip install PySide6
call python -m pip install PyOpenGL
:: Set up Vulkan SDK
:: We need to install Vulkan SDK silently. For more details please refer to https://vulkan.lunarg.com/doc/view/latest/windows/getting_started.html
if not exist ${EXTERNALS_DIR}\\VulkanSDK-1.3.231.1-Installer.exe call curl -o ${EXTERNALS_DIR}\\VulkanSDK-1.3.231.1-Installer.exe https://sdk.lunarg.com/sdk/download/1.3.231.1/windows/VulkanSDK-1.3.231.1-Installer.exe
Expand Down
16 changes: 9 additions & 7 deletions Libraries/Aurora/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,6 @@ source_group("DirectX/Shaders" FILES ${DIRECTX_PRECOMPILED_SHADERS})
source_group("HGI/Shaders" FILES ${HGI_SHADERS})

if(WIN32)
add_custom_target(MakeRuntimeDir ALL
COMMAND ${CMAKE_COMMAND} -E make_directory ${RUNTIME_OUTPUT_DIR}
)
set_property(TARGET MakeRuntimeDir PROPERTY FOLDER "Deployment")

if(ENABLE_DIRECTX_BACKEND)
# Create custom targets that will copy DLLs of the DirectX shader compiler to the runtime folder.
add_custom_target(CopyDXCompilerDLLs ALL
Expand Down Expand Up @@ -328,8 +323,8 @@ if(WIN32)
# Copy additional HGI files of the Pixar USD to our runtime directory
add_custom_target(CopyUSDDLLs ALL
COMMAND ${CMAKE_COMMAND} -E make_directory ${RUNTIME_OUTPUT_DIR}/usd/hgiVulkan/resources
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${pxr_DIR}/lib/usd/plugInfo.json ${RUNTIME_OUTPUT_DIR}/usd
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${pxr_DIR}/lib/usd/hgiVulkan/resources/plugInfo.json ${RUNTIME_OUTPUT_DIR}/usd/hgiVulkan/resources
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PXR_LIBRARY_DIR}/usd/plugInfo.json ${RUNTIME_OUTPUT_DIR}/usd
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PXR_LIBRARY_DIR}/usd/hgiVulkan/resources/plugInfo.json ${RUNTIME_OUTPUT_DIR}/usd/hgiVulkan/resources
)
set_property(TARGET CopyUSDDLLs PROPERTY FOLDER "Deployment")
add_dependencies(CopyUSDDLLs MakeRuntimeDir)
Expand Down Expand Up @@ -425,3 +420,10 @@ if(ENABLE_DIRECTX_BACKEND)

# TODO: do we have Vulkan computer shaders amd need to do similiar things for them?
endif()

install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION "${INSTALL_BIN}"
ARCHIVE DESTINATION "${INSTALL_LIB}"
LIBRARY DESTINATION "${INSTALL_LIB}"
COMPONENT ${PROJECT_NAME}
)
5 changes: 5 additions & 0 deletions Libraries/Aurora/Source/AssetManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@

// Include STB for image loading.
// TODO: Image loading will eventually be handled by clients.
#pragma warning(push)
// Disabe type conversion warnings intruduced from stb master.
// refer to the commit in stb https://github.com/nothings/stb/commit/b15b04321dfd8a2307c49ad9c5bf3c0c6bcc04cc
#pragma warning(disable : 4244)
#define STB_IMAGE_IMPLEMENTATION
#include <stb_image.h>
#pragma warning(pop)

BEGIN_AURORA

Expand Down
40 changes: 39 additions & 1 deletion Libraries/HdAurora/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,42 @@ PRIVATE
)

# Add default compile definitions (set in root CMakefile)
target_compile_definitions(${PROJECT_NAME} PRIVATE ${DEFAULT_COMPILE_DEFINITIONS})
target_compile_definitions(${PROJECT_NAME} PRIVATE ${DEFAULT_COMPILE_DEFINITIONS})

if(WIN32)
# Create a custom target that will copy USD executables to the runtime folder.
file(GLOB USD_EXECUTABLES ${pxr_ROOT}/bin/*)
set(USD_PYTHON_LIB_DIR "${pxr_ROOT}/lib/python")
set(USD_LIB_PLUGIN_DIR "${pxr_ROOT}/lib/usd")
set(USD_PLUGIN_DIR "${pxr_ROOT}/plugin/usd")
add_custom_target(CopyUSDExecutables ALL
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${USD_EXECUTABLES} ${RUNTIME_OUTPUT_DIR}
COMMAND ${CMAKE_COMMAND} -E copy_directory ${USD_LIB_PLUGIN_DIR} ${RUNTIME_OUTPUT_DIR}/usd
COMMAND ${CMAKE_COMMAND} -E copy_directory ${USD_PLUGIN_DIR} ${RUNTIME_OUTPUT_DIR}/usd
)
set_property(TARGET CopyUSDExecutables PROPERTY FOLDER "Deployment")
add_dependencies(CopyUSDExecutables MakeRuntimeDir)
add_dependencies(${PROJECT_NAME} CopyUSDExecutables)

if(ENABLE_USDVIEW)
add_custom_target(CopyUSDPythonExecutables ALL
COMMAND ${CMAKE_COMMAND} -E copy_directory ${USD_PYTHON_LIB_DIR} ${RUNTIME_OUTPUT_DIR}/python
)
set_property(TARGET CopyUSDPythonExecutables PROPERTY FOLDER "Deployment")
add_dependencies(CopyUSDPythonExecutables MakeRuntimeDir)
add_dependencies(${PROJECT_NAME} CopyUSDPythonExecutables)
endif()

set(HDAURORA_PLUGIN_RESOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/resources)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:${PROJECT_NAME}> $<$<CONFIG:Debug>:$<TARGET_PDB_FILE:${PROJECT_NAME}>> ${RUNTIME_OUTPUT_DIR}/usd
COMMAND ${CMAKE_COMMAND} -E copy_directory ${HDAURORA_PLUGIN_RESOURCES_DIR} ${RUNTIME_OUTPUT_DIR}/usd/hdAurora/resources
)

else() # Linux
#TODO anything we need to set to support the Aurora execution?
endif()

# Install the binaries.
install(TARGETS ${PROJECT_NAME} DESTINATION ${INSTALL_BIN}/usd)
install(FILES "resources/plugInfo.json" DESTINATION ${INSTALL_BIN}/usd/hdAurora/resources)
Loading

0 comments on commit 5ad8c8a

Please sign in to comment.