diff --git a/ports/openblas/install-tools.patch b/ports/openblas/install-tools.patch new file mode 100644 index 00000000000000..5d9e4061b8802c --- /dev/null +++ b/ports/openblas/install-tools.patch @@ -0,0 +1,22 @@ +diff --git a/cmake/prebuild.cmake b/cmake/prebuild.cmake +index 0c126e3..bb0124b 100644 +--- a/cmake/prebuild.cmake ++++ b/cmake/prebuild.cmake +@@ -558,6 +558,8 @@ else(NOT CMAKE_CROSSCOMPILING) + if (NOT ${GETARCH_RESULT}) + MESSAGE(FATAL_ERROR "Compiling getarch failed ${GETARCH_LOG}") + endif () ++ ++ install(FILES "${PROJECT_BINARY_DIR}/${GETARCH_BIN}" DESTINATION bin) + endif () + unset (HAVE_AVX2) + unset (HAVE_AVX) +@@ -601,6 +603,8 @@ execute_process(COMMAND "${BLASHELPER_BINARY_DIR}/${GETARCH_BIN}" 1 OUTPUT_VARIA + if (NOT ${GETARCH2_RESULT}) + MESSAGE(FATAL_ERROR "Compiling getarch_2nd failed ${GETARCH2_LOG}") + endif () ++ ++ install(FILES "${PROJECT_BINARY_DIR}/${GETARCH2_BIN}" DESTINATION bin) + endif () + + # use the cmake binary w/ the -E param to run a shell command in a cross-platform way diff --git a/ports/openblas/portfile.cmake b/ports/openblas/portfile.cmake index cec9cf2a98c99e..34e321a6864de5 100644 --- a/ports/openblas/portfile.cmake +++ b/ports/openblas/portfile.cmake @@ -10,17 +10,18 @@ vcpkg_from_github( fix-redefinition-function.patch fix-uwp-build.patch fix-marco-conflict.patch + install-tools.patch ) find_program(GIT NAMES git git.cmd) # sed and awk are installed with git but in a different directory -get_filename_component(GIT_EXE_PATH ${GIT} DIRECTORY) +get_filename_component(GIT_EXE_PATH "${GIT}" DIRECTORY) set(SED_EXE_PATH "${GIT_EXE_PATH}/../usr/bin") # openblas require perl to generate .def for exports vcpkg_find_acquire_program(PERL) -get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) +get_filename_component(PERL_EXE_PATH "${PERL}" DIRECTORY) set(PATH_BACKUP "$ENV{PATH}") vcpkg_add_to_path("${PERL_EXE_PATH}") vcpkg_add_to_path("${SED_EXE_PATH}") @@ -29,15 +30,11 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS FEATURES threads USE_THREAD simplethread USE_SIMPLE_THREADED_LEVEL3 + "dynamic-arch" DYNAMIC_ARCH ) set(COMMON_OPTIONS -DBUILD_WITHOUT_LAPACK=ON) -vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - FEATURES - "dynamic-arch" DYNAMIC_ARCH -) - if(VCPKG_TARGET_IS_OSX) if("dynamic-arch" IN_LIST FEATURES) vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) @@ -45,67 +42,41 @@ if(VCPKG_TARGET_IS_OSX) endif() endif() +set(OPENBLAS_EXTRA_OPTIONS) # for UWP version, must build non uwp first for helper # binaries. -if(VCPKG_TARGET_IS_UWP) - message(STATUS "Building Windows helper files") - set(TEMP_CMAKE_SYSTEM_NAME "${VCPKG_CMAKE_SYSTEM_NAME}") - set(TEMP_CMAKE_SYSTEM_VERSION "${VCPKG_CMAKE_SYSTEM_VERSION}") - set(TEMP_TARGET_TRIPLET "${TARGET_TRIPLET}") - unset(VCPKG_CMAKE_SYSTEM_NAME) - unset(VCPKG_CMAKE_SYSTEM_VERSION) - set(TARGET_TRIPLET "x64-windows") - - vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - OPTIONS ${FEATURE_OPTIONS} - ${COMMON_OPTIONS} - -DTARGET=NEHALEM - ) - - # add just built path to environment for gen_config_h.exe, - # getarch.exe and getarch_2nd.exe - vcpkg_add_to_path("${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") - - # restore target build information - set(VCPKG_CMAKE_SYSTEM_NAME "${TEMP_CMAKE_SYSTEM_NAME}") - set(VCPKG_CMAKE_SYSTEM_VERSION "${TEMP_CMAKE_SYSTEM_VERSION}") - set(TARGET_TRIPLET "${TEMP_TARGET_TRIPLET}") - - message(STATUS "Finished building Windows helper files") - - vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - OPTIONS - ${COMMON_OPTIONS} - -DCMAKE_SYSTEM_PROCESSOR=AMD64 - -DVS_WINRT_COMPONENT=TRUE - "-DBLASHELPER_BINARY_DIR=${CURRENT_BUILDTREES_DIR}/x64-windows-rel") - -elseif(VCPKG_TARGET_IS_WINDOWS) - vcpkg_configure_cmake( - PREFER_NINJA - SOURCE_PATH ${SOURCE_PATH} - OPTIONS - ${COMMON_OPTIONS} - ${FEATURE_OPTIONS} - ) -else() +if(VCPKG_TARGET_IS_UWP) + list(APPEND OPENBLAS_EXTRA_OPTIONS -DCMAKE_SYSTEM_PROCESSOR=AMD64 + "-DBLASHELPER_BINARY_DIR=${CURRENT_HOST_INSTALLED_DIR}/tools/${PORT}") +elseif(NOT (VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)) string(APPEND VCPKG_C_FLAGS " -DNEEDBUNDERSCORE") # Required to get common BLASFUNC to append extra _ string(APPEND VCPKG_CXX_FLAGS " -DNEEDBUNDERSCORE") - vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - OPTIONS - ${COMMON_OPTIONS} - ${FEATURE_OPTIONS} - -DNOFORTRAN=ON - -DBU=_ #required for all blas functions to append extra _ using NAME - ) + list(APPEND OPENBLAS_EXTRA_OPTIONS + -DNOFORTRAN=ON + -DBU=_ #required for all blas functions to append extra _ using NAME + ) endif() +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + ${FEATURE_OPTIONS} + ${COMMON_OPTIONS} + ${OPENBLAS_EXTRA_OPTIONS} +) + +vcpkg_cmake_install() +vcpkg_copy_pdbs() + +vcpkg_cmake_config_fixup(CONFIG_PATH share/cmake/OpenBLAS) + +if (EXISTS "${CURRENT_PACKAGES_DIR}/bin/getarch${VCPKG_HOST_EXECUTABLE_SUFFIX}") + vcpkg_copy_tools(TOOL_NAMES getarch AUTO_CLEAN) +endif() +if (EXISTS "${CURRENT_PACKAGES_DIR}/bin/getarch_2nd${VCPKG_HOST_EXECUTABLE_SUFFIX}") + vcpkg_copy_tools(TOOL_NAMES getarch_2nd AUTO_CLEAN) +endif() -vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/OpenBLAS TARGET_PATH share/openblas) set(ENV{PATH} "${PATH_BACKUP}") set(pcfile "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/openblas.pc") @@ -128,14 +99,14 @@ vcpkg_fixup_pkgconfig() # openblas do not make the config file , so I manually made this # but I think in most case, libraries will not include these files, they define their own used function prototypes # this is only to quite vcpkg -file(COPY ${CMAKE_CURRENT_LIST_DIR}/openblas_common.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) - -file(READ ${SOURCE_PATH}/cblas.h CBLAS_H) -string(REPLACE "#include \"common.h\"" "#include \"openblas_common.h\"" CBLAS_H "${CBLAS_H}") -file(WRITE ${CURRENT_PACKAGES_DIR}/include/cblas.h "${CBLAS_H}") +file(COPY "${CMAKE_CURRENT_LIST_DIR}/openblas_common.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include") -vcpkg_copy_pdbs() +vcpkg_replace_string( + "${SOURCE_PATH}/cblas.h" + "#include \"common.h\"" + "#include \"openblas_common.h\"" +) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share") -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/openblas/vcpkg.json b/ports/openblas/vcpkg.json index e0206c35c26925..041c0f3e309b4a 100644 --- a/ports/openblas/vcpkg.json +++ b/ports/openblas/vcpkg.json @@ -1,12 +1,25 @@ { "name": "openblas", "version": "0.3.15", + "port-version": 1, "description": "OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version.", "homepage": "https://github.com/xianyi/OpenBLAS", "dependencies": [ + { + "name": "openblas", + "host": true + }, { "name": "pthread", "platform": "!windows & !uwp" + }, + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true } ], "features": { diff --git a/ports/shogun/fix-cblas-path.patch b/ports/shogun/fix-cblas-path.patch new file mode 100644 index 00000000000000..e21a3723c48a40 --- /dev/null +++ b/ports/shogun/fix-cblas-path.patch @@ -0,0 +1,13 @@ +diff --git a/src/shogun/mathematics/lapack.h b/src/shogun/mathematics/lapack.h +index 6ba466f..f5de479 100644 +--- a/src/shogun/mathematics/lapack.h ++++ b/src/shogun/mathematics/lapack.h +@@ -38,7 +38,7 @@ extern "C" { + #include + #endif + #else +-#include ++#include + #endif + + #ifdef HAVE_ACML diff --git a/ports/shogun/portfile.cmake b/ports/shogun/portfile.cmake index 05ca61af0811c7..454245027a3654 100644 --- a/ports/shogun/portfile.cmake +++ b/ports/shogun/portfile.cmake @@ -11,6 +11,7 @@ vcpkg_from_github( cmake-config.in.patch fix-dirent.patch fix-ASSERT-not-found.patch + fix-cblas-path.patch ) vcpkg_find_acquire_program(PYTHON3) diff --git a/ports/shogun/vcpkg.json b/ports/shogun/vcpkg.json index 6711f2bfbf11cd..5ef5cf9444d662 100644 --- a/ports/shogun/vcpkg.json +++ b/ports/shogun/vcpkg.json @@ -1,7 +1,7 @@ { "name": "shogun", "version-string": "6.1.4", - "port-version": 5, + "port-version": 6, "description": "Unified and efficient Machine Learning", "homepage": "https://github.com/shogun-toolbox/shogun", "dependencies": [ diff --git a/versions/baseline.json b/versions/baseline.json index 1079671bb25e74..a244cf271ba287 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4858,7 +4858,7 @@ }, "openblas": { "baseline": "0.3.15", - "port-version": 0 + "port-version": 1 }, "opencascade": { "baseline": "7.5.0", @@ -6214,7 +6214,7 @@ }, "shogun": { "baseline": "6.1.4", - "port-version": 5 + "port-version": 6 }, "signalrclient": { "baseline": "1.0.0-beta1-9", diff --git a/versions/o-/openblas.json b/versions/o-/openblas.json index b7a541443a7f5e..7a54f9b2cca3cc 100644 --- a/versions/o-/openblas.json +++ b/versions/o-/openblas.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "048ae3833af8e5633ce86c3174e20c2794fe573d", + "version": "0.3.15", + "port-version": 1 + }, { "git-tree": "2a214e1bac47c70d932caef7d74771c8658b1f7a", "version": "0.3.15", diff --git a/versions/s-/shogun.json b/versions/s-/shogun.json index 185412f8283ee2..8fd9b801eb00ae 100644 --- a/versions/s-/shogun.json +++ b/versions/s-/shogun.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "0ae86e647188a99b1602164f4614ba54d55cf22a", + "version-string": "6.1.4", + "port-version": 6 + }, { "git-tree": "bc5a003bcb8a42fc935726d0d8de55156318a3db", "version-string": "6.1.4",