Я пробую другие решения ODE, кроме одаренности SciPy.Я нашел возможный, пакет scikits.odes.Требования включают в себя компилятор C и FORTRAN (я скачал MinGW-w64, никаких проблем), LAPACK (скачал, собрал, протестировал, кажется, в порядке) и SUNDIALS (проблемы с LAPACK).Если LAPACK не включен в SUNDIALS, то при установке и запуске scikits.odes.test () будет несколько ошибок.Любой, кто мог бы помочь мне с этой проблемой.
После установки scikits.odes на Python 3.5.5 и запуска:
import scikits.odes as od
od.test()
У меня есть следующий вывод:
Running unit tests for scikits.odes
NumPy version 1.15.1
NumPy relaxed strides checking option: True
NumPy is installed in C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\numpy
Python version 3.5.5 |Anaconda, Inc.| (default, Apr 7 2018, 04:52:34) [MSC v.1900 64 bit (AMD64)]
nose version 1.3.7
Ecannot import name 'cvode'
.EEEEEE.EE.EEEE
======================================================================
ERROR: Failure: ImportError (No module named 'scikits.odes.sundials.common_defs')
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\nose\failure.py", line 39, in runTest
raise self.exc_val.with_traceback(self.tb)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\nose\loader.py", line 417, in loadTestsFromName
addr.filename, addr.module)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\nose\importer.py", line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\nose\importer.py", line 94, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\imp.py", line 235, in load_module
return load_source(name, filename, file)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\imp.py", line 172, in load_source
module = _load(spec)
File "<frozen importlib._bootstrap>", line 693, in _load
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 697, in exec_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\scikits\odes\tests\test_dae.py", line 15, in <module>
from scikits.odes.sundials.common_defs import DTYPE
ImportError: No module named 'scikits.odes.sundials.common_defs'
======================================================================
ERROR: test_get_info_is_exposed_on_ode (scikits.odes.tests.test_get_info.GetInfoTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\scikits\odes\tests\test_get_info.py", line 23, in setUp
self.ode = ode('cvode', rhs, old_api=False)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\scikits\odes\ode.py", line 273, in __init__
integrator = find_ode_integrator(integrator_name)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\scikits\odes\ode.py", line 486, in find_ode_integrator
raise ValueError('Integrator name %s does not exist' % name)
ValueError: Integrator name cvode does not exist
======================================================================
ERROR: test_get_info_returns_dict (scikits.odes.tests.test_get_info.GetInfoTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\scikits\odes\tests\test_get_info.py", line 23, in setUp
self.ode = ode('cvode', rhs, old_api=False)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\scikits\odes\ode.py", line 273, in __init__
integrator = find_ode_integrator(integrator_name)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\scikits\odes\ode.py", line 486, in find_ode_integrator
raise ValueError('Integrator name %s does not exist' % name)
ValueError: Integrator name cvode does not exist
======================================================================
ERROR: test_ode_exposes_num_rhs_evals (scikits.odes.tests.test_get_info.GetInfoTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\scikits\odes\tests\test_get_info.py", line 23, in setUp
self.ode = ode('cvode', rhs, old_api=False)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\scikits\odes\ode.py", line 273, in __init__
integrator = find_ode_integrator(integrator_name)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\scikits\odes\ode.py", line 486, in find_ode_integrator
raise ValueError('Integrator name %s does not exist' % name)
ValueError: Integrator name cvode does not exist
======================================================================
ERROR: test_we_integrated_correctly (scikits.odes.tests.test_get_info.GetInfoTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\scikits\odes\tests\test_get_info.py", line 23, in setUp
self.ode = ode('cvode', rhs, old_api=False)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\scikits\odes\ode.py", line 273, in __init__
integrator = find_ode_integrator(integrator_name)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\scikits\odes\ode.py", line 486, in find_ode_integrator
raise ValueError('Integrator name %s does not exist' % name)
ValueError: Integrator name cvode does not exist
======================================================================
ERROR: test_ode_exposes_num_njtimes_evals (scikits.odes.tests.test_get_info.GetInfoTestSpils)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\scikits\odes\tests\test_get_info.py", line 50, in setUp
self.ode = ode('cvode', rhs, linsolver="spgmr", old_api=False)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\scikits\odes\ode.py", line 273, in __init__
integrator = find_ode_integrator(integrator_name)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\scikits\odes\ode.py", line 486, in find_ode_integrator
raise ValueError('Integrator name %s does not exist' % name)
ValueError: Integrator name cvode does not exist
======================================================================
ERROR: test_odeint (scikits.odes.tests.test_odeint.TestOdeint)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\scikits\odes\tests\test_odeint.py", line 47, in test_odeint
self._do_problem(problem)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\scikits\odes\tests\test_odeint.py", line 33, in _do_problem
sol = odeint(problem.f, t, problem.z0, method=method)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\scikits\odes\odeint.py", line 215, in odeint
solver = ode(int_name, rhsfun, **options)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\scikits\odes\ode.py", line 273, in __init__
integrator = find_ode_integrator(integrator_name)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\scikits\odes\ode.py", line 486, in find_ode_integrator
raise ValueError('Integrator name %s does not exist' % name)
ValueError: Integrator name cvode does not exist
======================================================================
ERROR: scikits.odes.tests.test_odeint.test_odeint_banded_jacobian
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\nose\case.py", line 197, in runTest
self.test(*self.arg)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\scikits\odes\tests\test_odeint.py", line 292, in test_odeint_banded_jacobian
jacfn=jac)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\scikits\odes\odeint.py", line 215, in odeint
solver = ode(int_name, rhsfun, **options)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\scikits\odes\ode.py", line 273, in __init__
integrator = find_ode_integrator(integrator_name)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\scikits\odes\ode.py", line 486, in find_ode_integrator
raise ValueError('Integrator name %s does not exist' % name)
ValueError: Integrator name cvode does not exist
======================================================================
ERROR: scikits.odes.tests.test_odeint.test_odeint_errors
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\nose\case.py", line 197, in runTest
self.test(*self.arg)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\scikits\odes\tests\test_odeint.py", line 403, in test_odeint_errors
assert_raises(ZeroDivisionError, odeint, bad1, [0, 1], [1.0])
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\numpy\testing\_private\utils.py", line 1244, in assert_raises
return _d.assertRaises(*args,**kwargs)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\unittest\case.py", line 733, in assertRaises
return context.handle('assertRaises', args, kwargs)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\unittest\case.py", line 178, in handle
callable_obj(*args, **kwargs)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\scikits\odes\odeint.py", line 215, in odeint
solver = ode(int_name, rhsfun, **options)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\scikits\odes\ode.py", line 273, in __init__
integrator = find_ode_integrator(integrator_name)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\scikits\odes\ode.py", line 486, in find_ode_integrator
raise ValueError('Integrator name %s does not exist' % name)
ValueError: Integrator name cvode does not exist
======================================================================
ERROR: Failure: ImportError (No module named 'scikits.odes.sundials.cvode')
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\nose\failure.py", line 39, in runTest
raise self.exc_val.with_traceback(self.tb)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\nose\loader.py", line 417, in loadTestsFromName
addr.filename, addr.module)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\nose\importer.py", line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\nose\importer.py", line 94, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\imp.py", line 235, in load_module
return load_source(name, filename, file)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\imp.py", line 172, in load_source
module = _load(spec)
File "<frozen importlib._bootstrap>", line 693, in _load
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 697, in exec_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\scikits\odes\tests\test_on_funcs.py", line 16, in <module>
from scikits.odes.sundials.cvode import StatusEnum
ImportError: No module named 'scikits.odes.sundials.cvode'
======================================================================
ERROR: Failure: ImportError (No module named 'scikits.odes.sundials.ida')
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\nose\failure.py", line 39, in runTest
raise self.exc_val.with_traceback(self.tb)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\nose\loader.py", line 417, in loadTestsFromName
addr.filename, addr.module)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\nose\importer.py", line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\nose\importer.py", line 94, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\imp.py", line 235, in load_module
return load_source(name, filename, file)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\imp.py", line 172, in load_source
module = _load(spec)
File "<frozen importlib._bootstrap>", line 693, in _load
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 697, in exec_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\scikits\odes\tests\test_on_funcs_ida.py", line 16, in <module>
from scikits.odes.sundials.ida import StatusEnumIDA
ImportError: No module named 'scikits.odes.sundials.ida'
======================================================================
ERROR: Failure: ImportError (No module named 'scikits.odes.sundials.cvode')
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\nose\failure.py", line 39, in runTest
raise self.exc_val.with_traceback(self.tb)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\nose\loader.py", line 417, in loadTestsFromName
addr.filename, addr.module)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\nose\importer.py", line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\nose\importer.py", line 94, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\imp.py", line 235, in load_module
return load_source(name, filename, file)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\imp.py", line 172, in load_source
module = _load(spec)
File "<frozen importlib._bootstrap>", line 693, in _load
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 697, in exec_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\scikits\odes\tests\test_user_return_vals_cvode.py", line 5, in <module>
from ..sundials.cvode import StatusEnum
ImportError: No module named 'scikits.odes.sundials.cvode'
======================================================================
ERROR: Failure: ImportError (No module named 'scikits.odes.sundials.ida')
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\nose\failure.py", line 39, in runTest
raise self.exc_val.with_traceback(self.tb)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\nose\loader.py", line 417, in loadTestsFromName
addr.filename, addr.module)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\nose\importer.py", line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\nose\importer.py", line 94, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\imp.py", line 235, in load_module
return load_source(name, filename, file)
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\imp.py", line 172, in load_source
module = _load(spec)
File "<frozen importlib._bootstrap>", line 693, in _load
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 697, in exec_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "C:\Users\f_lon_000\Anaconda3\envs\Python_35\lib\site-packages\scikits\odes\tests\test_user_return_vals_ida.py", line 5, in <module>
from ..sundials.ida import StatusEnumIDA
ImportError: No module named 'scikits.odes.sundials.ida'
----------------------------------------------------------------------
Ran 16 tests in 0.422s
FAILED (errors=13)
Out[2]: <nose.result.TextTestResult run=16 errors=13 failures=0>
В соответствии с процедурой устранения неполадок для scikits.odes, найденной в https://scikits -odes.readthedocs.io / en / latest / installation.html # устранение неполадок это вызвано тем, что SUNDIALS не связаны с LAPACK.
Я следовал процедуре, описанной в https://icl.cs.utk.edu/lapack-for-windows/lapack/#build, для простой сборки Windows LAPACK с MinGW-w64.Когда я запускаю:
C:/Program_Files/mingw-w64/x86_64-8.1.0-posix-sjlj-rt_v6-rev0/mingw64/bin/mingw32-make.exe test
в командной строке для проверки сборки LAPACK, она работает нормально (все тесты пройдены).
Для установки SUNDIALS 2.7.0 я выполняю аналогичную процедуру.С помощью CMake я выбираю исходную папку, выбираю другую папку сборки, использую configure и выбираю LAPACK_ENABLE.При повторной настройке я получаю сообщение об ошибке ниже.
Ошибка CMake:
The Fortran compiler identification is GNU 8.1.0
Searching for a Fortran compiler... C:/Program_Files/mingw-w64/x86_64-8.1.0-posix-sjlj-rt_v6-rev0/mingw64/bin/x86_64-w64-mingw32-gfortran.exe
Trying to compile and link a simple Fortran program... OK
Determining Fortran name-mangling scheme... OK
Looking for LAPACK libraries... OK
Checking if Lapack works... FAILED
WARNING: LAPACK not functional.
Blas/Lapack support will not be provided.
Added NVECTOR_SERIAL module
Added ARKODE module
Added CVODE module
Added CVODES module
Added IDA module
Added IDAS module
Added KINSOL module
Configuring done
Кстати, вроде как новичок в программировании, я пробую все это на Windows 10, Python 3.5.5, LAPACK 3.8.0, SUNDIALS 2.7.0, CMake 3.11.4.