Discussion:
[Numpy-discussion] numpy.distutils issue
Pavlyk, Oleksandr
2016-08-24 19:41:06 UTC
Permalink
Hi All,

According to the documentation page:

http://docs.scipy.org/doc/numpy/reference/distutils.html

Function add_library allows the following keywords:
extra_f77_compiler_args
extra_f90_compiler_args

however setting them seem to have no effect for my extension. Digging deeper, I discovered,
the documentation is inconsistent with the implementation, as per

https://github.com/numpy/numpy/blob/v1.11.0/numpy/distutils/fcompiler/__init__.py#L569

https://github.com/numpy/numpy/blob/v1.11.0/numpy/distutils/fcompiler/__init__.py#L583

And indeed, setting extra_f77_compile_arg has the effect I was looking for.

Fixing it is easy, but I am less certain whether we should fix the docs, or the code.

Given that add_extension lists extra_compile_args, extra_f77_compile_args, etc, I would think it
Is the documentation that need to change.

Please confirm, and I will open up a pull request for this.

Thank you,
Oleksandr
Charles R Harris
2016-08-24 23:05:48 UTC
Permalink
On Wed, Aug 24, 2016 at 1:41 PM, Pavlyk, Oleksandr <
Post by Pavlyk, Oleksandr
Hi All,
http://docs.scipy.org/doc/numpy/reference/distutils.html
extra_f77_compiler_args
extra_f90_compiler_args
however setting them seem to have no effect for my extension. Digging deeper, I discovered,
the documentation is inconsistent with the implementation, as per
https://github.com/numpy/numpy/blob/v1.11.0/numpy/
distutils/fcompiler/__init__.py#L569
https://github.com/numpy/numpy/blob/v1.11.0/numpy/
distutils/fcompiler/__init__.py#L583
And indeed, setting extra_f77_compile_arg has the effect I was looking for.
Fixing it is easy, but I am less certain whether we should fix the docs, or the code.
Given that add_extension lists extra_compile_args, extra_f77_compile_args,
etc, I would think it
Is the documentation that need to change.
Please confirm, and I will open up a pull request for this.
That's rather unfortunate, "compiler" would be better than "compile", but
it is best to document the actual behavior. If we later settle on changing
the argument we can do that, but it is a more involved process.

Chuck
Charles R Harris
2016-08-24 23:18:35 UTC
Permalink
Post by Charles R Harris
On Wed, Aug 24, 2016 at 1:41 PM, Pavlyk, Oleksandr <
Post by Pavlyk, Oleksandr
Hi All,
http://docs.scipy.org/doc/numpy/reference/distutils.html
extra_f77_compiler_args
extra_f90_compiler_args
however setting them seem to have no effect for my extension. Digging
deeper, I discovered,
the documentation is inconsistent with the implementation, as per
https://github.com/numpy/numpy/blob/v1.11.0/numpy/distutils/
fcompiler/__init__.py#L569
https://github.com/numpy/numpy/blob/v1.11.0/numpy/distutils/
fcompiler/__init__.py#L583
And indeed, setting extra_f77_compile_arg has the effect I was looking for.
Fixing it is easy, but I am less certain whether we should fix the docs, or the code.
Given that add_extension lists extra_compile_args,
extra_f77_compile_args, etc, I would think it
Is the documentation that need to change.
Please confirm, and I will open up a pull request for this.
That's rather unfortunate, "compiler" would be better than "compile", but
it is best to document the actual behavior. If we later settle on changing
the argument we can do that, but it is a more involved process.
Although I suppose we could allow either in the future.

Chuck
Loading...