[SciPy-user] f2py "Segmentation fault"-revisited, please help

George Nurser gnurser at googlemail.com
Mon Nov 3 08:49:24 EST 2008


2008/10/31 Kimberly Artita <kartita at gmail.com>:
> Tried it on a different machine (numpy-1.2.0 and gcc-4.3.2 on linux)
>
> Either way (--fcompiler=gnu95 or gfortran) gives a segfault
> The output says "General", then segfaults.
> It is reading the space as a delimiter, even though I specify delim='none'
>
> My laptop and the desktop used above run gentoo.  A third desktop using
> ubuntu with gcc-4.3.2 and numpy-1.2.0 works fine.  What gives?
>

I've idea why it should work on one machine but not the other.

--George.


>
> On Fri, Oct 31, 2008 at 5:20 AM, George Nurser <gnurser at googlemail.com>
> wrote:
>>
>> Hi,
>>
>> 2008/10/31 Kimberly Artita <kartita at gmail.com>:
>> > Hi,
>> >
>> > Can someone please tell me why I keep getting a segmentation fault?
>> [cut]
>>
>> You need to compile with fcompiler=gnu95
>>
>> >
>> > I type: f2py --fcompiler=gfortran -c -m gfortran_test gfortran_test.f90
>>
>> Do
>> f2py --fcompiler=gnu95 -c -m gfortran_test gfortran_test.f90
>>
>> It worked fine for me (gfortran 4.3.2, Numpy 1.3.0.dev5867, Mac OS X)
>>
>> HTH, George Nurser.
>> _______________________________________________
>> SciPy-user mailing list
>> SciPy-user at scipy.org
>> http://projects.scipy.org/mailman/listinfo/scipy-user
>
>
>
> On Thu, Oct 30, 2008 at 11:52 PM, Kimberly Artita <kartita at gmail.com> wrote:
>>
>> Hi,
>>
>> Can someone please tell me why I keep getting a segmentation fault?
>>
>> my fortran script (gfortran_test.f90):
>> subroutine readin_test
>>
>>     implicit none
>>
>>     character(len=4) :: title (60)
>>     character (len=13) :: bigsub, sbsout, rchout, rsvout, lwqout, wtrout
>>     open (2,file="gfortran.txt", delim='none')
>>     print *, "title"
>>     read (2,5100) title
>>     print *, title
>>     read (2,5000) bigsub, sbsout, rchout, rsvout, lwqout, wtrout
>>
>>     print *, "bigsub, sbsout, rchout, rsvout, lwqout, wtrout"
>>     print *, bigsub, sbsout, rchout, rsvout, lwqout, wtrout
>>     close(2)
>>
>>     5100 format (20a4)
>>     5000 format (6a)
>>
>> end subroutine readin_test
>>
>> my python script (gfortran_test.py):
>> import gfortran_test
>>
>> gfortran_test.readin_test()
>>
>> my text file (gfortran.txt):
>> General Input/Output section (file.cio):           Thu Mar 13 17:32:19
>> 2008 AVSWAT2000 - SWAT interface MDL
>>
>>
>>    basins.bsb   basins.sbs   basins.rch   basins.rsv   basins.lqo
>> basins.wtr
>>
>>
>> using this version of gfortran: i686-pc-linux-gnu-4.1.2 with either
>> numpy-1.0.4-r2 or numpy-1.2.0
>>
>> I can compile gfortran_test.f90 as a standalone program and it works!
>>
>> BUT, when I call it as a subroutine from python using f2py, it fails!
>> I type: f2py --fcompiler=gfortran -c -m gfortran_test gfortran_test.f90
>>
>>
>> Why??????
>>
>> --
>> Kimberly S. Artita
>> PhD Intern, CDM
>> Graduate Student, Engineering Science
>> Southern Illinois University Carbondale
>> Carbondale, Illinois 62901-6603
>> (618)-528-0349
>> e-mail: kartita at gmail.com, kartita at siu.edu
>> web: http://civil.engr.siu.edu/GraduateStudents/artita/index.html
>
>
>
> --
> Kimberly S. Artita
> PhD Intern, CDM
> Graduate Student, Engineering Science
> Southern Illinois University Carbondale
> Carbondale, Illinois 62901-6603
> (618)-528-0349
> e-mail: kartita at gmail.com, kartita at siu.edu
> web: http://civil.engr.siu.edu/GraduateStudents/artita/index.html
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user
>
>



More information about the SciPy-User mailing list