abacus-develop icon indicating copy to clipboard operation
abacus-develop copied to clipboard

Buiding scalapack fails (by running toolchain_gnu.sh) with GCC14

Open YuugataShinonome opened this issue 1 year ago • 5 comments

Describe the bug

When building scalapack (by running toolchain_gnu.sh), the compilation fails due to the error: implicit function declaration.

Expected behavior

When running toolchain_gnu.sh, it should install the toolchain without error.

To Reproduce

  1. Clone newest source code
  2. Run ./toolchain/toolchain_gnu.sh with GCC14 as default compiler.

Environment

  • OS: Archlinux
  • Compiler: GCC 14.1.1

Additional Context

Before GCC14, implicit function declaration is treated as warning but since GCC14 this is treated as error by default, which will cause compilation to stop. By adding flags to bypass this, I can confirm that the whole compilation procedure succeeds and the program works well.

This is also reported in scalapack upstream but no response. This bug is described and fixed by AUR (archlinux user repo) package maintainer, see this commit.

I change toolchain/scripts/stage3/install_scalapack.sh as in this commit to fix it.

Task list for Issue attackers (only for developers)

  • [ ] Verify the issue is not a duplicate.
  • [ ] Describe the bug.
  • [ ] Steps to reproduce.
  • [ ] Expected behavior.
  • [ ] Error message.
  • [ ] Environment details.
  • [ ] Additional context.
  • [ ] Assign a priority level (low, medium, high, urgent).
  • [ ] Assign the issue to a team member.
  • [ ] Label the issue with relevant tags.
  • [ ] Identify possible related issues.
  • [ ] Create a unit test or automated test to reproduce the bug (if applicable).
  • [ ] Fix the bug.
  • [ ] Test the fix.
  • [ ] Update documentation (if necessary).
  • [ ] Close the issue and inform the reporter (if applicable).

YuugataShinonome avatar Jul 08 '24 04:07 YuugataShinonome

@YuugataShinonome Thanks a lot! There're 2 questions

  1. Have you tried lower GCC version (current toolchain should be compatible with GCC 13.1.0 and below)
  2. Have you tried that your modification can be compatible with lower GCC version

We're so glad to see community commit for toolchain and any installlation toolkit for ABACUS !

QuantumMisaka avatar Jul 10 '24 02:07 QuantumMisaka

Also:

Before GCC14, implicit function declaration is treated as warning but since GCC14 this is treated as error by default, which will cause compilation to stop.

For these implicit function declaration, can we have some way to detect and fix them during our code reconstruction process? @mohanchen @WHUweiqingzhou

QuantumMisaka avatar Jul 10 '24 02:07 QuantumMisaka

our code

@QuantumMisaka This seems to be a problem from the legacy scalapack code, so there's not much we can do here.

caic99 avatar Jul 12 '24 08:07 caic99

I confirm that:

  • Both original code base and my modified one can be compiled with GCC 13.3.0 .

YuugataShinonome avatar Jul 12 '24 16:07 YuugataShinonome

@YuugataShinonome Thanks a lot! I will have a mind in it when doing update for next version of toolchain ,and you can also open a commit before me, we're welcome for it : )

QuantumMisaka avatar Jul 16 '24 07:07 QuantumMisaka

@YuugataShinonome Toolchain 2024.2 is ongoing I've seen that cp2k toolchain use another modification

      CFLAGS=${cflags} FFLAGS=${fflags} cmake -DCMAKE_FIND_ROOT_PATH="$ROOTDIR" \
        -DCMAKE_INSTALL_PREFIX="${pkg_install_dir}" \
        -DCMAKE_INSTALL_LIBDIR="lib" \
        **-DCMAKE_VERBOSE_MAKEFILE=ON \**
        -DBUILD_SHARED_LIBS=NO \
        -DCMAKE_BUILD_TYPE=Release .. \
        -DBUILD_TESTING=NO \
        -DSCALAPACK_BUILD_TESTS=NO \
        > configure.log 2>&1 || tail -n ${LOG_LINES} configure.log

I'll have test on this and your modification. thanks !

QuantumMisaka avatar Aug 10 '24 11:08 QuantumMisaka