modelon-community / Assimulo

Assimulo is a simulation package for solving ordinary differential equations.
https://jmodelica.org/assimulo/index.html
GNU Lesser General Public License v3.0
69 stars 17 forks source link

AttributeError: 'Assimulo_prepare' object has no attribute 'sundials_with_msvc' #18

Closed pswpswpsw closed 3 years ago

pswpswpsw commented 3 years ago

I tried to install from source code:

python setup.py install --user

Then it pops up the following error

  tree = Parsing.p_module(s, pxd, full_module_name)
Traceback (most recent call last):
  File "setup.py", line 610, in <module>
    ext_list = prepare.cython_extensionlists()
  File "setup.py", line 518, in cython_extensionlists
    if self.sundials_with_msvc:
AttributeError: 'Assimulo_prepare' object has no attribute 'sundials_with_msvc'
apigott commented 3 years ago

Hi @pswpswpsw did you ever figure this out? I have the same error

ChristophGehbauer commented 3 years ago

Same issue here. Versions up to 3.0 work, everything beyond throes this error for me (Ubuntu 18.04, Python3.6). Thanks!

apigott commented 3 years ago

Hi @ChristophGehbauer did you ever get this working? For me this was an issue with not finding the sundials library at all. An outtake from the Dockerfile I used that works:

  wget https://github.com/modelon-community/Assimulo/archive/Assimulo-3.2.4.tar.gz &&\
  tar xfz Assimulo-3.2.4.tar.gz &&\
  cd Assimulo-Assimulo-3.2.4 &&\
  python setup.py install --sundials-home=/opt/intel/oneapi/intelpython/latest/envs/myenv --lapack-home=/usr/lib/x86_64-linux-gnu/ --blas-home=/usr/lib/x86_64-linux-gnu/ &&\

Did you try looking in sundials-home/include/ for cvode and cvodes?

ChristophGehbauer commented 3 years ago

Thank you @apigott, that was a good hint. I didn't install Sundials in the default directory /usr/local, which caused the setup.py to throw this error.

Would suggest to review the check_SUNDIALS function and subsequent usage of the self.sundials_with_msvc to avoid the crash, and rather catch this issue.

chria commented 3 years ago

I've updated the setup script so that this does not occur.