Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vcpkg update #1259

Merged
merged 11 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .ci/check_format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ while read -r file; do
if [[ $file == *"/boost-stacktrace/"* ]]; then
continue
fi
if [[ $file == *"/glm/"* ]]; then
continue
fi
fi

# ignore 3rd party dirs
Expand Down
2 changes: 2 additions & 0 deletions .ci/docker/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
xorg-dev \
# libsodium / gmp:
autoconf libtool \
# icu:
autoconf-archive \
# thrift:
flex bison \
# GL/glu.h:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,21 @@ jobs:
generator: 'Visual Studio 17 2022'
cc: ''
cxx: ''
ignore_features: 'MPI POWER'
ignore_features: 'MPI'
- name: 'Ubuntu-GCC'
os: 'ubuntu-24.04'
container: 'ghcr.io/unistuttgart-visus/megamol_ci_ubuntu:master'
generator: 'Ninja'
cc: 'gcc-13'
cxx: 'g++-13'
ignore_features: 'CUESDK VR_INTEROP POWER'
ignore_features: 'CUESDK VR_INTEROP'
- name: 'Ubuntu-Clang'
os: 'ubuntu-24.04'
container: 'ghcr.io/unistuttgart-visus/megamol_ci_ubuntu:master'
generator: 'Ninja'
cc: 'clang-18'
cxx: 'clang++-18'
ignore_features: 'CUESDK VR_INTEROP POWER'
ignore_features: 'CUESDK VR_INTEROP'
name: "Vcpkg-${{ matrix.job.name }}"
runs-on: ${{ matrix.job.os }}
container:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ name: Docker Images
on:
push:
branches: [ master ]
paths: [ '.ci/docker/**' ]
paths:
- '.ci/docker/**'
- '.github/workflows/docker.yml'
workflow_dispatch:

env:
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
cmake_minimum_required(VERSION 3.19...3.29 FATAL_ERROR)

# Vcpkg setup
set(MEGAMOL_VCPKG_VERSION "2024.06.15") # Update default-registry baseline in vcpkg-configuration.json when changing!
set(MEGAMOL_VCPKG_VERSION "2024.07.12") # Update default-registry baseline in vcpkg.json when changing!

include(cmake/megamol_vcpkg_setup.cmake)
include(cmake/megamol_feature_option.cmake)
Expand Down
14 changes: 14 additions & 0 deletions cmake/vcpkg_ports/embree/cmake_policy.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 06f49a8..fdaaee7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -69,6 +69,9 @@ IF(COMMAND cmake_policy)
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
+ if (POLICY CMP0001)
+ cmake_policy(SET CMP0001 OLD)
+ endif()
ENDIF(COMMAND cmake_policy)

MARK_AS_ADVANCED(CMAKE_BACKWARDS_COMPATIBILITY)
26 changes: 26 additions & 0 deletions cmake/vcpkg_ports/embree/fix-path.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/common/cmake/embree-config.cmake b/common/cmake/embree-config.cmake
index b4fc24e8c..92d147b2a 100644
--- a/common/cmake/embree-config.cmake
+++ b/common/cmake/embree-config.cmake
@@ -5,8 +5,6 @@ SET(EMBREE_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/@EMBREE_RELATIVE_ROOT_DIR@")
GET_FILENAME_COMPONENT(EMBREE_ROOT_DIR "${EMBREE_ROOT_DIR}" ABSOLUTE)

SET(EMBREE_INCLUDE_DIRS "${EMBREE_ROOT_DIR}/@CMAKE_INSTALL_INCLUDEDIR@")
-SET(EMBREE_LIBRARY "${EMBREE_ROOT_DIR}/@CMAKE_INSTALL_LIBDIR@/@EMBREE_LIBRARY_FULLNAME@")
-SET(EMBREE_LIBRARIES ${EMBREE_LIBRARY})

SET(EMBREE_VERSION @EMBREE_VERSION@)
SET(EMBREE_VERSION_MAJOR @EMBREE_VERSION_MAJOR@)
diff --git a/common/cmake/package.cmake b/common/cmake/package.cmake
index 9d4d6572a..7b9f96c12 100644
--- a/common/cmake/package.cmake
+++ b/common/cmake/package.cmake
@@ -23,7 +23,7 @@ ENDIF()
# Install MSVC runtime
##############################################################

-IF (WIN32)
+IF (0)
SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
INCLUDE(InstallRequiredSystemLibraries)
LIST(FILTER CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS INCLUDE REGEX ".*msvcp[0-9]+\.dll|.*vcruntime[0-9]+\.dll|.*vcruntime[0-9]+_[0-9]+\.dll")
26 changes: 26 additions & 0 deletions cmake/vcpkg_ports/embree/fix-static-usage.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/common/cmake/embree-config.cmake b/common/cmake/embree-config.cmake
index 5087ca0..fdf8135 100644
--- a/common/cmake/embree-config.cmake
+++ b/common/cmake/embree-config.cmake
@@ -52,6 +52,21 @@ IF (EMBREE_STATIC_LIB)
INCLUDE("${EMBREE_ROOT_DIR}/@EMBREE_CMAKEEXPORT_DIR@/tasking-targets.cmake")


+ IF(EMBREE_ISA_SSE42)
+ INCLUDE("${EMBREE_ROOT_DIR}/@EMBREE_CMAKEEXPORT_DIR@/embree_sse42-targets.cmake")
+ ENDIF()
+ IF(EMBREE_ISA_AVX)
+ INCLUDE("${EMBREE_ROOT_DIR}/@EMBREE_CMAKEEXPORT_DIR@/embree_avx-targets.cmake")
+ ENDIF()
+ IF(EMBREE_ISA_AVX2)
+ INCLUDE("${EMBREE_ROOT_DIR}/@EMBREE_CMAKEEXPORT_DIR@/embree_avx2-targets.cmake")
+ ENDIF()
+ IF(EMBREE_ISA_AVX512KNL)
+ INCLUDE("${EMBREE_ROOT_DIR}/@EMBREE_CMAKEEXPORT_DIR@/embree_avx512knl-targets.cmake")
+ ENDIF()
+ IF(EMBREE_ISA_AVX512SKX)
+ INCLUDE("${EMBREE_ROOT_DIR}/@EMBREE_CMAKEEXPORT_DIR@/embree_avx512skx-targets.cmake")
+ ENDIF()
ENDIF()

INCLUDE("${EMBREE_ROOT_DIR}/@EMBREE_CMAKEEXPORT_DIR@/embree-targets.cmake")
18 changes: 18 additions & 0 deletions cmake/vcpkg_ports/embree/fix-targets-file-not-found.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
diff --git a/common/cmake/package.cmake b/common/cmake/package.cmake
index 8c89f5b..55cb2af 100644
--- a/common/cmake/package.cmake
+++ b/common/cmake/package.cmake
@@ -114,10 +114,10 @@ ENDIF()
# SET(EMBREE_CMAKEEXPORT_DIR "cmake")
# SET(EMBREE_RELATIVE_ROOT_DIR ".")
#ELSE()
-SET(EMBREE_CMAKECONFIG_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/embree-${EMBREE_VERSION}")
-SET(EMBREE_CMAKEEXPORT_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/embree-${EMBREE_VERSION}")
+SET(EMBREE_CMAKECONFIG_DIR "share/embree")
+SET(EMBREE_CMAKEEXPORT_DIR "share/embree")
IF (WIN32)
- SET(EMBREE_RELATIVE_ROOT_DIR "../../../")
+ SET(EMBREE_RELATIVE_ROOT_DIR "../..")
ELSE()
FILE(RELATIVE_PATH EMBREE_RELATIVE_ROOT_DIR "/${EMBREE_CMAKECONFIG_DIR}" "/")
ENDIF()
115 changes: 115 additions & 0 deletions cmake/vcpkg_ports/embree/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# stole the embree3 port and added ispc
set(EMBREE3_VERSION 3.13.4)
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO embree/embree
REF v${EMBREE3_VERSION}
SHA512 685c3935fabe1bfa7260ef148df26b686b085b75011d72011461471cbcef786a5ce7a0e85c57b2df05798489a2d4e80a8d3ee5df986029edad7df7511d99c0ca
HEAD_REF master
PATCHES
fix-path.patch
cmake_policy.patch
fix-targets-file-not-found.patch
)

list(LENGTH FEATURES FEATURE_COUNT)
#message("FEATURE_COUNT=${FEATURE_COUNT}")

string(COMPARE EQUAL ${VCPKG_LIBRARY_LINKAGE} static EMBREE_STATIC_LIB)
string(COMPARE EQUAL ${VCPKG_CRT_LINKAGE} static EMBREE_STATIC_RUNTIME)

if (NOT VCPKG_TARGET_IS_OSX)
if ("avx512" IN_LIST FEATURES)
message(FATAL_ERROR "Microsoft Visual C++ Compiler does not support feature avx512 officially.")
endif()

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
avx EMBREE_ISA_AVX
avx2 EMBREE_ISA_AVX2
avx512 EMBREE_ISA_AVX512
sse2 EMBREE_ISA_SSE2
sse42 EMBREE_ISA_SSE42
)
elseif (VCPKG_LIBRARY_LINKAGE STREQUAL static)
list(LENGTH FEATURES FEATURE_COUNT)
if (FEATURE_COUNT GREATER 2)
message(WARNING [[
Using Embree as static library is not supported with AppleClang >= 9.0 when multiple ISAs are selected.
Please install embree3 with only one feature using command "./vcpkg install embree3[core,FEATURE_NAME]"
Only set feature avx automaticlly.
]])
set(FEATURE_OPTIONS
-DEMBREE_ISA_AVX=ON
-DEMBREE_ISA_AVX2=OFF
-DEMBREE_ISA_AVX512=OFF
-DEMBREE_ISA_SSE2=OFF
-DEMBREE_ISA_SSE42=OFF
)
endif()
endif()

set(WIN32_OPTIONS "")
if (WIN32)
set(WIN32_OPTIONS -DEMBREE_STATIC_RUNTIME=OFF)
endif ()

if (FEATURE_COUNT LESS 2)
message(FATAL_ERROR "You have to select at least one ISA feature!")
endif()

vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
DISABLE_PARALLEL_CONFIGURE
OPTIONS ${FEATURE_OPTIONS}
-DEMBREE_TUTORIALS=OFF
-DEMBREE_STATIC_LIB=OFF
${WIN32_OPTIONS}
)

vcpkg_cmake_install()

vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()
if(APPLE)
file(REMOVE "${CURRENT_PACKAGES_DIR}/uninstall.command" "${CURRENT_PACKAGES_DIR}/debug/uninstall.command")
endif()
#file(RENAME "${CURRENT_PACKAGES_DIR}/share/doc" "${CURRENT_PACKAGES_DIR}/share/${PORT}/")

#file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

# simple mode which does not work
# vcpkg_from_github(
# OUT_SOURCE_PATH SOURCE_PATH
# REPO embree/embree
# REF 489b746c0d5010e0da10345e9dc96768bec9a037
# SHA512 502d6ed12678df20e773da057c234e7f44b5dd0e6b8c488a9a7d2117f7c1ee8fa84aba1b8d3668caf8ebbd51337812bbb2678e71fbb76b7d311ffb723bc4f5da
# HEAD_REF master
# )

# # TODO ISA options here
# # TODO openimageIO and libpng?

# vcpkg_cmake_configure(
# SOURCE_PATH "${SOURCE_PATH}"
# OPTIONS
# -DEMBREE_TUTORIALS=false
# )
# vcpkg_cmake_install()

# vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/embree-3.13.4)

# file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
# file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

# file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
36 changes: 36 additions & 0 deletions cmake/vcpkg_ports/embree/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "embree",
"version": "3.13.4",
"description": "High Performance Ray Tracing Kernels",
"homepage": "https://www.embree.org/",
"license": "Apache-2.0",
"dependencies": [
"ispc",
"tbb",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"features": {
"avx": {
"description": "avx ISA support"
},
"avx2": {
"description": "avx2 ISA support"
},
"avx512": {
"description": "avx512 ISA support"
},
"sse2": {
"description": "sse2 ISA support"
},
"sse42": {
"description": "sse4.2 ISA support"
}
}
}
17 changes: 0 additions & 17 deletions cmake/vcpkg_ports/glm/fix-clang.patch

This file was deleted.

27 changes: 0 additions & 27 deletions cmake/vcpkg_ports/glm/portfile.cmake

This file was deleted.

8 changes: 0 additions & 8 deletions cmake/vcpkg_ports/glm/usage

This file was deleted.

18 changes: 0 additions & 18 deletions cmake/vcpkg_ports/glm/vcpkg.json

This file was deleted.

Loading
Loading