Skip to content
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

Compilation fails with GCC14 #4668

Closed
busykai opened this issue Apr 29, 2024 · 5 comments · Fixed by #4671
Closed

Compilation fails with GCC14 #4668

busykai opened this issue Apr 29, 2024 · 5 comments · Fixed by #4671

Comments

@busykai
Copy link

busykai commented Apr 29, 2024

Straightforward make would fail (in my case x86-64, Skylake). For example:

pstrf.c: In function 'spstrf_':
spstrf.c:830:43: error: passing argument 1 of 'dmaxloc_' from incompatible pointer type [-Wincompatible-pointer-types]
  830 |                         itemp = mymaxloc_(&work[1], &i__4, &i__5, &c__1);
      |                                           ^~~~~~~~
      |                                           |
      |                                           real * {aka float *}
spstrf.c:259:37: note: in definition of macro 'mymaxloc_'
  259 | #define mymaxloc_(w,s,e,n) dmaxloc_(w,*(s),*(e),n)
      |                                     ^
spstrf.c:367:33: note: expected 'double *' but argument is of type 'real *' {aka 'float *'}
  367 | static integer dmaxloc_(double *w, integer s, integer e, integer *n)
      |                         ~~~~~~~~^

From the GCC14 porting guide:

Type checking on pointer types (-Werror=incompatible-pointer-types)
GCC no longer allows implicitly casting all pointer types to all other pointer types. This behavior is now restricted to the void * type and its qualified variations.

To fix compilation errors resulting from that, you can add the appropriate casts, and maybe consider using void * in more places (particularly for old programs that predate the introduction of void * into the C language).

@martin-frbg
Copy link
Collaborator

This is - I believe - addressed already in all "regular" parts of OpenBLAS, but you are getting the error as you are using the f2c-converted fallback version of the LAPACK codes. It should not be an issue if you install/use GCC14's gfortran.

@martin-frbg
Copy link
Collaborator

As does adding -Wno-error=incompatible-pointer-types to the compiler flags, which is probably more sensible than correcting a harmless flaw in around 2500 machine-translated files that only serve as fallback

@busykai
Copy link
Author

busykai commented Apr 30, 2024

Thanks for the background! The use we give OpenBLAS is very specific and agnostic (ignorant). We do need the C build to work though. Is there a plan to enable the fallback code for gcc14?

@martin-frbg
Copy link
Collaborator

Let me see if older gccs tolerate the -Wno-error, and gcc14.1 isn't even officially released yet...
Intriguing "very specific" use, guess it must be as a deterrent of some sort :)

@busykai
Copy link
Author

busykai commented May 1, 2024

Let me see if older gccs tolerate the -Wno-error, and gcc14.1 isn't even officially released yet... Intriguing "very specific" use, guess it must be as a deterrent of some sort :)

Our team uses OpenBLAS in order to create a "representative" stress on the system without trying to achieve meaningful results or solve real-world problem. We can work it around, of course, but I thought it would be better if we had a solution at the source. :) Thank you for the fix!

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

Successfully merging a pull request may close this issue.

2 participants