Skip to content

Commit

Permalink
Merge pull request #729 from CesiumGS/update-cesium-native
Browse files Browse the repository at this point in the history
Updated to vcpkg version of cesium-native
  • Loading branch information
lilleyse authored Sep 13, 2024
2 parents 9a9b11d + 1aaf653 commit aaf0696
Show file tree
Hide file tree
Showing 39 changed files with 778 additions and 49 deletions.
2 changes: 2 additions & 0 deletions .github/actions/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ runs:
env:
CONAN_USER_HOME: $GITHUB_WORKSPACE
PM_PACKAGES_ROOT: $GITHUB_WORKSPACE/packman-repo
EZVCPKG_BASEDIR: $GITHUB_WORKSPACE/.ezvcpkg
VCPKG_TRIPLET: "x64-linux-omniverse"
args:
# Tell bash to run a command
- "-c"
Expand Down
25 changes: 24 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,28 @@ jobs:
path: ${{ env.CONAN_USER_HOME }}/.conan
key: conan-${{ matrix.config.name }}-${{ hashFiles('cmake/AddConanDependencies.cmake') }}-v3

# Tell ezvcpkg to look for or create its build folder (.ezvcpkg) in the repository's root directory
# This is partly done to make the directory easily accessible to Docker builds
# We only need a release build of vcpkg dependencies
- name: vcpkg Set build directory (Unix)
if: runner.os != 'Windows'
run: |
echo "EZVCPKG_BASEDIR=$GITHUB_WORKSPACE/.ezvcpkg" >> $GITHUB_ENV
echo "CESIUM_VCPKG_RELEASE_ONLY=TRUE" >> $GITHUB_ENV
- name: vcpkg Set build directory (Windows)
if: runner.os == 'Windows'
run: |
echo "EZVCPKG_BASEDIR=$env:GITHUB_WORKSPACE/.ezvcpkg" >> $env:GITHUB_ENV
echo "CESIUM_VCPKG_RELEASE_ONLY=TRUE" >> $env:GITHUB_ENV
- name: vcpkg Check cache
id: vcpkg-cache
uses: actions/cache@v3
with:
path: ${{ env.EZVCPKG_BASEDIR }}
key: vcpkg-${{ matrix.config.name }}-${{ hashFiles('vcpkg/ports/**/*', 'vcpkg/triplets/**/*') }}-${{ hashFiles('extern/cesium-native/CMakeLists.txt', 'CMakeLists.txt') }}

- name: Packman Check cache
id: packman-cache
uses: actions/cache@v3
Expand All @@ -112,11 +134,12 @@ jobs:
# Change the ownership from root to user for all files created by Docker in
# the Conan build directory so that the files can be cached without permission
# denied errors
- name: AlmaLinux Change Conan & Packman directory permissions
- name: AlmaLinux Change Conan, vcpkg, and Packman directory permissions
if: matrix.config.name == 'AlmaLinux 8 - GCC'
run: |
sudo chown -R $USER:$USER $CONAN_USER_HOME/.conan
sudo chown -R $USER:$USER $PM_PACKAGES_ROOT
sudo chown -R $USER:$USER $EZVCPKG_BASEDIR
- name: Install Linux dependencies
if: ${{ runner.os == 'Linux' && matrix.config.name != 'AlmaLinux 8 - GCC' }}
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ compile_commands.json
trace.json
trace.csv

# CI puts Conan in the project directory
.conan

# Clion Config
.idea

Expand Down
31 changes: 29 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,14 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCH
-Wconversion
-Wno-missing-field-initializers
-Wno-return-local-addr
-Wno-array-bounds # Ignore false positives in libstdc++ in GCC 13.1.1
-fstrict-aliasing
-fstrict-enums)

if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(CESIUM_OMNI_CXX_FLAGS ${CESIUM_OMNI_CXX_FLAGS} -Wno-stringop-overflow) # Ignore false positives in libstdc++ in GCC 13.1.1
endif()

if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
set(CESIUM_OMNI_CXX_FLAGS ${CESIUM_OMNI_CXX_FLAGS} -Wno-gnu-anonymous-struct)
endif()
Expand Down Expand Up @@ -393,7 +398,7 @@ endif()

# USD is compiled with the old C++ ABI so we need to compile our own code and external libraries
# with the old ABI. Only relevant for libraries that have std::string or std::list in their
# public interface, which includes cesium-native and cpr.
# public interface, which includes cesium-native and spdlog.
# See https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CESIUM_OMNI_CXX_DEFINES ${CESIUM_OMNI_CXX_DEFINES} _GLIBCXX_USE_CXX11_ABI=0)
Expand All @@ -418,6 +423,28 @@ set(CESIUM_OMNI_LINKER_FLAGS_DEBUG
${CESIUM_OMNI_LINKER_FLAGS_DEBUG}
CACHE STRING "Linker flags to use in debug mode." FORCE)

# vcpkg setup
set(VCPKG_OVERLAY_PORTS "${CMAKE_CURRENT_LIST_DIR}/vcpkg/ports")
set(VCPKG_OVERLAY_TRIPLETS "${CMAKE_CURRENT_LIST_DIR}/vcpkg/triplets")

include(${CMAKE_CURRENT_SOURCE_DIR}/extern/cesium-native/cmake/detect-vcpkg-triplet.cmake)

if (NOT VCPKG_TRIPLET)
if (DEFINED ENV{VCPKG_TRIPLET})
set(VCPKG_TRIPLET "$ENV{VCPKG_TRIPLET}")
elseif(DETECTED_VCPKG_TRIPLET_ERROR)
message(FATAL_ERROR "${DETECTED_VCPKG_TRIPLET_ERROR}")
else()
set(VCPKG_TRIPLET "${DETECTED_VCPKG_TRIPLET}-omniverse")
endif()
endif()

if (NOT EZVCPKG_BASEDIR)
if (DEFINED ENV{EZVCPKG_BASEDIR})
set(EZVCPKG_BASEDIR "$ENV{EZVCPKG_BASEDIR}")
endif()
endif()

# Third party dependencies not handled by conan
add_subdirectory(extern)

Expand All @@ -428,7 +455,7 @@ set(CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE)
find_package(Threads) # System threading library

# Conan libraries
find_package(cpr)
find_package(CURL)
find_package(doctest)
find_package(stb)
find_package(ZLIB)
Expand Down
8 changes: 0 additions & 8 deletions ThirdParty.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@
"version": "0.17.0",
"url": "https://github.com/conan-io/cmake-conan"
},
{
"name": "cpr",
"license": [
"MIT"
],
"version": "1.10.4",
"url": "https://docs.libcpr.org/"
},
{
"name": "glTF-Asset-Generator",
"license": [
Expand Down
1 change: 0 additions & 1 deletion cmake/AddConanDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
include(ConfigureConan)

set(REQUIRES
"cpr/1.10.4@#860d6cd6d8eb5f893e647c2fb016eb61"
"doctest/2.4.9@#ea6440e3cd544c9a25bf3a96bcf16f48"
"openssl/1.1.1w@#42c32b02f62aa987a58201f4c4561d3e"
"pybind11/2.10.1@#561736204506dad955276aaab438aab4"
Expand Down
14 changes: 13 additions & 1 deletion docker/AlmaLinux8.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ RUN dnf config-manager --set-enabled powertools
RUN dnf install -y -q \
git \
git-lfs \
python39 \
wget \
gcc-toolset-11 \
gcc-toolset-11-libubsan-devel \
Expand All @@ -24,6 +23,7 @@ RUN dnf install -y -q \
zlib-devel \
perl-Data-Dumper \
perl-Thread-Queue \
perl-IPC-Cmd \
wget \
openssl-devel \
bzip2-devel \
Expand All @@ -39,6 +39,18 @@ RUN dnf module install -y -q nvidia-driver:535-dkms
RUN echo "source /opt/rh/gcc-toolset-11/enable" >> /etc/bashrc
SHELL ["/bin/bash", "--login", "-c"]

# Install newer version of Python
RUN wget https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tgz && \
tar xzf Python-3.9.6.tgz && \
cd Python-3.9.6 && \
./configure --enable-optimizations --enable-loadable-sqlite-extensions && \
make altinstall && \
cd .. && \
rm Python-3.9.6.tgz && \
rm -rf Python-3.9.6 && \
ln -sf /usr/local/bin/python3.9 /usr/bin/python3 && \
ln -sf /usr/local/bin/pip3.9 /usr/bin/pip3

# Install newer version of CMake
RUN wget https://cmake.org/files/v3.24/cmake-3.24.2.tar.gz && \
tar xzf cmake-3.24.2.tar.gz && \
Expand Down
2 changes: 1 addition & 1 deletion docker/CI.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM cesiumgs/omniverse-almalinux8-build:2024-04-12
FROM cesiumgs/omniverse-almalinux8-build:2024-09-12

WORKDIR /var/app

Expand Down
1 change: 1 addition & 0 deletions docker/CentOS7.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ RUN yum install -y -q \
zlib-devel \
perl-Data-Dumper \
perl-Thread-Queue \
perl-IPC-Cmd \
wget \
openssl-devel \
bzip2-devel \
Expand Down
2 changes: 1 addition & 1 deletion docs/release-guide/push-docker-image.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ After making your changes to the docker file, execute:
docker build --tag cesiumgs/omniverse-almalinux8-build:$TAGNAME -f docker/AlmaLinux8.Dockerfile . --no-cache
```

You should replace `TAGNAME` with the current date in `YYYY-MM-DD` format. So if it's the 29th of August, 2023, you would use `2023-08-29`.
You should replace `$TAGNAME` with the current date in `YYYY-MM-DD` format. So if it's the 29th of August, 2023, you would use `2023-08-29`.

### Push the image to Docker Hub

Expand Down
145 changes: 134 additions & 11 deletions extern/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
include(Macros)

if(MSVC)
set(SSL_LIBRARY_NAME "libssl")
set(CRYPTO_LIBRARY_NAME "libcrypto")
set(WEBP_LIBRARY_NAME "libwebp")
set(WEBPDECODER_LIBRARY_NAME "libwebpdecoder")
set(WEBPDEMUX_LIBRARY_NAME "libwebpdemux")
set(WEBPMUX_LIBRARY_NAME "libwebpmux")
set(SHARPYUV_LIBRARY_NAME "libsharpyuv")
set(ZNG_LIBRARY_NAME "zlibstatic-ng")
else()
set(SSL_LIBRARY_NAME "ssl")
set(CRYPTO_LIBRARY_NAME "crypto")
set(WEBP_LIBRARY_NAME "webp")
set(WEBPDECODER_LIBRARY_NAME "webpdecoder")
set(WEBPDEMUX_LIBRARY_NAME "webpdemux")
set(WEBPMUX_LIBRARY_NAME "webpmux")
set(SHARPYUV_LIBRARY_NAME "sharpyuv")
set(ZNG_LIBRARY_NAME "z-ng")
endif()

# cmake-format: off
add_external_project(
PROJECT_NAME
Expand All @@ -20,30 +40,131 @@ add_external_project(
CesiumAsync
CesiumUtility
async++
csprng
draco
glm
jpeg
ktx
modp_b64
s2geometry
libmodpbase64
meshoptimizer
s2
absl_cordz_sample_token
absl_die_if_null
absl_failure_signal_handler
absl_flags_parse
absl_log_flags
absl_log_initialize
absl_periodic_sampler
absl_random_internal_distribution_test_util
absl_scoped_set_env
absl_statusor
absl_bad_any_cast_impl
absl_log_internal_check_op
absl_leak_check
absl_flags_usage
absl_flags_usage_internal
absl_flags_internal
absl_flags_reflection
absl_flags_config
absl_flags_program_name
absl_flags_private_handle_accessor
absl_flags_commandlineflag
absl_flags_commandlineflag_internal
absl_flags_marshalling
absl_log_internal_conditions
absl_log_internal_message
absl_examine_stack
absl_log_internal_nullguard
absl_log_internal_format
absl_log_internal_proto
absl_log_internal_log_sink_set
absl_log_globals
absl_vlog_config_internal
absl_log_internal_fnmatch
absl_log_internal_globals
absl_log_sink
absl_log_entry
absl_raw_hash_set
absl_hash
absl_city
absl_low_level_hash
absl_hashtablez_sampler
absl_random_distributions
absl_random_seed_sequences
absl_random_internal_pool_urbg
absl_random_internal_randen
absl_random_internal_randen_hwaes
absl_random_internal_randen_hwaes_impl
absl_random_internal_randen_slow
absl_random_internal_platform
absl_random_internal_seed_material
absl_random_seed_gen_exception
absl_status
absl_cord
absl_cordz_info
absl_cordz_handle
absl_cordz_functions
absl_exponential_biased
absl_synchronization
absl_graphcycles_internal
absl_kernel_timeout_internal
absl_time
absl_civil_time
absl_time_zone
absl_cord_internal
absl_crc_cord_state
absl_crc32c
absl_crc_internal
absl_crc_cpu_detect
absl_stacktrace
absl_bad_optional_access
absl_str_format_internal
absl_strerror
absl_symbolize
absl_strings
absl_strings_internal
absl_int128
absl_string_view
absl_throw_delegate
absl_debugging_internal
absl_malloc_internal
absl_demangle_internal
absl_base
absl_spinlock_wait
absl_bad_variant_access
absl_raw_logging_internal
absl_log_severity
${SSL_LIBRARY_NAME}
${CRYPTO_LIBRARY_NAME}
spdlog
fmt
sqlite3
tinyxml2
uriparser
webpdecoder
turbojpeg
meshoptimizer
sqlite3
uriparser
${WEBP_LIBRARY_NAME}
${WEBPDECODER_LIBRARY_NAME}
${WEBPDEMUX_LIBRARY_NAME}
${WEBPMUX_LIBRARY_NAME}
astcenc-avx2-static
${SHARPYUV_LIBRARY_NAME}
${ZNG_LIBRARY_NAME}
zstd
OPTIONS
CESIUM_TESTS_ENABLED=OFF
CESIUM_COVERAGE_ENABLED=OFF
CESIUM_TRACING_ENABLED=${CESIUM_OMNI_ENABLE_TRACING}
VCPKG_OVERLAY_PORTS=${VCPKG_OVERLAY_PORTS}
VCPKG_OVERLAY_TRIPLETS=${VCPKG_OVERLAY_TRIPLETS}
VCPKG_TRIPLET=${VCPKG_TRIPLET}
EZVCPKG_BASEDIR=${EZVCPKG_BASEDIR}
PROJECT_EXTERN_DIRECTORY
"${PROJECT_SOURCE_DIR}/extern"
EXPECTED_DEBUG_POSTFIX "d"
)
# cmake-format: on

if(NOT ${USE_NVIDIA_RELEASE_LIBRARIES})
execute_process(COMMAND "${Python3_EXECUTABLE}" "${SCRIPTS_DIRECTORY}/copy_from_dir.py" "*.user.xml" "${PROJECT_SOURCE_DIR}/extern/nvidia/debug-deps" "${PROJECT_SOURCE_DIR}/extern/nvidia/deps")
execute_process(COMMAND "${Python3_EXECUTABLE}" "${SCRIPTS_DIRECTORY}/copy_from_dir.py" "*.user.xml"
"${PROJECT_SOURCE_DIR}/extern/nvidia/debug-deps" "${PROJECT_SOURCE_DIR}/extern/nvidia/deps")
endif()

if(WIN32)
Expand All @@ -55,9 +176,11 @@ else()
endif()

if(UNIX)
execute_process(COMMAND bash -c "${PROJECT_SOURCE_DIR}/extern/nvidia/build.sh --platform ${NVIDIA_PLATFORM_NAME}" RESULT_VARIABLE exit_code)
execute_process(COMMAND bash -c "${PROJECT_SOURCE_DIR}/extern/nvidia/build.sh --platform ${NVIDIA_PLATFORM_NAME}"
RESULT_VARIABLE exit_code)
elseif(WIN32)
execute_process(COMMAND cmd /C "${PROJECT_SOURCE_DIR}/extern/nvidia/build.bat --platform ${NVIDIA_PLATFORM_NAME}" RESULT_VARIABLE exit_code)
execute_process(COMMAND cmd /C "${PROJECT_SOURCE_DIR}/extern/nvidia/build.bat --platform ${NVIDIA_PLATFORM_NAME}"
RESULT_VARIABLE exit_code)
endif()

# cmake-format: off
Expand Down
2 changes: 1 addition & 1 deletion extern/cesium-native
Submodule cesium-native updated 130 files
Loading

0 comments on commit aaf0696

Please sign in to comment.