neurophysik / jitcdde

Just-in-time compilation for delay differential equations
Other
56 stars 14 forks source link

Problem trying the first example in mac os x #10

Closed ajalvarez closed 6 years ago

ajalvarez commented 6 years ago

I copy and paste the error/warning:

Generating, compiling, and loading C code.
/Users/alejandro/.local/lib/python3.6/site-packages/jitcxde_common/_jitcxde.py:191: UserWarning: Traceback (most recent call last):
  File "/Users/alejandro/.local/lib/python3.6/site-packages/jitcxde_common/_jitcxde.py", line 189, in _attempt_compilation
    self.compile_C()
  File "/Users/alejandro/.local/lib/python3.6/site-packages/jitcdde/_jitcdde.py", line 515, in compile_C
    chunk_size = chunk_size, # only for OMP
  File "/Users/alejandro/.local/lib/python3.6/site-packages/jitcxde_common/_jitcxde.py", line 142, in _render_template
    codefile.write(template.render(kwargs))
UnicodeEncodeError: ascii codec can't encode character '\u201c' in position 2338: ordinal not in range(128)

  warn(format_exc())
/Users/alejandro/.local/lib/python3.6/site-packages/jitcxde_common/_jitcxde.py:193: UserWarning: 
============================================================
READ ME FIRST
============================================================
Generating compiled integrator failed; resorting to lambdified functions. If you can live with using the Python backend, you can call generate_lambdas to explicitly do this and bypass the compile attempt and error messages. Otherwise, you want to take care of fixing the above errors.
============================================================

============================================================

  warn(line + "READ ME FIRST" + line + "Generating compiled integrator failed; resorting to lambdified functions. If you can live with using the Python backend, you can call generate_lambdas to explicitly do this and bypass the compile attempt and error messages. Otherwise, you want to take care of fixing the above errors." + 2*line)

I suppose that I need to install an specific version/distribution of C.

Wrzlprmft commented 6 years ago

UnicodeEncodeError: ascii codec can't encode character '\u201c' in position 2338: ordinal not in range(128)

Interestingly, it seems to be a problem with Jinja. Can you remove line 128 from jitced_template.c and see whether this problem persists?

Wrzlprmft commented 6 years ago

Can you also please tell me your Jinja version (import jinja2; print(jinja2.__version__)? I guess that you might have fallen victim to this issue.

ajalvarez commented 6 years ago

Hello,

First of all, your software is wonderful. Thank you !. Anything I could contribute would be delighted.

My Jinja2 is version 2.9.6

I will review the link that you recommend to me.

Thanks again,

import jinja2

jinja2.version

'2.9.6'

A. J. Alvarez-Socorro PhD Student at University of Chile Faculty of Physical and Mathematical Sciences - Department of Physics

2018-03-10 16:16 GMT+01:00 Gerrit Ansmann notifications@github.com:

Can you also please tell me your Jinja version (import jinja2; print(jinja2.version)? I guess that you might have fallen victim to this issue https://github.com/pallets/jinja/issues/309?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/neurophysik/jitcdde/issues/10#issuecomment-372037334, or mute the thread https://github.com/notifications/unsubscribe-auth/AGTbK0JEJhQusOEaPAzWGCi11FypHtzXks5tc-5LgaJpZM4SklWG .

Wrzlprmft commented 6 years ago

Okay, so your Jinja2 version is probably not the issue. You could still try updating to 2.10 to see whether it happens to solve the problem.

Did you try removing the offending line (line 128 from jitced_template.c)? It is just a comment; so it does not affect functionality, but it does contain Unicode characters.

Wrzlprmft commented 6 years ago

In yesterday’s release, I removed the offending Unicode characters. Now whoever reads that comment has to live with puny ASCII quotation marks and apostrophes, but your problem should be solved.

Can you please update and check?

ajalvarez commented 6 years ago

Yes, I will update the library in few seconds :-)

Thanks for all.

A. J. Alvarez-Socorro PhD Student at University of Chile Faculty of Physical and Mathematical Sciences - Department of Physics

2018-03-14 7:54 GMT+01:00 Gerrit Ansmann notifications@github.com:

In yesterday’s release, I removed the offending Unicode characters. Now whoever reads that comment has to live with puny ASCII quotation marks and apostrophes, but your problem should be solved.

Can you please update and check?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/neurophysik/jitcdde/issues/10#issuecomment-372922391, or mute the thread https://github.com/notifications/unsubscribe-auth/AGTbK7Lu025aQ05dVbTA-s5V-iIL6OHJks5teL6UgaJpZM4SklWG .

Wrzlprmft commented 6 years ago

@ajalvarez Are your problems solved now?

ajalvarez commented 6 years ago

Yes, thanks.