当前位置: 首页 > 工具软件 > SUNDIALS > 使用案例 >

linux终端安装sundials库,python – 安装“Sundials”以使用Assimulo

周奇文
2023-12-01

首先,我应该说明我这样做的原因:我想尝试一些不同的微分方程求解器来比较我正在研究的项目的效率和内存使用情况.因此我想安装Assimulo因为它使用了一套求解器并且非常用户友好.

在安装之前,我发现我需要安装“日程”:

我下载了它,解压缩并使用“-fPIC”标志安装它,因为我使用的是64位ubuntu.安装“显示”已经正常,没有退出状态消息.

然后我使用这些说明安装了assimulo:

我指定“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

from assimulo.examples import *

File "/usr/local/lib/python2.7/dist-packages/assimulo/examples/cvode_gyro.py", line 22, in

from assimulo.solvers import CVode

File "/usr/local/lib/python2.7/dist-packages/assimulo/solvers/__init__.py", line 23, in

from sundials import IDA, CVode

ImportError: No module named sundials

鼻子报告的其他五个错误非常相似.我理解它的说法在某种意义上看起来模块不在正确的位置,但我该如何解决?

如果有人可以帮助id非常感激.在过去的几天里,我对此产生了绝对的噩梦.我对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$

 类似资料: