Re: [SIESTA-L] Issues with building and compiling new siesta

2024-06-06 Por tôpico I. Camps
Hi Boubacar,

Take a look at this link, it may help:
https://urldefense.com/v3/__https://docs.siesta-project.org/projects/siesta/en/stable/installation/build-issues.html__;!!D9dNQwwGXtA!W7_FwTUE6tqp6WrQ8D3wsJLjE9muIaDjVOCP95FNi--GCwPavq6Ac4fosYmMJSd8pCIVgsxT9gQk$
 
.


[]'s,
Camps


On Wed, Jun 5, 2024 at 5:00 PM Boubacar Traore 
wrote:

> Hi,
>
> I am trying to compile siesta with cmake but I encounter issues with
> scalapack linking. I notice that the compilation process has changed
> compared to what I was used to.
>
> Here is my cmake build command:
>
> $ cmake -S. -B_build
> -DCMAKE_INSTALL_PREFIX=/home/boubacart/SIESTA/siesta/bin
> -DSIESTA_WITH_MPI=ON -DSIESTA_WITH_ELPA=ON -DSIESTA_WITH_LIBXC=ON
> -DSCALAPACK_LIBRARY="-lscalapack-openmpi-devel"
>
> It fails at with a linking error as shown below:
> ===
> -- The Fortran compiler identification is GNU 4.8.5
> -- The C compiler identification is GNU 4.8.5
> -- Detecting Fortran compiler ABI info
> -- Detecting Fortran compiler ABI info - done
> -- Check for working Fortran compiler: /bin/f95 - skipped
> -- Detecting C compiler ABI info
> -- Detecting C compiler ABI info - done
> -- Check for working C compiler: /bin/cc - skipped
> -- Detecting C compile features
> -- Detecting C compile features - done
> -- Check use of deprecated variables
> --   All Siesta variables/options are prefixed with SIESTA_, e.g.
> SIESTA_WITH_MPI
> -- Check use of deprecated variables - success
> -- Using GNU compiler
> -- Using toolchain: Config/cmake/toolchains/gnu.cmake
> --
> No build type selected. SIESTA will default to 'Release'.
> To override pass -DCMAKE_BUILD_TYPE= in order to configure SIESTA.
> Available options are:
>   * -DCMAKE_BUILD_TYPE=Release - For an optimized build with no assertions
> or debug info.
>   * -DCMAKE_BUILD_TYPE=Debug - For an unoptimized build with assertions
> and debug info.
>   * -DCMAKE_BUILD_TYPE=Check - For an unoptimized build with assertions
> and debug info + code checks.
>   * -DCMAKE_BUILD_TYPE=RelWithDebInfo - For an optimized build with no
> assertions but with debug info.
>   * -DCMAKE_BUILD_TYPE=MinSizeRel - For a build optimized for size instead
> of speed.
>
> -- Flags for C-compiler (build type: Release):  -O3 -march=native
> -- Flags for Fortran-compiler (build type: Release):  -O3 -march=native
> -- Found PkgConfig: /bin/pkg-config (found version "0.27.1")
> -- Checking Siesta version
> --   SIESTA_VERSION: 5.1-MaX-28-gf3224d62e (err=3)
> --
>   WARNING: This is *not* an official SIESTA release.
>   WARNING:
>   WARNING: Unless you are trying a feature or fix that has not
>   WARNING: been released yet, we strongly recommend the use of
>   WARNING: official releases of SIESTA, which can be downloaded from
>   WARNING: 
> https://urldefense.com/v3/__https://gitlab.com/siesta-project/siesta/-/releases__;!!D9dNQwwGXtA!W7_FwTUE6tqp6WrQ8D3wsJLjE9muIaDjVOCP95FNi--GCwPavq6Ac4fosYmMJSd8pCIVgkvC_xmO$
>  
> 
>
>
> -- Checking Siesta version - found development version
> -- Parsing BLAS options
> --   Locating BLAS library
> --   Looking for Fortran sgemm
> --   Looking for Fortran sgemm - not found
> --   Performing Test CMAKE_HAVE_LIBC_PTHREAD
> --   Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
> --   Looking for pthread_create in pthreads
> --   Looking for pthread_create in pthreads - not found
> --   Looking for pthread_create in pthread
> --   Looking for pthread_create in pthread - found
> --   Found Threads: TRUE
> --   Looking for Fortran sgemm
> --   Looking for Fortran sgemm - found
> --   Found BLAS: /usr/lib64/libblas.so
> --   Found CustomBlas: /usr/lib64/libblas.so
> --   Locating BLAS library - found
> --   BLAS library: /usr/lib64/libblas.so
> --   BLAS link flags:
> -- Parsing LAPACK options
> --   Locating LAPACK library
> --   Looking for Fortran cheev
> --   Looking for Fortran cheev - not found
> --   Looking for Fortran cheev
> --   Looking for Fortran cheev - found
> --   Found LAPACK: /usr/lib64/liblapack.so;/usr/lib64/libblas.so
> --   Found CustomLapack: /usr/lib64/liblapack.so;/usr/lib64/libblas.so
> --   Locating LAPACK library - found
> --   LAPACK library: /usr/lib64/liblapack.so;/usr/lib64/libblas.so
> --   LAPACK link flags:
> -- Found MPI_C: /usr/lib64/openmpi/lib/libmpi.so (found version "3.0")
> -- Found MPI_Fortran: /usr/lib64/openmpi/lib/libmpi_usempi.so (found
> version "3.0")
> -- Found MPI: TRUE (found version "3.0") found components: Fortran C
> -- Parsing ScaLAPACK options
> --   Locating ScaLAPACK library
> --   Using user-defined variables
> --   Found CustomScalapack: -lscalapack-openmpi-devel
> --   Locating ScaLAPACK library - found
> --   ScaLAPACK library: -lscalapack-openmpi-devel
> --   ScaLAPACK link flags:
> -- Checking that BLAS library works...
> --   Performing

Re: [SIESTA-L] Issues with building and compiling new siesta

2024-06-06 Por tôpico Boubacar Traore
More specifically it stops at scalapack stage when :
"--   Performing Test scalapack_has_blacs_gridinit - Failed"

The config routine finds scalapack but it fails in
"SiestaCheckLinalg.cmake" routine.
All the dependencies were installed according to the doc. So, I am not sure
if I still missed something or if it is a bug ?

Thanks,
Boubacar

On Wed, 5 Jun 2024 at 21:54, Boubacar Traore  wrote:

> Hi,
>
> I am trying to compile siesta with cmake but I encounter issues with
> scalapack linking. I notice that the compilation process has changed
> compared to what I was used to.
>
> Here is my cmake build command:
>
> $ cmake -S. -B_build
> -DCMAKE_INSTALL_PREFIX=/home/boubacart/SIESTA/siesta/bin
> -DSIESTA_WITH_MPI=ON -DSIESTA_WITH_ELPA=ON -DSIESTA_WITH_LIBXC=ON
> -DSCALAPACK_LIBRARY="-lscalapack-openmpi-devel"
>
> It fails at with a linking error as shown below:
> ===
> -- The Fortran compiler identification is GNU 4.8.5
> -- The C compiler identification is GNU 4.8.5
> -- Detecting Fortran compiler ABI info
> -- Detecting Fortran compiler ABI info - done
> -- Check for working Fortran compiler: /bin/f95 - skipped
> -- Detecting C compiler ABI info
> -- Detecting C compiler ABI info - done
> -- Check for working C compiler: /bin/cc - skipped
> -- Detecting C compile features
> -- Detecting C compile features - done
> -- Check use of deprecated variables
> --   All Siesta variables/options are prefixed with SIESTA_, e.g.
> SIESTA_WITH_MPI
> -- Check use of deprecated variables - success
> -- Using GNU compiler
> -- Using toolchain: Config/cmake/toolchains/gnu.cmake
> --
> No build type selected. SIESTA will default to 'Release'.
> To override pass -DCMAKE_BUILD_TYPE= in order to configure SIESTA.
> Available options are:
>   * -DCMAKE_BUILD_TYPE=Release - For an optimized build with no assertions
> or debug info.
>   * -DCMAKE_BUILD_TYPE=Debug - For an unoptimized build with assertions
> and debug info.
>   * -DCMAKE_BUILD_TYPE=Check - For an unoptimized build with assertions
> and debug info + code checks.
>   * -DCMAKE_BUILD_TYPE=RelWithDebInfo - For an optimized build with no
> assertions but with debug info.
>   * -DCMAKE_BUILD_TYPE=MinSizeRel - For a build optimized for size instead
> of speed.
>
> -- Flags for C-compiler (build type: Release):  -O3 -march=native
> -- Flags for Fortran-compiler (build type: Release):  -O3 -march=native
> -- Found PkgConfig: /bin/pkg-config (found version "0.27.1")
> -- Checking Siesta version
> --   SIESTA_VERSION: 5.1-MaX-28-gf3224d62e (err=3)
> --
>   WARNING: This is *not* an official SIESTA release.
>   WARNING:
>   WARNING: Unless you are trying a feature or fix that has not
>   WARNING: been released yet, we strongly recommend the use of
>   WARNING: official releases of SIESTA, which can be downloaded from
>   WARNING: 
> https://urldefense.com/v3/__https://gitlab.com/siesta-project/siesta/-/releases__;!!D9dNQwwGXtA!UYGP2tP5MBKEuEDYVd_AAXzvz0C3xJG_Brop7boUp6SK-HsSIaTpqmCq0R944FkAiIbjxG7ZlENeBCPQnN4$
>  
>
>
> -- Checking Siesta version - found development version
> -- Parsing BLAS options
> --   Locating BLAS library
> --   Looking for Fortran sgemm
> --   Looking for Fortran sgemm - not found
> --   Performing Test CMAKE_HAVE_LIBC_PTHREAD
> --   Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
> --   Looking for pthread_create in pthreads
> --   Looking for pthread_create in pthreads - not found
> --   Looking for pthread_create in pthread
> --   Looking for pthread_create in pthread - found
> --   Found Threads: TRUE
> --   Looking for Fortran sgemm
> --   Looking for Fortran sgemm - found
> --   Found BLAS: /usr/lib64/libblas.so
> --   Found CustomBlas: /usr/lib64/libblas.so
> --   Locating BLAS library - found
> --   BLAS library: /usr/lib64/libblas.so
> --   BLAS link flags:
> -- Parsing LAPACK options
> --   Locating LAPACK library
> --   Looking for Fortran cheev
> --   Looking for Fortran cheev - not found
> --   Looking for Fortran cheev
> --   Looking for Fortran cheev - found
> --   Found LAPACK: /usr/lib64/liblapack.so;/usr/lib64/libblas.so
> --   Found CustomLapack: /usr/lib64/liblapack.so;/usr/lib64/libblas.so
> --   Locating LAPACK library - found
> --   LAPACK library: /usr/lib64/liblapack.so;/usr/lib64/libblas.so
> --   LAPACK link flags:
> -- Found MPI_C: /usr/lib64/openmpi/lib/libmpi.so (found version "3.0")
> -- Found MPI_Fortran: /usr/lib64/openmpi/lib/libmpi_usempi.so (found
> version "3.0")
> -- Found MPI: TRUE (found version "3.0") found components: Fortran C
> -- Parsing ScaLAPACK options
> --   Locating ScaLAPACK library
> --   Using user-defined variables
> --   Found CustomScalapack: -lscalapack-openmpi-devel
> --   Locating ScaLAPACK library - found
> --   ScaLAPACK library: -lscalapack-openmpi-devel
> --   ScaLAPACK link flags:
> -- Checking that BLAS library works...
> --   Performing Test blas_has_sgemm
> --   Performing Test blas_has_sgemm - Success
> --   Performing Test blas_cdotu_return_convention

Re: [SIESTA-L] Issues with building and compiling new siesta

2024-06-06 Por tôpico Boubacar Traore
I finally sorted out the issue of scalapack linking by adding its path to
LIBRARY_PATH instead of LD_LIBRARY_PATH (more info here:
https://urldefense.com/v3/__https://stackoverflow.com/questions/47105835/ld-library-path-is-ignored-by-gcc__;!!D9dNQwwGXtA!UKXFsN93oU7fdjctS5itiA2CMH4YTUW-VUxSJl8f5ejE_wN2ffrRXxBautffKqwBfEnjMj-Kg2AAYGfMdi0$
 
).

I used this for cmake build stage:
$ cmake -S. -B_build
-DCMAKE_INSTALL_PREFIX=/home/boubacart/SIESTA/siesta/bin
-DSIESTA_WITH_MPI=ON -DSIESTA_WITH_ELPA=ON
-DSCALAPACK_LIBRARY_DIR=/usr/lib64/openmpi/lib
-DSCALAPACK_LIBRARY="-lscalapack"

The config steps then succeeds.

However, I encounter other issues during the compilation stage and I am not
sure what is the problem and from the start it issues errors regarding some
deferred-length character :
===
[  0%] Building Fortran object
_deps/libfdf-build/CMakeFiles/libfdf-lib.dir/src/prec.F90.o
[  0%] Building Fortran object
_deps/mctc-lib-build/CMakeFiles/mctc-lib-lib.dir/src/mctc/env/accuracy.f90.o
[  0%] Building Fortran object
_deps/xmlf90-build/CMakeFiles/xmlf90-lib.dir/src/wxml/m_wxml_array_str.f90.o
[  0%] Building Fortran object
_deps/libfdf-build/CMakeFiles/libfdf-lib.dir/src/utils.F90.o
[  0%] Building Fortran object
_deps/libgridxc-build/CMakeFiles/libgridxc-lib.dir/src/alloc.F90.o
[  0%] Building Fortran object
_deps/mctc-lib-build/CMakeFiles/mctc-lib-lib.dir/src/mctc/env/error.f90.o
/home/boubacart/SIESTA/siesta-5.0.0/_build/_deps/mctc-lib-src/src/mctc/env/error.f90:46.46:

  character(len=:), allocatable :: message
  1
Error: Deferred-length character component 'message' at (1) is not yet
supported
/home/boubacart/SIESTA/siesta-5.0.0/_build/_deps/mctc-lib-src/src/mctc/env/error.f90:46.46:

  character(len=:), allocatable :: message
  1
Error: Deferred-length character component 'message' at (1) is not yet
supported
gmake[2]: ***
[_deps/mctc-lib-build/CMakeFiles/mctc-lib-lib.dir/src/mctc/env/error.f90.o]
Error 1
gmake[1]: *** [_deps/mctc-lib-build/CMakeFiles/mctc-lib-lib.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs
[  0%] Building Fortran object
_deps/libgridxc-build/CMakeFiles/libgridxc-lib.dir/src/precision.F90.o
[  0%] Building Fortran object
_deps/xmlf90-build/CMakeFiles/xmlf90-lib.dir/src/wxml/m_wxml_error.f90.o
[  0%] Building Fortran object
_deps/libgridxc-build/CMakeFiles/libgridxc-lib.dir/src/sys.F90.o
[  0%] Building Fortran object
_deps/xmlf90-build/CMakeFiles/xmlf90-lib.dir/src/wxml/m_wxml_escape.f90.o

..
..
..
[  2%] Building Fortran object
_deps/xmlf90-build/CMakeFiles/xmlf90-lib.dir/src/dom/m_dom_parse.f90.o
[  2%] Building Fortran object
_deps/libgridxc-build/CMakeFiles/libgridxc-lib.dir/src/debugxc.F90.o
[  3%] Building Fortran object
_deps/xmlf90-build/CMakeFiles/xmlf90-lib.dir/src/xpath/xmlf90_xpath.f90.o
[  3%] Building Fortran object
_deps/libgridxc-build/CMakeFiles/libgridxc-lib.dir/src/vv_vdwxc.F90.o
[  3%] Building Fortran object
_deps/xmlf90-build/CMakeFiles/xmlf90-lib.dir/src/dom/xmlf90_dom.f90.o
[  3%] Linking Fortran static library libxmlf90.a
[  3%] Built target xmlf90-lib
[  3%] Building Fortran object
_deps/libgridxc-build/CMakeFiles/libgridxc-lib.dir/src/fft3d.F90.o
/home/boubacart/SIESTA/siesta-5.0.0/_build/_deps/libgridxc-src/src/fft3d.F90:234.25:

  call c_f_pointer(c_loc(aDat(:,:,:,1)),aux1,[aMesh(1)*aMesh(2)*aMesh(3)])
 1
Warning: Array section in 'c_loc' call at (1)
/home/boubacart/SIESTA/siesta-5.0.0/_build/_deps/libgridxc-src/src/fft3d.F90:235.25:

  call c_f_pointer(c_loc(aDat(:,:,:,2)),aux2,[aMesh(1)*aMesh(2)*aMesh(3)])
 1
Warning: Array section in 'c_loc' call at (1)
/home/boubacart/SIESTA/siesta-5.0.0/_build/_deps/libgridxc-src/src/fft3d.F90:249.28:

 call c_f_pointer(c_loc(aDat(:,:,i3,1)),aux1,[aMesh(1)*aMesh(2)])
1
Warning: Array section in 'c_loc' call at (1)
/home/boubacart/SIESTA/siesta-5.0.0/_build/_deps/libgridxc-src/src/fft3d.F90:250.28:

 call c_f_pointer(c_loc(aDat(:,:,i3,2)),aux2,[aMesh(1)*aMesh(2)])
1
Warning: Array section in 'c_loc' call at (1)
/home/boubacart/SIESTA/siesta-5.0.0/_build/_deps/libgridxc-src/src/fft3d.F90:263.25:

  call c_f_pointer(c_loc(aDat(:,:,:,1)),aux1,[aMesh(1)*aMesh(2)*aMesh(3)])
 1
Warning: Array section in 'c_loc' call at (1)
/home/boubacart/SIESTA/siesta-5.0.0/_build/_deps/libgridxc-src/src/fft3d.F90:264.25:

  call c_f_pointer(c_loc(aDat(:,:,:,2)),aux2,[aMesh(1)*aMesh(2)*aMesh(3)])
 1
Warning: Array section in 'c_loc' call at (1)
[  3%] Building Fortran object
_deps/libgridxc-build/CMakeFiles/libgridxc-lib.dir/src/vdwxc.F90.o
[  4%] Building Fortran object
_deps/libgridxc-build/CMakeFiles/libgridxc-lib.dir/src/fftr.F90.o
[  4%] Building Fortran object
_deps/libgridxc-build/CMakeFiles/libgridxc-lib.dir/src/xcmod.F90.o
[  4%] Building Fortran obje