deepmodeling / abacus-develop

An electronic structure package based on either plane wave basis or numerical atomic orbitals.
http://abacus.ustc.edu.cn
GNU Lesser General Public License v3.0
152 stars 125 forks source link

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

Open YuugataShinonome opened 2 weeks ago

YuugataShinonome commented 2 weeks ago

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

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)

QuantumMisaka commented 2 weeks ago

@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 commented 2 weeks ago

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

caic99 commented 2 weeks ago

our code

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

YuugataShinonome commented 2 weeks ago

I confirm that:

QuantumMisaka commented 1 week ago

@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 : )