Skip to content

Commit

Permalink
[openblas] Clean up portfile.cmake (#37498)
Browse files Browse the repository at this point in the history
  • Loading branch information
wangtz0607 authored Mar 18, 2024
1 parent a3f5d7a commit 7f629be
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
16 changes: 8 additions & 8 deletions ports/openblas/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ find_program(GIT NAMES git git.cmd)
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
# openblas requires perl to generate .def for exports
vcpkg_find_acquire_program(PERL)
get_filename_component(PERL_EXE_PATH "${PERL}" DIRECTORY)
set(PATH_BACKUP "$ENV{PATH}")
Expand Down Expand Up @@ -44,16 +44,15 @@ if(VCPKG_TARGET_IS_ANDROID)
endif()

set(OPENBLAS_EXTRA_OPTIONS)
# for UWP version, must build non uwp first for helper
# binaries.
# For UWP version, must build non-UWP first for helper binaries
if(VCPKG_TARGET_IS_UWP)
list(APPEND OPENBLAS_EXTRA_OPTIONS "-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")
list(APPEND OPENBLAS_EXTRA_OPTIONS
-DNOFORTRAN=ON
-DBU=_ #required for all blas functions to append extra _ using NAME
-DBU=_ # Required for all BLAS functions to append extra _ using NAME
)
endif()

Expand Down Expand Up @@ -99,11 +98,12 @@ if(EXISTS "${pcfile}")
#file(CREATE_LINK "${pcfile}" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/blas.pc" COPY_ON_ERROR)
endif()
vcpkg_fixup_pkgconfig()
#maybe we need also to write a wrapper inside share/blas to search implicitly for openblas, whenever we feel it's ready for its own -config.cmake file
# Maybe we need also to write a wrapper inside share/blas to search implicitly for openblas,
# whenever we feel it's ready for its own -config.cmake file.

# 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
# openblas does not have a config file, so I manually made this.
# But I think in most cases, 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")

vcpkg_replace_string(
Expand Down
2 changes: 1 addition & 1 deletion ports/openblas/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "openblas",
"version": "0.3.26",
"port-version": 2,
"port-version": 3,
"description": "OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version.",
"homepage": "https://github.com/OpenMathLib/OpenBLAS",
"license": "BSD-3-Clause",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -6354,7 +6354,7 @@
},
"openblas": {
"baseline": "0.3.26",
"port-version": 2
"port-version": 3
},
"opencascade": {
"baseline": "7.8.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/o-/openblas.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "f97eabf45b244d0c7cc374e23b818627fc82ffae",
"version": "0.3.26",
"port-version": 3
},
{
"git-tree": "e4543de7cb4becef05c5da248b647730031bd0c1",
"version": "0.3.26",
Expand Down

0 comments on commit 7f629be

Please sign in to comment.