Re: [f2py] -mno-cygwin

Pearu Peterson <[email protected]> Sat, 16 Oct 2010 22:24:09 +0300
Newsgroups gmane.comp.python.f2py.user
Message-ID <[email protected]>
Hi,
I have applied a patch to numpy git repository that removes
-mno-cygwin option for gcc-4 series compilers.
Thanks for testing it,
Pearu

On Sat, Oct 16, 2010 at 12:26 AM, Steve Westenbroek <[email protected]> wrote:
> Hi Pearu,
>
> Thanks so much for taking the time to dig into this! I've managed to hack up
> my Numpy distribution (exactly as you suggested) in order to get my code
> working with Python again.
>
> After I sent the email, I Googled about and stumbled onto one of your
> earlier posts regarding C compiler flags. I searched in the distutils
> directory for "-mno-cygwin", and somewhat naively deleted or commented out
> the offending compiler flag from the following two files:
>
> C:\Python26\Lib\site-packages\numpy\distutils\fcompiler\gnu.py
> C:\Python26\Lib\site-packages\numpy\distutils\mingw32ccompiler.py
>
> In running diff on the altered and unaltered files, the changes are as
> follows:
>
> mingw32compiler.py:
>   eliminate "-mno-cygwin" from statements in lines 120-123.
>
> gnu.py:
>   comment out lines 87-89 and lines 242-245.
>
> In retrospect, I probably should have left lines 87-89 alone, since it
> appears that the code is only executed if the compiler version string
> contains "g77".
>
> For the record, here are the versions of gcc/gfortran I am running
> (MinGW/MSYS), along with Python version 2.6:
>
> $ gcc --version
> gcc.exe (GCC) 4.6.0 20101009 (experimental)
>
> $ gfortran --version
> GNU Fortran (GCC) 4.6.0 20101009 (experimental)
>
> Thanks again. I hope this helps.
>
> Cheers,
>
>  - Steve
>
> On 10/15/2010 12:11 PM, Pearu Peterson wrote:
>>
>> Hi,
>>
>> Could you try removing all -mno-cygwin occurrences from the following
>> files:
>>
>>   numpy/distutils/mingw32ccompiler.py
>>   numpy/distutils/fcompiler/gnu.py
>>
>> to see if this fixes compilations. Let me know if you got it working and
>> what
>> changes were needed in these files. Then I can prepare the corresponding
>> patch for numpy.distutils..
>>
>> HTH,
>> Pearu
>>
>> On Fri, Oct 15, 2010 at 6:37 PM, Steve Westenbroek<[email protected]>
>>  wrote:
>>>
>>> Greetings,
>>>
>>> I recently upgraded my compiler to gcc/gfortran version 4.6.0 20101009,
>>> running under MSYS/MinGW.
>>>
>>> Before the upgrade, f2py happily compiled my fortran code into a Python
>>> module. Following the upgrade, f2py fails with the following message:
>>>
>>> Found executable C:\MinGW\bin\gcc.exe
>>> cc1.exe: error: unrecognized command line option '-mno-cygwin'
>>> error: Command "gcc -mno-cygwin -O2 -Wall -Wstrict-prototypes [snip]"
>>> failed with exit status 1
>>>
>>> Given that the "-mno-cygwin" flag is apparently obsolete (and redundant
>>> under MinGW), how can I force f2py to stop tacking it on when attempting
>>> to compile a module?
>>>
>>> Thanks,
>>>
>>> �- Steve
>>>
>>> _______________________________________________
>>> f2py-users mailing list
>>> [email protected]
>>> http://cens.ioc.ee/mailman/listinfo/f2py-users
>>>
>>
>
>

_______________________________________________
f2py-users mailing list
[email protected]
http://cens.ioc.ee/mailman/listinfo/f2py-users