commit:     472f36bcd300da19c6f6953ece0811b63a3134e0
Author:     Marek Szuba <marecki <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 14 16:03:10 2021 +0000
Commit:     Marek Szuba <marecki <AT> gentoo <DOT> org>
CommitDate: Wed Jul 14 16:14:45 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=472f36bc

sci-libs/pastix: add 6.0.3, masked

The ebuild in principle works but there are several features which for
various reasons remain problematic (see the package.use.mask entry), and
with this being a new major version chances are not all revdeps will be
happy with it (hence the overall mask). Testing very much encouraged!

Bug: https://bugs.gentoo.org/751034
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>

 profiles/base/package.use.mask                     |  20 +
 profiles/package.mask                              |   5 +
 sci-libs/pastix/Manifest                           |   1 +
 .../pastix-6.0.3-cmake-examples-optional.patch     | 170 +++++++++
 .../files/pastix-6.0.3-cmake-installdirs.patch     | 424 +++++++++++++++++++++
 .../files/pastix-6.0.3-cmake-python-optional.patch |  64 ++++
 .../files/pastix-6.0.3-cmake-spm-project.patch     |  12 +
 .../pastix-6.0.3-multiple-coeftabMemory.patch      |  11 +
 sci-libs/pastix/metadata.xml                       |   8 +-
 sci-libs/pastix/pastix-6.0.3.ebuild                |  84 ++++
 10 files changed, 797 insertions(+), 2 deletions(-)

diff --git a/profiles/base/package.use.mask b/profiles/base/package.use.mask
index 83513d5d82c..3bcead9090d 100644
--- a/profiles/base/package.use.mask
+++ b/profiles/base/package.use.mask
@@ -6,6 +6,26 @@
 # This file is only for generic masks. For arch-specific masks (i.e.
 # mask everywhere, unmask on arch/*) use arch/base.
 
+# Marek Szuba <mare...@gentoo.org> (2021-07-14)
+# Several known issues (possibly with older pastix versions as well but
+# in v6 they result in clear errors):
+# * CUDA support needs testing, may or may not work as it is;
+# * All sci-libs/scotch ebuilds currently in the tree seem to always use
+#   32-bit integer representation, even when built USE=int64. Seeing as
+#   metis ordering has got more complicated issues (see below), just
+#   stick with 32 bits for now;
+# * sci-libs/metis currently always uses whatever integer representation
+#   is native to the target architecture even though upstream allows for
+#   using 32-bit integers on 64-bit arches, this will have to be implemented
+#   so that pastix can pass int64? to it;
+# * With MPI enabled two tests fail (when linked against openmpi, at least)
+#   due to incorrect implementation of either MPI support itself or
+#   said tests - example_drv_facto0_d_reentrant tries to initialise MPI
+#   more than once, test_bvec_gemv_tests calls MPI_Query_thread() after
+#   invocation of MPI_FINALIZE;
+# * dev-libs/starpu needs a version bump.
+>=sci-libs/pastix-6.0.0 cuda int64 metis mpi starpu
+
 # Alfredo Tupone <tup...@gentoo.org> (2021-06-27)
 # lto does not work on dev-lang/gnat-gpl-2021
 dev-lang/gnat-gpl:10 lto

diff --git a/profiles/package.mask b/profiles/package.mask
index 25612156c60..6a20d46213b 100644
--- a/profiles/package.mask
+++ b/profiles/package.mask
@@ -32,6 +32,11 @@
 
 #--- END OF EXAMPLES ---
 
+# Marek Szuba <mare...@gentoo.org> (2021-07-14)
+# New, considerably refactored major version with a new build system.
+# Masked for further testing.
+>=sci-libs/pastix-6.0.0
+
 # Marco Scardovi <ma...@scardovi.vom> (2021-07-13)
 # These packages were only ported for netbox. Not useful for anything else
 # No revdeps. Removal in 30 days (Bug #801991)

diff --git a/sci-libs/pastix/Manifest b/sci-libs/pastix/Manifest
index ebbea05dd67..54351d75797 100644
--- a/sci-libs/pastix/Manifest
+++ b/sci-libs/pastix/Manifest
@@ -1,2 +1,3 @@
+DIST pastix-6.0.3.tar.gz 1793579 BLAKE2B 
9e0ee71c80b2c93c6762c1a824b2e1262fd1a9f406194fb99eeecbfc172cf82f497d23a541b56c44e5487c3c228cab781f47f683ee04c6cdf426da6126750a69
 SHA512 
5bf8dfa6ed02ee7e236c63e21c80bd45af807b465b21a8c0520b1328e179095f1416f925be9f8b5ec0e8078ca9bc4398bf0d091fdc8e9ea51b9af12a06d9a544
 DIST pastix_5.2.2.22.tar.bz2 2664470 BLAKE2B 
b1fbd12bf2c882aa8fd2c4891a6890df4bdc4488cedca2a7861e676ec5678063927f2e4a4edc47aa7ca0422b283f8f012aa1032af7212fe39f4c55e7f0f7adc4
 SHA512 
15ecdb10b5229e40f744c1ad54be7cac6560cb92e90df1937c90ca7da290df6bdb6f24a1e1c54197731b9df3e0dcc0b9fa39750479fcf03a0c08c304c5b9df70
 DIST pastix_5.2.3.tar.bz2 2246903 BLAKE2B 
b13cb31bbc2aeb122e932b2a934598ec975a55f327483bf1383280976584858426c56982f6980b52f32f04e05c6e6c8de1cf35e378e61a7be9dddb705b1c033a
 SHA512 
69acffac1be8c756886783c2a6307269ab4d14abfc4a77268b3d14995e53b16084c298446812484233d9d52c317490d6ad67788166adf367075e6c8442147b95

diff --git a/sci-libs/pastix/files/pastix-6.0.3-cmake-examples-optional.patch 
b/sci-libs/pastix/files/pastix-6.0.3-cmake-examples-optional.patch
new file mode 100644
index 00000000000..5f070116827
--- /dev/null
+++ b/sci-libs/pastix/files/pastix-6.0.3-cmake-examples-optional.patch
@@ -0,0 +1,170 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -94,6 +94,9 @@
+   "Build PaStiX with PaRSEC runtime support" OFF)
+ 
+ # Internal options
++option(INSTALL_EXAMPLES
++  "Install example code" OFF)
++
+ option(PASTIX_GENERATE_MODEL
+   "Enable performances profiling for model generation" OFF)
+ 
+--- a/example/CMakeLists.txt
++++ b/example/CMakeLists.txt
+@@ -38,15 +38,18 @@
+   )
+ set (example_install_dir "${CMAKE_INSTALL_DOCDIR}/examples/c")
+ 
++if (BUILD_TESTING)
+ foreach (_file ${EXAMPLES})
+   get_filename_component(_name_we ${_file} NAME_WE)
+   add_executable(${_name_we} ${_file})
+   target_link_libraries(${_name_we} pastix)
+   target_link_libraries(${_name_we} ${BLAS_LIBRARIES})
+-
+-  install(TARGETS ${_name_we} RUNTIME DESTINATION ${example_install_dir} )
+-  install(FILES   ${_file}            DESTINATION ${example_install_dir} )
+ endforeach()
++endif()
++
++if (INSTALL_EXAMPLES)
++
++install(FILES ${EXAMPLES} DESTINATION ${example_install_dir} )
+ 
+ ### Install a makefile for user compilation test
+ set( EXAMPLE_LIBS ${DEPS_LIBRARIES} )
+@@ -61,4 +64,6 @@
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/make/Makefile"
+   DESTINATION ${example_install_dir})
+ 
++endif (INSTALL_EXAMPLES)
++
+ include(CTestLists.txt)
+--- a/example/old/CMakeLists.txt
++++ b/example/old/CMakeLists.txt
+@@ -15,14 +15,17 @@
+   )
+ set (example_install_dir "${CMAKE_INSTALL_DOCDIR}/examples/c/old")
+ 
++if (BUILD_TESTING)
+ foreach (_file ${EXAMPLES})
+   get_filename_component(_name_we ${_file} NAME_WE)
+   add_executable("old_${_name_we}" ${_file})
+   target_link_libraries("old_${_name_we}" pastix)
+-
+-  install(TARGETS old_${_name_we} RUNTIME DESTINATION ${example_install_dir} )
+-  install(FILES   ${_file}                DESTINATION ${example_install_dir} )
+ endforeach()
++endif()
++
++if (INSTALL_EXAMPLES)
++
++install(FILES ${EXAMPLES} DESTINATION ${example_install_dir} )
+ 
+ ### Install a makefile for user compilation test
+ set( EXAMPLE_LIBS
+@@ -36,3 +39,4 @@
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/make/Makefile"
+   DESTINATION ${example_install_dir} )
+ 
++endif (INSTALL_EXAMPLES)
+--- a/spm/wrappers/fortran90/CMakeLists.txt
++++ b/spm/wrappers/fortran90/CMakeLists.txt
+@@ -43,15 +43,19 @@
+   )
+ set ( example_install_dir "${CMAKE_INSTALL_DOCDIR}/examples/fortran" )
+ 
++if (BUILD_TESTING)
+ foreach (_file ${EXAMPLES})
+   get_filename_component(_name_we ${_file} NAME_WE)
+   add_executable(${_name_we} examples/${_file})
+   target_link_libraries(${_name_we} spmf)
+ 
+-  install(TARGETS ${_name_we}       RUNTIME DESTINATION 
${example_install_dir} )
+-  install(FILES   examples/${_file}         DESTINATION 
${example_install_dir} )
+-
+   add_test(fortran_${_name_we} ./${_name_we})
+ 
+ endforeach()
++endif()
+ 
++if (INSTALL_EXAMPLES)
++  foreach (_file ${EXAMPLES})
++    install(FILES examples/${_file} DESTINATION ${example_install_dir} )
++  endforeach()
++endif()
+--- a/spm/wrappers/python/CMakeLists.txt
++++ b/spm/wrappers/python/CMakeLists.txt
+@@ -31,11 +31,13 @@
+   DESTINATION "${Python_SITELIB}/spm" )
+ 
+ # Install python examples
++if (INSTALL_EXAMPLES)
+ install(FILES
+   ${CMAKE_CURRENT_SOURCE_DIR}/spm_driver.py
+   ${CMAKE_CURRENT_SOURCE_DIR}/spm_scipy.py
+   DESTINATION "${CMAKE_INSTALL_DOCDIR}/examples/python"
+   )
++endif()
+ 
+ ## CTest execution
+   set( PYTHON_TESTS
+--- a/wrappers/fortran90/CMakeLists.txt
++++ b/wrappers/fortran90/CMakeLists.txt
+@@ -45,14 +45,13 @@
+   )
+ set ( example_install_dir "${CMAKE_INSTALL_DOCDIR}/examples/fortran" )
+ 
++if (BUILD_TESTING)
++
+ foreach (_file ${EXAMPLES})
+   get_filename_component(_name_we ${_file} NAME_WE)
+   add_executable(${_name_we} examples/${_file})
+   target_link_libraries(${_name_we} pastixf spmf)
+ 
+-  install(TARGETS ${_name_we}       RUNTIME DESTINATION 
${example_install_dir} )
+-  install(FILES   examples/${_file}         DESTINATION 
${example_install_dir} )
+-
+   add_test(fortran_${_name_we} ./${_name_we})
+ 
+ endforeach()
+@@ -66,10 +65,16 @@
+ add_executable(${_name_we} examples/${_file})
+ target_link_libraries(${_name_we} pastixf spmf)
+ 
+-install(TARGETS ${_name_we}       RUNTIME DESTINATION ${example_install_dir} )
+-install(FILES   examples/${_file}         DESTINATION ${example_install_dir} )
+-install(FILES   examples/test_seq.in      DESTINATION ${example_install_dir} )
+-install(FILES   examples/test_mt.in       DESTINATION ${example_install_dir} )
++endif (BUILD_TESTING)
++
++if (INSTALL_EXAMPLES)
++  foreach (_file ${EXAMPLES})
++    install(FILES examples/${_file} DESTINATION ${example_install_dir} )
++  endforeach()
++  install(FILES examples/fmultilap.f90 DESTINATION ${example_install_dir} )
++  install(FILES examples/test_seq.in DESTINATION ${example_install_dir} )
++  install(FILES examples/test_mt.in DESTINATION ${example_install_dir} )
++endif()
+ 
+ # Add OpenMP if available
+ find_package(OpenMP)
+--- a/wrappers/python/CMakeLists.txt
++++ b/wrappers/python/CMakeLists.txt
+@@ -32,6 +32,7 @@
+   DESTINATION "${Python_SITELIB}/pypastix" )
+ 
+ # Install python examples
++if (INSTALL_EXAMPLES)
+ install(FILES
+   ${CMAKE_CURRENT_SOURCE_DIR}/examples/simple.py
+   ${CMAKE_CURRENT_SOURCE_DIR}/examples/simple_obj.py
+@@ -39,6 +40,7 @@
+   ${CMAKE_CURRENT_SOURCE_DIR}/examples/schur_obj.py
+   DESTINATION "${CMAKE_INSTALL_DOCDIR}/examples/python"
+   )
++endif()
+ 
+ ## CTest execution
+   set( PYTHON_TESTS

diff --git a/sci-libs/pastix/files/pastix-6.0.3-cmake-installdirs.patch 
b/sci-libs/pastix/files/pastix-6.0.3-cmake-installdirs.patch
new file mode 100644
index 00000000000..a586981f37e
--- /dev/null
+++ b/sci-libs/pastix/files/pastix-6.0.3-cmake-installdirs.patch
@@ -0,0 +1,424 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -13,6 +13,7 @@
+ 
+ include(CMakeDependentOption)
+ include(CheckFunctionExists)
++include(GNUInstallDirs)
+ 
+ # The current version number
+ set(PASTIX_VERSION_MAJOR 6)
+@@ -516,7 +517,7 @@
+ configure_file (
+   "${CMAKE_CURRENT_SOURCE_DIR}/include/pastix/config.h.in"
+   "${PROJECT_INCLUDE_DIR}/pastix/config.h")
+-install(FILES "${PROJECT_INCLUDE_DIR}/pastix/config.h" DESTINATION 
include/pastix)
++install(FILES "${PROJECT_INCLUDE_DIR}/pastix/config.h" DESTINATION 
${CMAKE_INSTALL_INCLUDEDIR}/pastix)
+ 
+ include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
+ include_directories("${CMAKE_CURRENT_BINARY_DIR}")
+@@ -844,9 +845,9 @@
+ # endforeach()
+ 
+ install(TARGETS pastix
+-  RUNTIME DESTINATION bin
+-  ARCHIVE DESTINATION lib
+-  LIBRARY DESTINATION lib)
++  RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
++  ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
++  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ 
+ # Install header files
+ set(PASTIX_HDRS
+@@ -861,8 +862,8 @@
+ )
+ install(FILES
+   include/pastix.h
+-  DESTINATION include )
+-install(FILES ${PASTIX_HDRS} DESTINATION include/pastix )
++  DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
++install(FILES ${PASTIX_HDRS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pastix )
+ 
+ ## Executable and tests
+ enable_testing()
+@@ -934,8 +935,6 @@
+   "${CMAKE_CURRENT_SOURCE_DIR}/pastixf.pc.in"
+   PROJECTNAME PASTIX )
+ 
+-generate_env_file( PROJECTNAME PASTIX )
+-
+ #############################################################
+ #
+ #      Build documentation
+--- a/cmake_modules/morse_cmake/modules/GenPkgConfig.cmake
++++ b/cmake_modules/morse_cmake/modules/GenPkgConfig.cmake
+@@ -196,7 +196,7 @@
+     # ------------
+     install(FILES
+       "${CMAKE_BINARY_DIR}/lib/pkgconfig/${fname}.pc"
+-      DESTINATION lib/pkgconfig )
++      DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig" )
+ 
+   endforeach()
+ 
+@@ -232,7 +232,7 @@
+   # installation
+   # ------------
+   install(FILES "${CMAKE_CURRENT_BINARY_DIR}/bin/${LONAME}_env.sh"
+-    DESTINATION bin)
++    DESTINATION ${CMAKE_INSTALL_BINDIR})
+ 
+ endmacro(generate_env_file)
+ 
+--- a/example/CMakeLists.txt
++++ b/example/CMakeLists.txt
+@@ -36,6 +36,7 @@
+   simple.c
+   step-by-step.c
+   )
++set (example_install_dir "${CMAKE_INSTALL_DOCDIR}/examples/c")
+ 
+ foreach (_file ${EXAMPLES})
+   get_filename_component(_name_we ${_file} NAME_WE)
+@@ -43,8 +44,8 @@
+   target_link_libraries(${_name_we} pastix)
+   target_link_libraries(${_name_we} ${BLAS_LIBRARIES})
+ 
+-  install(TARGETS ${_name_we} RUNTIME DESTINATION examples )
+-  install(FILES   ${_file}            DESTINATION examples )
++  install(TARGETS ${_name_we} RUNTIME DESTINATION ${example_install_dir} )
++  install(FILES   ${_file}            DESTINATION ${example_install_dir} )
+ endforeach()
+ 
+ ### Install a makefile for user compilation test
+@@ -58,6 +59,6 @@
+   "${CMAKE_CURRENT_SOURCE_DIR}/Makefile.in"
+   "${CMAKE_CURRENT_BINARY_DIR}/make/Makefile" @ONLY)
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/make/Makefile"
+-  DESTINATION examples)
++  DESTINATION ${example_install_dir})
+ 
+ include(CTestLists.txt)
+--- a/example/old/CMakeLists.txt
++++ b/example/old/CMakeLists.txt
+@@ -13,14 +13,15 @@
+   simple.c
+   step-by-step.c
+   )
++set (example_install_dir "${CMAKE_INSTALL_DOCDIR}/examples/c/old")
+ 
+ foreach (_file ${EXAMPLES})
+   get_filename_component(_name_we ${_file} NAME_WE)
+   add_executable("old_${_name_we}" ${_file})
+   target_link_libraries("old_${_name_we}" pastix)
+ 
+-  install(TARGETS old_${_name_we} RUNTIME DESTINATION examples/old )
+-  install(FILES   ${_file}                DESTINATION examples/old )
++  install(TARGETS old_${_name_we} RUNTIME DESTINATION ${example_install_dir} )
++  install(FILES   ${_file}                DESTINATION ${example_install_dir} )
+ endforeach()
+ 
+ ### Install a makefile for user compilation test
+@@ -33,5 +34,5 @@
+   "${CMAKE_CURRENT_SOURCE_DIR}/Makefile.in"
+   "${CMAKE_CURRENT_BINARY_DIR}/make/Makefile" @ONLY)
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/make/Makefile"
+-  DESTINATION examples/old )
++  DESTINATION ${example_install_dir} )
+ 
+--- a/kernels/CMakeLists.txt
++++ b/kernels/CMakeLists.txt
+@@ -149,8 +149,8 @@
+ 
+ ### Install library
+ install(TARGETS pastix_kernels
+-  ARCHIVE DESTINATION lib
+-  LIBRARY DESTINATION lib)
++      ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
++  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ 
+ ### Add generated files to the global property
+ add_documented_files(
+--- a/kernels/gpus/CMakeLists.txt
++++ b/kernels/gpus/CMakeLists.txt
+@@ -66,8 +66,8 @@
+ #     ${cuda_generated_files})
+ #   cuda_add_cublas_to_target( pastix_cucores_sm${_smtarget} )
+ #   install(TARGETS pastix_cucores_sm${_smtarget}
+-#     LIBRARY DESTINATION lib
+-#     ARCHIVE DESTINATION lib )
++#     LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
++#     ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} )
+ #   # if( NOT CMAKE_BUILD_SHARED_LIBS )
+ #   #   target_link_libraries( pastix_cucores pastix_cucores_sm${_smtarget} )
+ #   # endif()
+@@ -79,7 +79,7 @@
+ cuda_add_cublas_to_target( pastix_kernels_cuda )
+ 
+ install(TARGETS pastix_kernels_cuda
+-  LIBRARY DESTINATION lib
+-  ARCHIVE DESTINATION lib )
++  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
++  ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} )
+ 
+ cuda_build_clean_target()
+--- a/sopalin/parsec/CMakeLists.txt
++++ b/sopalin/parsec/CMakeLists.txt
+@@ -114,8 +114,8 @@
+ endif (MPI_C_FOUND)
+ 
+ install(TARGETS pastix_parsec
+-  ARCHIVE DESTINATION lib
+-  LIBRARY DESTINATION lib)
++  ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
++  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ 
+ ### Add non-generated documented files to the global property
+ add_documented_files(
+--- a/sopalin/starpu/CMakeLists.txt
++++ b/sopalin/starpu/CMakeLists.txt
+@@ -96,8 +96,8 @@
+ endif (MPI_C_FOUND)
+ 
+ install(TARGETS pastix_starpu
+-  ARCHIVE DESTINATION lib
+-  LIBRARY DESTINATION lib)
++  ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
++  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ 
+ ### Add non-generated documented files to the global property
+ add_documented_files(
+--- a/spm/CMakeLists.txt
++++ b/spm/CMakeLists.txt
+@@ -139,7 +139,7 @@
+ configure_file (
+   "${CMAKE_CURRENT_SOURCE_DIR}/include/spm_config.h.in"
+   "${CMAKE_CURRENT_BINARY_DIR}/include/spm_config.h")
+-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/include/spm_config.h" DESTINATION 
include)
++install(FILES "${CMAKE_CURRENT_BINARY_DIR}/include/spm_config.h" DESTINATION 
${CMAKE_INSTALL_INCLUDEDIR})
+ 
+ include_directories(include)
+ include_directories("${CMAKE_CURRENT_BINARY_DIR}/include")
+@@ -231,14 +231,14 @@
+ endif (MPI_C_FOUND)
+ 
+ install(TARGETS spm
+-  ARCHIVE DESTINATION lib
+-  LIBRARY DESTINATION lib)
++  ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
++  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ 
+ install(FILES
+   include/spm.h
+   include/spm_const.h
+   include/spm_datatypes.h
+-  DESTINATION include )
++  DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
+ 
+ ### Build pkg-config and environment file
+ include(GenPkgConfig)
+@@ -251,8 +251,6 @@
+   "${CMAKE_CURRENT_SOURCE_DIR}/tools/spmf.pc.in"
+   PROJECTNAME SPM )
+ 
+-generate_env_file( PROJECTNAME SPM )
+-
+ ### Add documented files to the global property
+ add_documented_files(
+   DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+--- a/spm/cmake_modules/morse_cmake/modules/GenPkgConfig.cmake
++++ b/spm/cmake_modules/morse_cmake/modules/GenPkgConfig.cmake
+@@ -196,7 +196,7 @@
+     # ------------
+     install(FILES
+       "${CMAKE_BINARY_DIR}/lib/pkgconfig/${fname}.pc"
+-      DESTINATION lib/pkgconfig )
++      DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig" )
+ 
+   endforeach()
+ 
+@@ -232,7 +232,7 @@
+   # installation
+   # ------------
+   install(FILES "${CMAKE_CURRENT_BINARY_DIR}/bin/${LONAME}_env.sh"
+-    DESTINATION bin)
++    DESTINATION ${CMAKE_INSTALL_BINDIR})
+ 
+ endmacro(generate_env_file)
+ 
+--- a/spm/wrappers/fortran90/CMakeLists.txt
++++ b/spm/wrappers/fortran90/CMakeLists.txt
+@@ -12,7 +12,7 @@
+ 
+ # Coherce CMake to install the generated .mod files
+ set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/mod_files)
+-install(DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/ DESTINATION include)
++install(DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/ DESTINATION 
${CMAKE_INSTALL_INCLUDEDIR})
+ 
+ add_library( spmf
+   src/spm_enums.F90
+@@ -30,9 +30,9 @@
+ 
+ target_link_libraries( spmf spm )
+ install(TARGETS spmf
+-  RUNTIME DESTINATION bin
+-  ARCHIVE DESTINATION lib
+-  LIBRARY DESTINATION lib )
++  RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
++  ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
++  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} )
+ 
+ #
+ # Add examples
+@@ -41,14 +41,15 @@
+   spm_driver.f90
+   spm_user.f90
+   )
++set ( example_install_dir "${CMAKE_INSTALL_DOCDIR}/examples/fortran" )
+ 
+ foreach (_file ${EXAMPLES})
+   get_filename_component(_name_we ${_file} NAME_WE)
+   add_executable(${_name_we} examples/${_file})
+   target_link_libraries(${_name_we} spmf)
+ 
+-  install(TARGETS ${_name_we}       RUNTIME DESTINATION examples )
+-  install(FILES   examples/${_file}         DESTINATION examples )
++  install(TARGETS ${_name_we}       RUNTIME DESTINATION 
${example_install_dir} )
++  install(FILES   examples/${_file}         DESTINATION 
${example_install_dir} )
+ 
+   add_test(fortran_${_name_we} ./${_name_we})
+ 
+--- a/spm/wrappers/python/CMakeLists.txt
++++ b/spm/wrappers/python/CMakeLists.txt
+@@ -9,6 +9,8 @@
+ #
+ ###
+ 
++find_package(Python COMPONENTS Interpreter REQUIRED)
++
+ # Configure enum.py
+ if (SPM_INT64)
+   set(SPM_PYTHON_INTEGER c_int64)
+@@ -26,23 +28,20 @@
+   ${CMAKE_CURRENT_SOURCE_DIR}/spm/__spm__.py
+   ${CMAKE_CURRENT_SOURCE_DIR}/spm/spm.py
+   ${CMAKE_CURRENT_SOURCE_DIR}/spm/enum.py
+-  DESTINATION lib/python/spm )
++  DESTINATION "${Python_SITELIB}/spm" )
+ 
+ # Install python examples
+ install(FILES
+   ${CMAKE_CURRENT_SOURCE_DIR}/spm_driver.py
+   ${CMAKE_CURRENT_SOURCE_DIR}/spm_scipy.py
+-  DESTINATION examples
++  DESTINATION "${CMAKE_INSTALL_DOCDIR}/examples/python"
+   )
+ 
+ ## CTest execution
+-find_package(PythonInterp QUIET)
+-if (PYTHONINTERP_FOUND)
+   set( PYTHON_TESTS
+     spm_driver spm_scipy )
+ 
+   foreach(example ${PYTHON_TESTS} )
+     add_test(python_${example} ${PYTHON_EXECUTABLE} 
${CMAKE_CURRENT_SOURCE_DIR}/${example}.py)
+   endforeach()
+-endif()
+ 
+--- a/wrappers/fortran90/CMakeLists.txt
++++ b/wrappers/fortran90/CMakeLists.txt
+@@ -12,7 +12,7 @@
+ 
+ # Coherce CMake to install the generated .mod files
+ set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/mod_files)
+-install(DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/ DESTINATION include)
++install(DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/ DESTINATION 
${CMAKE_INSTALL_INCLUDEDIR})
+ 
+ add_library( pastixf
+   src/pastix_enums.F90
+@@ -30,9 +30,9 @@
+ 
+ target_link_libraries( pastixf pastix )
+ install(TARGETS pastixf
+-  RUNTIME DESTINATION bin
+-  ARCHIVE DESTINATION lib
+-  LIBRARY DESTINATION lib )
++  RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
++  ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
++  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} )
+ 
+ #
+ # Add examples
+@@ -43,14 +43,15 @@
+   fstep-by-step.f90
+   fmultidof.f90
+   )
++set ( example_install_dir "${CMAKE_INSTALL_DOCDIR}/examples/fortran" )
+ 
+ foreach (_file ${EXAMPLES})
+   get_filename_component(_name_we ${_file} NAME_WE)
+   add_executable(${_name_we} examples/${_file})
+   target_link_libraries(${_name_we} pastixf spmf)
+ 
+-  install(TARGETS ${_name_we}       RUNTIME DESTINATION examples )
+-  install(FILES   examples/${_file}         DESTINATION examples )
++  install(TARGETS ${_name_we}       RUNTIME DESTINATION 
${example_install_dir} )
++  install(FILES   examples/${_file}         DESTINATION 
${example_install_dir} )
+ 
+   add_test(fortran_${_name_we} ./${_name_we})
+ 
+@@ -65,10 +66,10 @@
+ add_executable(${_name_we} examples/${_file})
+ target_link_libraries(${_name_we} pastixf spmf)
+ 
+-install(TARGETS ${_name_we}       RUNTIME DESTINATION examples )
+-install(FILES   examples/${_file}         DESTINATION examples )
+-install(FILES   examples/test_seq.in      DESTINATION examples )
+-install(FILES   examples/test_mt.in       DESTINATION examples )
++install(TARGETS ${_name_we}       RUNTIME DESTINATION ${example_install_dir} )
++install(FILES   examples/${_file}         DESTINATION ${example_install_dir} )
++install(FILES   examples/test_seq.in      DESTINATION ${example_install_dir} )
++install(FILES   examples/test_mt.in       DESTINATION ${example_install_dir} )
+ 
+ # Add OpenMP if available
+ find_package(OpenMP)
+--- a/wrappers/python/CMakeLists.txt
++++ b/wrappers/python/CMakeLists.txt
+@@ -9,6 +9,8 @@
+ #
+ ###
+ 
++find_package(Python COMPONENTS Interpreter REQUIRED)
++
+ # Configure enum.py
+ if (PASTIX_INT64)
+   set(PASTIX_PYTHON_INTEGER c_int64)
+@@ -27,7 +29,7 @@
+   ${CMAKE_CURRENT_SOURCE_DIR}/examples/pypastix/pastix.py
+   ${CMAKE_CURRENT_SOURCE_DIR}/examples/pypastix/enum.py
+   ${CMAKE_CURRENT_SOURCE_DIR}/examples/pypastix/solver.py
+-  DESTINATION lib/python/pypastix )
++  DESTINATION "${Python_SITELIB}/pypastix" )
+ 
+ # Install python examples
+ install(FILES
+@@ -35,12 +37,10 @@
+   ${CMAKE_CURRENT_SOURCE_DIR}/examples/simple_obj.py
+   ${CMAKE_CURRENT_SOURCE_DIR}/examples/schur.py
+   ${CMAKE_CURRENT_SOURCE_DIR}/examples/schur_obj.py
+-  DESTINATION examples
++  DESTINATION "${CMAKE_INSTALL_DOCDIR}/examples/python"
+   )
+ 
+ ## CTest execution
+-find_package(PythonInterp QUIET)
+-if (PYTHONINTERP_FOUND)
+   set( PYTHON_TESTS
+     simple step-by-step schur simple_obj schur_obj )
+ 
+@@ -57,5 +57,4 @@
+     set_tests_properties( python_${example} PROPERTIES
+       ENVIRONMENT "${TEST_ENV_LIST}" )
+   endforeach()
+-endif()
+ 

diff --git a/sci-libs/pastix/files/pastix-6.0.3-cmake-python-optional.patch 
b/sci-libs/pastix/files/pastix-6.0.3-cmake-python-optional.patch
new file mode 100644
index 00000000000..71d356fae2f
--- /dev/null
+++ b/sci-libs/pastix/files/pastix-6.0.3-cmake-python-optional.patch
@@ -0,0 +1,64 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -100,6 +100,9 @@
+ option(PASTIX_WITH_FORTRAN
+   "Enable Fortran files/interface/examples to be compiled" ON)
+ 
++option(PASTIX_WITH_PYTHON
++  "Install Python wrapper and examples" ON)
++
+ cmake_dependent_option(PASTIX_DISTRIBUTED
+  "Enable the distributed interface (requires PASTIX_WITH_MPI)" OFF 
"PASTIX_WITH_MPI" OFF)
+ 
+--- a/spm/CMakeLists.txt
++++ b/spm/CMakeLists.txt
+@@ -83,6 +83,13 @@
+     "Enable Fortran files/interface/examples to be compiled" ON)
+ endif()
+ 
++if ( DEFINED PASTIX_WITH_PYTHON )
++  set( SPM_WITH_PYTHON ${PASTIX_WITH_PYTHON} )
++else()
++  option(SPM_WITH_PYTHON
++    "Install Python wrapper and examples" ON)
++endif()
++
+ if (SPM_WITH_FORTRAN)
+   include(FortranCInterface)
+   FortranCInterface_HEADER(src/FCmangle.h
+--- a/spm/wrappers/CMakeLists.txt
++++ b/spm/wrappers/CMakeLists.txt
+@@ -13,8 +13,10 @@
+   add_subdirectory( fortran90 )
+ endif()
+ 
+-if (BUILD_SHARED_LIBS)
+-  add_subdirectory( python )
+-else()
+-  message(STATUS "--- Python wrapper is disabled with static libraries")
+-endif()
++if (SPM_WITH_PYTHON)
++  if (BUILD_SHARED_LIBS)
++    add_subdirectory( python )
++  else (BUILD_SHARED_LIBS)
++    message(FATAL_ERROR "--- Python wrapper requested but it cannot be built 
with static libraries")
++  endif (BUILD_SHARED_LIBS)
++endif (SPM_WITH_PYTHON)
+--- a/wrappers/CMakeLists.txt
++++ b/wrappers/CMakeLists.txt
+@@ -13,8 +13,10 @@
+   add_subdirectory( fortran90 )
+ endif()
+ 
+-if (BUILD_SHARED_LIBS)
+-  add_subdirectory( python )
+-else()
+-  message(STATUS "--- Python wrapper is disabled with static libraries")
+-endif()
++if (PASTIX_WITH_PYTHON)
++  if (BUILD_SHARED_LIBS)
++    add_subdirectory( python )
++  else (BUILD_SHARED_LIBS)
++    message(FATAL_ERROR "--- Python wrapper requested but it cannot be built 
with static libraries")
++  endif (BUILD_SHARED_LIBS)
++endif (PASTIX_WITH_PYTHON)

diff --git a/sci-libs/pastix/files/pastix-6.0.3-cmake-spm-project.patch 
b/sci-libs/pastix/files/pastix-6.0.3-cmake-spm-project.patch
new file mode 100644
index 00000000000..f2ca9a5699d
--- /dev/null
+++ b/sci-libs/pastix/files/pastix-6.0.3-cmake-spm-project.patch
@@ -0,0 +1,12 @@
+--- a/spm/CMakeLists.txt
++++ b/spm/CMakeLists.txt
+@@ -8,9 +8,6 @@
+ #  @date 2013-06-24
+ #
+ ###
+-cmake_minimum_required (VERSION 3.0)
+-project (SPM C Fortran)
+-
+ # Check if compiled independently or within another project
+ if ( ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
+   set( BUILD_AS_SUBPROJECT OFF )

diff --git a/sci-libs/pastix/files/pastix-6.0.3-multiple-coeftabMemory.patch 
b/sci-libs/pastix/files/pastix-6.0.3-multiple-coeftabMemory.patch
new file mode 100644
index 00000000000..84dfdd4cc10
--- /dev/null
+++ b/sci-libs/pastix/files/pastix-6.0.3-multiple-coeftabMemory.patch
@@ -0,0 +1,11 @@
+--- a/sopalin/coeftab.h
++++ b/sopalin/coeftab.h
+@@ -41,7 +41,7 @@
+ /**
+  * @brief List of functions to compute the memory gain in low-rank per 
precision.
+  */
+-coeftab_fct_memory_t coeftabMemory[4];
++extern coeftab_fct_memory_t coeftabMemory[4];
+ 
+ /**
+  * @}

diff --git a/sci-libs/pastix/metadata.xml b/sci-libs/pastix/metadata.xml
index 387eff2e8ed..1a653c7ffd2 100644
--- a/sci-libs/pastix/metadata.xml
+++ b/sci-libs/pastix/metadata.xml
@@ -17,7 +17,11 @@
   block structure of the incomplete factors.
 </longdescription>
   <use>
-    <flag name="int64">Build the 64 bits integer library</flag>
-    <flag name="starpu">Build and link with <pkg>dev-libs/starpu</pkg></flag>
+    <flag name="cuda">Enable GPU support using CUDA kernels</flag>
+    <flag name="fortran">Install the Fortran interface</flag>
+    <flag name="int64">Use 64- rather than 32-bit integer representation</flag>
+    <flag name="metis">Enable matrix ordering with 
<pkg>sci-libs/metis</pkg></flag>
+    <flag name="scotch">Enable matrix ordering with 
<pkg>sci-libs/scotch</pkg></flag>
+    <flag name="starpu">Enable support for ther <pkg>dev-libs/starpu</pkg> 
runtime</flag>
   </use>
 </pkgmetadata>

diff --git a/sci-libs/pastix/pastix-6.0.3.ebuild 
b/sci-libs/pastix/pastix-6.0.3.ebuild
new file mode 100644
index 00000000000..e2dce19cca2
--- /dev/null
+++ b/sci-libs/pastix/pastix-6.0.3.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_9 )
+
+inherit cmake fortran-2 python-single-r1
+
+# package id: changes every version, see the link on inriaforge
+PID=38205
+DESCRIPTION="Parallel solver for very large sparse linear systems"
+HOMEPAGE="https://pastix.gforge.inria.fr";
+SRC_URI="https://gforge.inria.fr/frs/download.php/file/${PID}/${P}.tar.gz";
+
+LICENSE="CeCILL-C"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux 
~x86-linux"
+IUSE="cuda examples +fortran int64 metis mpi +python +scotch starpu test"
+
+RESTRICT="!test? ( test )"
+
+# REQUIRED_USE explanation:
+# 1. Not a typo, Python is needed at build time regardless of whether
+#    the bindings are to be installed or not
+# 2. While not enforced by upstream build scripts, having no ordering at all
+#    results in rather spectacular test and runtime failures.
+REQUIRED_USE="${PYTHON_REQUIRED_USE}
+       || ( metis scotch )"
+
+RDEPEND="sys-apps/hwloc:0=
+       virtual/blas
+       virtual/cblas
+       virtual/lapack
+       virtual/lapacke
+       cuda? ( dev-util/nvidia-cuda-toolkit )
+       metis? ( sci-libs/metis[int64?] )
+       mpi? ( virtual/mpi[fortran] )
+       python? (
+               ${PYTHON_DEPS}
+               $(python_gen_cond_dep '
+                       dev-python/numpy[${PYTHON_USEDEP}]
+                       dev-python/scipy[${PYTHON_USEDEP}]
+               ')
+       )
+       scotch? ( sci-libs/scotch:0=[int64?,mpi?] )
+       starpu? ( >=dev-libs/starpu-1.3.0:0= )"
+DEPEND="${RDEPEND}"
+BDEPEND="${PYTHON_DEPS}
+       virtual/pkgconfig
+       test? ( ${RDEPEND} )"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-6.0.3-cmake-installdirs.patch
+       "${FILESDIR}"/${PN}-6.0.3-cmake-examples-optional.patch
+       "${FILESDIR}"/${PN}-6.0.3-cmake-python-optional.patch
+       "${FILESDIR}"/${PN}-6.0.3-cmake-spm-project.patch
+       "${FILESDIR}"/${PN}-6.0.3-multiple-coeftabMemory.patch
+)
+
+pkg_setup() {
+       python-single-r1_pkg_setup
+}
+
+src_configure() {
+       local mycmakeargs=(
+               -DBUILD_SHARED_LIBS=yes
+               -DINSTALL_EXAMPLES=$(usex examples)
+               -DPASTIX_INT64=$(usex int64)
+               -DPASTIX_ORDERING_METIS=$(usex metis)
+               -DPASTIX_ORDERING_SCOTCH=$(usex scotch)
+               -DPASTIX_WITH_CUDA=$(usex cuda)
+               -DPASTIX_WITH_FORTRAN=$(usex fortran)
+               -DPASTIX_WITH_MPI=$(usex mpi)
+               -DPASTIX_WITH_PYTHON=$(usex python)
+               -DPASTIX_WITH_STARPU=$(usex starpu)
+       )
+       cmake_src_configure
+}
+
+src_install() {
+       cmake_src_install
+       use python && python_optimize
+}

Reply via email to