-
Notifications
You must be signed in to change notification settings - Fork 1
Ft automatic installation parsec #11
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
mahmoudElkarargyBS
merged 5 commits into
Climate-Emulator
from
FT-automatic-installation-parsec
Oct 23, 2024
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,108 @@ | ||
|
|
||
| # Copyright (c) 2017-2024 King Abdullah University of Science and Technology, | ||
| # All rights reserved. | ||
mahmoudElkarargyBS marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # ExaGeoStat is a software package, provided by King Abdullah University of Science and Technology (KAUST). | ||
|
|
||
| # @file FindHICMA-X.cmake | ||
| # @brief This is a CMakeLists file for finding HiCMA-X and link and include it's headers | ||
| # @version 2.0.0 | ||
| # @author Mahmoud ElKarargy | ||
| # @date 2024-09-28 | ||
|
|
||
| # Include pkg-config | ||
| find_package(PkgConfig QUIET) | ||
|
|
||
| # Try to find dplasma and parsec via pkg-config | ||
| if(PKG_CONFIG_FOUND) | ||
| pkg_check_modules(DPLASMA_PKG dplasma) | ||
| pkg_check_modules(PARSEC_PKG parsec) | ||
| if(DPLASMA_PKG_FOUND AND PARSEC_PKG_FOUND) | ||
| # Try to find the HICMA-X or hicma-x path in the library directories | ||
| string(FIND "${PARSEC_PKG_LIBRARY_DIRS}" "HICMA-X" HICMA_X_START) | ||
| if(HICMA_X_START EQUAL -1) | ||
| string(FIND "${PARSEC_PKG_LIBRARY_DIRS}" "hicma-x" HICMA_X_START) | ||
| endif() | ||
| if(HICMA_X_START GREATER -1) | ||
| # Extract the full path to HICMA-X or hicma-x and set the include directory | ||
| string(REGEX MATCH "([^;]*(HICMA-X|hicma-x)[^;]*/lib)" HICMA_X_LIB_PATH "${PARSEC_PKG_LIBRARY_DIRS}") | ||
| get_filename_component(HICMA_X_ROOT "${HICMA_X_LIB_PATH}" DIRECTORY) # Go one level up | ||
| set(HICMA-X_INCLUDE_DIRS "${HICMA_X_ROOT}/include") # Set the include path | ||
| endif() | ||
| # TODO: This is not generalized for the case of hicma installed manually | ||
| set(HICMA_X_SRC_DIR ${HICMA_X_ROOT}/hicma-x-src) | ||
| set(HICMA-X_FOUND TRUE) | ||
| set(HICMA-X_LIBRARIES ${DPLASMA_PKG_LIBRARIES} ${PARSEC_PKG_LIBRARIES}) | ||
| set(HICMA-X_LIBRARY_DIRS "${HICMA_X_LIB_PATH}") | ||
| # Add a search for lib64 directories and set HICMA-X_LIBRARY_DIRS_DEP | ||
| set(HICMA-X_LIBRARY_DIRS_DEP "${HICMA_X_LIB_PATH}64") | ||
|
|
||
| find_library(HICMA_PARSEC_LIB hicma_parsec PATHS ${HICMA-X_LIBRARY_DIRS_DEP}) | ||
|
|
||
| if(HICMA_PARSEC_LIB) | ||
| list(APPEND HICMA-X_LIBRARIES ${HICMA_PARSEC_LIB}) | ||
| else() | ||
| message(FATAL_ERROR "libhicma_parsec.so not found") | ||
| endif() | ||
|
|
||
| endif() | ||
| endif() | ||
|
|
||
| # Fallback: Manual search if pkg-config fails or HICMA-X path isn't set | ||
| if(NOT HICMA-X_FOUND) | ||
| # Improved search to handle multiple possible paths and fallback for include directories | ||
| find_path(HICMA-X_INCLUDE_DIR | ||
| NAMES hicma.h | ||
| PATHS | ||
| ${CMAKE_CURRENT_LIST_DIR}/../hicma-x/include | ||
| /usr/local/include/hicma-x | ||
| /usr/local/include | ||
| /usr/include/hicma-x | ||
| /usr/include | ||
| DOC "Path to HICMA-X include directory" | ||
| ) | ||
|
|
||
| # Search for the main HICMA-X library | ||
| find_library(HICMA-X_LIBRARY | ||
| NAMES hicma-x | ||
| PATHS | ||
| ${CMAKE_CURRENT_LIST_DIR}/../hicma-x/lib | ||
| /usr/local/lib | ||
| /usr/lib | ||
| DOC "Path to HICMA-X library" | ||
| ) | ||
|
|
||
| # Search for the hicma_parsec library in the lib64 directory if it's not found in the standard lib | ||
| find_library(HICMA_PARSEC_LIB | ||
| NAMES hicma_parsec | ||
| PATHS | ||
| ${CMAKE_CURRENT_LIST_DIR}/../hicma-x/lib64 | ||
| /usr/local/lib64 | ||
| /usr/lib64 | ||
| DOC "Path to HICMA-Parsec library" | ||
| ) | ||
|
|
||
| # Check if both the include directory and libraries were found | ||
| if(HICMA-X_INCLUDE_DIR AND HICMA-X_LIBRARY AND HICMA_PARSEC_LIB) | ||
| set(HICMA-X_FOUND TRUE) | ||
| # Combine the found libraries | ||
| set(HICMA-X_LIBRARIES ${HICMA-X_LIBRARY} ${HICMA_PARSEC_LIB}) | ||
| # Set the include directory | ||
| set(HICMA-X_INCLUDE_DIRS "${HICMA-X_INCLUDE_DIR}") | ||
| # Include both lib and lib64 directories | ||
| # TODO: This paths are not generalized, if the install is not with the same dir. | ||
| set(HICMA-X_LIBRARY_DIRS "${HICMA-X_LIBRARY}/lib") | ||
| set(HICMA-X_LIBRARY_DIRS_DEP "${HICMA-X_LIBRARY}/lib64") | ||
| else() | ||
| set(HICMA-X_FOUND FALSE) | ||
| endif() | ||
| endif() | ||
|
|
||
| # Mark the variables as advanced to keep the CMake GUI clean | ||
| mark_as_advanced(HICMA-X_INCLUDE_DIR HICMA-X_LIBRARY HICMA_PARSEC_LIB) | ||
|
|
||
| # Provide feedback on whether the library was found | ||
| if(HICMA-X_FOUND) | ||
| message(STATUS "Found HICMA-X") | ||
| else() | ||
| message("Could not find HICMA-X or its dependencies (dplasma, parsec)") | ||
| endif() | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| # Copyright (c) 2017-2024 King Abdullah University of Science and Technology, | ||
| # All rights reserved. | ||
| # ExaGeoStat is a software package, provided by King Abdullah University of Science and Technology (KAUST). | ||
|
|
||
| # @file ImportHiCMAX.cmake | ||
| # @brief Find and include HiCMA-X library as a dependency. | ||
| # @version 2.0.0 | ||
| # @author Mahmoud ElKarargy | ||
| # @author Sameh Abdulah | ||
| # @date 2024-09-21 | ||
|
|
||
| # Configuration settings for integrating the HICMA-X library into the project | ||
| # 'name' sets the identifier for the HICMA-X library within this script to "HICMA-X". | ||
| set(name "HICMA-X") | ||
| # Set the version tag for HiCMA-X. | ||
| set(tag "FIX-package-installation-MK") | ||
| # Flags to configure the build for HiCMA-X, including precision settings for DPLASMA | ||
| # and disabling GPU support for both CUDA and HIP. | ||
| set(flags '-DDPLASMA_PRECISIONS="s;d"' \-DPARSEC_WITH_DEVEL_HEADERS=ON \-DCMAKE_Fortran_FLAGS="-Wno-main" \-DPARSEC_GPU_WITH_HIP=OFF \-DPARSEC_GPU_WITH_CUDA=OFF \-DPARSEC_HAVE_CUDA=OFF \-DPARSEC_DIST_SHORT_LIMIT=0 \-DPARSEC_DIST_COLLECTIVES=ON \-DPARSEC_HAVE_DEV_CUDA_SUPPORT=OFF \-DDPLASMA_HAVE_CUDA=OFF) | ||
| # Indicates that HiCMA-X uses CMake for its build system. | ||
| set(is_cmake ON) | ||
| # Indicates that HiCMA-X is hosted on a Git repository. | ||
| set(is_git ON) | ||
| # Indicates that autogen scripts are not required for HiCMA-X. | ||
| set(auto_gen OFF) | ||
| # Set the URL of the HiCMA-X GitHub repository. | ||
| set(url "https://github.com/SAbdulah/hicma-x-dev.git") | ||
| # Include the macro to import HiCMA-X as a dependency. | ||
| include(macros/ImportDependency) | ||
|
|
||
| # Use the ImportDependency macro to handle fetching, detecting, and setting up HiCMA-X. | ||
| ImportDependency(${name} ${tag} "" ${url} "${flags}" "" ${is_cmake} ${is_git} ${auto_gen}) | ||
|
|
||
| # Include necessary directories for HiCMA-X and its dependencies. | ||
| include_directories(${HICMA_X_SRC_DIR}) | ||
| include_directories(${HICMA_X_SRC_DIR}/dplasma/src) | ||
| include_directories(${HICMA_X_SRC_DIR}/hicma_parsec) | ||
| include_directories(${HICMA_X_SRC_DIR}/bin/dplasma/src) | ||
| # Display a status message indicating that HiCMA-X has been successfully included. | ||
| message(STATUS "HiCMA-X done") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.