From 2047d854b50ae7c1e594477ace51cc49ab78aa83 Mon Sep 17 00:00:00 2001 From: Jeremie Vandenplas Date: Fri, 24 Jan 2025 18:25:08 +0100 Subject: [PATCH 1/6] Proposition for fixing CMake procedure --- src/CMakeLists.txt | 71 +++------------------------------------ src/blas/CMakeLists.txt | 24 +++++++++++++ src/lapack/CMakeLists.txt | 58 ++++++++++++++++++++++++++++++++ 3 files changed, 86 insertions(+), 67 deletions(-) create mode 100644 src/blas/CMakeLists.txt create mode 100644 src/lapack/CMakeLists.txt diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d29b34f27..a2bc09463 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,6 @@ #### Pre-process: .fpp -> .f90 via Fypp + # Create a list of the files to be preprocessed set(fppFiles stdlib_ascii.fypp @@ -21,7 +22,6 @@ set(fppFiles stdlib_io_npy_load.fypp stdlib_io_npy_save.fypp stdlib_kinds.fypp - blas/stdlib_blas_constants.fypp stdlib_linalg.fypp stdlib_linalg_diag.fypp stdlib_linalg_least_squares.fypp @@ -86,77 +86,13 @@ set(fppFiles # Preprocessed files to contain preprocessor directives -> .F90 set(cppFiles stdlib_linalg_constants.fypp - blas/stdlib_blas.fypp - blas/stdlib_linalg_blas_aux.fypp - blas/stdlib_blas_level1.fypp - blas/stdlib_blas_level2_gen.fypp - blas/stdlib_blas_level2_ban.fypp - blas/stdlib_blas_level2_pac.fypp - blas/stdlib_blas_level2_sym.fypp - blas/stdlib_blas_level2_tri.fypp - blas/stdlib_blas_level3_gen.fypp - blas/stdlib_blas_level3_sym.fypp - blas/stdlib_blas_level3_tri.fypp - - lapack/stdlib_lapack_base.fypp - lapack/stdlib_lapack_solve.fypp - lapack/stdlib_lapack_others.fypp - lapack/stdlib_lapack_orthogonal_factors.fypp - lapack/stdlib_lapack_eig_svd_lsq.fypp - lapack/stdlib_linalg_lapack_aux.fypp - - lapack/stdlib_lapack_auxiliary.fypp - lapack/stdlib_lapack_blas_like_base.fypp - lapack/stdlib_lapack_blas_like_l1.fypp - lapack/stdlib_lapack_blas_like_l2.fypp - lapack/stdlib_lapack_blas_like_l3.fypp - lapack/stdlib_lapack_blas_like_mnorm.fypp - lapack/stdlib_lapack_blas_like_scalar.fypp - lapack/stdlib_lapack_cosine_sine.fypp - lapack/stdlib_lapack_cosine_sine2.fypp - lapack/stdlib_lapack_eigv_comp.fypp - lapack/stdlib_lapack_eigv_comp2.fypp - lapack/stdlib_lapack_eigv_gen.fypp - lapack/stdlib_lapack_eigv_gen2.fypp - lapack/stdlib_lapack_eigv_gen3.fypp - lapack/stdlib_lapack_eigv_std_driver.fypp - lapack/stdlib_lapack_eigv_svd_bidiag_dc.fypp - lapack/stdlib_lapack_eigv_svd_drivers.fypp - lapack/stdlib_lapack_eigv_svd_drivers2.fypp - lapack/stdlib_lapack_eigv_svd_drivers3.fypp - lapack/stdlib_lapack_eigv_sym_comp.fypp - lapack/stdlib_lapack_eigv_sym.fypp - lapack/stdlib_lapack_eigv_tridiag.fypp - lapack/stdlib_lapack_eigv_tridiag2.fypp - lapack/stdlib_lapack_eigv_tridiag3.fypp - lapack/stdlib_lapack_givens_jacobi_rot.fypp - lapack/stdlib_lapack_householder_reflectors.fypp - lapack/stdlib_lapack_lsq.fypp - lapack/stdlib_lapack_lsq_aux.fypp - lapack/stdlib_lapack_lsq_constrained.fypp - lapack/stdlib_lapack_orthogonal_factors_ql.fypp - lapack/stdlib_lapack_orthogonal_factors_qr.fypp - lapack/stdlib_lapack_orthogonal_factors_rz.fypp - lapack/stdlib_lapack_others_sm.fypp - lapack/stdlib_lapack_solve_aux.fypp - lapack/stdlib_lapack_solve_chol_comp.fypp - lapack/stdlib_lapack_solve_chol.fypp - lapack/stdlib_lapack_solve_ldl_comp.fypp - lapack/stdlib_lapack_solve_ldl_comp2.fypp - lapack/stdlib_lapack_solve_ldl_comp3.fypp - lapack/stdlib_lapack_solve_ldl_comp4.fypp - lapack/stdlib_lapack_solve_ldl.fypp - lapack/stdlib_lapack_solve_lu_comp.fypp - lapack/stdlib_lapack_solve_lu.fypp - lapack/stdlib_lapack_solve_tri_comp.fypp - lapack/stdlib_lapack_svd_bidiag_qr.fypp - lapack/stdlib_lapack_svd_comp.fypp - lapack/stdlib_lapack_svd_comp2.fypp stdlib_linalg_blas.fypp stdlib_linalg_lapack.fypp ) +add_subdirectory(blas) + fypp_f90("${fyppFlags}" "${fppFiles}" outFiles) fypp_f90pp("${fyppFlags}" "${cppFiles}" outPreprocFiles) @@ -183,6 +119,7 @@ set(SRC ${outPreprocFiles} ) +message(${outPreprocFiles}) add_library(${PROJECT_NAME} ${SRC}) set_target_properties( diff --git a/src/blas/CMakeLists.txt b/src/blas/CMakeLists.txt new file mode 100644 index 000000000..ad2ee4c27 --- /dev/null +++ b/src/blas/CMakeLists.txt @@ -0,0 +1,24 @@ +#### + +set(dir "${CMAKE_CURRENT_SOURCE_DIR}") + +list(APPEND fppFiles + blas/stdlib_blas_constants.fypp +) + +list(APPEND cppFiles + blas/stdlib_blas.fypp + blas/stdlib_blas_level1.fypp + blas/stdlib_blas_level2_ban.fypp + blas/stdlib_blas_level2_gen.fypp + blas/stdlib_blas_level2_pac.fypp + blas/stdlib_blas_level2_sym.fypp + blas/stdlib_blas_level2_tri.fypp + blas/stdlib_blas_level3_gen.fypp + blas/stdlib_blas_level3_sym.fypp + blas/stdlib_blas_level3_tri.fypp + blas/stdlib_linalg_blas_aux.fypp +) + +set(fppFiles "${fppFiles}" PARENT_SCOPE) +set(cppFiles "${cppFiles}" PARENT_SCOPE) diff --git a/src/lapack/CMakeLists.txt b/src/lapack/CMakeLists.txt new file mode 100644 index 000000000..6aa0a44ec --- /dev/null +++ b/src/lapack/CMakeLists.txt @@ -0,0 +1,58 @@ +list(APPEND cppFiles + lapack/stdlib_lapack_base.fypp + lapack/stdlib_lapack_solve.fypp + lapack/stdlib_lapack_others.fypp + lapack/stdlib_lapack_orthogonal_factors.fypp + lapack/stdlib_lapack_eig_svd_lsq.fypp + lapack/stdlib_linalg_lapack_aux.fypp + + lapack/stdlib_lapack_auxiliary.fypp + lapack/stdlib_lapack_blas_like_base.fypp + lapack/stdlib_lapack_blas_like_l1.fypp + lapack/stdlib_lapack_blas_like_l2.fypp + lapack/stdlib_lapack_blas_like_l3.fypp + lapack/stdlib_lapack_blas_like_mnorm.fypp + lapack/stdlib_lapack_blas_like_scalar.fypp + lapack/stdlib_lapack_cosine_sine.fypp + lapack/stdlib_lapack_cosine_sine2.fypp + lapack/stdlib_lapack_eigv_comp.fypp + lapack/stdlib_lapack_eigv_comp2.fypp + lapack/stdlib_lapack_eigv_gen.fypp + lapack/stdlib_lapack_eigv_gen2.fypp + lapack/stdlib_lapack_eigv_gen3.fypp + lapack/stdlib_lapack_eigv_std_driver.fypp + lapack/stdlib_lapack_eigv_svd_bidiag_dc.fypp + lapack/stdlib_lapack_eigv_svd_drivers.fypp + lapack/stdlib_lapack_eigv_svd_drivers2.fypp + lapack/stdlib_lapack_eigv_svd_drivers3.fypp + lapack/stdlib_lapack_eigv_sym_comp.fypp + lapack/stdlib_lapack_eigv_sym.fypp + lapack/stdlib_lapack_eigv_tridiag.fypp + lapack/stdlib_lapack_eigv_tridiag2.fypp + lapack/stdlib_lapack_eigv_tridiag3.fypp + lapack/stdlib_lapack_givens_jacobi_rot.fypp + lapack/stdlib_lapack_householder_reflectors.fypp + lapack/stdlib_lapack_lsq.fypp + lapack/stdlib_lapack_lsq_aux.fypp + lapack/stdlib_lapack_lsq_constrained.fypp + lapack/stdlib_lapack_orthogonal_factors_ql.fypp + lapack/stdlib_lapack_orthogonal_factors_qr.fypp + lapack/stdlib_lapack_orthogonal_factors_rz.fypp + lapack/stdlib_lapack_others_sm.fypp + lapack/stdlib_lapack_solve_aux.fypp + lapack/stdlib_lapack_solve_chol_comp.fypp + lapack/stdlib_lapack_solve_chol.fypp + lapack/stdlib_lapack_solve_ldl_comp.fypp + lapack/stdlib_lapack_solve_ldl_comp2.fypp + lapack/stdlib_lapack_solve_ldl_comp3.fypp + lapack/stdlib_lapack_solve_ldl_comp4.fypp + lapack/stdlib_lapack_solve_ldl.fypp + lapack/stdlib_lapack_solve_lu_comp.fypp + lapack/stdlib_lapack_solve_lu.fypp + lapack/stdlib_lapack_solve_tri_comp.fypp + lapack/stdlib_lapack_svd_bidiag_qr.fypp + lapack/stdlib_lapack_svd_comp.fypp + lapack/stdlib_lapack_svd_comp2.fypp +) + +set(cppFiles "${cppFiles}" PARENT_SCOPE) From acc93fad398f340eabae3888c3bb9a440b9d0e45 Mon Sep 17 00:00:00 2001 From: Jeremie Vandenplas Date: Fri, 24 Jan 2025 18:38:05 +0100 Subject: [PATCH 2/6] Fix cmakelist by adding the subdirectory lapapck --- src/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a2bc09463..c0c2e9ba5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -92,6 +92,7 @@ set(cppFiles ) add_subdirectory(blas) +add_subdirectory(lapack) fypp_f90("${fyppFlags}" "${fppFiles}" outFiles) fypp_f90pp("${fyppFlags}" "${cppFiles}" outPreprocFiles) From 3b86fc5b3677d5f22990d007b0f784c5c9a2ebbe Mon Sep 17 00:00:00 2001 From: Jeremie Vandenplas Date: Fri, 24 Jan 2025 18:47:35 +0100 Subject: [PATCH 3/6] Test ubuntu 20.04 --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 707916ea2..9bc7fbbfe 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-13] + os: [ubuntu-20.04, macos-13] toolchain: - {compiler: gcc, version: 10} - {compiler: gcc, version: 11} From 6ee3a185fafdeed0912b928c45bda2f2cdbaf871 Mon Sep 17 00:00:00 2001 From: Jeremie Vandenplas Date: Fri, 24 Jan 2025 12:56:52 -0500 Subject: [PATCH 4/6] Test Ubuntu 22.04 --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 9bc7fbbfe..f89780dcd 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04, macos-13] + os: [ubuntu-22.04, macos-13] toolchain: - {compiler: gcc, version: 10} - {compiler: gcc, version: 11} From cf60c8dad55aca83e728a7b3ba1b1244b64ff04e Mon Sep 17 00:00:00 2001 From: Jeremie Vandenplas Date: Fri, 24 Jan 2025 14:51:29 -0500 Subject: [PATCH 5/6] Update .github/workflows/CI.yml --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index f89780dcd..707916ea2 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-22.04, macos-13] + os: [ubuntu-latest, macos-13] toolchain: - {compiler: gcc, version: 10} - {compiler: gcc, version: 11} From 8907f265f928ccd23747f825084a32fc4f942f7b Mon Sep 17 00:00:00 2001 From: Jeremie Vandenplas Date: Fri, 24 Jan 2025 14:52:25 -0500 Subject: [PATCH 6/6] Apply suggestions from code review --- src/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c0c2e9ba5..d8a4ac1a9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,6 +1,5 @@ #### Pre-process: .fpp -> .f90 via Fypp - # Create a list of the files to be preprocessed set(fppFiles stdlib_ascii.fypp @@ -120,7 +119,6 @@ set(SRC ${outPreprocFiles} ) -message(${outPreprocFiles}) add_library(${PROJECT_NAME} ${SRC}) set_target_properties(