首先,我可能应该说明我这样做的原因:我想尝试一些不同的微分方程求解器来比较我正在从事的项目的效率和内存使用情况。因此,我想安装 Assimulo,因为它使用了一套求解器并且非常用户友好。
在安装它之前,我发现我需要安装“日晷”:
https://computation.llnl.gov/casc/sundials/download/download.html
因为我使用的是 64 位 ubuntu,所以我下载了它,解压缩并使用“-fPIC”标志安装它。安装“似乎”顺利,没有退出状态消息。
然后我使用以下说明安装了 assimulo:
http://www.jmodelica.org/assimulo_home/installation.html
我将“usr/local/lib”指定为安装日晷的路径,因为这是脚本运行时它在终端中安装的路径。
为了检查它是否正常工作,我下载并安装了鼻子来执行鼻子测试,但是,它告诉我有问题。错误的一部分是:
======================================================================
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 sundials
鼻子报告的其他五个错误非常相似。我理解它的意思,因为它似乎模块不在正确的位置,但我该如何解决它?
如果有人可以帮助我非常感激。在过去的几天里,我对此做了一场绝对的噩梦。我对 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$