Python导入编译函数

时间:2016-05-17 15:38:05

标签: python module fortran compiled .so

我已经下载了一个' custom'基于R函数的fisher精确测试,该函数又是从C / FORTRAN编译的(source

该软件包包括主文件/函数(Fisher.py),后者又从fexact,asa159和asa205文件导入函数。问题是这些文件是C共享对象,即具有.so扩展名,因此python在导入时无法识别它们;给出错误。

  ...customlib/fexact.so, 2): no suitable image found.  Did find:
  .../customlib/fexact.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00

不确定如何处理此问题。

Fisher.py包含:

  import customlib.fexact as f
  from customlib.fexact import fisher_exact as f_exact
  from customlib.asa159 import rcont2
  from customlib.asa205 import enum as rcont

customlib文件夹包含: 1. __init__ 2. asa159.so 3. asa205.so 4. fexact.so

1 个答案:

答案 0 :(得分:1)

运行包中提供的重新编译脚本。这些库是为原始作者使用的系统编译的,并且不能跨系统移植。您可能需要更新f2py的来电以指向正确的版本供您使用。

相关问题