8000 Fix hwloc version detection by upsj · Pull Request #1266 · ginkgo-project/ginkgo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix hwloc version detection #1266

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

Merged
merged 1 commit into from
Feb 8, 2023
Merged
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
36 changes: 1 addition & 35 deletions cmake/Modules/hwloc_helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -71,40 +71,6 @@ macro(ginkgo_check_static_or_dynamic package libraries)
endif()
endmacro()

function(HEX2DEC str res)
string(LENGTH "${str}" len)
if("${len}" EQUAL 1)
if("${str}" MATCHES "[0-9]")
set(${res} "${str}" PARENT_SCOPE)
elseif( "${str}" MATCHES "[aA]")
set(${res} 10 PARENT_SCOPE)
elseif( "${str}" MATCHES "[bB]")
set(${res} 11 PARENT_SCOPE)
elseif( "${str}" MATCHES "[cC]")
set(${res} 12 PARENT_SCOPE)
elseif( "${str}" MATCHES "[dD]")
set(${res} 13 PARENT_SCOPE)
elseif( "${str}" MATCHES "[eE]")
set(${res} 14 PARENT_SCOPE)
elseif( "${str}" MATCHES "[fF]")
set(${res} 15 PARENT_SCOPE)
else()
return()
endif()
else()
string(SUBSTRING "${str}" 0 1 str1)
string(SUBSTRING "${str}" 1 -1 str2)
hex2dec(${str1} res1)
hex2dec(${str2} res2)
math(EXPR val "16 * ${res1} + ${res2}")
set(${res} "${val}" PARENT_SCOPE)
endif()
endfunction()

macro(get_dec_from_hex hex dec)
if(${CMAKE_VERSION} VERSION_GREATER 3.13)
math(EXPR ${dec} ${hex} OUTPUT_FORMAT DECIMAL)
else()
hex2dec(${hex} ${dec})
endif()
math(EXPR ${dec} 0x${hex} OUTPUT_FORMAT DECIMAL)
endmacro()
0