Gentoo Archives: gentoo-commits

From: Marek Szuba <marecki@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/pastix/, profiles/, profiles/base/, sci-libs/pastix/files/
Date: Wed, 14 Jul 2021 16:15:10
Message-Id: 1626279285.472f36bcd300da19c6f6953ece0811b63a3134e0.marecki@gentoo
1 commit: 472f36bcd300da19c6f6953ece0811b63a3134e0
2 Author: Marek Szuba <marecki <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jul 14 16:03:10 2021 +0000
4 Commit: Marek Szuba <marecki <AT> gentoo <DOT> org>
5 CommitDate: Wed Jul 14 16:14:45 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=472f36bc
7
8 sci-libs/pastix: add 6.0.3, masked
9
10 The ebuild in principle works but there are several features which for
11 various reasons remain problematic (see the package.use.mask entry), and
12 with this being a new major version chances are not all revdeps will be
13 happy with it (hence the overall mask). Testing very much encouraged!
14
15 Bug: https://bugs.gentoo.org/751034
16 Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>
17
18 profiles/base/package.use.mask | 20 +
19 profiles/package.mask | 5 +
20 sci-libs/pastix/Manifest | 1 +
21 .../pastix-6.0.3-cmake-examples-optional.patch | 170 +++++++++
22 .../files/pastix-6.0.3-cmake-installdirs.patch | 424 +++++++++++++++++++++
23 .../files/pastix-6.0.3-cmake-python-optional.patch | 64 ++++
24 .../files/pastix-6.0.3-cmake-spm-project.patch | 12 +
25 .../pastix-6.0.3-multiple-coeftabMemory.patch | 11 +
26 sci-libs/pastix/metadata.xml | 8 +-
27 sci-libs/pastix/pastix-6.0.3.ebuild | 84 ++++
28 10 files changed, 797 insertions(+), 2 deletions(-)
29
30 diff --git a/profiles/base/package.use.mask b/profiles/base/package.use.mask
31 index 83513d5d82c..3bcead9090d 100644
32 --- a/profiles/base/package.use.mask
33 +++ b/profiles/base/package.use.mask
34 @@ -6,6 +6,26 @@
35 # This file is only for generic masks. For arch-specific masks (i.e.
36 # mask everywhere, unmask on arch/*) use arch/base.
37
38 +# Marek Szuba <marecki@g.o> (2021-07-14)
39 +# Several known issues (possibly with older pastix versions as well but
40 +# in v6 they result in clear errors):
41 +# * CUDA support needs testing, may or may not work as it is;
42 +# * All sci-libs/scotch ebuilds currently in the tree seem to always use
43 +# 32-bit integer representation, even when built USE=int64. Seeing as
44 +# metis ordering has got more complicated issues (see below), just
45 +# stick with 32 bits for now;
46 +# * sci-libs/metis currently always uses whatever integer representation
47 +# is native to the target architecture even though upstream allows for
48 +# using 32-bit integers on 64-bit arches, this will have to be implemented
49 +# so that pastix can pass int64? to it;
50 +# * With MPI enabled two tests fail (when linked against openmpi, at least)
51 +# due to incorrect implementation of either MPI support itself or
52 +# said tests - example_drv_facto0_d_reentrant tries to initialise MPI
53 +# more than once, test_bvec_gemv_tests calls MPI_Query_thread() after
54 +# invocation of MPI_FINALIZE;
55 +# * dev-libs/starpu needs a version bump.
56 +>=sci-libs/pastix-6.0.0 cuda int64 metis mpi starpu
57 +
58 # Alfredo Tupone <tupone@g.o> (2021-06-27)
59 # lto does not work on dev-lang/gnat-gpl-2021
60 dev-lang/gnat-gpl:10 lto
61
62 diff --git a/profiles/package.mask b/profiles/package.mask
63 index 25612156c60..6a20d46213b 100644
64 --- a/profiles/package.mask
65 +++ b/profiles/package.mask
66 @@ -32,6 +32,11 @@
67
68 #--- END OF EXAMPLES ---
69
70 +# Marek Szuba <marecki@g.o> (2021-07-14)
71 +# New, considerably refactored major version with a new build system.
72 +# Masked for further testing.
73 +>=sci-libs/pastix-6.0.0
74 +
75 # Marco Scardovi <marco@××××××××.vom> (2021-07-13)
76 # These packages were only ported for netbox. Not useful for anything else
77 # No revdeps. Removal in 30 days (Bug #801991)
78
79 diff --git a/sci-libs/pastix/Manifest b/sci-libs/pastix/Manifest
80 index ebbea05dd67..54351d75797 100644
81 --- a/sci-libs/pastix/Manifest
82 +++ b/sci-libs/pastix/Manifest
83 @@ -1,2 +1,3 @@
84 +DIST pastix-6.0.3.tar.gz 1793579 BLAKE2B 9e0ee71c80b2c93c6762c1a824b2e1262fd1a9f406194fb99eeecbfc172cf82f497d23a541b56c44e5487c3c228cab781f47f683ee04c6cdf426da6126750a69 SHA512 5bf8dfa6ed02ee7e236c63e21c80bd45af807b465b21a8c0520b1328e179095f1416f925be9f8b5ec0e8078ca9bc4398bf0d091fdc8e9ea51b9af12a06d9a544
85 DIST pastix_5.2.2.22.tar.bz2 2664470 BLAKE2B b1fbd12bf2c882aa8fd2c4891a6890df4bdc4488cedca2a7861e676ec5678063927f2e4a4edc47aa7ca0422b283f8f012aa1032af7212fe39f4c55e7f0f7adc4 SHA512 15ecdb10b5229e40f744c1ad54be7cac6560cb92e90df1937c90ca7da290df6bdb6f24a1e1c54197731b9df3e0dcc0b9fa39750479fcf03a0c08c304c5b9df70
86 DIST pastix_5.2.3.tar.bz2 2246903 BLAKE2B b13cb31bbc2aeb122e932b2a934598ec975a55f327483bf1383280976584858426c56982f6980b52f32f04e05c6e6c8de1cf35e378e61a7be9dddb705b1c033a SHA512 69acffac1be8c756886783c2a6307269ab4d14abfc4a77268b3d14995e53b16084c298446812484233d9d52c317490d6ad67788166adf367075e6c8442147b95
87
88 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
89 new file mode 100644
90 index 00000000000..5f070116827
91 --- /dev/null
92 +++ b/sci-libs/pastix/files/pastix-6.0.3-cmake-examples-optional.patch
93 @@ -0,0 +1,170 @@
94 +--- a/CMakeLists.txt
95 ++++ b/CMakeLists.txt
96 +@@ -94,6 +94,9 @@
97 + "Build PaStiX with PaRSEC runtime support" OFF)
98 +
99 + # Internal options
100 ++option(INSTALL_EXAMPLES
101 ++ "Install example code" OFF)
102 ++
103 + option(PASTIX_GENERATE_MODEL
104 + "Enable performances profiling for model generation" OFF)
105 +
106 +--- a/example/CMakeLists.txt
107 ++++ b/example/CMakeLists.txt
108 +@@ -38,15 +38,18 @@
109 + )
110 + set (example_install_dir "${CMAKE_INSTALL_DOCDIR}/examples/c")
111 +
112 ++if (BUILD_TESTING)
113 + foreach (_file ${EXAMPLES})
114 + get_filename_component(_name_we ${_file} NAME_WE)
115 + add_executable(${_name_we} ${_file})
116 + target_link_libraries(${_name_we} pastix)
117 + target_link_libraries(${_name_we} ${BLAS_LIBRARIES})
118 +-
119 +- install(TARGETS ${_name_we} RUNTIME DESTINATION ${example_install_dir} )
120 +- install(FILES ${_file} DESTINATION ${example_install_dir} )
121 + endforeach()
122 ++endif()
123 ++
124 ++if (INSTALL_EXAMPLES)
125 ++
126 ++install(FILES ${EXAMPLES} DESTINATION ${example_install_dir} )
127 +
128 + ### Install a makefile for user compilation test
129 + set( EXAMPLE_LIBS ${DEPS_LIBRARIES} )
130 +@@ -61,4 +64,6 @@
131 + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/make/Makefile"
132 + DESTINATION ${example_install_dir})
133 +
134 ++endif (INSTALL_EXAMPLES)
135 ++
136 + include(CTestLists.txt)
137 +--- a/example/old/CMakeLists.txt
138 ++++ b/example/old/CMakeLists.txt
139 +@@ -15,14 +15,17 @@
140 + )
141 + set (example_install_dir "${CMAKE_INSTALL_DOCDIR}/examples/c/old")
142 +
143 ++if (BUILD_TESTING)
144 + foreach (_file ${EXAMPLES})
145 + get_filename_component(_name_we ${_file} NAME_WE)
146 + add_executable("old_${_name_we}" ${_file})
147 + target_link_libraries("old_${_name_we}" pastix)
148 +-
149 +- install(TARGETS old_${_name_we} RUNTIME DESTINATION ${example_install_dir} )
150 +- install(FILES ${_file} DESTINATION ${example_install_dir} )
151 + endforeach()
152 ++endif()
153 ++
154 ++if (INSTALL_EXAMPLES)
155 ++
156 ++install(FILES ${EXAMPLES} DESTINATION ${example_install_dir} )
157 +
158 + ### Install a makefile for user compilation test
159 + set( EXAMPLE_LIBS
160 +@@ -36,3 +39,4 @@
161 + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/make/Makefile"
162 + DESTINATION ${example_install_dir} )
163 +
164 ++endif (INSTALL_EXAMPLES)
165 +--- a/spm/wrappers/fortran90/CMakeLists.txt
166 ++++ b/spm/wrappers/fortran90/CMakeLists.txt
167 +@@ -43,15 +43,19 @@
168 + )
169 + set ( example_install_dir "${CMAKE_INSTALL_DOCDIR}/examples/fortran" )
170 +
171 ++if (BUILD_TESTING)
172 + foreach (_file ${EXAMPLES})
173 + get_filename_component(_name_we ${_file} NAME_WE)
174 + add_executable(${_name_we} examples/${_file})
175 + target_link_libraries(${_name_we} spmf)
176 +
177 +- install(TARGETS ${_name_we} RUNTIME DESTINATION ${example_install_dir} )
178 +- install(FILES examples/${_file} DESTINATION ${example_install_dir} )
179 +-
180 + add_test(fortran_${_name_we} ./${_name_we})
181 +
182 + endforeach()
183 ++endif()
184 +
185 ++if (INSTALL_EXAMPLES)
186 ++ foreach (_file ${EXAMPLES})
187 ++ install(FILES examples/${_file} DESTINATION ${example_install_dir} )
188 ++ endforeach()
189 ++endif()
190 +--- a/spm/wrappers/python/CMakeLists.txt
191 ++++ b/spm/wrappers/python/CMakeLists.txt
192 +@@ -31,11 +31,13 @@
193 + DESTINATION "${Python_SITELIB}/spm" )
194 +
195 + # Install python examples
196 ++if (INSTALL_EXAMPLES)
197 + install(FILES
198 + ${CMAKE_CURRENT_SOURCE_DIR}/spm_driver.py
199 + ${CMAKE_CURRENT_SOURCE_DIR}/spm_scipy.py
200 + DESTINATION "${CMAKE_INSTALL_DOCDIR}/examples/python"
201 + )
202 ++endif()
203 +
204 + ## CTest execution
205 + set( PYTHON_TESTS
206 +--- a/wrappers/fortran90/CMakeLists.txt
207 ++++ b/wrappers/fortran90/CMakeLists.txt
208 +@@ -45,14 +45,13 @@
209 + )
210 + set ( example_install_dir "${CMAKE_INSTALL_DOCDIR}/examples/fortran" )
211 +
212 ++if (BUILD_TESTING)
213 ++
214 + foreach (_file ${EXAMPLES})
215 + get_filename_component(_name_we ${_file} NAME_WE)
216 + add_executable(${_name_we} examples/${_file})
217 + target_link_libraries(${_name_we} pastixf spmf)
218 +
219 +- install(TARGETS ${_name_we} RUNTIME DESTINATION ${example_install_dir} )
220 +- install(FILES examples/${_file} DESTINATION ${example_install_dir} )
221 +-
222 + add_test(fortran_${_name_we} ./${_name_we})
223 +
224 + endforeach()
225 +@@ -66,10 +65,16 @@
226 + add_executable(${_name_we} examples/${_file})
227 + target_link_libraries(${_name_we} pastixf spmf)
228 +
229 +-install(TARGETS ${_name_we} RUNTIME DESTINATION ${example_install_dir} )
230 +-install(FILES examples/${_file} DESTINATION ${example_install_dir} )
231 +-install(FILES examples/test_seq.in DESTINATION ${example_install_dir} )
232 +-install(FILES examples/test_mt.in DESTINATION ${example_install_dir} )
233 ++endif (BUILD_TESTING)
234 ++
235 ++if (INSTALL_EXAMPLES)
236 ++ foreach (_file ${EXAMPLES})
237 ++ install(FILES examples/${_file} DESTINATION ${example_install_dir} )
238 ++ endforeach()
239 ++ install(FILES examples/fmultilap.f90 DESTINATION ${example_install_dir} )
240 ++ install(FILES examples/test_seq.in DESTINATION ${example_install_dir} )
241 ++ install(FILES examples/test_mt.in DESTINATION ${example_install_dir} )
242 ++endif()
243 +
244 + # Add OpenMP if available
245 + find_package(OpenMP)
246 +--- a/wrappers/python/CMakeLists.txt
247 ++++ b/wrappers/python/CMakeLists.txt
248 +@@ -32,6 +32,7 @@
249 + DESTINATION "${Python_SITELIB}/pypastix" )
250 +
251 + # Install python examples
252 ++if (INSTALL_EXAMPLES)
253 + install(FILES
254 + ${CMAKE_CURRENT_SOURCE_DIR}/examples/simple.py
255 + ${CMAKE_CURRENT_SOURCE_DIR}/examples/simple_obj.py
256 +@@ -39,6 +40,7 @@
257 + ${CMAKE_CURRENT_SOURCE_DIR}/examples/schur_obj.py
258 + DESTINATION "${CMAKE_INSTALL_DOCDIR}/examples/python"
259 + )
260 ++endif()
261 +
262 + ## CTest execution
263 + set( PYTHON_TESTS
264
265 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
266 new file mode 100644
267 index 00000000000..a586981f37e
268 --- /dev/null
269 +++ b/sci-libs/pastix/files/pastix-6.0.3-cmake-installdirs.patch
270 @@ -0,0 +1,424 @@
271 +--- a/CMakeLists.txt
272 ++++ b/CMakeLists.txt
273 +@@ -13,6 +13,7 @@
274 +
275 + include(CMakeDependentOption)
276 + include(CheckFunctionExists)
277 ++include(GNUInstallDirs)
278 +
279 + # The current version number
280 + set(PASTIX_VERSION_MAJOR 6)
281 +@@ -516,7 +517,7 @@
282 + configure_file (
283 + "${CMAKE_CURRENT_SOURCE_DIR}/include/pastix/config.h.in"
284 + "${PROJECT_INCLUDE_DIR}/pastix/config.h")
285 +-install(FILES "${PROJECT_INCLUDE_DIR}/pastix/config.h" DESTINATION include/pastix)
286 ++install(FILES "${PROJECT_INCLUDE_DIR}/pastix/config.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pastix)
287 +
288 + include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
289 + include_directories("${CMAKE_CURRENT_BINARY_DIR}")
290 +@@ -844,9 +845,9 @@
291 + # endforeach()
292 +
293 + install(TARGETS pastix
294 +- RUNTIME DESTINATION bin
295 +- ARCHIVE DESTINATION lib
296 +- LIBRARY DESTINATION lib)
297 ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
298 ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
299 ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
300 +
301 + # Install header files
302 + set(PASTIX_HDRS
303 +@@ -861,8 +862,8 @@
304 + )
305 + install(FILES
306 + include/pastix.h
307 +- DESTINATION include )
308 +-install(FILES ${PASTIX_HDRS} DESTINATION include/pastix )
309 ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
310 ++install(FILES ${PASTIX_HDRS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pastix )
311 +
312 + ## Executable and tests
313 + enable_testing()
314 +@@ -934,8 +935,6 @@
315 + "${CMAKE_CURRENT_SOURCE_DIR}/pastixf.pc.in"
316 + PROJECTNAME PASTIX )
317 +
318 +-generate_env_file( PROJECTNAME PASTIX )
319 +-
320 + #############################################################
321 + #
322 + # Build documentation
323 +--- a/cmake_modules/morse_cmake/modules/GenPkgConfig.cmake
324 ++++ b/cmake_modules/morse_cmake/modules/GenPkgConfig.cmake
325 +@@ -196,7 +196,7 @@
326 + # ------------
327 + install(FILES
328 + "${CMAKE_BINARY_DIR}/lib/pkgconfig/${fname}.pc"
329 +- DESTINATION lib/pkgconfig )
330 ++ DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig" )
331 +
332 + endforeach()
333 +
334 +@@ -232,7 +232,7 @@
335 + # installation
336 + # ------------
337 + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/bin/${LONAME}_env.sh"
338 +- DESTINATION bin)
339 ++ DESTINATION ${CMAKE_INSTALL_BINDIR})
340 +
341 + endmacro(generate_env_file)
342 +
343 +--- a/example/CMakeLists.txt
344 ++++ b/example/CMakeLists.txt
345 +@@ -36,6 +36,7 @@
346 + simple.c
347 + step-by-step.c
348 + )
349 ++set (example_install_dir "${CMAKE_INSTALL_DOCDIR}/examples/c")
350 +
351 + foreach (_file ${EXAMPLES})
352 + get_filename_component(_name_we ${_file} NAME_WE)
353 +@@ -43,8 +44,8 @@
354 + target_link_libraries(${_name_we} pastix)
355 + target_link_libraries(${_name_we} ${BLAS_LIBRARIES})
356 +
357 +- install(TARGETS ${_name_we} RUNTIME DESTINATION examples )
358 +- install(FILES ${_file} DESTINATION examples )
359 ++ install(TARGETS ${_name_we} RUNTIME DESTINATION ${example_install_dir} )
360 ++ install(FILES ${_file} DESTINATION ${example_install_dir} )
361 + endforeach()
362 +
363 + ### Install a makefile for user compilation test
364 +@@ -58,6 +59,6 @@
365 + "${CMAKE_CURRENT_SOURCE_DIR}/Makefile.in"
366 + "${CMAKE_CURRENT_BINARY_DIR}/make/Makefile" @ONLY)
367 + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/make/Makefile"
368 +- DESTINATION examples)
369 ++ DESTINATION ${example_install_dir})
370 +
371 + include(CTestLists.txt)
372 +--- a/example/old/CMakeLists.txt
373 ++++ b/example/old/CMakeLists.txt
374 +@@ -13,14 +13,15 @@
375 + simple.c
376 + step-by-step.c
377 + )
378 ++set (example_install_dir "${CMAKE_INSTALL_DOCDIR}/examples/c/old")
379 +
380 + foreach (_file ${EXAMPLES})
381 + get_filename_component(_name_we ${_file} NAME_WE)
382 + add_executable("old_${_name_we}" ${_file})
383 + target_link_libraries("old_${_name_we}" pastix)
384 +
385 +- install(TARGETS old_${_name_we} RUNTIME DESTINATION examples/old )
386 +- install(FILES ${_file} DESTINATION examples/old )
387 ++ install(TARGETS old_${_name_we} RUNTIME DESTINATION ${example_install_dir} )
388 ++ install(FILES ${_file} DESTINATION ${example_install_dir} )
389 + endforeach()
390 +
391 + ### Install a makefile for user compilation test
392 +@@ -33,5 +34,5 @@
393 + "${CMAKE_CURRENT_SOURCE_DIR}/Makefile.in"
394 + "${CMAKE_CURRENT_BINARY_DIR}/make/Makefile" @ONLY)
395 + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/make/Makefile"
396 +- DESTINATION examples/old )
397 ++ DESTINATION ${example_install_dir} )
398 +
399 +--- a/kernels/CMakeLists.txt
400 ++++ b/kernels/CMakeLists.txt
401 +@@ -149,8 +149,8 @@
402 +
403 + ### Install library
404 + install(TARGETS pastix_kernels
405 +- ARCHIVE DESTINATION lib
406 +- LIBRARY DESTINATION lib)
407 ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
408 ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
409 +
410 + ### Add generated files to the global property
411 + add_documented_files(
412 +--- a/kernels/gpus/CMakeLists.txt
413 ++++ b/kernels/gpus/CMakeLists.txt
414 +@@ -66,8 +66,8 @@
415 + # ${cuda_generated_files})
416 + # cuda_add_cublas_to_target( pastix_cucores_sm${_smtarget} )
417 + # install(TARGETS pastix_cucores_sm${_smtarget}
418 +-# LIBRARY DESTINATION lib
419 +-# ARCHIVE DESTINATION lib )
420 ++# LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
421 ++# ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} )
422 + # # if( NOT CMAKE_BUILD_SHARED_LIBS )
423 + # # target_link_libraries( pastix_cucores pastix_cucores_sm${_smtarget} )
424 + # # endif()
425 +@@ -79,7 +79,7 @@
426 + cuda_add_cublas_to_target( pastix_kernels_cuda )
427 +
428 + install(TARGETS pastix_kernels_cuda
429 +- LIBRARY DESTINATION lib
430 +- ARCHIVE DESTINATION lib )
431 ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
432 ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} )
433 +
434 + cuda_build_clean_target()
435 +--- a/sopalin/parsec/CMakeLists.txt
436 ++++ b/sopalin/parsec/CMakeLists.txt
437 +@@ -114,8 +114,8 @@
438 + endif (MPI_C_FOUND)
439 +
440 + install(TARGETS pastix_parsec
441 +- ARCHIVE DESTINATION lib
442 +- LIBRARY DESTINATION lib)
443 ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
444 ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
445 +
446 + ### Add non-generated documented files to the global property
447 + add_documented_files(
448 +--- a/sopalin/starpu/CMakeLists.txt
449 ++++ b/sopalin/starpu/CMakeLists.txt
450 +@@ -96,8 +96,8 @@
451 + endif (MPI_C_FOUND)
452 +
453 + install(TARGETS pastix_starpu
454 +- ARCHIVE DESTINATION lib
455 +- LIBRARY DESTINATION lib)
456 ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
457 ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
458 +
459 + ### Add non-generated documented files to the global property
460 + add_documented_files(
461 +--- a/spm/CMakeLists.txt
462 ++++ b/spm/CMakeLists.txt
463 +@@ -139,7 +139,7 @@
464 + configure_file (
465 + "${CMAKE_CURRENT_SOURCE_DIR}/include/spm_config.h.in"
466 + "${CMAKE_CURRENT_BINARY_DIR}/include/spm_config.h")
467 +-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/include/spm_config.h" DESTINATION include)
468 ++install(FILES "${CMAKE_CURRENT_BINARY_DIR}/include/spm_config.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
469 +
470 + include_directories(include)
471 + include_directories("${CMAKE_CURRENT_BINARY_DIR}/include")
472 +@@ -231,14 +231,14 @@
473 + endif (MPI_C_FOUND)
474 +
475 + install(TARGETS spm
476 +- ARCHIVE DESTINATION lib
477 +- LIBRARY DESTINATION lib)
478 ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
479 ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
480 +
481 + install(FILES
482 + include/spm.h
483 + include/spm_const.h
484 + include/spm_datatypes.h
485 +- DESTINATION include )
486 ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
487 +
488 + ### Build pkg-config and environment file
489 + include(GenPkgConfig)
490 +@@ -251,8 +251,6 @@
491 + "${CMAKE_CURRENT_SOURCE_DIR}/tools/spmf.pc.in"
492 + PROJECTNAME SPM )
493 +
494 +-generate_env_file( PROJECTNAME SPM )
495 +-
496 + ### Add documented files to the global property
497 + add_documented_files(
498 + DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
499 +--- a/spm/cmake_modules/morse_cmake/modules/GenPkgConfig.cmake
500 ++++ b/spm/cmake_modules/morse_cmake/modules/GenPkgConfig.cmake
501 +@@ -196,7 +196,7 @@
502 + # ------------
503 + install(FILES
504 + "${CMAKE_BINARY_DIR}/lib/pkgconfig/${fname}.pc"
505 +- DESTINATION lib/pkgconfig )
506 ++ DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig" )
507 +
508 + endforeach()
509 +
510 +@@ -232,7 +232,7 @@
511 + # installation
512 + # ------------
513 + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/bin/${LONAME}_env.sh"
514 +- DESTINATION bin)
515 ++ DESTINATION ${CMAKE_INSTALL_BINDIR})
516 +
517 + endmacro(generate_env_file)
518 +
519 +--- a/spm/wrappers/fortran90/CMakeLists.txt
520 ++++ b/spm/wrappers/fortran90/CMakeLists.txt
521 +@@ -12,7 +12,7 @@
522 +
523 + # Coherce CMake to install the generated .mod files
524 + set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/mod_files)
525 +-install(DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/ DESTINATION include)
526 ++install(DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
527 +
528 + add_library( spmf
529 + src/spm_enums.F90
530 +@@ -30,9 +30,9 @@
531 +
532 + target_link_libraries( spmf spm )
533 + install(TARGETS spmf
534 +- RUNTIME DESTINATION bin
535 +- ARCHIVE DESTINATION lib
536 +- LIBRARY DESTINATION lib )
537 ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
538 ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
539 ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} )
540 +
541 + #
542 + # Add examples
543 +@@ -41,14 +41,15 @@
544 + spm_driver.f90
545 + spm_user.f90
546 + )
547 ++set ( example_install_dir "${CMAKE_INSTALL_DOCDIR}/examples/fortran" )
548 +
549 + foreach (_file ${EXAMPLES})
550 + get_filename_component(_name_we ${_file} NAME_WE)
551 + add_executable(${_name_we} examples/${_file})
552 + target_link_libraries(${_name_we} spmf)
553 +
554 +- install(TARGETS ${_name_we} RUNTIME DESTINATION examples )
555 +- install(FILES examples/${_file} DESTINATION examples )
556 ++ install(TARGETS ${_name_we} RUNTIME DESTINATION ${example_install_dir} )
557 ++ install(FILES examples/${_file} DESTINATION ${example_install_dir} )
558 +
559 + add_test(fortran_${_name_we} ./${_name_we})
560 +
561 +--- a/spm/wrappers/python/CMakeLists.txt
562 ++++ b/spm/wrappers/python/CMakeLists.txt
563 +@@ -9,6 +9,8 @@
564 + #
565 + ###
566 +
567 ++find_package(Python COMPONENTS Interpreter REQUIRED)
568 ++
569 + # Configure enum.py
570 + if (SPM_INT64)
571 + set(SPM_PYTHON_INTEGER c_int64)
572 +@@ -26,23 +28,20 @@
573 + ${CMAKE_CURRENT_SOURCE_DIR}/spm/__spm__.py
574 + ${CMAKE_CURRENT_SOURCE_DIR}/spm/spm.py
575 + ${CMAKE_CURRENT_SOURCE_DIR}/spm/enum.py
576 +- DESTINATION lib/python/spm )
577 ++ DESTINATION "${Python_SITELIB}/spm" )
578 +
579 + # Install python examples
580 + install(FILES
581 + ${CMAKE_CURRENT_SOURCE_DIR}/spm_driver.py
582 + ${CMAKE_CURRENT_SOURCE_DIR}/spm_scipy.py
583 +- DESTINATION examples
584 ++ DESTINATION "${CMAKE_INSTALL_DOCDIR}/examples/python"
585 + )
586 +
587 + ## CTest execution
588 +-find_package(PythonInterp QUIET)
589 +-if (PYTHONINTERP_FOUND)
590 + set( PYTHON_TESTS
591 + spm_driver spm_scipy )
592 +
593 + foreach(example ${PYTHON_TESTS} )
594 + add_test(python_${example} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${example}.py)
595 + endforeach()
596 +-endif()
597 +
598 +--- a/wrappers/fortran90/CMakeLists.txt
599 ++++ b/wrappers/fortran90/CMakeLists.txt
600 +@@ -12,7 +12,7 @@
601 +
602 + # Coherce CMake to install the generated .mod files
603 + set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/mod_files)
604 +-install(DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/ DESTINATION include)
605 ++install(DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
606 +
607 + add_library( pastixf
608 + src/pastix_enums.F90
609 +@@ -30,9 +30,9 @@
610 +
611 + target_link_libraries( pastixf pastix )
612 + install(TARGETS pastixf
613 +- RUNTIME DESTINATION bin
614 +- ARCHIVE DESTINATION lib
615 +- LIBRARY DESTINATION lib )
616 ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
617 ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
618 ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} )
619 +
620 + #
621 + # Add examples
622 +@@ -43,14 +43,15 @@
623 + fstep-by-step.f90
624 + fmultidof.f90
625 + )
626 ++set ( example_install_dir "${CMAKE_INSTALL_DOCDIR}/examples/fortran" )
627 +
628 + foreach (_file ${EXAMPLES})
629 + get_filename_component(_name_we ${_file} NAME_WE)
630 + add_executable(${_name_we} examples/${_file})
631 + target_link_libraries(${_name_we} pastixf spmf)
632 +
633 +- install(TARGETS ${_name_we} RUNTIME DESTINATION examples )
634 +- install(FILES examples/${_file} DESTINATION examples )
635 ++ install(TARGETS ${_name_we} RUNTIME DESTINATION ${example_install_dir} )
636 ++ install(FILES examples/${_file} DESTINATION ${example_install_dir} )
637 +
638 + add_test(fortran_${_name_we} ./${_name_we})
639 +
640 +@@ -65,10 +66,10 @@
641 + add_executable(${_name_we} examples/${_file})
642 + target_link_libraries(${_name_we} pastixf spmf)
643 +
644 +-install(TARGETS ${_name_we} RUNTIME DESTINATION examples )
645 +-install(FILES examples/${_file} DESTINATION examples )
646 +-install(FILES examples/test_seq.in DESTINATION examples )
647 +-install(FILES examples/test_mt.in DESTINATION examples )
648 ++install(TARGETS ${_name_we} RUNTIME DESTINATION ${example_install_dir} )
649 ++install(FILES examples/${_file} DESTINATION ${example_install_dir} )
650 ++install(FILES examples/test_seq.in DESTINATION ${example_install_dir} )
651 ++install(FILES examples/test_mt.in DESTINATION ${example_install_dir} )
652 +
653 + # Add OpenMP if available
654 + find_package(OpenMP)
655 +--- a/wrappers/python/CMakeLists.txt
656 ++++ b/wrappers/python/CMakeLists.txt
657 +@@ -9,6 +9,8 @@
658 + #
659 + ###
660 +
661 ++find_package(Python COMPONENTS Interpreter REQUIRED)
662 ++
663 + # Configure enum.py
664 + if (PASTIX_INT64)
665 + set(PASTIX_PYTHON_INTEGER c_int64)
666 +@@ -27,7 +29,7 @@
667 + ${CMAKE_CURRENT_SOURCE_DIR}/examples/pypastix/pastix.py
668 + ${CMAKE_CURRENT_SOURCE_DIR}/examples/pypastix/enum.py
669 + ${CMAKE_CURRENT_SOURCE_DIR}/examples/pypastix/solver.py
670 +- DESTINATION lib/python/pypastix )
671 ++ DESTINATION "${Python_SITELIB}/pypastix" )
672 +
673 + # Install python examples
674 + install(FILES
675 +@@ -35,12 +37,10 @@
676 + ${CMAKE_CURRENT_SOURCE_DIR}/examples/simple_obj.py
677 + ${CMAKE_CURRENT_SOURCE_DIR}/examples/schur.py
678 + ${CMAKE_CURRENT_SOURCE_DIR}/examples/schur_obj.py
679 +- DESTINATION examples
680 ++ DESTINATION "${CMAKE_INSTALL_DOCDIR}/examples/python"
681 + )
682 +
683 + ## CTest execution
684 +-find_package(PythonInterp QUIET)
685 +-if (PYTHONINTERP_FOUND)
686 + set( PYTHON_TESTS
687 + simple step-by-step schur simple_obj schur_obj )
688 +
689 +@@ -57,5 +57,4 @@
690 + set_tests_properties( python_${example} PROPERTIES
691 + ENVIRONMENT "${TEST_ENV_LIST}" )
692 + endforeach()
693 +-endif()
694 +
695
696 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
697 new file mode 100644
698 index 00000000000..71d356fae2f
699 --- /dev/null
700 +++ b/sci-libs/pastix/files/pastix-6.0.3-cmake-python-optional.patch
701 @@ -0,0 +1,64 @@
702 +--- a/CMakeLists.txt
703 ++++ b/CMakeLists.txt
704 +@@ -100,6 +100,9 @@
705 + option(PASTIX_WITH_FORTRAN
706 + "Enable Fortran files/interface/examples to be compiled" ON)
707 +
708 ++option(PASTIX_WITH_PYTHON
709 ++ "Install Python wrapper and examples" ON)
710 ++
711 + cmake_dependent_option(PASTIX_DISTRIBUTED
712 + "Enable the distributed interface (requires PASTIX_WITH_MPI)" OFF "PASTIX_WITH_MPI" OFF)
713 +
714 +--- a/spm/CMakeLists.txt
715 ++++ b/spm/CMakeLists.txt
716 +@@ -83,6 +83,13 @@
717 + "Enable Fortran files/interface/examples to be compiled" ON)
718 + endif()
719 +
720 ++if ( DEFINED PASTIX_WITH_PYTHON )
721 ++ set( SPM_WITH_PYTHON ${PASTIX_WITH_PYTHON} )
722 ++else()
723 ++ option(SPM_WITH_PYTHON
724 ++ "Install Python wrapper and examples" ON)
725 ++endif()
726 ++
727 + if (SPM_WITH_FORTRAN)
728 + include(FortranCInterface)
729 + FortranCInterface_HEADER(src/FCmangle.h
730 +--- a/spm/wrappers/CMakeLists.txt
731 ++++ b/spm/wrappers/CMakeLists.txt
732 +@@ -13,8 +13,10 @@
733 + add_subdirectory( fortran90 )
734 + endif()
735 +
736 +-if (BUILD_SHARED_LIBS)
737 +- add_subdirectory( python )
738 +-else()
739 +- message(STATUS "--- Python wrapper is disabled with static libraries")
740 +-endif()
741 ++if (SPM_WITH_PYTHON)
742 ++ if (BUILD_SHARED_LIBS)
743 ++ add_subdirectory( python )
744 ++ else (BUILD_SHARED_LIBS)
745 ++ message(FATAL_ERROR "--- Python wrapper requested but it cannot be built with static libraries")
746 ++ endif (BUILD_SHARED_LIBS)
747 ++endif (SPM_WITH_PYTHON)
748 +--- a/wrappers/CMakeLists.txt
749 ++++ b/wrappers/CMakeLists.txt
750 +@@ -13,8 +13,10 @@
751 + add_subdirectory( fortran90 )
752 + endif()
753 +
754 +-if (BUILD_SHARED_LIBS)
755 +- add_subdirectory( python )
756 +-else()
757 +- message(STATUS "--- Python wrapper is disabled with static libraries")
758 +-endif()
759 ++if (PASTIX_WITH_PYTHON)
760 ++ if (BUILD_SHARED_LIBS)
761 ++ add_subdirectory( python )
762 ++ else (BUILD_SHARED_LIBS)
763 ++ message(FATAL_ERROR "--- Python wrapper requested but it cannot be built with static libraries")
764 ++ endif (BUILD_SHARED_LIBS)
765 ++endif (PASTIX_WITH_PYTHON)
766
767 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
768 new file mode 100644
769 index 00000000000..f2ca9a5699d
770 --- /dev/null
771 +++ b/sci-libs/pastix/files/pastix-6.0.3-cmake-spm-project.patch
772 @@ -0,0 +1,12 @@
773 +--- a/spm/CMakeLists.txt
774 ++++ b/spm/CMakeLists.txt
775 +@@ -8,9 +8,6 @@
776 + # @date 2013-06-24
777 + #
778 + ###
779 +-cmake_minimum_required (VERSION 3.0)
780 +-project (SPM C Fortran)
781 +-
782 + # Check if compiled independently or within another project
783 + if ( ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
784 + set( BUILD_AS_SUBPROJECT OFF )
785
786 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
787 new file mode 100644
788 index 00000000000..84dfdd4cc10
789 --- /dev/null
790 +++ b/sci-libs/pastix/files/pastix-6.0.3-multiple-coeftabMemory.patch
791 @@ -0,0 +1,11 @@
792 +--- a/sopalin/coeftab.h
793 ++++ b/sopalin/coeftab.h
794 +@@ -41,7 +41,7 @@
795 + /**
796 + * @brief List of functions to compute the memory gain in low-rank per precision.
797 + */
798 +-coeftab_fct_memory_t coeftabMemory[4];
799 ++extern coeftab_fct_memory_t coeftabMemory[4];
800 +
801 + /**
802 + * @}
803
804 diff --git a/sci-libs/pastix/metadata.xml b/sci-libs/pastix/metadata.xml
805 index 387eff2e8ed..1a653c7ffd2 100644
806 --- a/sci-libs/pastix/metadata.xml
807 +++ b/sci-libs/pastix/metadata.xml
808 @@ -17,7 +17,11 @@
809 block structure of the incomplete factors.
810 </longdescription>
811 <use>
812 - <flag name="int64">Build the 64 bits integer library</flag>
813 - <flag name="starpu">Build and link with <pkg>dev-libs/starpu</pkg></flag>
814 + <flag name="cuda">Enable GPU support using CUDA kernels</flag>
815 + <flag name="fortran">Install the Fortran interface</flag>
816 + <flag name="int64">Use 64- rather than 32-bit integer representation</flag>
817 + <flag name="metis">Enable matrix ordering with <pkg>sci-libs/metis</pkg></flag>
818 + <flag name="scotch">Enable matrix ordering with <pkg>sci-libs/scotch</pkg></flag>
819 + <flag name="starpu">Enable support for ther <pkg>dev-libs/starpu</pkg> runtime</flag>
820 </use>
821 </pkgmetadata>
822
823 diff --git a/sci-libs/pastix/pastix-6.0.3.ebuild b/sci-libs/pastix/pastix-6.0.3.ebuild
824 new file mode 100644
825 index 00000000000..e2dce19cca2
826 --- /dev/null
827 +++ b/sci-libs/pastix/pastix-6.0.3.ebuild
828 @@ -0,0 +1,84 @@
829 +# Copyright 1999-2021 Gentoo Authors
830 +# Distributed under the terms of the GNU General Public License v2
831 +
832 +EAPI=7
833 +
834 +PYTHON_COMPAT=( python3_9 )
835 +
836 +inherit cmake fortran-2 python-single-r1
837 +
838 +# package id: changes every version, see the link on inriaforge
839 +PID=38205
840 +DESCRIPTION="Parallel solver for very large sparse linear systems"
841 +HOMEPAGE="https://pastix.gforge.inria.fr"
842 +SRC_URI="https://gforge.inria.fr/frs/download.php/file/${PID}/${P}.tar.gz"
843 +
844 +LICENSE="CeCILL-C"
845 +SLOT="0"
846 +KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux"
847 +IUSE="cuda examples +fortran int64 metis mpi +python +scotch starpu test"
848 +
849 +RESTRICT="!test? ( test )"
850 +
851 +# REQUIRED_USE explanation:
852 +# 1. Not a typo, Python is needed at build time regardless of whether
853 +# the bindings are to be installed or not
854 +# 2. While not enforced by upstream build scripts, having no ordering at all
855 +# results in rather spectacular test and runtime failures.
856 +REQUIRED_USE="${PYTHON_REQUIRED_USE}
857 + || ( metis scotch )"
858 +
859 +RDEPEND="sys-apps/hwloc:0=
860 + virtual/blas
861 + virtual/cblas
862 + virtual/lapack
863 + virtual/lapacke
864 + cuda? ( dev-util/nvidia-cuda-toolkit )
865 + metis? ( sci-libs/metis[int64?] )
866 + mpi? ( virtual/mpi[fortran] )
867 + python? (
868 + ${PYTHON_DEPS}
869 + $(python_gen_cond_dep '
870 + dev-python/numpy[${PYTHON_USEDEP}]
871 + dev-python/scipy[${PYTHON_USEDEP}]
872 + ')
873 + )
874 + scotch? ( sci-libs/scotch:0=[int64?,mpi?] )
875 + starpu? ( >=dev-libs/starpu-1.3.0:0= )"
876 +DEPEND="${RDEPEND}"
877 +BDEPEND="${PYTHON_DEPS}
878 + virtual/pkgconfig
879 + test? ( ${RDEPEND} )"
880 +
881 +PATCHES=(
882 + "${FILESDIR}"/${PN}-6.0.3-cmake-installdirs.patch
883 + "${FILESDIR}"/${PN}-6.0.3-cmake-examples-optional.patch
884 + "${FILESDIR}"/${PN}-6.0.3-cmake-python-optional.patch
885 + "${FILESDIR}"/${PN}-6.0.3-cmake-spm-project.patch
886 + "${FILESDIR}"/${PN}-6.0.3-multiple-coeftabMemory.patch
887 +)
888 +
889 +pkg_setup() {
890 + python-single-r1_pkg_setup
891 +}
892 +
893 +src_configure() {
894 + local mycmakeargs=(
895 + -DBUILD_SHARED_LIBS=yes
896 + -DINSTALL_EXAMPLES=$(usex examples)
897 + -DPASTIX_INT64=$(usex int64)
898 + -DPASTIX_ORDERING_METIS=$(usex metis)
899 + -DPASTIX_ORDERING_SCOTCH=$(usex scotch)
900 + -DPASTIX_WITH_CUDA=$(usex cuda)
901 + -DPASTIX_WITH_FORTRAN=$(usex fortran)
902 + -DPASTIX_WITH_MPI=$(usex mpi)
903 + -DPASTIX_WITH_PYTHON=$(usex python)
904 + -DPASTIX_WITH_STARPU=$(usex starpu)
905 + )
906 + cmake_src_configure
907 +}
908 +
909 +src_install() {
910 + cmake_src_install
911 + use python && python_optimize
912 +}