首先,我可能应该说明我这样做的原因:我想试验一些不同的微分方程解算器,以比较我正在处理的项目的效率和内存使用情况。因此,我想安装Assimulo,因为它使用了一套求解器,并且非常用户友好。
在安装它之前,我发现我需要安装"sundials":
https://computation.llnl.gov/casc/sundials/download/download.html
因为我使用的是64位的ubuntu,所以我下载了它,解压并使用"-fPIC“标志安装了它。安装“看起来”正常,没有退出状态消息。
然后,我使用以下说明安装了一个模拟器:
http://www.jmodelica.org/assimulo_home/installation.html
我指定"usr/local/lib“作为安装sundials的路径,因为这是脚本运行时在终端中安装的路径。
为了检查它是否正常工作,我下载并安装了nose来执行nosetest,但是,它告诉我有问题。错误的一部分是:
======================================================================
ERROR: Failure: ImportError (No module named sundials)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
addr.filename, addr.module)
File "/usr/local/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/usr/local/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/usr/local/lib/python2.7/dist-packages/assimulo/tests/test_examples.py", line 21, in <module>
from assimulo.examples import *
File "/usr/local/lib/python2.7/dist-packages/assimulo/examples/cvode_gyro.py", line 22, in <module>
from assimulo.solvers import CVode
File "/usr/local/lib/python2.7/dist-packages/assimulo/solvers/__init__.py", line 23, in <module>
from sundials import IDA, CVode
ImportError: No module named sundialsnose报告的其他五个错误非常相似。我理解它的意思,在某种意义上,模块似乎不在正确的位置,但我如何修复它?
如果有人能帮忙,我将不胜感激。在过去的几天里,我做了一场噩梦。我对linux非常陌生,并且一直在努力,但我安装的所有东西似乎都不起作用。
操作系统: Ubuntu 12.10 64位。Python版本: 2.7安装了Numpy/Scipy。
编辑:下面是我如何安装assiumulo的,如果有帮助的话,还有终端输出:
nathan@ubuntu:~/Documents/pythoncode/Assimulo-2.1.1$ sudo python setup.py install --sundials-home=/usr/local/lib
running install
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
build_src
building extension "assimulo.implicit_ode" sources
building extension "assimulo.ode" sources
building extension "assimulo.explicit_ode" sources
building extension "assimulo.problem" sources
building extension "assimulo.solvers.euler" sources
building extension "assimulo.lib.dopri5" sources
f2py options: []
adding 'build/src.linux-x86_64-2.7/fortranobject.c' to sources.
adding 'build/src.linux-x86_64-2.7' to include_dirs.
adding 'build/src.linux-x86_64-2.7/assimulo/thirdparty/hairer/dopri5-f2pywrappers.f' to sources.
building extension "assimulo.lib.rodas" sources
f2py options: []
adding 'build/src.linux-x86_64-2.7/fortranobject.c' to sources.
adding 'build/src.linux-x86_64-2.7' to include_dirs.
adding 'build/src.linux-x86_64-2.7/assimulo/thirdparty/hairer/rodas-f2pywrappers.f' to sources.
building extension "assimulo.lib.radau5" sources
f2py options: []
adding 'build/src.linux-x86_64-2.7/fortranobject.c' to sources.
adding 'build/src.linux-x86_64-2.7' to include_dirs.
adding 'build/src.linux-x86_64-2.7/assimulo/thirdparty/hairer/radau5-f2pywrappers.f' to sources.
build_src: building npy-pkg config files
running build_py
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 pgfortran
customize AbsoftFCompiler
Could not locate executable f90
customize NAGFCompiler
Found executable /usr/bin/f95
customize VastFCompiler
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
running scons
running install_lib
running install_egg_info
Removing /usr/local/lib/python2.7/dist-packages/Assimulo-2.1.1.egg-info
Writing /usr/local/lib/python2.7/dist-packages/Assimulo-2.1.1.egg-info
running install_clib
customize UnixCCompiler
nathan@ubuntu:~/Documents/pythoncode/Assimulo-2.1.1$ 发布于 2014-06-02 02:16:10
当安装一个模拟器时,只尝试将/usr作为sundials-home目录。我已经在每个示例中搜索了位于/usr/include/cvodes的sundials模块的文件cvodes.h。要为sundials-home目录使用的是包含目录的父目录,因此为/usr。
https://stackoverflow.com/questions/14484877
复制相似问题