Skip to content

[Code scan] Accept the advertised CUSOLVERMP_PATH variable in cuSOLVERMp setup #7570

Description

@njzjz

This issue is a result of a Codex global repository scan.

SetupCuSolverMp.cmake tells users to set CUSOLVERMP_PATH, but the actual search hints use CAL_CUSOLVERMP_PATH and NVHPC_ROOT_DIR. CollectBuildInfoVars.cmake also reports only CAL_CUSOLVERMP_PATH. Users following the error message can still get “not found”.

Search hints and error message:

# Find cuSOLVERMp first, then decide communicator backend.
find_library(CUSOLVERMP_LIBRARY NAMES cusolverMp
HINTS ${CAL_CUSOLVERMP_PATH} ${NVHPC_ROOT_DIR}
PATH_SUFFIXES lib lib64 math_libs/lib math_libs/lib64)
find_path(CUSOLVERMP_INCLUDE_DIR NAMES cusolverMp.h
HINTS ${CAL_CUSOLVERMP_PATH} ${NVHPC_ROOT_DIR}
PATH_SUFFIXES include math_libs/include)
if(NOT CUSOLVERMP_LIBRARY OR NOT CUSOLVERMP_INCLUDE_DIR)
message(FATAL_ERROR
"cuSOLVERMp not found. Set CUSOLVERMP_PATH or NVHPC_ROOT_DIR."
)

Build info path reporting:

if(DEFINED CAL_CUSOLVERMP_PATH AND ENABLE_CUSOLVERMP)
set(ABACUS_CUSOLVERMP_VERSION "yes (path: ${CAL_CUSOLVERMP_PATH})")
elseif(ENABLE_CUSOLVERMP)
set(ABACUS_CUSOLVERMP_VERSION "yes (version unknown)")

Relevant code:

find_library(CUSOLVERMP_LIBRARY NAMES cusolverMp
    HINTS ${CAL_CUSOLVERMP_PATH} ${NVHPC_ROOT_DIR}
    ...)
...
message(FATAL_ERROR
  "cuSOLVERMp not found. Set CUSOLVERMP_PATH or NVHPC_ROOT_DIR."
)

Suggested fix:

Either accept both CUSOLVERMP_PATH and CAL_CUSOLVERMP_PATH as aliases in the search/build-info logic, or update the error message and documentation to the actual supported variable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions