SLACKHA / pyJac

Creates C and CUDA analytical Jacobians for chemical kinetics ODE systems
http://slackha.github.io/pyJac/
MIT License
52 stars 23 forks source link

Pywrap Error #45

Open testcan opened 1 year ago

testcan commented 1 year ago

Hello all,

I am quite new with pyjac, so please apologies stupid questions.
My target is to calculate the jacobian matrix during the time integration and feeding back to my stiff ode solver to speed-up the calculation. Pyjac sounds very interesting to my task so i decided to take a look on the documentation and use it.,

I install pyjac with the conda command conda install -c slackha pyjac under Windows and i started to understand the basic running the first example H2O2 chemistry. Everything run smoothyl creating the out folder with all c and h files. So I assumed the installation was successfull.

The second step was to generate the the python wrapper to import into cantera script with the following command: python -m pyjac.pywrap --source_dir out -l c but i got the following error: "FileNotFoundError: [WinError 2] The system cannot find the file specified". (as C compiler i have instlled 'mingw-w64' with the following command conda install libpython m2w64-toolchain -c msys2

The detailed description of the error is reported in the attacched file. pywrapper_error.txt

Do you know how to fix the issue?

Thanks in advance for any help

cbedick commented 10 months ago

I have had the same issue. You can get a bit further if you adjust some things within the pywrap folder. If you look at the error, it fails within pywrap_gen at subprocess.check_call. I was able to change python_str to just 'python' and it proceeded a bit further. Then, I ran into some filename issues, that I had to adjust within pywrap_setup.py.in (template). The homepath and buildpath strings were not being interpreted correctly. Making them raw strings with an r before each fixed it. But then I hit a wall at the next error. You need MSVC to compile further in windows, which I installed. But then it failed for me with a 'cl.exe exit status 2' type error. I have yet to resolve this. Note that all of these utilities work fine on Linux. Full error log is attached if anyone has thoughts. error.txt

skyreflectedinmirrors commented 7 months ago

I think I tried to get Windows working long ago (https://github.com/SLACKHA/pyJac/issues/32), but never succeeded. If you manage it, a PR would be great!