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

Kimberly Artita kartita@gmail....
Fri Oct 31 12:34:53 CDT 2008


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?

Kim

On Fri, Oct 31, 2008 at 5:20 AM, George Nurser <gnurser@googlemail.com>wrote:

> Hi,
>
> 2008/10/31 Kimberly Artita <kartita@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@scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user
>



On Thu, Oct 30, 2008 at 11:52 PM, Kimberly Artita <kartita@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@gmail.com, kartita@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@gmail.com, kartita@siu.edu
web: http://civil.engr.siu.edu/GraduateStudents/artita/index.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/scipy-user/attachments/20081031/2ecb3baf/attachment.html 


More information about the SciPy-user mailing list