Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CompilationError: Error executing in get_native(rsys, odesys, 'cvode') #185

Open
jankaWIS opened this issue Oct 26, 2020 · 3 comments
Open

Comments

@jankaWIS
Copy link

Hi,

I have general problems (I will point out more once I will be sure the problem is not on my side) with this specific line (4th) in this example notebook but this one I got right now on Win10:

native = get_native(rsys, odesys, 'cvode')

and I am getting:

CompilationError: Error executing 'C:\Users\janka.WISMAIN\AppData\Local\Continuum\anaconda3\Library\mingw-w64\bin\g++.exe -fwrapv -pthread -c -std=c++11 -Wall -Wextra -fPIC -O2 -ffast-math -funroll-loops -fopenmp -fno-strict-aliasing -o .\_cvode_wrapper.obj -DPYCVODES_NO_KLU=1 -DPYCVODES_NO_LAPACK=1 -DANYODE_NO_LAPACK=1 -IC:\Users\janka.WISMAIN\AppData\Local\Continuum\anaconda3\lib\site-packages\numpy\core\include -IC:\Users\janka.WISMAIN\AppData\Local\Continuum\anaconda3\lib\site-packages\pyodesys\native\sources -Ic:\users\janka.wismain\appdata\local\continuum\anaconda3\lib\site-packages\pycvodes\include -IC:\Users\janka.WISMAIN\AppData\Local\Continuum\anaconda3\include .\_cvode_wrapper.cpp' in C:\Users\JANKA~1.WIS\AppData\Local\Temp\tmp0j3jigxs. Command exited with status 1 after givning the following output: .\_cvode_wrapper.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
 /* Generated by Cython 0.29.14 */
 ^
In file included from .\_cvode_wrapper.cpp:622:0:
c:\users\janka.wismain\appdata\local\continuum\anaconda3\lib\site-packages\pycvodes\include/cvodes_cxx.hpp:19:38: fatal error: sundials/sundials_config.h: No such file or directory
compilation terminated.

What is going on and how can I fix it?

I am using:

CPython 3.7.3
IPython 7.17.0
chempy 0.7.12
chempy._release 0.7.12
sympy 1.6.2
numpy 1.16.2
pytest 6.1.1
scipy 1.5.0
pycodeexport 0.1.2

@bjodah
Copy link
Owner

bjodah commented Oct 26, 2020

Hi @jankaWIS,

I don't have access to a Windows machine so I cannot say for certain, perhaps some other user here has. I did however manage to compile a corresponding python extension (and link to sundials) under windows for a tutorial we gave at SciPy 2017. You can find the configuration over here: https://github.com/sympy/scipy-2017-codegen-tutorial

I haven't touched it since though, so expect some "bit-rot". If you manage to get this working, and want to ensure it stays working, we can look into adding a windows build to the continuous integration setup for ChemPy.

@jankaWIS
Copy link
Author

jankaWIS commented Oct 27, 2020

Hi @bjodah,

thanks for responding so fast. What exactly do you mean by trying to do the configuration?
I have run your tests (python3 -m pytest -rs -W ignore::chempy.ChemPyDeprecationWarning --pyargs chempy ) and it complains about a missing package:
anaconda3/lib/python3.8/site-packages/chempy/kinetics/tests/test__native.py:89: Unfulfilled requirements. Missing modules: pygslodeiv2
which is giving me the following error when I tried to install it as recommended on your github using conda:

PackagesNotFoundError: The following packages are not available from current channels:

  - pygslodeiv2

I believe this should done the job (so I should probably open an issue there but since it's connected, I will pose it here):
conda install -c conda-forge pygslodeiv2 pytest

And it is both on Mac and Windows. Which brings me to the second problem I am having which I have I summed up here:
https://stackoverflow.com/questions/64348908/chempy-clang-error-unsupported-option-fopenmp.

@bjodah
Copy link
Owner

bjodah commented Oct 27, 2020

Hi again @jankaWIS,

OK, so there are multiple issues here, I used to have a conda channel with my packages, but this was way back before conda-forge was a thing, I've updated the instructions in pygslodeiv2's README: bjodah/pygslodeiv2@e43faf0

Regarding Windows and MacOS: both are systems which I don't work with regularly, I've tried my best not to exclude the possibility to support these systems, but I would almost be surprised if these things work out-of-the-box. The code-generation, compilation & import of python extension module is inherently coupled to the platform. And it was this I alluded to with the link to that scipy2017codegen repository: there we managed to get that workflow to work on Windows, macOS and Linux.

So if you only want to get some results, I would actually recommend just using a Linux machine (virtual or not). If you want to see this working on macOS and Windows, my guess is that it will take some work, perhaps adding fixes/features to one or more of "my" packages linked in the README.

Back when I wrote pycompilation, meson was not very popular, if I would do this again, I would probably look into using it, at least as a back-end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants