Skip to content

Build failed due to implicit declaration #97

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

Open
Vineyo opened this issue May 11, 2024 · 8 comments
Open

Build failed due to implicit declaration #97

Vineyo opened this issue May 11, 2024 · 8 comments

Comments

@Vineyo
Copy link

Vineyo commented May 11, 2024

/home/usrname/.cache/paru/clone/scalapack/src/scalapack-2.2.0/BLACS/SRC/igsum2d_.c: In function ‘igsum2d_’:
/home/usrname/.cache/paru/clone/scalapack/src/scalapack-2.2.0/BLACS/SRC/igsum2d_.c:154:7: error: implicit declaration of function ‘BI_imvcopy’; did you mean ‘BI_zmvcopy’? [-Wimplicit-function-declaration]
  154 |       BI_imvcopy(Mpval(m), Mpval(n), A, tlda, bp->Buff);
      |       ^~~~~~~~~~
      |       BI_zmvcopy
/home/usrname/.cache/paru/clone/scalapack/src/scalapack-2.2.0/BLACS/SRC/igsum2d_.c:169:13: error: implicit declaration of function ‘BI_ivmcopy’; did you mean ‘BI_cvmcopy’? [-Wimplicit-function-declaration]
  169 |             BI_ivmcopy(Mpval(m), Mpval(n), A, tlda, bp2->Buff);
      |             ^~~~~~~~~~
      |             BI_cvmcopy
make[2]: *** [CMakeFiles/scalapack.dir/build.make:636: CMakeFiles/scalapack.dir/BLACS/SRC/igsum2d_.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1039: CMakeFiles/scalapack.dir/all] Error 2
make: *** [Makefile:166: all] Error 2

I've found similar issues, but I don't know what to do.

@carlosal1015
Copy link

Changes in compiler, use gcc 13 or older. https://gcc.gnu.org/gcc-14/changes.html

@eeickmeyer
Copy link

I'm having the same problem in Ubuntu, and Debian is having the same problem as well despite their package bug being closed (it looks like an erroneous merge/diagnostic). See https://launchpadlibrarian.net/741773910/buildlog_ubuntu-oracular-amd64.scalapack_2.2.1-3.1ubuntu2_BUILDING.txt.gz. We cannot use an older compiler, so the above option is not an option for us.

@robert-mijakovic
Copy link

Any plans or guidelines on how to solve this but still compile with GCC 14?

@davidedelvento
Copy link

This can be actually worked around by adding the -Wno-error=implicit-function-declaration flag to the compilers.

@fsidoli
Copy link

fsidoli commented May 14, 2025

Hi @davidedelvento,

How did you implement this? I naively added -DCMAKE_C_FLAGS="-Wno-error=implicit-function-declaration" to the cmake command line but this hasn't worked.

Fab

@davidedelvento
Copy link

I don't recall the details, but I did get it to work. My shell history has invocation of make (not cmake) with that flag added to both CFLAGS and FFLAGS, with something like:

FC=mpif90 CFLAGS="...." FFLAGS="...." make -j 32

However these were only "throw away" experiments, which I do to explore what works and what doesn't, but I don't carefully document.


In fact I use SPACK for all my installs.

SPACK: https://github.com/spack/spack/

Once it did get it to work, I implemented it by patching spack's netlib-scalapack/package.py. Important: this is with spack v0.23.1 (at this time in history, before they sort several important things, I recommend against using any other version, besides possible v0.23.2 if they released that). I simply added

if self.spec.satisfies("%cce"):
  flags.append("-Wno-error=implicit-function-declaration")

under the if name == "cflags": section of the flag_handler method (sorry I'd give you a diff, but I'm on a different computer at the moment and I can't).

Note that if you didn't ever use spack before, it has a steep learning curve. It's very well worth, but only if you install lots of things from source with intention to keep several versions of the same software and/or same version compiled with different options and/or with different compilers. If you do that, spack makes your life much easier. If you don't (i.e. if you just casually install one piece of software occasionally because your distro does not provide what you need), then spack is overkill and adds lots of complexity which you would hate.


If you don't want to use spack, I recommend asking cmake to be verbose (by default it's not) and trying to track all compiler invocations. I suspect the relevant ones aren't getting that flag for whatever reason.

@fsidoli
Copy link

fsidoli commented May 14, 2025

Thanks @davidedelvento. I'll have a dig around and will report back if I get it working.

@fsidoli
Copy link

fsidoli commented May 14, 2025

Update: I found that using -DCMAKE_C_FLAGS="-Wno-error=implicit-function-declaration" with cmake resulted in some parts being ignored. Using -fpermissive (which downgrades the error to warnings) allows me to build ScaLAPACK.

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

No branches or pull requests

6 participants