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

Build on PowerPC fails due to missing ieee_arithmetic #690

Open
barracuda156 opened this issue Jan 10, 2023 · 5 comments
Open

Build on PowerPC fails due to missing ieee_arithmetic #690

barracuda156 opened this issue Jan 10, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@barracuda156
Copy link

Description

FAILED: src/CMakeFiles/fortran_stdlib.dir/stdlib_stats_cov.f90.o src/mod_files/stdlib_stats@stdlib_stats_cov.smod 
/opt/local/bin/gfortran-mp-12 -I/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_fortran-stdlib/fortran-stdlib/work/build/src -I/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_fortran-stdlib/fortran-stdlib/work/build/src/mod_files -pipe -Os -m32 -fimplicit-none -ffree-line-length-132 -mmacosx-version-min=10.6 -Jsrc/mod_files/ -fPIC -fpreprocessed -c src/CMakeFiles/fortran_stdlib.dir/stdlib_stats_cov.f90-pp.f90 -o src/CMakeFiles/fortran_stdlib.dir/stdlib_stats_cov.f90.o
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_fortran-stdlib/fortran-stdlib/work/build/src/stdlib_stats_cov.f90:3:19:

    3 |   use, intrinsic:: ieee_arithmetic, only: ieee_value, ieee_quiet_nan
      |                   1
Fatal Error: Cannot find an intrinsic module named 'ieee_arithmetic' at (1)
compilation terminated.

FAILED: src/CMakeFiles/fortran_stdlib.dir/stdlib_stats_mean.f90.o src/mod_files/stdlib_stats@stdlib_stats_mean.smod 
/opt/local/bin/gfortran-mp-12 -I/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_fortran-stdlib/fortran-stdlib/work/build/src -I/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_fortran-stdlib/fortran-stdlib/work/build/src/mod_files -pipe -Os -m32 -fimplicit-none -ffree-line-length-132 -mmacosx-version-min=10.6 -Jsrc/mod_files/ -fPIC -fpreprocessed -c src/CMakeFiles/fortran_stdlib.dir/stdlib_stats_mean.f90-pp.f90 -o src/CMakeFiles/fortran_stdlib.dir/stdlib_stats_mean.f90.o
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_fortran-stdlib/fortran-stdlib/work/build/src/stdlib_stats_mean.f90:3:19:

    3 |   use, intrinsic:: ieee_arithmetic, only: ieee_value, ieee_quiet_nan
      |                   1
Fatal Error: Cannot find an intrinsic module named 'ieee_arithmetic' at (1)
compilation terminated.

There may be two solutions: if it is not required, for now fix compilation without it. If it is required, we need to implement ieee_arithmetic for PPC :)
Relevant discussion: iains/darwin-toolchains-start-here#40

Expected Behaviour

We want Fortran stdlib to build successfully on PowerPC.

Version of stdlib

0.2.1

Platform and Architecture

MacOS/ppc

Additional Information

GCC 12.2.0
10.6.8 Rosetta (ppc32), but the failure applied to all macOS ppc/ppc64

@barracuda156 barracuda156 added the bug Something isn't working label Jan 10, 2023
@jvdp1
Copy link
Member

jvdp1 commented Jan 10, 2023

Thanks for reporting this issue. This seems to be an issue related to the OS/compiler. Is the fix proposed in this thread working?

@barracuda156
Copy link
Author

Thanks for reporting this issue. This seems to be an issue related to the OS/compiler. Is the fix proposed in this thread working?

@jvdp1 You are right, it is compiler-related, GCC does not have ieee_arithmetic module for Darwin PPC (as well as for a number of other systems and archs). Optimal solution would be implement that in GCC, of course. However it is not a trivial thing to do.
If anyone is interested and can help with that, it would be awesome. There are some details in the discussion I have referred to above with GCC developers.

FreeBSD solution is not applicable, since Darwin does not use glibc.

@barracuda156
Copy link
Author

@jvdp1 Could we come up with a temporary fix?

While I kinda have ieee_arithmetic fixed for PPC, it is still WIP, and even when completed, may take ages to get merged into GCC. It is desirable to have stdlib available prior to that.
I do not ask for the fix to be here in master branch, if it is too intrusive. I rather mean a local patch for Macports.

@jvdp1
Copy link
Member

jvdp1 commented Mar 5, 2023

Could the fix be a minimal implementation of ieee_arithmetic inside stdlib?

@barracuda156
Copy link
Author

Could the fix be a minimal implementation of ieee_arithmetic inside stdlib?

@jvdp1 That would be awesome. It would also fix the build for some other platforms (perhaps something like Irix and VxWorks).
(If that is done, it is desirable for it to be non-conflicting with compilers that do support ieee_arithmetic, including PowerPC case, so that we do not have to fix that again later on.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants