DrTimothyAldenDavis / SuiteSparse

The official SuiteSparse library: a suite of sparse matrix algorithms authored or co-authored by Tim Davis, Texas A&M University.
https://people.engr.tamu.edu/davis/suitesparse.html
Other
1.17k stars 261 forks source link

SuiteSparse 5.12.0 fails when using an unmodified METIS 5.1.0 (which is not supported; SuiteSparse's own revised METIS is required) #696

Closed andreinimarco closed 9 months ago

andreinimarco commented 9 months ago

Hi,

I am trying to compile suitesparse 5.12.0 with metis-5.1.0 on RHEL9, wiht no root privilegies, and encountering the Error in the title when approching to use the Makefile in UMFPACK/DEMO. Can you help me solving it?

Thanks, Marco

mmuetzel commented 9 months ago

SuiteSparse 5.12.0 is pretty old. And I'm not sure if it is still supported.

Can you reproduce the error with SuiteSparse 7.4.0?

andreinimarco commented 9 months ago

Thanks for your swift reply! v7.4.0 requires cmake 3.22, I got 3.20 unfortunately. Can you suggest the most recent version compatible with cmake 3.20 embedding metis (whose version I am suggested to use is 5.1.0). Thanks once again.

mmuetzel commented 9 months ago

Newer versions of CHOLMOD integrate the necessary parts of METIS. No need (and no option) to link to an external METIS library.

Does installing a newer version of CMake work? E.g., from snapcraft: https://snapcraft.io/install/cmake/rhel

mmuetzel commented 9 months ago

I don't know if this will work. But maybe try applying the following patch on top of a current tarball or repository checkout: 0001-CHOLMOD-Reduce-minimum-CMake-version.patch

Then, configure with cmake -DSUITESPARSE_ENABLE_PROJECTS="umfpack" -DBLAS_LIBRARIES="blas" -DLAPACK_LIBRARIES="lapack".

DrTimothyAldenDavis commented 9 months ago

I would not recommend trying to use the unmodified METIS 5.1.0 with UMFPACK. METIS has some bugs and issues that cause my codes to segfault. I've fixed them in my copy of METIS in the current version of SuiteSparse. I no longer use an unmodified copy of METIS, and I can't link against any installed -lmetis. Instead, I fold METIS directly into -lcholmod.

UMFPACK should not call METIS directly. It can call CHOLMOD, which calls METIS. You just tell UMFPACK to use metis by setting

Control [UMFPACK_ORDERING] = UMFPACK_ORDERING_METIS ; but you can't do that with UMFPACK 5.12.0.

Getting your own copy of cmake is very easy with spack. See https://github.com/spack/spack . Just do

cd
git clone -c feature.manyFiles=true https://github.com/spack/spack.git
cd spack/bin
./spack install cmake

Then just add this to your .bashrc file:

source /home/me/spack/share/spack/setup-env.sh where /home/me is your home directory.

SuiteSparse itself is in spack but it's an old copy. They are in the process of upgrading it to 7.4.0 I think.

DrTimothyAldenDavis commented 9 months ago

Then you can also add this to your .bashrc file:

spack load cmake@3.24.2 (or whatever version of cmake you get). You don't need to have sudo privilege to do any of this.

andreinimarco commented 9 months ago

I don't know if this will work. But maybe try applying the following patch on top of a current tarball or repository checkout: 0001-CHOLMOD-Reduce-minimum-CMake-version.patch

Then, configure with cmake -DSUITESPARSE_ENABLE_PROJECTS="umfpack" -DBLAS_LIBRARIES="blas" -DLAPACK_LIBRARIES="lapack".

Sorry for my late response - busy with other activities. Thanks a lot for the patch - BTW, it did not change minimum requierd version (3.22->3.20) in the ./SuiteSparse_config/cmake_modules/ files, so I had to do it "manually".

However, when running: cmake -DSUITESPARSE_ENABLE_PROJECTS="umfpack" -DBLAS_LIBRARIES="blas" -DLAPACK_LIBRARIES="lapack"

I got this Error: CMake Error at SuiteSparse_config/cmake_modules/SuiteSparseReport.cmake:26 (if): if given arguments: "STREQUAL" "Debug" Unknown arguments specified Call Stack (most recent call first): CMakeLists.txt:497 (include)

May you please help me fixing it?

Thanks a lot in advance.

andreinimarco commented 9 months ago

Then you can also add this to your .bashrc file:

spack load cmake@3.24.2 (or whatever version of cmake you get). You don't need to have sudo privilege to do any of this.

Thanks a lot for this - To waht I know cmake 3.20 is the latest cmake version for RHEL9. I tried to follow your indications with spack, but unfortunatelly cmake installation failed for denied permissions on ../.spack/bootstrap/store/linux-rhel9-x86_64/..

mmuetzel commented 8 months ago

I got this Error: CMake Error at SuiteSparse_config/cmake_modules/SuiteSparseReport.cmake:26 (if): if given arguments: "STREQUAL" "Debug" Unknown arguments specified Call Stack (most recent call first): CMakeLists.txt:497 (include)

Try adding -DCMAKE_BUILD_TYPE=Release to your CMake command line flags.