From b1fa60cffb175bbc694b43f0455954387a290815 Mon Sep 17 00:00:00 2001 From: NancyLi1013 Date: Tue, 22 Sep 2020 22:56:53 -0700 Subject: [PATCH 1/8] [netcdf-c/nvtt] Update to the latest version --- ports/netcdf-c/CONTROL | 3 +- ports/netcdf-c/config-pkg-location.patch | 4 +- ports/netcdf-c/fix-dependency-libmath.patch | 4 +- ports/netcdf-c/mpi.patch | 14 -- ports/netcdf-c/no-install-deps.patch | 4 +- ports/netcdf-c/portfile.cmake | 7 +- ports/netcdf-c/use_targets.patch | 188 ++++++++++---------- ports/nvtt/CONTROL | 3 +- ports/nvtt/bc6h.patch | 13 +- ports/nvtt/bc7.patch | 12 +- ports/nvtt/fix-build-error.patch | 59 +++--- ports/nvtt/portfile.cmake | 9 +- ports/nvtt/squish.patch | 11 +- 13 files changed, 147 insertions(+), 184 deletions(-) delete mode 100644 ports/netcdf-c/mpi.patch diff --git a/ports/netcdf-c/CONTROL b/ports/netcdf-c/CONTROL index 92d0439d96285a..9ea0d125efa104 100644 --- a/ports/netcdf-c/CONTROL +++ b/ports/netcdf-c/CONTROL @@ -1,6 +1,5 @@ Source: netcdf-c -Version: 4.7.3 -Port-Version: 4 +Version: 4.7.4 Build-Depends: hdf5, curl Homepage: https://github.com/Unidata/netcdf-c Description: a set of self-describing, machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data. diff --git a/ports/netcdf-c/config-pkg-location.patch b/ports/netcdf-c/config-pkg-location.patch index 532082ccb60019..13f0aeaa69eba3 100644 --- a/ports/netcdf-c/config-pkg-location.patch +++ b/ports/netcdf-c/config-pkg-location.patch @@ -1,8 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 46892ee..803ff46 100644 +index bd7c4f8..e4e92c6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -1742,7 +1742,9 @@ FILE(COPY ${netCDF_SOURCE_DIR}/include/netcdf_meta.h +@@ -2050,7 +2050,9 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ncdap_test/pingurl.c ${CMAKE_CURRENT_ # Create CMake package configuration files. With these, other packages using # cmake should be able to find netcdf using find_package and find_library. # The EXPORT call is paired with one in liblib. diff --git a/ports/netcdf-c/fix-dependency-libmath.patch b/ports/netcdf-c/fix-dependency-libmath.patch index 0db00ccaff9056..d6b4c214e92f91 100644 --- a/ports/netcdf-c/fix-dependency-libmath.patch +++ b/ports/netcdf-c/fix-dependency-libmath.patch @@ -1,8 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 35c694f..e2c03e5 100644 +index bd7c4f8..03b7ccf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -839,7 +839,7 @@ ENDIF() +@@ -866,7 +866,7 @@ ENDIF() # Check for the math library so it can be explicitly linked. IF(NOT WIN32) diff --git a/ports/netcdf-c/mpi.patch b/ports/netcdf-c/mpi.patch deleted file mode 100644 index 64027e65c4a5d0..00000000000000 --- a/ports/netcdf-c/mpi.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 101f97719..b070121b8 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1004,6 +1004,8 @@ IF(ENABLE_PARALLEL4 AND ENABLE_NETCDF_4) - IF(MSVC) - FIND_PACKAGE(MPI REQUIRED) - INCLUDE_DIRECTORIES(${MPI_C_INCLUDE_PATH}) -+ list(APPEND CMAKE_REQUIRED_LIBRARIES MPI::MPI_C) -+ list(APPEND EXTRA_DEPS MPI::MPI_C) - ENDIF() - SET(HDF5_PARALLEL ON CACHE BOOL "") - SET(USE_PARALLEL ON CACHE BOOL "") - diff --git a/ports/netcdf-c/no-install-deps.patch b/ports/netcdf-c/no-install-deps.patch index 3d44b383ec82bb..535a0dc088a5bc 100644 --- a/ports/netcdf-c/no-install-deps.patch +++ b/ports/netcdf-c/no-install-deps.patch @@ -1,8 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index e87f3de..46892ee 100644 +index bd7c4f8..95fb01c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -1570,7 +1570,7 @@ ADD_SUBDIRECTORY(docs) +@@ -1830,7 +1830,7 @@ ADD_SUBDIRECTORY(docs) # install them in the binary dir. Grab all of the .libs, put them # in the libdir. ## diff --git a/ports/netcdf-c/portfile.cmake b/ports/netcdf-c/portfile.cmake index 4813aa5b83824d..16715053029973 100644 --- a/ports/netcdf-c/portfile.cmake +++ b/ports/netcdf-c/portfile.cmake @@ -1,14 +1,13 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Unidata/netcdf-c - REF b7cd387bee8c661141fabb490f4969587c008c55 # v4.7.3 - SHA512 a55391620fac61e4975fe62907ca21049911afce6190fc12d183d24133a32aae8cd223b97a3fe57fc82d8bdca1a7db451046e3be3c379051624d48b1f56c0332 + REF 26fba54a58fa02af92d84441ed90b417c1d08161 # v4.7.4 + SHA512 7144374b5bd3574ea422de07ffb30fecc4e5f560f9b46f62762cc0cce511dd33068b8df9244fe94ae3cc7b3a9bb9fe398c7e67c3e5ac2109768e5a9b984f24fb HEAD_REF master PATCHES no-install-deps.patch config-pkg-location.patch use_targets.patch - mpi.patch fix-dependency-libmath.patch ) @@ -51,4 +50,4 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) -file(INSTALL ${SOURCE_PATH}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL ${SOURCE_PATH}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/netcdf-c/use_targets.patch b/ports/netcdf-c/use_targets.patch index 99e50dc9d06d0b..d15ab749524294 100644 --- a/ports/netcdf-c/use_targets.patch +++ b/ports/netcdf-c/use_targets.patch @@ -1,103 +1,99 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 1ce05e0fe..7671d7b1e 100644 +index bd7c4f8..9e09cf3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -431,7 +431,6 @@ IF(NC_EXTRA_DEPS) - SET(EXTRA_DEPS ${EXTRA_DEPS} "${${_LIB}_DEP}") - ENDFOREACH() - MESSAGE("Extra deps: ${EXTRA_DEPS}") -- LIST(REMOVE_DUPLICATES EXTRA_DEPS) - SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${EXTRA_DEPS}) - ENDIF() - ### -@@ -599,15 +599,6 @@ IF(USE_HDF5 OR ENABLE_NETCDF_4) - # we will use a static library. This can be toggled - # by explicitly modifying NC_FIND_SHARED_LIBS. - ## -- IF(NC_FIND_SHARED_LIBS) -- SET(NC_HDF5_LINK_TYPE "shared") -- SET(NC_HDF5_LINK_TYPE_UPPER "SHARED") -- ADD_DEFINITIONS(-DH5_BUILT_AS_DYNAMIC_LIB) -- ELSE(NC_FIND_SHARED_LIBS) -- SET(NC_HDF5_LINK_TYPE "static") -- SET(NC_HDF5_LINK_TYPE_UPPER "STATIC") -- ADD_DEFINITIONS(-DH5_BUILT_AS_STATIC_LIB) -- ENDIF(NC_FIND_SHARED_LIBS) - - ##### - # First, find the C and HL libraries. -@@ -620,9 +620,9 @@ IF(USE_HDF5 OR ENABLE_NETCDF_4) - SET(SEARCH_PACKAGE_NAME ${HDF5_PACKAGE_NAME}) - FIND_PACKAGE(HDF5 NAMES ${SEARCH_PACKAGE_NAME} COMPONENTS C HL CONFIG REQUIRED ${NC_HDF5_LINK_TYPE}) - ELSE(MSVC) -- FIND_PACKAGE(HDF5 COMPONENTS C HL REQUIRED) -+ FIND_PACKAGE(HDF5 COMPONENTS C HL CONFIG REQUIRED) - ENDIF(MSVC) -- -+ - ## - # Next, check the HDF5 version. This will inform which - # HDF5 variables we need to munge. -@@ -695,6 +695,19 @@ IF(USE_HDF5 OR ENABLE_NETCDF_4) - ENDIF() - ENDIF(HDF5_C_LIBRARY AND HDF5_HL_LIBRARY AND HDF5_INCLUDE_DIR) - -+ if(TARGET hdf5::hdf5-shared) -+ set(HDF5_C_LIBRARY hdf5::hdf5-shared) -+ set(HDF5_C_LIBRARY_hdf5 hdf5::hdf5-shared) +@@ -430,7 +430,6 @@ IF(NC_EXTRA_DEPS) + SET(EXTRA_DEPS ${EXTRA_DEPS} "${${_LIB}_DEP}") + ENDFOREACH() + MESSAGE("Extra deps: ${EXTRA_DEPS}") +- LIST(REMOVE_DUPLICATES EXTRA_DEPS) + SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${EXTRA_DEPS}) + ENDIF() + ### +@@ -598,15 +597,6 @@ IF(USE_HDF5 OR ENABLE_NETCDF_4) + # we will use a static library. This can be toggled + # by explicitly modifying NC_FIND_SHARED_LIBS. + ## +- IF(NC_FIND_SHARED_LIBS) +- SET(NC_HDF5_LINK_TYPE "shared") +- SET(NC_HDF5_LINK_TYPE_UPPER "SHARED") +- ADD_DEFINITIONS(-DH5_BUILT_AS_DYNAMIC_LIB) +- ELSE(NC_FIND_SHARED_LIBS) +- SET(NC_HDF5_LINK_TYPE "static") +- SET(NC_HDF5_LINK_TYPE_UPPER "STATIC") +- ADD_DEFINITIONS(-DH5_BUILT_AS_STATIC_LIB) +- ENDIF(NC_FIND_SHARED_LIBS) + + ##### + # First, find the C and HL libraries. +@@ -619,7 +609,7 @@ IF(USE_HDF5 OR ENABLE_NETCDF_4) + SET(SEARCH_PACKAGE_NAME ${HDF5_PACKAGE_NAME}) + FIND_PACKAGE(HDF5 NAMES ${SEARCH_PACKAGE_NAME} COMPONENTS C HL CONFIG REQUIRED ${NC_HDF5_LINK_TYPE}) + ELSE(MSVC) +- FIND_PACKAGE(HDF5 COMPONENTS C HL REQUIRED) ++ FIND_PACKAGE(HDF5 COMPONENTS C HL CONFIG REQUIRED) + ENDIF(MSVC) + + ## +@@ -701,6 +691,19 @@ IF(USE_HDF5 OR ENABLE_NETCDF_4) + SET(HDF5_C_LIBRARY hdf5) + ENDIF() + ENDIF(HDF5_C_LIBRARY AND HDF5_HL_LIBRARY AND HDF5_INCLUDE_DIR) ++ ++ if(TARGET hdf5::hdf5-shared) ++ set(HDF5_C_LIBRARY hdf5::hdf5-shared) ++ set(HDF5_C_LIBRARY_hdf5 hdf5::hdf5-shared) + set(HDF5_HL_LIBRARIES hdf5::hdf5_hl-shared) -+ ADD_DEFINITIONS(-DH5_BUILT_AS_DYNAMIC_LIB) -+ else() -+ set(HDF5_C_LIBRARY hdf5::hdf5-static) -+ set(HDF5_C_LIBRARY_hdf5 hdf5::hdf5-static) ++ ADD_DEFINITIONS(-DH5_BUILT_AS_DYNAMIC_LIB) ++ else() ++ set(HDF5_C_LIBRARY hdf5::hdf5-static) ++ set(HDF5_C_LIBRARY_hdf5 hdf5::hdf5-static) + set(HDF5_HL_LIBRARIES hdf5::hdf5_hl-static) -+ ADD_DEFINITIONS(-DH5_BUILT_AS_STATIC_LIB) -+ endif() -+ list(APPEND CMAKE_REQUIRED_LIBRARIES ${HDF5_C_LIBRARY}) -+ - FIND_PACKAGE(Threads) - - # There is a missing case in the above code so default it -@@ -721,16 +733,11 @@ IF(USE_HDF5 OR ENABLE_NETCDF_4) - CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5Pset_all_coll_metadata_ops "" HDF5_HAS_COLL_METADATA_OPS) - - #Check to see if H5Z_SZIP exists in HDF5_Libraries. If so, we must use szip. -- CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5Z_SZIP "" USE_SZIP) -+ set(USE_SZIP ${HDF5_ENABLE_SZIP_SUPPORT}) - IF(USE_SZIP) -- FIND_LIBRARY(SZIP NAMES szip sz) -- IF(SZIP) -+ #FIND_LIBRARY(SZIP NAMES szip sz) -+ #IF(SZIP) - SET(HAVE_H5Z_SZIP 1) -- SET(SZIP_LIBRARY ${SZIP}) -- SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${SZIP}) -- ELSE() -- MESSAGE(FATAL_ERROR "HDF5 Requires SZIP, but cannot find libszip or libsz.") -- ENDIF() - ENDIF() - - CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5Pset_libver_bounds "" HAVE_H5PSET_LIBVER_BOUNDS) -@@ -764,8 +776,7 @@ IF(USE_HDF5 OR ENABLE_NETCDF_4) - ENDIF(USE_HDF5 OR ENABLE_NETCDF_4) - - # See if we have libcurl --FIND_PACKAGE(CURL) --ADD_DEFINITIONS(-DCURL_STATICLIB=1) -+FIND_PACKAGE(CURL CONFIG) - INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIRS}) - - # Check to see if CURLOPT_USERNAME is defined. -@@ -1890,7 +1902,6 @@ ENDIF() - - STRING(REPLACE ";" " " LINKFLAGS "${LINKFLAGS}") - --LIST(REMOVE_DUPLICATES NC_LIBS) - LIST(REMOVE_DUPLICATES LINKFLAGS) - - SET(LIBS ${NC_LIBS}) ++ ADD_DEFINITIONS(-DH5_BUILT_AS_STATIC_LIB) ++ endif() ++ list(APPEND CMAKE_REQUIRED_LIBRARIES ${HDF5_C_LIBRARY}) + + FIND_PACKAGE(Threads) + +@@ -728,17 +731,9 @@ IF(USE_HDF5 OR ENABLE_NETCDF_4) + CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5Pset_all_coll_metadata_ops "" HDF5_HAS_COLL_METADATA_OPS) + + #Check to see if H5Z_SZIP exists in HDF5_Libraries. If so, we must use szip. +- CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5Z_SZIP "" USE_SZIP) ++ set(USE_SZIP ${HDF5_ENABLE_SZIP_SUPPORT}) + IF(USE_SZIP) +- FIND_LIBRARY(SZIP NAMES szip sz) +- IF(SZIP) + SET(HAVE_H5Z_SZIP 1) +- SET(SZIP_LIBRARY ${SZIP}) +- SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${SZIP}) +- MESSAGE(STATUS "HDF5 has szip.") +- ELSE() +- MESSAGE(FATAL_ERROR "HDF5 Requires SZIP, but cannot find libszip or libsz.") +- ENDIF() + ENDIF() + + CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5Pset_libver_bounds "" HAVE_H5PSET_LIBVER_BOUNDS) +@@ -788,8 +783,7 @@ IF(USE_HDF5 OR ENABLE_NETCDF_4) + ENDIF(USE_HDF5 OR ENABLE_NETCDF_4) + + # See if we have libcurl +-FIND_PACKAGE(CURL) +-ADD_DEFINITIONS(-DCURL_STATICLIB=1) ++FIND_PACKAGE(CURL CONFIG) + INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIRS}) + + # Check to see if CURLOPT_USERNAME is defined. +@@ -1893,7 +1887,6 @@ ENDIF() + + STRING(REPLACE ";" " " LINKFLAGS "${LINKFLAGS}") + +-LIST(REMOVE_DUPLICATES NC_LIBS) + LIST(REMOVE_DUPLICATES LINKFLAGS) + + SET(LIBS ${NC_LIBS}) diff --git a/liblib/CMakeLists.txt b/liblib/CMakeLists.txt -index ea9b02949..ec7851f37 100644 +index ea9b029..8aeeab7 100644 --- a/liblib/CMakeLists.txt +++ b/liblib/CMakeLists.txt @@ -58,7 +58,7 @@ ENDIF() @@ -152,11 +148,11 @@ index ea9b02949..ec7851f37 100644 TARGET_LINK_LIBRARIES(netcdf ${TLL_LIBS}) diff --git a/netCDFConfig.cmake.in b/netCDFConfig.cmake.in -index c89cf3e67..b81f35a1b 100644 +index 9d68eec..b8f6113 100644 --- a/netCDFConfig.cmake.in +++ b/netCDFConfig.cmake.in @@ -12,6 +12,10 @@ set_and_check(netCDF_LIB_DIR "@PACKAGE_CMAKE_INSTALL_LIBDIR@") - set(netCDF_LIBRARIES netcdf) + set(netCDF_LIBRARIES netCDF::netcdf) # include target information +include(CMakeFindDependencyMacro) diff --git a/ports/nvtt/CONTROL b/ports/nvtt/CONTROL index 189ff6caf8e51f..75ef3948133240 100644 --- a/ports/nvtt/CONTROL +++ b/ports/nvtt/CONTROL @@ -1,3 +1,4 @@ Source: nvtt -Version: 2.1.1 +Version: 2.1.2 +Homepage: https://github.com/castano/nvidia-texture-tools Description: Texture processing tools with support for Direct3D 10 and 11 formats. diff --git a/ports/nvtt/bc6h.patch b/ports/nvtt/bc6h.patch index 3e68ff51634210..8d3339eb266640 100644 --- a/ports/nvtt/bc6h.patch +++ b/ports/nvtt/bc6h.patch @@ -1,14 +1,13 @@ diff --git a/src/bc6h/CMakeLists.txt b/src/bc6h/CMakeLists.txt -index 635e0f3a..f758df43 100644 ---- a/src/bc6h/CMakeLists.txt +index fd75e74..b392d90 100644 +--- a/src/bc6h/CMakeLists.txt +++ b/src/bc6h/CMakeLists.txt -@@ -20,3 +20,8 @@ IF(NOT WIN32) - SET_TARGET_PROPERTIES(bc6h PROPERTIES COMPILE_FLAGS -fPIC) - ENDIF(CMAKE_COMPILER_IS_GNUCXX) - ENDIF(NOT WIN32) +@@ -15,3 +15,8 @@ SET(BC6H_SRCS + + ADD_LIBRARY(bc6h STATIC ${BC6H_SRCS}) + TARGET_LINK_LIBRARIES(bc6h nvcore nvmath) + +INSTALL(TARGETS bc6h + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib/static) -\ No newline at end of file diff --git a/ports/nvtt/bc7.patch b/ports/nvtt/bc7.patch index c94fcef231b0ee..5c644feceaee59 100644 --- a/ports/nvtt/bc7.patch +++ b/ports/nvtt/bc7.patch @@ -1,11 +1,11 @@ diff --git a/src/bc7/CMakeLists.txt b/src/bc7/CMakeLists.txt -index 2eb01c06..0c36895b 100644 ---- a/src/bc7/CMakeLists.txt +index 566fe1f..d0d4e8a 100644 +--- a/src/bc7/CMakeLists.txt +++ b/src/bc7/CMakeLists.txt -@@ -28,3 +28,8 @@ IF(NOT WIN32) - SET_TARGET_PROPERTIES(bc7 PROPERTIES COMPILE_FLAGS -fPIC) - ENDIF(CMAKE_COMPILER_IS_GNUCXX) - ENDIF(NOT WIN32) +@@ -23,3 +23,8 @@ SET(BC7_SRCS + + ADD_LIBRARY(bc7 STATIC ${BC7_SRCS}) + TARGET_LINK_LIBRARIES(bc7 nvcore nvmath) + +INSTALL(TARGETS bc7 + RUNTIME DESTINATION bin diff --git a/ports/nvtt/fix-build-error.patch b/ports/nvtt/fix-build-error.patch index 7ba1c19763fad6..43739c546a9358 100644 --- a/ports/nvtt/fix-build-error.patch +++ b/ports/nvtt/fix-build-error.patch @@ -1,39 +1,24 @@ -diff --git a/extern/butteraugli/butteraugli.h b/extern/butteraugli/butteraugli.h -index 31824b8..c116a73 100644 ---- a/extern/butteraugli/butteraugli.h -+++ b/extern/butteraugli/butteraugli.h -@@ -134,7 +134,14 @@ bool ButteraugliAdaptiveQuantization(size_t xsize, size_t ysize, - // The conventional syntax uint8_t* const RESTRICT is more confusing - it is - // not immediately obvious that the pointee is non-const. - template -+#ifdef _MSC_VER -+// Due to MSVC bug: -+// https://developercommunity.visualstudio.com/content/problem/32196/msvc-cant-compile-a-templated-using-without-instan.html -+// , we cannot use __restrict now. Loss some performance instead of can't use this code. -+using ConstRestrict = T const; -+#else - using ConstRestrict = T const BUTTERAUGLI_RESTRICT; -+#endif +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 668cd7e..b0fbae1 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -8,6 +8,7 @@ SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${NV_CMAKE_DIR}") + # Compiler check (needs -std:c++11 flag) + include(CheckCXXCompilerFlag) + CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) ++set(COMPILER_SUPPORTS_CXX11 "COMPILER_SUPPORTS_CXX11") + if(COMPILER_SUPPORTS_CXX11) + set(CMAKE_CXX_STANDARD 11) + set(CMAKE_CXX_STANDARD_REQUIRED ON) +diff --git a/src/nvtt/CMakeLists.txt b/src/nvtt/CMakeLists.txt +index 8285f99..9688c9c 100644 +--- a/src/nvtt/CMakeLists.txt ++++ b/src/nvtt/CMakeLists.txt +@@ -63,5 +63,5 @@ INSTALL(TARGETS nvtt + INSTALL(FILES nvtt.h nvtt_wrapper.h DESTINATION include/nvtt) - // Functions that depend on the cache line size. - class CacheAligned { -diff --git a/src/nvthread/Atomic.h b/src/nvthread/Atomic.h -index 212b9cb..b8eaedb 100644 ---- a/src/nvthread/Atomic.h -+++ b/src/nvthread/Atomic.h -@@ -183,7 +183,6 @@ namespace nv { - - #elif NV_CC_CLANG && (NV_OS_IOS || NV_OS_DARWIN) -- NV_COMPILER_CHECK(sizeof(uint32) == sizeof(long)); - - //ACS: Use Apple's atomics instead? I don't know if these are better in any way; there are non-barrier versions too. There's no OSAtomicSwap32 tho' - /* -@@ -254,7 +253,6 @@ namespace nv { - - - #elif NV_CC_CLANG && POSH_CPU_STRONGARM -- NV_COMPILER_CHECK(sizeof(uint32) == sizeof(long)); - - inline uint32 atomicIncrement(uint32 * value) - { +-ADD_SUBDIRECTORY(tools) +-ADD_SUBDIRECTORY(tests) ++#ADD_SUBDIRECTORY(tools) ++#ADD_SUBDIRECTORY(tests) diff --git a/ports/nvtt/portfile.cmake b/ports/nvtt/portfile.cmake index bacdebbbc4cdc7..051b4366cdd53c 100644 --- a/ports/nvtt/portfile.cmake +++ b/ports/nvtt/portfile.cmake @@ -1,12 +1,10 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO castano/nvidia-texture-tools - REF 2.1.1 - SHA512 3e6fef5977ca29daa7dc97afe11d61de57a8556c9caf30902db8c5c167d9c38f736bcb62eebdaaf7558299b39975bc269d41ab980c813b67dd1fc85064c853c9 + REF b1a90f36013522b9e5a3a2197859b72188752e3f # 2.1.1 + SHA512 13cf04a9856f150f7569c8c256c42fc6a5bc40586c9ca2b3ae553edf5bfcbccbba5b8538924079ed35effdd07b9e3ef4bfdb9733a2ec51f5a95f958885cc6cca HEAD_REF master PATCHES 001-define-value-for-HAVE_UNISTD_H-in-mac-os.patch @@ -37,5 +35,4 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) # Handle copyright file(REMOVE ${CURRENT_PACKAGES_DIR}/share/doc/nvtt/LICENSE) -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/nvtt) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/nvtt/LICENSE ${CURRENT_PACKAGES_DIR}/share/nvtt/copyright) \ No newline at end of file +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/nvtt/squish.patch b/ports/nvtt/squish.patch index 36ce7be7649df5..f01ab40c6c0007 100644 --- a/ports/nvtt/squish.patch +++ b/ports/nvtt/squish.patch @@ -1,11 +1,12 @@ diff --git a/src/nvtt/squish/CMakeLists.txt b/src/nvtt/squish/CMakeLists.txt -index 832013e1..76824137 100644 ---- a/src/nvtt/squish/CMakeLists.txt +index 65a5dd3..d093ce5 100644 +--- a/src/nvtt/squish/CMakeLists.txt +++ b/src/nvtt/squish/CMakeLists.txt -@@ -33,3 +33,7 @@ IF(NOT WIN32) - ENDIF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX) - ENDIF(NOT WIN32) +@@ -21,3 +21,8 @@ SET(SQUISH_SRCS + simd_ve.h) + ADD_LIBRARY(nvsquish STATIC ${SQUISH_SRCS}) ++ +INSTALL(TARGETS squish + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib From 0d7c57c82010d542cbc37b878b4403125f2dc576 Mon Sep 17 00:00:00 2001 From: NancyLi1013 Date: Wed, 23 Sep 2020 02:36:57 -0700 Subject: [PATCH 2/8] [nvtt] Fix build error --- ports/nvtt/fix-round-not-found.patch | 13 +++++++++++++ ports/nvtt/portfile.cmake | 1 + 2 files changed, 14 insertions(+) create mode 100644 ports/nvtt/fix-round-not-found.patch diff --git a/ports/nvtt/fix-round-not-found.patch b/ports/nvtt/fix-round-not-found.patch new file mode 100644 index 00000000000000..d9b8d59550bf44 --- /dev/null +++ b/ports/nvtt/fix-round-not-found.patch @@ -0,0 +1,13 @@ +diff --git a/extern/CMP_Core/source/cmp_math_func.h b/extern/CMP_Core/source/cmp_math_func.h +index c2f8908..2965f8c 100644 +--- a/extern/CMP_Core/source/cmp_math_func.h ++++ b/extern/CMP_Core/source/cmp_math_func.h +@@ -31,7 +31,7 @@ + //============================================================================ + // Core API which have have GPU equivalents, defined here for HPC_CPU usage + //============================================================================ +- ++#include + #include + using namespace std; + diff --git a/ports/nvtt/portfile.cmake b/ports/nvtt/portfile.cmake index 051b4366cdd53c..04cda75aea7c5a 100644 --- a/ports/nvtt/portfile.cmake +++ b/ports/nvtt/portfile.cmake @@ -12,6 +12,7 @@ vcpkg_from_github( bc7.patch squish.patch fix-build-error.patch + fix-round-not-found.patch ) vcpkg_configure_cmake( From 9eef55d33324117aa9da6fd529e519dcbaca1a33 Mon Sep 17 00:00:00 2001 From: NancyLi1013 Date: Sun, 27 Sep 2020 03:24:11 -0700 Subject: [PATCH 3/8] [nvtt] Update patch --- ports/nvtt/fix-build-error.patch | 31 ++++++++++++++++++++++++---- ports/nvtt/fix-round-not-found.patch | 13 ------------ ports/nvtt/portfile.cmake | 3 +-- 3 files changed, 28 insertions(+), 19 deletions(-) delete mode 100644 ports/nvtt/fix-round-not-found.patch diff --git a/ports/nvtt/fix-build-error.patch b/ports/nvtt/fix-build-error.patch index 43739c546a9358..5274efa3100c88 100644 --- a/ports/nvtt/fix-build-error.patch +++ b/ports/nvtt/fix-build-error.patch @@ -1,15 +1,38 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 668cd7e..b0fbae1 100644 +index 668cd7e..72d6e61 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -8,6 +8,7 @@ SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${NV_CMAKE_DIR}") +@@ -7,9 +7,17 @@ SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${NV_CMAKE_DIR}") + # Compiler check (needs -std:c++11 flag) include(CheckCXXCompilerFlag) ++if(MSVC) ++CHECK_CXX_COMPILER_FLAG("/std:c++14" COMPILER_SUPPORTS_CXX14) ++else() CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) -+set(COMPILER_SUPPORTS_CXX11 "COMPILER_SUPPORTS_CXX11") - if(COMPILER_SUPPORTS_CXX11) +-if(COMPILER_SUPPORTS_CXX11) ++endif() ++if(COMPILER_SUPPORTS_CXX11 OR COMPILER_SUPPORTS_CXX14) ++ if(COMPILER_SUPPORTS_CXX11) set(CMAKE_CXX_STANDARD 11) ++ else() ++ set(CMAKE_CXX_STANDARD 14) ++ endif() set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(CMAKE_CXX_EXTENSIONS OFF) + else() +diff --git a/extern/CMP_Core/source/cmp_math_func.h b/extern/CMP_Core/source/cmp_math_func.h +index c2f8908..b652497 100644 +--- a/extern/CMP_Core/source/cmp_math_func.h ++++ b/extern/CMP_Core/source/cmp_math_func.h +@@ -32,6 +32,7 @@ + // Core API which have have GPU equivalents, defined here for HPC_CPU usage + //============================================================================ + ++#include + #include + using namespace std; + diff --git a/src/nvtt/CMakeLists.txt b/src/nvtt/CMakeLists.txt index 8285f99..9688c9c 100644 --- a/src/nvtt/CMakeLists.txt diff --git a/ports/nvtt/fix-round-not-found.patch b/ports/nvtt/fix-round-not-found.patch deleted file mode 100644 index d9b8d59550bf44..00000000000000 --- a/ports/nvtt/fix-round-not-found.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/extern/CMP_Core/source/cmp_math_func.h b/extern/CMP_Core/source/cmp_math_func.h -index c2f8908..2965f8c 100644 ---- a/extern/CMP_Core/source/cmp_math_func.h -+++ b/extern/CMP_Core/source/cmp_math_func.h -@@ -31,7 +31,7 @@ - //============================================================================ - // Core API which have have GPU equivalents, defined here for HPC_CPU usage - //============================================================================ -- -+#include - #include - using namespace std; - diff --git a/ports/nvtt/portfile.cmake b/ports/nvtt/portfile.cmake index 04cda75aea7c5a..cc45a9b2dd2ea7 100644 --- a/ports/nvtt/portfile.cmake +++ b/ports/nvtt/portfile.cmake @@ -3,7 +3,7 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO castano/nvidia-texture-tools - REF b1a90f36013522b9e5a3a2197859b72188752e3f # 2.1.1 + REF b1a90f36013522b9e5a3a2197859b72188752e3f # 2.1.2 SHA512 13cf04a9856f150f7569c8c256c42fc6a5bc40586c9ca2b3ae553edf5bfcbccbba5b8538924079ed35effdd07b9e3ef4bfdb9733a2ec51f5a95f958885cc6cca HEAD_REF master PATCHES @@ -12,7 +12,6 @@ vcpkg_from_github( bc7.patch squish.patch fix-build-error.patch - fix-round-not-found.patch ) vcpkg_configure_cmake( From ee80fc412019c024c8fafe1d069676ea1c05317a Mon Sep 17 00:00:00 2001 From: NancyLi1013 Date: Mon, 28 Sep 2020 00:18:34 -0700 Subject: [PATCH 4/8] [nvtt] Add unsupported x86 --- ports/nvtt/CONTROL | 1 + ports/nvtt/portfile.cmake | 2 ++ 2 files changed, 3 insertions(+) diff --git a/ports/nvtt/CONTROL b/ports/nvtt/CONTROL index 75ef3948133240..aaa38826959a1f 100644 --- a/ports/nvtt/CONTROL +++ b/ports/nvtt/CONTROL @@ -2,3 +2,4 @@ Source: nvtt Version: 2.1.2 Homepage: https://github.com/castano/nvidia-texture-tools Description: Texture processing tools with support for Direct3D 10 and 11 formats. +Supports: !x86 diff --git a/ports/nvtt/portfile.cmake b/ports/nvtt/portfile.cmake index cc45a9b2dd2ea7..c32e249a074c15 100644 --- a/ports/nvtt/portfile.cmake +++ b/ports/nvtt/portfile.cmake @@ -1,3 +1,5 @@ +vcpkg_fail_port_install(ON_ARCH "x86") + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( From dae86a014fb92da14d8886e500a116f470440dc3 Mon Sep 17 00:00:00 2001 From: NancyLi1013 Date: Tue, 13 Oct 2020 02:27:03 -0700 Subject: [PATCH 5/8] [nvtt] Try to fix the problem on osx --- ports/nvtt/add_compile_options_for_osx.patch | 15 +++++++++++++++ ports/nvtt/portfile.cmake | 1 + 2 files changed, 16 insertions(+) create mode 100644 ports/nvtt/add_compile_options_for_osx.patch diff --git a/ports/nvtt/add_compile_options_for_osx.patch b/ports/nvtt/add_compile_options_for_osx.patch new file mode 100644 index 00000000000000..ec9afebdd62423 --- /dev/null +++ b/ports/nvtt/add_compile_options_for_osx.patch @@ -0,0 +1,15 @@ +diff --git a/src/nvtt/CMakeLists.txt b/src/nvtt/CMakeLists.txt +index 9688c9c..a196f64 100644 +--- a/src/nvtt/CMakeLists.txt ++++ b/src/nvtt/CMakeLists.txt +@@ -53,6 +53,10 @@ ELSE(NVTT_SHARED) + ADD_LIBRARY(nvtt ${NVTT_SRCS}) + ENDIF(NVTT_SHARED) + ++if(APPLE) ++ add_compile_options(nvtt -mbmi2 -mfma) ++endif() ++ + TARGET_LINK_LIBRARIES(nvtt ${LIBS} nvcore nvimage nvthread nvsquish bc6h bc7 nvmath rg_etc1) + + INSTALL(TARGETS nvtt diff --git a/ports/nvtt/portfile.cmake b/ports/nvtt/portfile.cmake index c32e249a074c15..1d2d106e577304 100644 --- a/ports/nvtt/portfile.cmake +++ b/ports/nvtt/portfile.cmake @@ -14,6 +14,7 @@ vcpkg_from_github( bc7.patch squish.patch fix-build-error.patch + add_compile_options_for_osx.patch ) vcpkg_configure_cmake( From 313cd7c6e59231870a6950649fd763502b886f7e Mon Sep 17 00:00:00 2001 From: NancyLi1013 Date: Mon, 19 Oct 2020 19:50:06 -0700 Subject: [PATCH 6/8] [nvtt] Remove the compile option patch to retrigger CI --- ports/nvtt/add_compile_options_for_osx.patch | 15 --------------- ports/nvtt/portfile.cmake | 1 - 2 files changed, 16 deletions(-) delete mode 100644 ports/nvtt/add_compile_options_for_osx.patch diff --git a/ports/nvtt/add_compile_options_for_osx.patch b/ports/nvtt/add_compile_options_for_osx.patch deleted file mode 100644 index ec9afebdd62423..00000000000000 --- a/ports/nvtt/add_compile_options_for_osx.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/src/nvtt/CMakeLists.txt b/src/nvtt/CMakeLists.txt -index 9688c9c..a196f64 100644 ---- a/src/nvtt/CMakeLists.txt -+++ b/src/nvtt/CMakeLists.txt -@@ -53,6 +53,10 @@ ELSE(NVTT_SHARED) - ADD_LIBRARY(nvtt ${NVTT_SRCS}) - ENDIF(NVTT_SHARED) - -+if(APPLE) -+ add_compile_options(nvtt -mbmi2 -mfma) -+endif() -+ - TARGET_LINK_LIBRARIES(nvtt ${LIBS} nvcore nvimage nvthread nvsquish bc6h bc7 nvmath rg_etc1) - - INSTALL(TARGETS nvtt diff --git a/ports/nvtt/portfile.cmake b/ports/nvtt/portfile.cmake index 1d2d106e577304..c32e249a074c15 100644 --- a/ports/nvtt/portfile.cmake +++ b/ports/nvtt/portfile.cmake @@ -14,7 +14,6 @@ vcpkg_from_github( bc7.patch squish.patch fix-build-error.patch - add_compile_options_for_osx.patch ) vcpkg_configure_cmake( From 45c409beb5b27b312b59c8d2cf639b13b6af7e82 Mon Sep 17 00:00:00 2001 From: PhoebeHui <20694052+PhoebeHui@users.noreply.github.com> Date: Wed, 21 Oct 2020 23:29:03 -0700 Subject: [PATCH 7/8] Try to address the issue on osx --- ports/nvtt/add-compile-options-for-osx.patch | 15 +++++++++++++++ ports/nvtt/portfile.cmake | 1 + 2 files changed, 16 insertions(+) create mode 100644 ports/nvtt/add-compile-options-for-osx.patch diff --git a/ports/nvtt/add-compile-options-for-osx.patch b/ports/nvtt/add-compile-options-for-osx.patch new file mode 100644 index 00000000000000..6b7d94559fc707 --- /dev/null +++ b/ports/nvtt/add-compile-options-for-osx.patch @@ -0,0 +1,15 @@ +diff --git a/src/nvtt/CMakeLists.txt b/src/nvtt/CMakeLists.txt +index 9688c9c..42942c0 100644 +--- a/src/nvtt/CMakeLists.txt ++++ b/src/nvtt/CMakeLists.txt +@@ -47,6 +47,10 @@ ADD_DEFINITIONS(-DNVTT_EXPORTS) + #ADD_DEFINITIONS(-DHAVE_RGETC) + #ADD_DEFINITIONS(-DHAVE_ETCPACK) + ++if(APPLE) ++ add_compile_options(-mbmi2 -mfma) ++endif() ++ + IF(NVTT_SHARED) + ADD_LIBRARY(nvtt SHARED ${NVTT_SRCS}) + ELSE(NVTT_SHARED) diff --git a/ports/nvtt/portfile.cmake b/ports/nvtt/portfile.cmake index c32e249a074c15..46ea7f9b8e31f3 100644 --- a/ports/nvtt/portfile.cmake +++ b/ports/nvtt/portfile.cmake @@ -14,6 +14,7 @@ vcpkg_from_github( bc7.patch squish.patch fix-build-error.patch + add-compile-options-for-osx.patch ) vcpkg_configure_cmake( From 9e73b927288efeb07cd7234ab93d8ff06e91f7a5 Mon Sep 17 00:00:00 2001 From: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> Date: Fri, 23 Oct 2020 18:11:56 +0800 Subject: [PATCH 8/8] Update ports/nvtt/squish.patch --- ports/nvtt/squish.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/nvtt/squish.patch b/ports/nvtt/squish.patch index f01ab40c6c0007..5f971a7621df60 100644 --- a/ports/nvtt/squish.patch +++ b/ports/nvtt/squish.patch @@ -7,7 +7,7 @@ index 65a5dd3..d093ce5 100644 ADD_LIBRARY(nvsquish STATIC ${SQUISH_SRCS}) + -+INSTALL(TARGETS squish ++INSTALL(TARGETS nvsquish + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib/static)