Skip to content

Adjust CI to test for CMake versions #123

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
merged 5 commits into from
Apr 8, 2025

Conversation

LecrisUT
Copy link
Contributor

The reasoning for each CMake version to test:

  • minimum: make sure that no functions that are provided in later CMake versions are introduced (without proper version checks) during development
  • maximum: make sure that when the new policies are used, the CMake code accounts for them accordingly
  • latest/latest-rc: make sure previous policies are not dropped yet

@LecrisUT LecrisUT force-pushed the ci/cmake branch 2 times, most recently from 87565fc to 39d0ba9 Compare March 31, 2025 09:37
@LecrisUT LecrisUT mentioned this pull request Mar 31, 2025
Signed-off-by: Cristian Le <[email protected]>
@LecrisUT
Copy link
Contributor Author

LecrisUT commented Mar 31, 2025

Based on the failure in https://github.com/Reference-ScaLAPACK/scalapack/actions/runs/14168865703/job/39688007257. I would suggest bumping the minimum to 3.16, because there seems to be a CMake bug in how the ninja generator is detected and it would be better to drop the support rather than surprise the user. Depending on the support model, I would say even bumping it to 3.26 would make sense. See this list for available CMake versions. Consider that any changes made would typically not be backported all the way to the very oldest distro.

I also think it is high time to drop the Makefile support based on the current status of the CI there.

@LecrisUT LecrisUT marked this pull request as draft March 31, 2025 15:21
@LecrisUT
Copy link
Contributor Author

Note: do not merge this, because I still have a [DEBUG] commit there. Let me know how you would like to proceed with #123 (comment)

@langou
Copy link
Contributor

langou commented Mar 31, 2025

Hi @LecrisUT, Okey doc, let me know when this is ready for merge. I would be fine to push the cmake version requirement to 3.26. Julien.

Signed-off-by: Cristian Le <[email protected]>
Signed-off-by: Cristian Le <[email protected]>
Signed-off-by: Cristian Le <[email protected]>
@LecrisUT LecrisUT marked this pull request as ready for review March 31, 2025 16:32
@LecrisUT
Copy link
Contributor Author

Hi @LecrisUT, Okey doc, let me know when this is ready for merge. I would be fine to push the cmake version requirement to 3.26. Julien.

Thanks, the discussion on the minimum CMake was the only blocker. What to do with the Makefile builds will also be appreciated, but it can be deferred.

@prj-
Copy link
Contributor

prj- commented Apr 1, 2025

This breaks something else, BTW.

-- Found MPI_LIBRARY : TRUE 
-- --> MPI C Compiler : /media/psf/repositories/petsc/arch-linux-c-debug-real/bin/mpicc
-- --> C Compiler : /media/psf/repositories/petsc/arch-linux-c-debug-real/bin/mpicc
-- --> MPI Fortran Compiler : /media/psf/repositories/petsc/arch-linux-c-debug-real/bin/mpif90
-- --> Fortran Compiler : /media/psf/repositories/petsc/arch-linux-c-debug-real/bin/mpif90
-- =========
-- Compiling and Building BLACS INSTALL Testing to set correct variables
--  Build Output:
 -- The C compiler identification is GNU 14.2.0
-- The Fortran compiler identification is unknown
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Configuring incomplete, errors occurred!

--  Error Output:
 CMake Error at CMakeLists.txt:2 (project):
  No CMAKE_Fortran_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "FC" or the CMake cache entry CMAKE_Fortran_COMPILER to the full
  path to the compiler, or to the compiler name if it is in the PATH.



CMake Error at CMAKE/FortranMangling.cmake:33 (MESSAGE):
   Configure in the BLACS INSTALL directory FAILED
Call Stack (most recent call first):
  CMakeLists.txt:121 (COMPILE)


-- Configuring incomplete, errors occurred!

@LecrisUT
Copy link
Contributor Author

LecrisUT commented Apr 1, 2025

This breaks something else, BTW.

Could you go into detail on what configure flags you used? Generally it is no longer recommended to use the mpi* compilers, instead the bare compilers should be passed or be detectable.

But yes, there are plenty of things to be addressed and I will try to do them gradually with CI coverage along the way.

@prj-
Copy link
Contributor

prj- commented Apr 2, 2025

Here is my configuration line/log. Let me know if you need something else.

$ ../../../bin/cmake .. -DCMAKE_INSTALL_PREFIX=/media/psf/repositories/petsc/arch-linux-c-debug-real -DCMAKE_INSTALL_NAME_DIR:STRING="/media/psf/repositories/petsc/arch-linux-c-debug-real/lib" -DCMAKE_INSTALL_LIBDIR:STRING="lib" -DCMAKE_VERBOSE_MAKEFILE=1 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_AR="/usr/bin/ar" -DCMAKE_C_COMPILER="/media/psf/repositories/petsc/arch-linux-c-debug-real/bin/mpicc" -DMPI_C_COMPILER="/media/psf/repositories/petsc/arch-linux-c-debug-real/bin/mpicc" -DCMAKE_RANLIB=/usr/bin/ranlib -DCMAKE_CXX_COMPILER="/media/psf/repositories/petsc/arch-linux-c-debug-real/bin/mpicxx" -DMPI_CXX_COMPILER="/media/psf/repositories/petsc/arch-linux-c-debug-real/bin/mpicxx" -DCMAKE_Fortran_COMPILER="gfortran-14" -DMPI_Fortran_COMPILER="/media/psf/repositories/petsc/arch-linux-c-debug-real/bin/mpif90" -DCMAKE_Fortran_FLAGS:STRING="-Wextra -ffree-line-length-512 -g -fopenmp -fallow-argument-mismatch" -DCMAKE_Fortran_FLAGS_DEBUG:STRING="-Wextra -ffree-line-length-512 -g -fopenmp -fallow-argument-mismatch" -DCMAKE_Fortran_FLAGS_RELEASE:STRING="-Wextra -ffree-line-length-512 -g -fopenmp -fallow-argument-mismatch" -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_STATIC_LIBS:BOOL=OFF -DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON -DLAPACK_LIBRARIES="-Wl,-rpath,/media/psf/repositories/petsc/arch-linux-c-debug-real/lib -L/media/psf/repositories/petsc/arch-linux-c-debug-real/lib -lf2clapack -Wl,-rpath,/media/psf/repositories/petsc/arch-linux-c-debug-real/lib -L/media/psf/repositories/petsc/arch-linux-c-debug-real/lib -lf2cblas -lm -Wl,-rpath,/media/psf/repositories/petsc/arch-linux-c-debug-real/lib -Wl,-rpath,/media/psf/repositories/petsc/arch-linux-c-debug-real/lib -L/media/psf/repositories/petsc/arch-linux-c-debug-real/lib -lmpifort -lmpi -lgfortran -lm -Wl,-rpath,/usr/lib/gcc/aarch64-linux-gnu/14 -Wl,-rpath,/usr/lib/gcc/aarch64-linux-gnu/14 -L/usr/lib/gcc/aarch64-linux-gnu/14 -Wl,-rpath,/media/psf/repositories/petsc/arch-linux-c-debug-real/lib -lgfortran -lm -lgcc_s" -DSCALAPACK_BUILD_TESTS=OFF
-- The C compiler identification is GNU 14.2.0
-- The Fortran compiler identification is GNU 14.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /media/psf/repositories/petsc/arch-linux-c-debug-real/bin/mpicc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /usr/bin/gfortran-14 - skipped
-- Found MPI_C: /media/psf/repositories/petsc/arch-linux-c-debug-real/bin/mpicc (found version "4.1")
-- Found MPI_Fortran: /media/psf/repositories/petsc/arch-linux-c-debug-real/lib/libmpifort.so (found version "4.1")
-- Found MPI: TRUE (found version "4.1")
-- Found MPI_LIBRARY : TRUE 
-- --> MPI C Compiler : /media/psf/repositories/petsc/arch-linux-c-debug-real/bin/mpicc
-- --> C Compiler : /media/psf/repositories/petsc/arch-linux-c-debug-real/bin/mpicc
-- --> MPI Fortran Compiler : /media/psf/repositories/petsc/arch-linux-c-debug-real/bin/mpif90
-- --> Fortran Compiler : /usr/bin/gfortran-14
-- =========
-- Compiling and Building BLACS INSTALL Testing to set correct variables
--  Build Output:
 -- The Fortran compiler identification is unknown
-- Configuring incomplete, errors occurred!

--  Error Output:
 CMake Error at CMakeLists.txt:2 (project):
  No CMAKE_Fortran_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "FC" or the CMake cache entry CMAKE_Fortran_COMPILER to the full
  path to the compiler, or to the compiler name if it is in the PATH.



CMake Error at CMAKE/FortranMangling.cmake:33 (MESSAGE):
   Configure in the BLACS INSTALL directory FAILED
Call Stack (most recent call first):
  CMakeLists.txt:121 (COMPILE)


-- Configuring incomplete, errors occurred!

@prj-
Copy link
Contributor

prj- commented Apr 2, 2025

If I further do export FC=gfortran-14 as advised by CMake (but which isn't needed outside of your branch), then it goes through fine (with the same CMake command).

-- Found MPI_LIBRARY : TRUE 
-- --> MPI C Compiler : /media/psf/repositories/petsc/arch-linux-c-debug-real/bin/mpicc
-- --> C Compiler : /media/psf/repositories/petsc/arch-linux-c-debug-real/bin/mpicc
-- --> MPI Fortran Compiler : /media/psf/repositories/petsc/arch-linux-c-debug-real/bin/mpif90
-- --> Fortran Compiler : /usr/bin/gfortran-14
-- =========
-- Compiling and Building BLACS INSTALL Testing to set correct variables
-- Configure in the INSTALL directory successful
-- Build in the BLACS INSTALL directory successful
-- =========
-- Testing FORTRAN_MANGLING
-- CDEFS set to Add_
-- =========
-- CHECKING BLAS AND LAPACK LIBRARIES
-- --> LAPACK supplied by user is -Wl,-rpath,/media/psf/repositories/petsc/arch-linux-c-debug-real/lib -L/media/psf/repositories/petsc/arch-linux-c-debug-real/lib -lf2clapack -Wl,-rpath,/media/psf/repositories/petsc/arch-linux-c-debug-real/lib -L/media/psf/repositories/petsc/arch-linux-c-debug-real/lib -lf2cblas -lm -Wl,-rpath,/media/psf/repositories/petsc/arch-linux-c-debug-real/lib -Wl,-rpath,/media/psf/repositories/petsc/arch-linux-c-debug-real/lib -L/media/psf/repositories/petsc/arch-linux-c-debug-real/lib -lmpifort -lmpi -lgfortran -lm -Wl,-rpath,/usr/lib/gcc/aarch64-linux-gnu/14 -Wl,-rpath,/usr/lib/gcc/aarch64-linux-gnu/14 -L/usr/lib/gcc/aarch64-linux-gnu/14 -Wl,-rpath,/media/psf/repositories/petsc/arch-linux-c-debug-real/lib -lgfortran -lm -lgcc_s.
-- Looking for Fortran dgesv
-- Looking for Fortran dgesv - found
-- --> LAPACK routine dgesv is found: 1.
-- --> LAPACK supplied by user is WORKING, will use -Wl,-rpath,/media/psf/repositories/petsc/arch-linux-c-debug-real/lib -L/media/psf/repositories/petsc/arch-linux-c-debug-real/lib -lf2clapack -Wl,-rpath,/media/psf/repositories/petsc/arch-linux-c-debug-real/lib -L/media/psf/repositories/petsc/arch-linux-c-debug-real/lib -lf2cblas -lm -Wl,-rpath,/media/psf/repositories/petsc/arch-linux-c-debug-real/lib -Wl,-rpath,/media/psf/repositories/petsc/arch-linux-c-debug-real/lib -L/media/psf/repositories/petsc/arch-linux-c-debug-real/lib -lmpifort -lmpi -lgfortran -lm -Wl,-rpath,/usr/lib/gcc/aarch64-linux-gnu/14 -Wl,-rpath,/usr/lib/gcc/aarch64-linux-gnu/14 -L/usr/lib/gcc/aarch64-linux-gnu/14 -Wl,-rpath,/media/psf/repositories/petsc/arch-linux-c-debug-real/lib -lgfortran -lm -lgcc_s.
-- BLAS library: 
-- LAPACK library: -Wl,-rpath,/media/psf/repositories/petsc/arch-linux-c-debug-real/lib -L/media/psf/repositories/petsc/arch-linux-c-debug-real/lib -lf2clapack -Wl,-rpath,/media/psf/repositories/petsc/arch-linux-c-debug-real/lib -L/media/psf/repositories/petsc/arch-linux-c-debug-real/lib -lf2cblas -lm -Wl,-rpath,/media/psf/repositories/petsc/arch-linux-c-debug-real/lib -Wl,-rpath,/media/psf/repositories/petsc/arch-linux-c-debug-real/lib -L/media/psf/repositories/petsc/arch-linux-c-debug-real/lib -lmpifort -lmpi -lgfortran -lm -Wl,-rpath,/usr/lib/gcc/aarch64-linux-gnu/14 -Wl,-rpath,/usr/lib/gcc/aarch64-linux-gnu/14 -L/usr/lib/gcc/aarch64-linux-gnu/14 -Wl,-rpath,/media/psf/repositories/petsc/arch-linux-c-debug-real/lib -lgfortran -lm -lgcc_s
-- =========
-- Configuring done (2.7s)
-- Generating done (0.6s)
-- Build files have been written to: /media/psf/repositories/petsc/arch-linux-c-debug-real/externalpackages/git.scalapack/petsc-build

@LecrisUT
Copy link
Contributor Author

LecrisUT commented Apr 2, 2025

Ok, I've found the issue

    EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND}  
        "${PROJECT_SOURCE_DIR}/BLACS/INSTALL"
        -G ${CMAKE_GENERATOR} ${BUILD_TYPE}
        WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/BLACS/INSTALL/
        RESULT_VARIABLE RESVAR OUTPUT_VARIABLE LOG1_OUT ERROR_VARIABLE LOG1_ERR
    )

It is pre-existing failure, but thanks for pointing it out. Could you split this in a separate issue and I will address it in an upcoming PR which will refactor most of these.

@prj-
Copy link
Contributor

prj- commented Apr 2, 2025

Could you split this in a separate issue

It's working on master (with CMake < 4.0), so I don't know what issue to report.

@LecrisUT
Copy link
Contributor Author

LecrisUT commented Apr 3, 2025

Could you split this in a separate issue

It's working on master (with CMake < 4.0), so I don't know what issue to report.

Just reference my comment. The part there needs to be migrated to try_compile which will inherit the setup defined in the main project.

@langou langou merged commit c3d6b22 into Reference-ScaLAPACK:master Apr 8, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants