Skip to content

Commit

Permalink
AssImp 5.4.3: Universal Scene Description (USD) (#264)
Browse files Browse the repository at this point in the history
Migrating to AssImp 5.4.3 
- Enabling USD (AssImp's USD imports TinyUSDZ which compiles with
warnings, so had to turn off compiler warnings as errors)
 - Disable building tools as they aren't required (assimp.exe)
- Making sure installation scripts works. Build scripts and installer
scripts were looking in different folders (src vs build folder)
- Long term it would be better update scripts built into a separate
"build" folder.


![image](https://github.com/user-attachments/assets/81c6a103-b7c5-455e-9362-a1f2b91a464a)

---------

Signed-off-by: AMZN-Gene <[email protected]>
Signed-off-by: Gene Walters <[email protected]>
  • Loading branch information
AMZN-Gene authored Oct 2, 2024
1 parent d727740 commit 11c082c
Show file tree
Hide file tree
Showing 14 changed files with 46 additions and 47 deletions.
6 changes: 5 additions & 1 deletion package-system/assimp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,13 @@ RUN apt-get install -y build-essential \
pkg-config \
libminizip-dev \
git \
cmake \
ninja-build

# Use python-pip to pull CMake.
# 20.04 Ubuntu apt-get comes with CMake 3.16, but Assimp requires CMake 3.22+
RUN apt-get -y install python3-pip
RUN pip install cmake --upgrade

RUN apt upgrade -y

# Prepare a target folder within the container to install the build artifacts tp
Expand Down
8 changes: 4 additions & 4 deletions package-system/assimp/Findassimplib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ set(${LIB_NAME}_BIN_DIR ${CMAKE_CURRENT_LIST_DIR}/assimp/bin)
set(${LIB_NAME}_LIBS_DIR ${CMAKE_CURRENT_LIST_DIR}/assimp/lib)

if (${PAL_PLATFORM_NAME} STREQUAL "Linux")
set(${LIB_NAME}_LIBRARY_DEBUG ${${LIB_NAME}_BIN_DIR}/libassimp.so.5.2.4)
set(${LIB_NAME}_LIBRARY_RELEASE ${${LIB_NAME}_BIN_DIR}/libassimp.so.5.2.4)
set(${LIB_NAME}_LIBRARY_DEBUG ${${LIB_NAME}_BIN_DIR}/libassimp.so.5.4.3)
set(${LIB_NAME}_LIBRARY_RELEASE ${${LIB_NAME}_BIN_DIR}/libassimp.so.5.4.3)
set(${LIB_NAME}_STATIC_LIBRARY_DEBUG ${${LIB_NAME}_LIBS_DIR}/libassimp.a)
set(${LIB_NAME}_STATIC_LIBRARY_RELEASE ${${LIB_NAME}_LIBS_DIR}/libassimp.a)
elseif (${PAL_PLATFORM_NAME} STREQUAL "Mac")
set(${LIB_NAME}_LIBRARY_DEBUG ${${LIB_NAME}_BIN_DIR}/libassimp.5.2.4.dylib)
set(${LIB_NAME}_LIBRARY_RELEASE ${${LIB_NAME}_BIN_DIR}/libassimp.5.2.4.dylib)
set(${LIB_NAME}_LIBRARY_DEBUG ${${LIB_NAME}_BIN_DIR}/libassimp.5.4.3.dylib)
set(${LIB_NAME}_LIBRARY_RELEASE ${${LIB_NAME}_BIN_DIR}/libassimp.5.4.3.dylib)
set(${LIB_NAME}_STATIC_LIBRARY_DEBUG ${${LIB_NAME}_LIBS_DIR}/libassimp.a)
set(${LIB_NAME}_STATIC_LIBRARY_RELEASE ${${LIB_NAME}_LIBS_DIR}/libassimp.a)
elseif (${PAL_PLATFORM_NAME} STREQUAL "Windows")
Expand Down
2 changes: 1 addition & 1 deletion package-system/assimp/PackageInfo.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"PackageName": "assimp-5.2.5-rev1",
"PackageName": "assimp-5.4.3-rev1",
"URL": "https://github.com/assimp/assimp/blob/master/LICENSE",
"License": "BSD-3-Clause",
"LicenseFile": "LICENSE"
Expand Down
25 changes: 8 additions & 17 deletions package-system/assimp/build_assimp_unix_like.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
#
#

cmake_base_command="cmake -S temp/src -B temp/src -DCMAKE_BUILD_TYPE=Release -DCMAKE_MODULE_PATH=\"$DOWNLOADED_PACKAGE_FOLDERS\" -DASSIMP_BUILD_ZLIB=OFF"
# -Wno-error, turning off warnings as errors because Assimp uses TinyUSDZ for USD support which has compiler warnings.
cmake_base_command="cmake -S temp/src -B temp/src temp/src/CMakeLists.txt -DCMAKE_BUILD_TYPE=Release -DCMAKE_MODULE_PATH=\"$DOWNLOADED_PACKAGE_FOLDERS\" -DASSIMP_BUILD_ZLIB=OFF -DASSIMP_BUILD_ASSIMP_TOOLS=OFF -DASSIMP_HUNTER_ENABLED=OFF -DASSIMP_BUILD_USD_IMPORTER=ON -DASSIMP_WARNINGS_AS_ERRORS=OFF -DASSIMP_BUILD_TESTS=ON -DCMAKE_CXX_FLAGS=\"-Wno-unused-const-variable -Wno-error\""

# On Mac, load the toolchain file to make sure
# the build matches compatibility with other Mac libraries
Expand All @@ -17,27 +18,17 @@ then
cmake_base_command+=" -DCMAKE_TOOLCHAIN_FILE=$PWD/../../Scripts/cmake/Platform/Mac/Toolchain_mac.cmake"
fi

cmake_no_shared_libs="$cmake_base_command -DBUILD_SHARED_LIBS=OFF -DASSIMP_BUILD_ASSIMP_TOOLS=ON"
cmake_shared_libs="$cmake_base_command -DBUILD_SHARED_LIBS=ON -DASSIMP_BUILD_ASSIMP_TOOLS=ON"
cmake_no_shared_libs="$cmake_base_command -DBUILD_SHARED_LIBS=OFF"
cmake_shared_libs="$cmake_base_command -DBUILD_SHARED_LIBS=ON"

echo "Running first cmake command:"
echo "$cmake_no_shared_libs"

eval "$cmake_no_shared_libs temp/src/CMakeLists.txt" || exit 1
cmake --build temp/build --config release || exit 1
eval "$cmake_no_shared_libs" || exit 1
cmake --build temp/src --config release || exit 1

echo "Running second cmake command:"
echo "$cmake_shared_libs"

eval "$cmake_shared_libs temp/src/CMakeLists.txt" || exit 1
cmake --build temp/build --config release || exit 1

mkdir temp/build/port/
cp -R temp/src/port/PyAssimp temp/build/port/

if [ "$(uname)" = "Darwin" ];
then
# Printing the minimum OS version here can save some time debugging.
echo "Min OS version:"
otool -l temp/src/bin/assimp | grep -i minos
fi
eval "$cmake_shared_libs" || exit 1
cmake --build temp/src --config release || exit 1
16 changes: 12 additions & 4 deletions package-system/assimp/build_assimp_windows.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,30 @@
@rem # cmake expects fowardslashes:
set "DOWNLOADED_PACKAGE_FOLDERS=%DOWNLOADED_PACKAGE_FOLDERS:\=/%"

cmake -S temp/src ^
@rem # /w compiler option. Assimp USD is implemented using TinyUSDZ which, unfortunately, contains compiler warnings
cmake -S temp/src -G "Visual Studio 17" ^
-DBUILD_SHARED_LIBS=OFF ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_MODULE_PATH="%DOWNLOADED_PACKAGE_FOLDERS%" ^
-DASSIMP_BUILD_ZLIB=OFF ^
-DASSIMP_BUILD_ASSIMP_TOOLS=ON ^
-DASSIMP_BUILD_ASSIMP_TOOLS=OFF ^
-DASSIMP_BUILD_USD_IMPORTER=ON ^
-DASSIMP_WARNINGS_AS_ERRORS=OFF ^
-DCMAKE_CXX_FLAGS="/EHsc /w" ^
temp/src/CMakeLists.txt || exit /b 1
cmake --build temp/src --config release || exit /b 1
cmake --build temp/src --config debug || exit /b 1

cmake -S temp/src ^
@rem # /w compiler option. Assimp USD is implemented using TinyUSDZ which, unfortunately, contains compiler warnings
cmake -S temp/src -G "Visual Studio 17" ^
-DBUILD_SHARED_LIBS=ON ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_MODULE_PATH="%DOWNLOADED_PACKAGE_FOLDERS%" ^
-DASSIMP_BUILD_ZLIB=OFF ^
-DASSIMP_BUILD_ASSIMP_TOOLS=ON ^
-DASSIMP_BUILD_ASSIMP_TOOLS=OFF ^
-DASSIMP_BUILD_USD_IMPORTER=ON ^
-DASSIMP_WARNINGS_AS_ERRORS=OFF ^
-DCMAKE_CXX_FLAGS="/EHsc /w" ^
temp/src/CMakeLists.txt || exit /b 1
cmake --build temp/src --config release || exit /b 1
cmake --build temp/src --config debug || exit /b 1
Expand Down
5 changes: 2 additions & 3 deletions package-system/assimp/build_config.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
{
"git_url":"https://github.com/assimp/assimp",
"git_tag": "v5.2.5",
"git_tag": "v5.4.3",
"package_name":"assimp",
"package_version":"5.2.5-rev1",
"package_version":"5.4.3-rev1",
"package_url":"https://github.com/assimp/assimp",
"package_license":"BSD-3-Clause",
"package_license_file":"LICENSE",
"cmake_find_source":"Findassimplib.cmake",
"cmake_find_target":"Findassimplib.cmake",
"patch_file" : "O3DE-fixes-applied-on-top-of-v5.2.5.patch",
"Platforms":{
"Windows":{
"Windows":{
Expand Down
4 changes: 2 additions & 2 deletions package-system/assimp/docker_build_assimp_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ echo "Working with Assimp commit hash ${GIT_HASH}"
echo "Using custom zlib (shared) library at /data/workspace/${ZLIB_LIB_PATH}"


cmake -S . -B /data/workspace/build -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_MODULE_PATH="/data/workspace/${ZLIB_LIB_PATH}" -DASSIMP_BUILD_ZLIB=ON -DBUILD_SHARED_LIBS=ON -DASSIMP_BUILD_ASSIMP_TOOLS=ON ${AARCH64_FLAGS}
cmake -S . -B /data/workspace/build -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_MODULE_PATH="/data/workspace/${ZLIB_LIB_PATH}" -DASSIMP_BUILD_ZLIB=ON -DBUILD_SHARED_LIBS=ON -DASSIMP_BUILD_ASSIMP_TOOLS=OFF -DASSIMP_BUILD_USD_IMPORTER=ON -DASSIMP_WARNINGS_AS_ERRORS=OFF -DCMAKE_CXX_FLAGS="-Wno-sign-compare -Wno-maybe-uninitialized" ${AARCH64_FLAGS}
if [ $? -ne 0 ]
then
echo "Failed generating cmake project for assimp/shared."
Expand All @@ -49,7 +49,7 @@ fi

echo "Using custom zlib (static) library at /data/workspace/${ZLIB_LIB_PATH}"

cmake -S . -B /data/workspace/build -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_MODULE_PATH="/data/workspace/${ZLIB_LIB_PATH}" -DASSIMP_BUILD_ZLIB=ON -DBUILD_SHARED_LIBS=OFF -DASSIMP_BUILD_ASSIMP_TOOLS=ON ${AARCH64_FLAGS}
cmake -S . -B /data/workspace/build -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_MODULE_PATH="/data/workspace/${ZLIB_LIB_PATH}" -DASSIMP_BUILD_ZLIB=ON -DBUILD_SHARED_LIBS=OFF -DASSIMP_BUILD_ASSIMP_TOOLS=OFF -DASSIMP_BUILD_USD_IMPORTER=ON -DASSIMP_WARNINGS_AS_ERRORS=OFF -DCMAKE_CXX_FLAGS="-Wno-sign-compare -Wno-maybe-uninitialized" ${AARCH64_FLAGS}
if [ $? -ne 0 ]
then
echo "Failed generating cmake project for assimp/static."
Expand Down
3 changes: 1 addition & 2 deletions package-system/assimp/install_assimp_linux.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"Install_Paths": [
"include/",
"lib/libassimp.a",
"bin/assimp",
"bin/libassimp.so.5.2.4",
"bin/libassimp.so.5.4.3",
"bin/unit",
"port/PyAssimp/"
]
Expand Down
3 changes: 1 addition & 2 deletions package-system/assimp/install_assimp_mac.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
"Install_Paths": [
"include/",
"lib/libassimp.a",
"bin/libassimp.5.2.4.dylib",
"bin/libassimp.5.4.3.dylib",
"bin/libassimp.5.dylib",
"bin/libassimp.dylib",
"bin/assimp",
"bin/unit",
"port/PyAssimp/"
]
Expand Down
3 changes: 0 additions & 3 deletions package-system/assimp/install_assimp_windows.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@
"lib/Debug/assimp-vc143-mtd.lib",
"lib/Debug/assimp-vc143-mtd.pdb",
"lib/Release/assimp-vc143-mt.lib",
"bin/Release/assimp.exe",
"bin/Release/assimp-vc143-mt.dll",
"bin/Release/unit.exe",
"bin/Debug/assimpd.exe",
"bin/Debug/assimpd.pdb",
"bin/Debug/assimp-vc143-mtd.dll",
"bin/Debug/assimp-vc143-mtd.pdb",
"bin/Debug/unit.exe",
Expand Down
4 changes: 2 additions & 2 deletions package_build_list_host_darwin.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"comment3" : "build_from_folder is package name --> folder containing built image of package",
"comment4" : "Note: Build from source occurs before build_from_folder",
"build_from_source": {
"assimp-5.2.5-rev1-mac": "Scripts/extras/pull_and_build_from_git.py ../../package-system/assimp --platform-name Mac --package-root ../../package-system --clean",
"assimp-5.4.3-rev1-mac": "Scripts/extras/pull_and_build_from_git.py ../../package-system/assimp --platform-name Mac --package-root ../../package-system --clean",
"AWSNativeSDK-1.11.361-rev1-mac": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name Mac --package-root ../../package-system --clean",
"AWSNativeSDK-1.11.361-rev1-ios": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name iOS --package-root ../../package-system --clean",
"Lua-5.4.4-rev1-mac": "Scripts/extras/pull_and_build_from_git.py ../../package-system/Lua --platform-name Mac --package-root ../../package-system/Lua/temp --clean",
Expand Down Expand Up @@ -55,7 +55,7 @@
"expat-2.4.2-rev2-ios": "Scripts/extras/pull_and_build_from_git.py ../../package-system/expat --platform-name iOS --package-root ../../package-system/expat/temp --clean"
},
"build_from_folder": {
"assimp-5.2.5-rev1-mac": "package-system/assimp-mac",
"assimp-5.4.3-rev1-mac": "package-system/assimp-mac",
"AWSNativeSDK-1.11.361-rev1-mac": "package-system/AWSNativeSDK-mac",
"AWSNativeSDK-1.11.361-rev1-ios": "package-system/AWSNativeSDK-ios",
"AwsIotDeviceSdkCpp-1.15.2-rev2-mac": "package-system/AwsIotDeviceSdkCpp-mac",
Expand Down
4 changes: 2 additions & 2 deletions package_build_list_host_linux-aarch64.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"comment3" : "build_from_folder is package name --> folder containing built image of package",
"comment4" : "Note: Build from source occurs before build_from_folder",
"build_from_source": {
"assimp-5.2.5-rev1-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/assimp --platform-name Linux-aarch64 --clean",
"assimp-5.4.3-rev1-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/assimp --platform-name Linux-aarch64 --clean",
"astc-encoder-3.2-rev3-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/astc-encoder --platform-name Linux-aarch64 --clean",
"AWSGameLiftServerSDK-5.1.2-rev1-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSGameLiftServerSDK --platform-name Linux-aarch64 --clean",
"AwsIotDeviceSdkCpp-1.15.2-rev1-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AwsIotDeviceSdkCpp --platform-name Linux-aarch64 --clean",
Expand Down Expand Up @@ -45,7 +45,7 @@
"zlib-1.2.11-rev5-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/zlib --platform-name Linux-aarch64 --clean"
},
"build_from_folder": {
"assimp-5.2.5-rev1-linux-aarch64": "package-system/assimp/temp/assimp-linux-aarch64",
"assimp-5.4.3-rev1-linux-aarch64": "package-system/assimp/temp/assimp-linux-aarch64",
"astc-encoder-3.2-rev3-linux-aarch64": "package-system/astc-encoder/temp/astc-encoder-linux-aarch64",
"AWSGameLiftServerSDK-5.1.2-rev1-linux-aarch64": "package-system/AWSGameLiftServerSDK/temp/AWSGameLiftServerSDK-linux-aarch64",
"AwsIotDeviceSdkCpp-1.15.2-rev1-linux-aarch64": "package-system/AwsIotDeviceSdkCpp/temp/AwsIotDeviceSdkCpp-linux-aarch64",
Expand Down
6 changes: 4 additions & 2 deletions package_build_list_host_linux.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"comment3" : "build_from_folder is package name --> folder containing built image of package",
"comment4" : "Note: Build from source occurs before build_from_folder",
"build_from_source": {
"assimp-5.2.5-rev1-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/assimp --platform-name Linux --package-root ../../package-system --clean",
"assimp-5.4.3-rev1-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/assimp --platform-name Linux --package-root ../../package-system --clean",
"assimp-5.4.3-rev1-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/assimp --platform-name Linux-aarch64 --package-root ../../package-system --clean",
"AWSGameLiftServerSDK-5.1.2-rev1-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSGameLiftServerSDK --platform-name Linux --clean",
"AWSGameLiftServerSDK-5.1.2-rev1-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSGameLiftServerSDK --platform-name Linux-aarch64 --clean",
"AWSNativeSDK-1.11.361-rev1-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name Linux --clean",
Expand Down Expand Up @@ -52,7 +53,8 @@
"vulkan-validationlayers-1.2.198-rev1-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/vulkan-validationlayers --platform-name Linux --package-root ../../package-system/vulkan-validationlayers/temp --clean"
},
"build_from_folder": {
"assimp-5.2.5-rev1-linux": "package-system/assimp-linux",
"assimp-5.4.3-rev1-linux": "package-system/assimp-linux",
"assimp-5.4.3-rev1-linux-aarch64": "package-system/assimp-linux-aarch64",
"AWSGameLiftServerSDK-5.1.2-rev1-linux": "package-system/AWSGameLiftServerSDK/temp/AWSGameLiftServerSDK-linux",
"AWSGameLiftServerSDK-5.1.2-rev1-linux-aarch64": "package-system/AWSGameLiftServerSDK/temp/AWSGameLiftServerSDK-linux-aarch64",
"AWSNativeSDK-1.11.361-rev1-linux": "package-system/AWSNativeSDK/temp/AWSNativeSDK-linux",
Expand Down
4 changes: 2 additions & 2 deletions package_build_list_host_windows.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"comment3" : "build_from_folder is package name --> folder containing built image of package",
"comment4" : "Note: Build from source occurs before build_from_folder",
"build_from_source": {
"assimp-5.2.5-rev1-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/assimp --platform-name Windows --package-root ../../package-system --clean",
"assimp-5.4.3-rev1-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/assimp --platform-name Windows --package-root ../../package-system --clean",
"astc-encoder-3.2-rev2-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/astc-encoder --platform-name Windows --package-root ../../package-system --clean",
"azslc-1.8.22-rev1-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/azslc --platform-name Windows --package-root ../../package-system/azslc/temp --clean",
"AWSGameLiftServerSDK-5.1.2-rev1-windows": "package-system/AWSGameLiftServerSDK/build_package_image.py --platform-name windows",
Expand Down Expand Up @@ -66,7 +66,7 @@
},
"build_from_folder": {
"alembic-1.7.11-rev3-multiplatform": "package-system/alembic-multiplatform",
"assimp-5.2.5-rev1-windows": "package-system/assimp-windows",
"assimp-5.4.3-rev1-windows": "package-system/assimp-windows",
"astc-encoder-3.2-rev2-windows": "package-system/astc-encoder-windows",
"azslc-1.8.22-rev1-windows": "package-system/azslc/temp/azslc-windows",
"AWSGameLiftServerSDK-5.1.2-rev1-windows": "package-system/AWSGameLiftServerSDK-windows",
Expand Down

0 comments on commit 11c082c

Please sign in to comment.