diff --git a/sci-libs/CombBLAS/CombBLAS-0_pre20220331.ebuild b/sci-libs/CombBLAS/CombBLAS-0_pre20220331.ebuild new file mode 100644 index 0000000000..23f7d80736 --- /dev/null +++ b/sci-libs/CombBLAS/CombBLAS-0_pre20220331.ebuild @@ -0,0 +1,49 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +COMMIT="426f6be0b29831025cdcacc1f8f69e3520bfb0ff" + +inherit cmake + +DESCRIPTION='The Combinatorial BLAS' +HOMEPAGE="https://github.com/PASSIONLab/CombBLAS" +SRC_URI="https://github.com/PASSIONLab/${PN}/archive/${COMMIT}.tar.gz -> ${PF}.tar.gz" +S="${WORKDIR}/${PN}-${COMMIT}" + +KEYWORDS="~amd64" +LICENSE='BSD' +IUSE="" +SLOT="0" + +DEPEND=" + ~sys-cluster/Graph500-1.2 + sys-cluster/usort + virtual/mpi +" +RDEPEND="${DEPEND}" + +PATCHES=( + "${FILESDIR}/${P}-rename-THRESHOLD.patch" + "${FILESDIR}/${P}-psort.patch" + "${FILESDIR}/${P}-cxx17.patch" + "${FILESDIR}/${P}-system-libs.patch" + "${FILESDIR}/${P}-GNUInstallDirs.patch" +) + +src_prepare() { + rm -r graph500-1.2 usort psort-1.0 || die + cmake_src_prepare +} + +src_install() { + cmake_src_install + dodoc README.md FAQ.md CombBLASbinaryIO.docx + insinto "/usr/include/CombBLAS" + doins Applications/BipartiteMatchings/*.h + insinto "/usr/share/octave/site/m/${PN}" + doins -r Matlab/* + insinto "/usr/share/doc/${PF}/html" + doins *.html +} diff --git a/sci-libs/CombBLAS/Manifest b/sci-libs/CombBLAS/Manifest new file mode 100644 index 0000000000..6ae411de03 --- /dev/null +++ b/sci-libs/CombBLAS/Manifest @@ -0,0 +1 @@ +DIST CombBLAS-0_pre20220331.tar.gz 43783582 BLAKE2B b80e871a21832b2210642bacddeef0c5447cee1e46be3aab2accaaddd393bc0fc05c6d7505a154d303dc3449ec5772d789300b6a78dd97e8119739495aba642f SHA512 5cb6156ab0d8a3fa9c13b9599d2e2bd3f6d3a1fd81f101cf2cadbe72d4b3bcd35013687835549f98fef3ea8e371e562ac55d2f4aa91720a0ef1bdf6da3a97640 diff --git a/sci-libs/CombBLAS/files/CombBLAS-0_pre20220331-GNUInstallDirs.patch b/sci-libs/CombBLAS/files/CombBLAS-0_pre20220331-GNUInstallDirs.patch new file mode 100644 index 0000000000..1ac90b980a --- /dev/null +++ b/sci-libs/CombBLAS/files/CombBLAS-0_pre20220331-GNUInstallDirs.patch @@ -0,0 +1,37 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -18,6 +18,7 @@ + endif() + + # set include directories ++include(GNUInstallDirs) + target_include_directories(CombBLAS PUBLIC $ $) + target_include_directories(CombBLAS PUBLIC /usr/include/psort $) + target_include_directories(CombBLAS PRIVATE include/CombBLAS) +@@ -54,7 +55,7 @@ + # modifications to CombBLAS and have the changes automatically recompiled for + # dependent projects. + # Either way, we need to create a CombBLASConfig.cmake. +-set(ConfigPackageLocation lib/cmake/CombBLAS) ++set(ConfigPackageLocation ${CMAKE_INSTALL_LIBDIR}/cmake/CombBLAS) + + # Generate version number header + include(GenerateExportHeader) +@@ -62,12 +63,12 @@ + set_target_properties(CombBLAS PROPERTIES VERSION ${CombBLAS_VERSION}) + + # installation +-install(DIRECTORY include/ DESTINATION include) ++install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + install(TARGETS CombBLAS EXPORT CombBLASTargets +- LIBRARY DESTINATION lib +- ARCHIVE DESTINATION lib +- RUNTIME DESTINATION bin +- INCLUDES DESTINATION include ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + ) + + include(CMakePackageConfigHelpers) diff --git a/sci-libs/CombBLAS/files/CombBLAS-0_pre20220331-cxx17.patch b/sci-libs/CombBLAS/files/CombBLAS-0_pre20220331-cxx17.patch new file mode 100644 index 0000000000..d4bc94dbd8 --- /dev/null +++ b/sci-libs/CombBLAS/files/CombBLAS-0_pre20220331-cxx17.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -2,7 +2,7 @@ + project(CombBLAS VERSION 1.16.0 LANGUAGES C CXX) + + # require c++14 +-set(CMAKE_CXX_STANDARD 14) ++set(CMAKE_CXX_STANDARD 17) + set(CMAKE_CXX_STANDARD_REQUIRED YES) + set(CMAKE_CXX_EXTENSIONS OFF) + diff --git a/sci-libs/CombBLAS/files/CombBLAS-0_pre20220331-psort.patch b/sci-libs/CombBLAS/files/CombBLAS-0_pre20220331-psort.patch new file mode 100644 index 0000000000..2f67cf0976 --- /dev/null +++ b/sci-libs/CombBLAS/files/CombBLAS-0_pre20220331-psort.patch @@ -0,0 +1,22 @@ +--- a/include/CombBLAS/SpParHelper.cpp ++++ b/include/CombBLAS/SpParHelper.cpp +@@ -121,7 +121,7 @@ + { + long * dist_in = new long[nprocs]; + for(int i=0; i< nprocs; ++i) dist_in[i] = (long) dist[i]; +- vpsort::parallel_sort (array, array+length, dist_in, comm); ++ psort::parallel_sort (array, array+length, dist_in, comm); + delete [] dist_in; + } + else +@@ -157,7 +157,7 @@ + MPI_Comm_create(comm, real_group, &real_comm); + if(!excluded) + { +- vpsort::parallel_sort (array, array+length, dist_in, real_comm); ++ psort::parallel_sort (array, array+length, dist_in, real_comm); + MPI_Comm_free(&real_comm); + } + MPI_Group_free(&real_group); +Solo in /var/tmp/portage/sci-libs/CombBLAS-0_pre20220331/work/CombBLAS-426f6be0b29831025cdcacc1f8f69e3520bfb0ff: psort-1.0 +Solo in /var/tmp/portage/sci-libs/CombBLAS-0_pre20220331/work/CombBLAS-426f6be0b29831025cdcacc1f8f69e3520bfb0ff: usort diff --git a/sci-libs/CombBLAS/files/CombBLAS-0_pre20220331-rename-THRESHOLD.patch b/sci-libs/CombBLAS/files/CombBLAS-0_pre20220331-rename-THRESHOLD.patch new file mode 100644 index 0000000000..cff6d5d512 --- /dev/null +++ b/sci-libs/CombBLAS/files/CombBLAS-0_pre20220331-rename-THRESHOLD.patch @@ -0,0 +1,24 @@ +--- a/include/CombBLAS/dcsc.cpp ++++ b/include/CombBLAS/dcsc.cpp +@@ -1223,7 +1223,7 @@ + template + void Dcsc::FillColInds(const VT * colnums, IT nind, std::vector< std::pair > & colinds, IT * aux, IT csize) const + { +- if ( aux == NULL || (nzc / nind) < THRESHOLD) // use scanning indexing ++ if ( aux == NULL || (nzc / nind) < COMBBLAS_THRESHOLD) // use scanning indexing + { + IT mink = std::min(nzc, nind); + std::pair * isect = new std::pair[mink]; +--- a/include/CombBLAS/SpDefs.h ++++ b/include/CombBLAS/SpDefs.h +@@ -122,8 +122,8 @@ + #define ALIGN 8 + #endif + +-#ifndef THRESHOLD +-#define THRESHOLD 4 // if range1.size() / range2.size() < threshold, use scanning based indexing ++#ifndef COMBBLAS_THRESHOLD ++#define COMBBLAS_THRESHOLD 4 // if range1.size() / range2.size() < threshold, use scanning based indexing + #endif + + #ifndef MEMORYINBYTES diff --git a/sci-libs/CombBLAS/files/CombBLAS-0_pre20220331-system-libs.patch b/sci-libs/CombBLAS/files/CombBLAS-0_pre20220331-system-libs.patch new file mode 100644 index 0000000000..1a8d5cc12c --- /dev/null +++ b/sci-libs/CombBLAS/files/CombBLAS-0_pre20220331-system-libs.patch @@ -0,0 +1,33 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -19,7 +19,7 @@ + + # set include directories + target_include_directories(CombBLAS PUBLIC $ $) +-target_include_directories(CombBLAS PUBLIC $ $) ++target_include_directories(CombBLAS PUBLIC /usr/include/psort $) + target_include_directories(CombBLAS PRIVATE include/CombBLAS) + + # MPI and OpenMP dependencies +@@ -43,11 +43,9 @@ + target_link_libraries(CombBLAS PUBLIC "${OpenMP_CXX_FLAGS}") + endif() + +-add_subdirectory(usort) +-target_link_libraries(CombBLAS PUBLIC Usortlib) ++target_link_libraries(CombBLAS PUBLIC -lUsortlib) + +-add_subdirectory(graph500-1.2/generator) +-target_link_libraries(CombBLAS PUBLIC GraphGenlib) ++target_link_libraries(CombBLAS PUBLIC -lGraphGenlib) + + # Set up exported configuration + # This allows CombBLAS to be installed in two ways: +@@ -65,7 +63,6 @@ + + # installation + install(DIRECTORY include/ DESTINATION include) +-install(DIRECTORY psort-1.0/include/ DESTINATION include) + install(TARGETS CombBLAS EXPORT CombBLASTargets + LIBRARY DESTINATION lib64 + ARCHIVE DESTINATION lib64 diff --git a/sci-libs/CombBLAS/metadata.xml b/sci-libs/CombBLAS/metadata.xml new file mode 100644 index 0000000000..a9dcd17582 --- /dev/null +++ b/sci-libs/CombBLAS/metadata.xml @@ -0,0 +1,12 @@ + + + + + Alessandro Barbieri + lssndrbarbieri@gmail.com + + + https://github.com/PASSIONLab/CombBLAS/issues + PASSIONLab/CombBLAS + +