8000 allow specifying non-default Fortran compiler with FC env var · Issue #13462 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

allow specifying non-default Fortran compiler with FC env var #13462

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

Closed
rgommers opened this issue May 3, 2019 · 5 comments
Closed

allow specifying non-default Fortran compiler with FC env var #13462

rgommers opened this issue May 3, 2019 · 5 comments

Comments

@rgommers
Copy link
Member
rgommers commented May 3, 2019

Using flang via setting the FC environment variable is reported not to be working at scipy/scipy#10125. A -lgfortran flag is added, when gfortran isn't installed on the system. This is due to the config stage not knowing about FC and always picking up GnuFortranCompiler if --fcompiler is not used.

@isuruf
Copy link
Contributor
isuruf commented May 3, 2019

flang is not added to default_compiler

_default_compilers = (

and is only defined for python 3 for some weird reason,
if sys.version_info >= (3, 5):

@dimpase
Copy link
8000
Contributor
dimpase commented May 12, 2020

Another error I am getting with flang in OpenBSD 6.6 (based on clang 8.0.1) is that it attempts to use it with -g flag, which results in inability to compile anything with a named COMMON block (a known flang bug), e.g. an attempt to build scipy ends with

    compiling Fortran sources
    Fortran f77 compiler: flang -Wall -g -ffixed-form -fno-second-underscore -I/usr/local/include -fPIC
    Fortran f90 compiler: flang -Wall -g -fno-second-underscore -I/usr/local/include -fPIC
    Fortran fix compiler: flang -Wall -g -ffixed-form -fno-second-underscore -Wall -g -fno-second-underscore -I/usr/local/include -fPIC
    creating build/temp.openbsd-6.6-amd64-3.7/scipy/integrate
    creating build/temp.openbsd-6.6-amd64-3.7/scipy/integrate/mach
    compile options: '-I/home/dima/sagetrac-mirror/local/lib/python3.7/site-packages/numpy/core/include -c'
    flang:f77: scipy/integrate/mach/d1mach.f
    flang: warning: argument unused during compilation: '-fno-second-underscore' [-Wunused-command-line-argument]
    /tmp/d1mach-f87f56.ll:894:17: error: expected metadata type
    !121 = distinct !DICommonBlock(scope: !17, declaration: !126, name: "d9mach")
                    ^

Given that the only other Fortran provided on OpenBSD is g95 (very old), it's a show-stopper.

Is there a graceful way to remove -g? If not, what should I patch?

@dimpase
Copy link
Contributor
dimpase commented May 12, 2020

A related question - what is the need for that COMMON block? It does not seem to be used anywhere in scipy. Can it just be removed?

@rgommers
Copy link
Member Author

This is another feature request for numpy.distutils. Bug reports about numpy.distutils are still needed until it is completely removed from numpy, however feature requests we can close now.

@rgommers
Copy link
Member Author

I'll also note that Meson already does the right thing here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
0