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

Unable to compile extension modules #31

Open
rbonometto opened this issue Oct 23, 2024 · 2 comments
Open

Unable to compile extension modules #31

rbonometto opened this issue Oct 23, 2024 · 2 comments

Comments

@rbonometto
Copy link

I am trying to compile an extension module of a custom neuron model for NEST 3.7.
Everything seems to run smoothly during cmake, make and make install and the .so file is correctly created in the $NEST_INSTALL_DIR/lib/nest folder.
However, when trying to install the module in Python script I get the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/alphabuntu/workspace/simulation/dependencies/nest-install/lib/python3.10/site-packages/nest/ll_api.py", line 216, in stack_checker_func
    return f(*args, **kwargs)
  File "/home/alphabuntu/workspace/simulation/dependencies/nest-install/lib/python3.10/site-packages/nest/lib/hl_api_simulation.py", line 331, in Install
    return sr("(%s) Install" % module_name)
  File "/home/alphabuntu/workspace/simulation/dependencies/nest-install/lib/python3.10/site-packages/nest/ll_api.py", line 98, in catching_sli_run
    message = sli_pop()
  File "pynestkernel.pyx", line 240, in pynestkernel.NESTEngine.pop
  File "pynestkernel.pyx", line 511, in pynestkernel.sli_datum_to_object
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd0 in position 91: invalid continuation byte

This happens both with my .cpp and .h files, but also with models that I download from the NEST repository.

@heplesser
Copy link
Contributor

Hi @rbonometto, if I understand you correctly, you can compile an extension module, but you run into problems loading it, right?

From the error message it seems to me that the NEST kernel returns an (error) message that is not a well-formed UTF-8 string. One reason for this could be a special character in a path name on an OS that is not using UTF-8. In ISO 8859-1 the problematic 0xd0 would be Ð.

Instead of running NEST via Python, could you start NEST directly with <path_to_nest_install>/bin/nest and then in NEST do

(mymodule) Install

replacing mymodule with the name of your module, i.e., the same string you pass to nest.Install('mymodule'). NEST should then print the message directly into your terminal window. Could you paste this here?

@clinssen
Copy link
Contributor

I think I have seen this error before. Could it be that you have more than one NEST version installed in different locations, and the linking and loading are happening with respect to different versions?

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

3 participants