[SciPy-user] f2py problem: failed to map segment from shared object: Operation not permitted

Ryan Krauss ryanlists at gmail.com
Wed Jun 10 17:50:28 EDT 2009


I found this thread from a year ago:
http://mail.scipy.org/pipermail/numpy-discussion/2008-June/035107.html

The --fcompiler=gnu95 switch cleans up my output, but doesn't get rid of my
problem:


#------------------------------------
ryan at ryan-duo-laptop:~/thesis/sym_control_design$ f2py -c -m
fortran_model_bode1f --fcompiler=gnu95 fortran_model_bode1_out.f
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler
options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler
options
running build_src
building extension "fortran_model_bode1f" sources
f2py options: []
f2py:> /tmp/tmpocK64J/src.linux-i686-2.6/fortran_model_bode1fmodule.c
creating /tmp/tmpocK64J
creating /tmp/tmpocK64J/src.linux-i686-2.6
Reading fortran codes...
    Reading file 'fortran_model_bode1_out.f' (format:fix,strict)
Post-processing...
    Block: fortran_model_bode1f
            Block: bodevect
            Block: invbodevect
            Block: invbode
            Block: zcosh
            Block: zsinh
            Block: bode
Post-processing (stage 2)...
Building modules...
    Building module "fortran_model_bode1f"...
        Constructing wrapper function "bodevect"...
          outvect = bodevect(svect,ucv)
        Constructing wrapper function "invbodevect"...
          outvect = invbodevect(svect,ucv)
        Creating wrapper for Fortran function "invbode"("invbode")...
        Constructing wrapper function "invbode"...
          invbode = invbode(s,ucv)
        Creating wrapper for Fortran function "zcosh"("zcosh")...
        Constructing wrapper function "zcosh"...
          zcosh = zcosh(z)
        Creating wrapper for Fortran function "zsinh"("zsinh")...
        Constructing wrapper function "zsinh"...
          zsinh = zsinh(z)
        Creating wrapper for Fortran function "bode"("bode")...
        Constructing wrapper function "bode"...
          bode = bode(s,ucv)
    Wrote C/API module "fortran_model_bode1f" to file
"/tmp/tmpocK64J/src.linux-i686-2.6/fortran_model_bode1fmodule.c"
    Fortran 77 wrappers are saved to
"/tmp/tmpocK64J/src.linux-i686-2.6/fortran_model_bode1f-f2pywrappers.f"
  adding '/tmp/tmpocK64J/src.linux-i686-2.6/fortranobject.c' to sources.
  adding '/tmp/tmpocK64J/src.linux-i686-2.6' to include_dirs.
copying /usr/lib/python2.6/dist-packages/numpy/f2py/src/fortranobject.c ->
/tmp/tmpocK64J/src.linux-i686-2.6
copying /usr/lib/python2.6/dist-packages/numpy/f2py/src/fortranobject.h ->
/tmp/tmpocK64J/src.linux-i686-2.6
  adding
'/tmp/tmpocK64J/src.linux-i686-2.6/fortran_model_bode1f-f2pywrappers.f' to
sources.
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
customize Gnu95FCompiler
Found executable /usr/bin/gfortran
customize Gnu95FCompiler using build_ext
building 'fortran_model_bode1f' extension
compiling C sources
C compiler: gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
-Wstrict-prototypes -fPIC

creating /tmp/tmpocK64J/tmp
creating /tmp/tmpocK64J/tmp/tmpocK64J
creating /tmp/tmpocK64J/tmp/tmpocK64J/src.linux-i686-2.6
compile options: '-I/tmp/tmpocK64J/src.linux-i686-2.6
-I/usr/lib/python2.6/dist-packages/numpy/core/include
-I/usr/include/python2.6 -c'
gcc: /tmp/tmpocK64J/src.linux-i686-2.6/fortran_model_bode1fmodule.c
gcc: /tmp/tmpocK64J/src.linux-i686-2.6/fortranobject.c
compiling Fortran sources
Fortran f77 compiler: /usr/bin/gfortran -Wall -ffixed-form
-fno-second-underscore -fPIC -O3 -funroll-loops -march=i686 -mmmx -msse2
-msse -msse3 -fomit-frame-pointer -malign-double
Fortran f90 compiler: /usr/bin/gfortran -Wall -fno-second-underscore -fPIC
-O3 -funroll-loops -march=i686 -mmmx -msse2 -msse -msse3
-fomit-frame-pointer -malign-double
Fortran fix compiler: /usr/bin/gfortran -Wall -ffixed-form
-fno-second-underscore -Wall -fno-second-underscore -fPIC -O3 -funroll-loops
-march=i686 -mmmx -msse2 -msse -msse3 -fomit-frame-pointer -malign-double
compile options: '-I/tmp/tmpocK64J/src.linux-i686-2.6
-I/usr/lib/python2.6/dist-packages/numpy/core/include
-I/usr/include/python2.6 -c'
gfortran:f77: fortran_model_bode1_out.f
gfortran:f77:
/tmp/tmpocK64J/src.linux-i686-2.6/fortran_model_bode1f-f2pywrappers.f
/usr/bin/gfortran -Wall -Wall -shared
/tmp/tmpocK64J/tmp/tmpocK64J/src.linux-i686-2.6/fortran_model_bode1fmodule.o
/tmp/tmpocK64J/tmp/tmpocK64J/src.linux-i686-2.6/fortranobject.o
/tmp/tmpocK64J/fortran_model_bode1_out.o
/tmp/tmpocK64J/tmp/tmpocK64J/src.linux-i686-2.6/fortran_model_bode1f-f2pywrappers.o
-lgfortran -o ./fortran_model_bode1f.so
running scons
Removing build directory /tmp/tmpocK64J

#--------------------------------

In [2]: import fortran_model_bode1f
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)

/home/ryan/siue/Research/papers/noncolocated_TMM/expgraphs/symbolic_modeling.py
in <module>()
----> 1
      2
      3
      4
      5

ImportError: /home/ryan/thesis/sym_control_design/fortran_model_bode1f.so:
failed to map segment from shared object: Operation not permitted





On Wed, Jun 10, 2009 at 2:57 PM, Ryan Krauss <ryanlists at gmail.com> wrote:

> I am trying to reuse some old code.  I am running into a problem importing
> a module created by f2py.  Here is the traceback:
>
> /home/ryan/pythonutil/rwkmisc.pyc in my_import(name)
>     347
>     348 def my_import(name):
> --> 349     mod = __import__(name)
>     350     components = name.split('.')
>     351     for comp in components[1:]:
>
> ImportError: /home/ryan/thesis/sym_control_design/fortran_model_bode1f.so:
> failed to map segment from shared object: Operation not permitted
> WARNING: Failure executing file: <symbolic_modeling.py>
>
> I just tried recompiling the code.  The output of "f2py -c -m
> fortran_model_bode1f fortran_model_bode1_out.f" is below.  Note that g77
> doesn't show up in my Ubuntu 9.04 package manager.  I have gfortran
> installed.  Can I safely ignore all the messages about not finding various
> executeables since it eventually finds gfortran, or is this part of the
> problem?  Recompiling did not fix my problem.  The fortran file is attached.
>
> Thanks,
>
> Ryan
>
> ryan at ryan-duo-laptop:~/thesis/sym_control_design$ f2py -c -m
> fortran_model_bode1f fortran_model_bode1_out.f
> running build
> running config_cc
> unifing config_cc, config, build_clib, build_ext, build commands --compiler
> options
> running config_fc
> unifing config_fc, config, build_clib, build_ext, build commands
> --fcompiler options
> running build_src
> building extension "fortran_model_bode1f" sources
> f2py options: []
> f2py:> /tmp/tmp3H0RSG/src.linux-i686-2.6/fortran_model_bode1fmodule.c
> creating /tmp/tmp3H0RSG
> creating /tmp/tmp3H0RSG/src.linux-i686-2.6
> Reading fortran codes...
>     Reading file 'fortran_model_bode1_out.f' (format:fix,strict)
> Post-processing...
>     Block: fortran_model_bode1f
>             Block: bodevect
>             Block: invbodevect
>             Block: invbode
>             Block: zcosh
>             Block: zsinh
>             Block: bode
> Post-processing (stage 2)...
> Building modules...
>     Building module "fortran_model_bode1f"...
>         Constructing wrapper function "bodevect"...
>           outvect = bodevect(svect,ucv)
>         Constructing wrapper function "invbodevect"...
>           outvect = invbodevect(svect,ucv)
>         Creating wrapper for Fortran function "invbode"("invbode")...
>         Constructing wrapper function "invbode"...
>           invbode = invbode(s,ucv)
>         Creating wrapper for Fortran function "zcosh"("zcosh")...
>         Constructing wrapper function "zcosh"...
>           zcosh = zcosh(z)
>         Creating wrapper for Fortran function "zsinh"("zsinh")...
>         Constructing wrapper function "zsinh"...
>           zsinh = zsinh(z)
>         Creating wrapper for Fortran function "bode"("bode")...
>         Constructing wrapper function "bode"...
>           bode = bode(s,ucv)
>     Wrote C/API module "fortran_model_bode1f" to file
> "/tmp/tmp3H0RSG/src.linux-i686-2.6/fortran_model_bode1fmodule.c"
>     Fortran 77 wrappers are saved to
> "/tmp/tmp3H0RSG/src.linux-i686-2.6/fortran_model_bode1f-f2pywrappers.f"
>   adding '/tmp/tmp3H0RSG/src.linux-i686-2.6/fortranobject.c' to sources.
>   adding '/tmp/tmp3H0RSG/src.linux-i686-2.6' to include_dirs.
> copying /usr/lib/python2.6/dist-packages/numpy/f2py/src/fortranobject.c ->
> /tmp/tmp3H0RSG/src.linux-i686-2.6
> copying /usr/lib/python2.6/dist-packages/numpy/f2py/src/fortranobject.h ->
> /tmp/tmp3H0RSG/src.linux-i686-2.6
>   adding
> '/tmp/tmp3H0RSG/src.linux-i686-2.6/fortran_model_bode1f-f2pywrappers.f' to
> sources.
> running build_ext
> customize UnixCCompiler
> customize UnixCCompiler using build_ext
> customize GnuFCompiler
> Could not locate executable g77
> Could not locate executable f77
> customize IntelFCompiler
> Could not locate executable ifort
> Could not locate executable ifc
> customize LaheyFCompiler
> Could not locate executable lf95
> customize PGroupFCompiler
> Could not locate executable pgf90
> Could not locate executable pgf77
> customize AbsoftFCompiler
> Could not locate executable f90
> customize NAGFCompiler
> Found executable /usr/bin/f95
> customize VastFCompiler
> customize GnuFCompiler
> customize CompaqFCompiler
> Could not locate executable fort
> customize IntelItaniumFCompiler
> Could not locate executable efort
> Could not locate executable efc
> customize IntelEM64TFCompiler
> customize Gnu95FCompiler
> Found executable /usr/bin/gfortran
> customize Gnu95FCompiler
> customize Gnu95FCompiler using build_ext
> building 'fortran_model_bode1f' extension
> compiling C sources
> C compiler: gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
> -Wstrict-prototypes -fPIC
>
> creating /tmp/tmp3H0RSG/tmp
> creating /tmp/tmp3H0RSG/tmp/tmp3H0RSG
> creating /tmp/tmp3H0RSG/tmp/tmp3H0RSG/src.linux-i686-2.6
> compile options: '-I/tmp/tmp3H0RSG/src.linux-i686-2.6
> -I/usr/lib/python2.6/dist-packages/numpy/core/include
> -I/usr/include/python2.6 -c'
> gcc: /tmp/tmp3H0RSG/src.linux-i686-2.6/fortran_model_bode1fmodule.c
> gcc: /tmp/tmp3H0RSG/src.linux-i686-2.6/fortranobject.c
> compiling Fortran sources
> Fortran f77 compiler: /usr/bin/gfortran -Wall -ffixed-form
> -fno-second-underscore -fPIC -O3 -funroll-loops -march=i686 -mmmx -msse2
> -msse -msse3 -fomit-frame-pointer -malign-double
> Fortran f90 compiler: /usr/bin/gfortran -Wall -fno-second-underscore -fPIC
> -O3 -funroll-loops -march=i686 -mmmx -msse2 -msse -msse3
> -fomit-frame-pointer -malign-double
> Fortran fix compiler: /usr/bin/gfortran -Wall -ffixed-form
> -fno-second-underscore -Wall -fno-second-underscore -fPIC -O3 -funroll-loops
> -march=i686 -mmmx -msse2 -msse -msse3 -fomit-frame-pointer -malign-double
> compile options: '-I/tmp/tmp3H0RSG/src.linux-i686-2.6
> -I/usr/lib/python2.6/dist-packages/numpy/core/include
> -I/usr/include/python2.6 -c'
> gfortran:f77: fortran_model_bode1_out.f
> gfortran:f77:
> /tmp/tmp3H0RSG/src.linux-i686-2.6/fortran_model_bode1f-f2pywrappers.f
> /usr/bin/gfortran -Wall -Wall -shared
> /tmp/tmp3H0RSG/tmp/tmp3H0RSG/src.linux-i686-2.6/fortran_model_bode1fmodule.o
> /tmp/tmp3H0RSG/tmp/tmp3H0RSG/src.linux-i686-2.6/fortranobject.o
> /tmp/tmp3H0RSG/fortran_model_bode1_out.o
> /tmp/tmp3H0RSG/tmp/tmp3H0RSG/src.linux-i686-2.6/fortran_model_bode1f-f2pywrappers.o
> -lgfortran -o ./fortran_model_bode1f.so
> running scons
> Removing build directory /tmp/tmp3H0RSG
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20090610/d20621a3/attachment.html>


More information about the SciPy-User mailing list