Hi Chuck, On Thu, Jun 30, 2022 at 2:13 PM Charles R Harris <charlesr.harris@gmail.com> wrote:
On Wed, Jun 29, 2022 at 5:26 PM Matthew Brett <matthew.brett@gmail.com> wrote:
Hi,
I am very sorry - I feel I should know this, or be able to work it out, but is there a way of setting the flags to the C compiler and the linker, for the Numpy build, on Windows?
I'm trying to set the flags for a build with Windows mingw-w64 - but I believe Numpy is ignoring $env:LDFLAGS, $env:CFLAGS and $env:OPT - and I can't see any way of setting these options from the command line. Am I missing something?
Cheers,
Matthew
I don't know how you are using env, but variables set that way are local to the shell in which they are set. In PS that is every separate shell invocation.
Maybe you are thinking of local PS variables? $env: variables do get passed to subshells, like exported Bash variables. """ # show_env.py import os print('MY VAR', os.environ.get('MY_VAR')) print('LOCAL VAR', os.environ.get('LOCAL_VAR')) """ Then: """ PS C:\tmp> $env:MY_VAR = 'foo' PS C:\tmp> $LOCAL_VAR = 'bar' PS C:\tmp> python .\show_env.py """ gives """ MY VAR foo LOCAL VAR None """ Cheers, Matthew