nest / nestml

A domain specific language for neuron and synapse models in spiking neural network simulation
GNU General Public License v2.0
47 stars 45 forks source link

Unable to compile neuromodulated STDP synapse #833

Closed ewa8 closed 1 year ago

ewa8 commented 2 years ago

Hi, I tried running the following code from the NESTML dopamine-modulated STDP synapse tutorial with my own neuron module (which I have previously tested and can be compiled and installed in NEST):

module_name, neuron_model_name, synapse_model_name = \ generate_code_for("nest_module/snr.nestml", "nest_module/neuromodulated_stdp.nestml", post_ports=["post_spikes"], mod_ports=["mod_spikes"])

and I got the following error:

nestml_180c32c25bde495cbc0827e3b7a400b9_module Configuration Summary

C++ compiler : /usr/bin/clang++ Build static libs : OFF C++ compiler flags : NEST compiler flags : -O2 -std=c++11 -Wall -Xclang -fopenmp -O3 -DNDEBUG ... 14 warnings and 2 errors generated. make[2]: [CMakeFiles/nestml_180c32c25bde495cbc0827e3b7a400b9_module_module.dir/nestml_180c32c25bde495cbc0827e3b7a400b9_module.o] Error 1 make[1]: [CMakeFiles/nestml_180c32c25bde495cbc0827e3b7a400b9_module_module.dir/all] Error 2 make: *** [all] Error 2 Output exceeds the size limit. Open the full output data in a text editor CalledProcessError Traceback (most recent call last) File /opt/homebrew/lib/python3.10/site-packages/pynestml/codegeneration/nest_builder.py:151, in NESTBuilder.build(self) 150 try: --> 151 subprocess.check_call(make_all_cmd, stderr=subprocess.STDOUT, shell=shell, 152 cwd=str(os.path.join(target_path))) 153 except subprocess.CalledProcessError as e:

File /opt/homebrew/Cellar/python@3.10/3.10.2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py:369, in check_call(*popenargs, **kwargs) 368 cmd = popenargs[0] --> 369 raise CalledProcessError(retcode, cmd) 370 return 0

CalledProcessError: Command '['make', 'all']' returned non-zero exit status 2.

During handling of the above exception, another exception occurred:

GeneratedCodeBuildException Traceback (most recent call last) /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/01 - General behaviour.ipynb Cell 7 in <cell line: 3>() 1 # generate and build code 2 module_name, neuron_model_name, synapse_model_name = \ ----> 3 generate_code_for("nest_module/snr.nestml", 4 "nest_module/neuromodulated_stdp.nestml", 5 post_ports=["post_spikes"], 6 mod_ports=["mod_spikes"]) ... --> 154 raise GeneratedCodeBuildException('Error occurred during \'make all\'! More detailed error messages can be found in stdout.') 156 # finally execute make install 157 try:

GeneratedCodeBuildException: Error occurred during 'make all'! More detailed error messages can be found in stdout.

Additionally, I tried running the code with the iaf_psc_delta neuron model just like it is shown in the tutorial to make sure it is not my neuron model throwing the error but I just got this error instead:

Exception Traceback (most recent call last) /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/01 - General behaviour.ipynb Cell 7 in <cell line: 3>() 1 # generate and build code 2 module_name, neuron_model_name, synapse_model_name = \ ----> 3 generate_code_for(iaf_psc_delta, 4 "nest_module/neuromodulated_stdp.nestml", 5 post_ports=["post_spikes"], 6 mod_ports=["mod_spikes"])

/Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/01 - General behaviour.ipynb Cell 7 in generate_code_for(nestml_neuron_model, nestml_synapse_model, post_ports, mod_ports, uniq_id, logging_level) 51 # generate the code for neuron and synapse (co-generated) 52 modulename = "nestml" + uniq_id + "_module" ---> 53 generate_nest_target(input_path=[neuron_uniq_fn, synapse_uniq_fn], 54 logging_level=logging_level, 55 module_name=module_name, 56 suffix="_nestml", 57 codegen_opts={"neuron_parent_class": "StructuralPlasticityNode", 58 "neuron_parent_class_include": "structural_plasticity_node.h", 59 "neuron_synapse_pairs": [{"neuron": neuron_model_name_uniq, 60 "synapse": synapse_model_name_uniq, 61 "post_ports": post_ports, 62 "vt_ports": mod_ports}]}) 63 mangled_neuron_name = neuron_model_name_uniq + "_nestml_with" + synapse_model_name_uniq + "_nestml" 64 mangled_synapse_name = synapse_model_name_uniq + "_nestml_with" + neuron_model_name_uniq + "_nestml" ... --> 432 raise Exception("Neuron name used in pair ("" + neuron_name + "") not found") # XXX: log error 433 return neurons, synapses 434 neuron = neurons[neuron_names.index(neuron_name + FrontendConfiguration.suffix)]

Exception: Neuron name used in pair ( + neuron_name + ) not found

Any idea what it might be caused by or how I could otherwise compile the STDP synapse with my neuron model?

clinssen commented 2 years ago

Hi, thanks for your error report. This is an error we were seeing earlier on MacOS systems, which was caused when a script was calling generate_nest_target() without this call being enclosed in an if __name__ == "__main__" block. But it would be strange if this was also happening from within Jupyter notebooks.

Could you check that you are running the latest version of NESTML (optionally, do a pip install git+https://github.com/nest/nestml --upgrade)?

@pnbabu: could you see if you can replicate this error, as you also have a Mac system?

ewa8 commented 2 years ago

Hi, I upgraded to the latest version but unfortunately the same error persists

clinssen commented 2 years ago

Thanks for testing that. Could I ask you to do the following:

Cheers!

ewa8 commented 2 years ago

Here are the full logs after running it with the DEBUG logging level: [75,GLOBAL, INFO]: Analysing/transforming synapse neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml. [76,neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml, INFO, [1:0;64:0]]: Starts processing of the model 'neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml' [77,neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml, DEBUG, [1:0;64:0]]: Start building symbol table! [78,neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml, INFO, [38:9;38:15]]: Implicit casting from (compatible) type '1 / ms' to 'real'. [79,neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml, INFO, [59:9;59:97]]: Implicit casting from (compatible) type 'ms' to 'real'. [80,neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml, DEBUG, [1:0;64:0]]: Start building symbol table! [81,neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml, INFO, [38:9;38:15]]: Implicit casting from (compatible) type '1 / ms' to 'real'. [82,neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml, INFO, [59:9;59:97]]: Implicit casting from (compatible) type 'ms' to 'real'. [83,GLOBAL, INFO]: Rendering template /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/msn3401d9d2e34444829fe4d884092e3e6b_nestml.cpp [84,GLOBAL, INFO]: Rendering template /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/msn3401d9d2e34444829fe4d884092e3e6b_nestml.h [85,msn3401d9d2e34444829fe4d884092e3e6b_nestml, INFO, [1:0;84:0]]: Successfully generated code for the model: 'msn3401d9d2e34444829fe4d884092e3e6b_nestml' in: '/Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target' ! [86,GLOBAL, INFO]: Rendering template /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/msn3401d9d2e34444829fe4d884092e3e6b_nestml__with_neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestml.cpp [87,GLOBAL, INFO]: Rendering template /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/msn3401d9d2e34444829fe4d884092e3e6b_nestmlwith_neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestml.h [88,msn3401d9d2e34444829fe4d884092e3e6b_nestmlwith_neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestml, INFO, [1:0;84:0]]: Successfully generated code for the model: 'msn3401d9d2e34444829fe4d884092e3e6b_nestmlwith_neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestml' in: '/Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target' ! [89,GLOBAL, INFO]: Rendering template /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml.h [90,neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml, INFO, [1:0;64:0]]: Successfully generated code for the model: 'neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestml__with_msn3401d9d2e34444829fe4d884092e3e6b_nestml' in: '/Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target' ! [91,GLOBAL, INFO]: Rendering template /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/CMakeLists.txt [92,GLOBAL, INFO]: Rendering template /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/nestml_3401d9d2e34444829fe4d884092e3e6b_module.h [93,GLOBAL, INFO]: Rendering template /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/nestml_3401d9d2e34444829fe4d884092e3e6b_module.cpp [94,GLOBAL, INFO]: Rendering template /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/CMakeLists.txt [95,GLOBAL, INFO]: Rendering template /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/nestml_3401d9d2e34444829fe4d884092e3e6b_module.h [96,GLOBAL, INFO]: Rendering template /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/nestml_3401d9d2e34444829fe4d884092e3e6b_module.cpp [97,GLOBAL, INFO]: Rendering template /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/CMakeLists.txt [98,GLOBAL, INFO]: Rendering template /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/nestml_3401d9d2e34444829fe4d884092e3e6b_module.h [99,GLOBAL, INFO]: Rendering template /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/nestml_3401d9d2e34444829fe4d884092e3e6b_module.cpp [100,GLOBAL, INFO]: Rendering template /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/CMakeLists.txt [101,GLOBAL, INFO]: Rendering template /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/nestml_3401d9d2e34444829fe4d884092e3e6b_module.h [102,GLOBAL, INFO]: Rendering template /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/nestml_3401d9d2e34444829fe4d884092e3e6b_module.cpp [103,GLOBAL, INFO]: Rendering template /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/CMakeLists.txt [104,GLOBAL, INFO]: Rendering template /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/nestml_3401d9d2e34444829fe4d884092e3e6b_module.h [105,GLOBAL, INFO]: Rendering template /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/nestml_3401d9d2e34444829fe4d884092e3e6b_module.cpp [106,GLOBAL, INFO]: Rendering template /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/CMakeLists.txt [107,GLOBAL, INFO]: Rendering template /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/nestml_3401d9d2e34444829fe4d884092e3e6b_module.h [108,GLOBAL, INFO]: Rendering template /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/nestml_3401d9d2e34444829fe4d884092e3e6b_module.cpp [109,GLOBAL, INFO]: Rendering template /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/CMakeLists.txt [110,GLOBAL, INFO]: Rendering template /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/nestml_3401d9d2e34444829fe4d884092e3e6b_module.h [111,GLOBAL, INFO]: Rendering template /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/nestml_3401d9d2e34444829fe4d884092e3e6b_module.cpp [112,GLOBAL, INFO]: Rendering template /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/CMakeLists.txt [113,GLOBAL, INFO]: Rendering template /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/nestml_3401d9d2e34444829fe4d884092e3e6b_module.h [114,GLOBAL, INFO]: Rendering template /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/nestml_3401d9d2e34444829fe4d884092e3e6b_module.cpp [115,GLOBAL, INFO]: Rendering template /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/CMakeLists.txt [116,GLOBAL, INFO]: Rendering template /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/nestml_3401d9d2e34444829fe4d884092e3e6b_module.h [117,GLOBAL, INFO]: Rendering template /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/nestml_3401d9d2e34444829fe4d884092e3e6b_module.cpp [118,GLOBAL, INFO]: Successfully generated NEST module code in '/Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target' ! -- The CXX compiler identification is AppleClang 14.0.0.14000029 -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/clang++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done

nestml_3401d9d2e34444829fe4d884092e3e6b_module Configuration Summary

C++ compiler : /usr/bin/clang++ Build static libs : OFF C++ compiler flags : NEST compiler flags : -O2 -std=c++11 -Wall -Xclang -fopenmp -O3 -DNDEBUG NEST include dirs : -I/opt/homebrew/Cellar/nest/3.3_1/include/nest -I/opt/homebrew/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/include NEST libraries flags : -L/opt/homebrew/Cellar/nest/3.3_1/lib/nest -lnestutil -lnest -lsli -lnestkernel -Xclang -fopenmp /opt/homebrew/lib/libltdl.dylib /opt/homebrew/opt/readline/lib/libreadline.dylib /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/lib/libncurses.tbd /opt/homebrew/lib/libgsl.dylib /opt/homebrew/lib/libgslcblas.dylib

You can now build and install 'nestml_3401d9d2e34444829fe4d884092e3e6b_module' using make make install

The library file libnestml_3401d9d2e34444829fe4d884092e3e6b_module.so will be installed to /opt/homebrew/Cellar/nest/3.3_1/lib/nest The module can be loaded into NEST using (nestml_3401d9d2e34444829fe4d884092e3e6b_module) Install (in SLI) nest.Install(nestml_3401d9d2e34444829fe4d884092e3e6b_module) (in PyNEST)

CMake Warning (dev) in CMakeLists.txt: No cmake_minimum_required command is present. A line of code such as

cmake_minimum_required(VERSION 3.22)

should be added at the top of the file. The version specified may be lower if you wish to support older CMake versions for this project. For more information run "cmake --help-policy CMP0000". This warning is for project developers. Use -Wno-dev to suppress it.

-- Configuring done -- Generating done -- Build files have been written to: /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target [ 25%] Building CXX object CMakeFiles/nestml_3401d9d2e34444829fe4d884092e3e6b_module_module.dir/nestml_3401d9d2e34444829fe4d884092e3e6b_module.o In file included from /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/nestml_3401d9d2e34444829fe4d884092e3e6b_module.cpp:47: /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/msn3401d9d2e34444829fe4d884092e3e6b_nestml.h:372:17: warning: 'msn3401d9d2e34444829fe4d884092e3e6b_nestml::get_C_m' hides overloaded virtual function [-Woverloaded-virtual] inline double get_C_m() const ^ /opt/homebrew/Cellar/nest/3.3_1/include/nest/node.h:689:18: note: hidden overloaded virtual function 'nest::Node::get_C_m' declared here: different number of parameters (1 vs 0) virtual double get_C_m( int comp ); ^ In file included from /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/nestml_3401d9d2e34444829fe4d884092e3e6b_module.cpp:49: /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/msn3401d9d2e34444829fe4d884092e3e6b_nestmlwith_neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestml.h:425:17: warning: 'msn3401d9d2e34444829fe4d884092e3e6b_nestmlwith_neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestml::get_C_m' hides overloaded virtual function [-Woverloaded-virtual] inline double get_C_m() const ^ /opt/homebrew/Cellar/nest/3.3_1/include/nest/node.h:689:18: note: hidden overloaded virtual function 'nest::Node::get_C_m' declared here: different number of parameters (1 vs 0) virtual double get_C_m( int comp ); ^ In file included from /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/nestml_3401d9d2e34444829fe4d884092e3e6b_module.cpp:49: /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/msn3401d9d2e34444829fe4d884092e3e6b_nestmlwith_neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestml.h:234:8: warning: 'register_stdp_connection' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] void register_stdp_connection( double t_first_read, double delay ); ^ /opt/homebrew/Cellar/nest/3.3_1/include/nest/node.h:457:16: note: overridden virtual function is here virtual void register_stdp_connection( double, double ); ^ In file included from /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/nestml_3401d9d2e34444829fe4d884092e3e6b_module.cpp:52: /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml.h:580:22: warning: unused variable 'minus_dt' [-Wunused-variable] const double minus_dt = tlastspike - ( start->t_ + dendritic_delay ); ^ /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml.h:603:22: warning: unused variable '_tr_t' [-Wunused-variable] const double _trt = start->t;
^ /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml.h:530:18: warning: unused variable 'resolution' [-Wunused-variable] const double resolution = nest::Time::get_resolution().get_ms(); // do not remove, this is necessary for the resolution() function ^ /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestml__with_msn3401d9d2e34444829fe4d884092e3e6b_nestml.h:720:12: warning: unused variable 'cd' [-Wunused-variable] double cd; ^ /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml.h:871:16: warning: unused variable 'resolution' [-Wunused-variable] const double resolution = nest::Time::get_resolution().get_ms(); // do not remove, this is necessary for the resolution() function ^ /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml.h:886:16: warning: unused variable 'resolution' [-Wunused-variable] const double resolution = nest::Time::get_resolution().get_ms(); // do not remove, this is necessary for the resolution() function ^ /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml.h:1031:18: warning: unused variable '_tr_t' [-Wunused-variable] const double _trt = start->t; ^ /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml.h:1013:10: warning: unused variable 'timestep' [-Wunused-variable] double timestep = 0; ^ /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml.h:859:13: error: too few arguments to function call, single argument 'delay' was not specified set_delay(); /opt/homebrew/Cellar/nest/3.3_1/include/nest/connector_model_impl.h:239:16: note: in instantiation of member function 'nest::neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml::set_status' requested here connection.set_status( p, *this ); ^ /opt/homebrew/Cellar/nest/3.3_1/include/nest/connector_model.h:183:3: note: in instantiation of member function 'nest::GenericConnectorModel<nest::neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml>::add_connection' requested here GenericConnectorModel( const std::string name, ^ /opt/homebrew/Cellar/nest/3.3_1/include/nest/model_manager_impl.h:61:28: note: in instantiation of member function 'nest::GenericConnectorModel<nest::neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml>::GenericConnectorModel' requested here ConnectorModel* cf = new GenericConnectorModel< ConnectionT< TargetIdentifierPtrRport > >( name, ^ /opt/homebrew/Cellar/nest/3.3_1/include/nest/nest_impl.h:35:26: note: in instantiation of function template specialization 'nest::ModelManager::register_connection_model<nest::neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml>' requested here kernel().model_manager.register_connection_model< ConnectorModelT >( name, flags ); ^ /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/nestml_3401d9d2e34444829fe4d884092e3e6b_module.cpp:113:9: note: in instantiation of function template specialization 'nest::register_connection_model' requested here nest::register_connection_model< nest::neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml >( "neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml" ); ^ /opt/homebrew/Cellar/nest/3.3_1/include/nest/connection.h:184:3: note: 'set_delay' declared here set_delay( const double delay ) ^ In file included from /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/nestml_3401d9d2e34444829fe4d884092e3e6b_module.cpp:52: /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml.h:532:10: warning: unused variable 'get_thread' [-Wunused-variable] auto get_thread = [tid]() ^ /opt/homebrew/Cellar/nest/3.3_1/include/nest/connector_base.h:379:18: note: in instantiation of member function 'nest::neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6bnestml::send' requested here C[ lcid ].send( ^ /opt/homebrew/Cellar/nest/3.3_1/include/nest/connector_base.h:223:12: note: in instantiation of member function 'nest::Connector<nest::neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml>::send_to_all' requested here explicit Connector( const synindex syn_id ) ^ /opt/homebrew/Cellar/nest/3.3_1/include/nest/connector_model_impl.h:271:45: note: in instantiation of member function 'nest::Connector<nest::neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml>::Connector' requested here thread_local_connectors[ syn_id ] = new Connector< ConnectionT >( syn_id ); ^ /opt/homebrew/Cellar/nest/3.3_1/include/nest/connector_model_impl.h:252:3: note: in instantiation of member function 'nest::GenericConnectorModel<nest::neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestml__with_msn3401d9d2e34444829fe4d884092e3e6b_nestml>::addconnection' requested here addconnection( src, tgt, thread_local_connectors, syn_id, connection, actual_receptor_type ); ^ /opt/homebrew/Cellar/nest/3.3_1/include/nest/connector_model.h:183:3: note: in instantiation of member function 'nest::GenericConnectorModel<nest::neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml>::add_connection' requested here GenericConnectorModel( const std::string name, ^ /opt/homebrew/Cellar/nest/3.3_1/include/nest/model_manager_impl.h:61:28: note: in instantiation of member function 'nest::GenericConnectorModel<nest::neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml>::GenericConnectorModel' requested here ConnectorModel* cf = new GenericConnectorModel< ConnectionT< TargetIdentifierPtrRport > >( name, ^ /opt/homebrew/Cellar/nest/3.3_1/include/nest/nest_impl.h:35:26: note: in instantiation of function template specialization 'nest::ModelManager::register_connection_model' requested here kernel().model_manager.register_connection_model< ConnectorModelT >( name, flags ); ^ /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/nestml_3401d9d2e34444829fe4d884092e3e6b_module.cpp:113:9: note: in instantiation of function template specialization 'nest::register_connection_model' requested here nest::register_connection_model< nest::neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml >( "neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml" ); ^ In file included from /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/nestml_3401d9d2e34444829fe4d884092e3e6b_module.cpp:52: /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml.h:512:7: warning: expression result unused [-Wunused-value] dynamic_cast<msn3401d9d2e34444829fe4d884092e3e6b_nestmlwith_neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestml&>(t);

/opt/homebrew/Cellar/nest/3.3_1/include/nest/connector_model_impl.h:276:14: note: in instantiation of member function 'nest::neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml::check_connection' requested here connection.check_connection( src, tgt, receptor_type, get_common_properties() ); ^ /opt/homebrew/Cellar/nest/3.3_1/include/nest/connector_model_impl.h:252:3: note: in instantiation of member function 'nest::GenericConnectorModel<nest::neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml>::addconnection' requested here addconnection( src, tgt, thread_local_connectors, syn_id, connection, actual_receptor_type ); ^ /opt/homebrew/Cellar/nest/3.3_1/include/nest/connector_model.h:183:3: note: in instantiation of member function 'nest::GenericConnectorModel<nest::neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml>::add_connection' requested here GenericConnectorModel( const std::string name, ^ /opt/homebrew/Cellar/nest/3.3_1/include/nest/model_manager_impl.h:61:28: note: in instantiation of member function 'nest::GenericConnectorModel<nest::neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml>::GenericConnectorModel' requested here ConnectorModel cf = new GenericConnectorModel< ConnectionT< TargetIdentifierPtrRport > >( name, ^ /opt/homebrew/Cellar/nest/3.3_1/include/nest/nest_impl.h:35:26: note: in instantiation of function template specialization 'nest::ModelManager::register_connection_model' requested here kernel().model_manager.register_connection_model< ConnectorModelT >( name, flags ); ^ /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/nestml_3401d9d2e34444829fe4d884092e3e6b_module.cpp:113:9: note: in instantiation of function template specialization 'nest::register_connection_model' requested here nest::register_connection_model< nest::neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml >( "neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml" ); ^ In file included from /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/nestml_3401d9d2e34444829fe4d884092e3e6b_module.cpp:52: /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml.h:859:13: error: too few arguments to function call, single argument 'delay' was not specified set_delay(); /opt/homebrew/Cellar/nest/3.3_1/include/nest/connector_model_impl.h:239:16: note: in instantiation of member function 'nest::neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml::set_status' requested here connection.set_status( p, this ); ^ /opt/homebrew/Cellar/nest/3.3_1/include/nest/connector_model.h:183:3: note: in instantiation of member function 'nest::GenericConnectorModel<nest::neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml>::add_connection' requested here GenericConnectorModel( const std::string name, ^ /opt/homebrew/Cellar/nest/3.3_1/include/nest/model_manager_impl.h:74:14: note: in instantiation of member function 'nest::GenericConnectorModel<nest::neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml>::GenericConnectorModel' requested here cf = new GenericConnectorModel< ConnectionT< TargetIdentifierIndex > >( name + "_hpc", ^ /opt/homebrew/Cellar/nest/3.3_1/include/nest/nest_impl.h:35:26: note: in instantiation of function template specialization 'nest::ModelManager::register_connection_model' requested here kernel().model_manager.register_connection_model< ConnectorModelT >( name, flags ); ^ /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/nestml_3401d9d2e34444829fe4d884092e3e6b_module.cpp:113:9: note: in instantiation of function template specialization 'nest::register_connection_model' requested here nest::register_connection_model< nest::neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml >( "neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml" ); ^ /opt/homebrew/Cellar/nest/3.3_1/include/nest/connection.h:184:3: note: 'set_delay' declared here set_delay( const double delay ) ^ In file included from /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/nestml_3401d9d2e34444829fe4d884092e3e6b_module.cpp:52: /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml.h:532:10: warning: unused variable 'get_thread' [-Wunused-variable] auto get_thread = [tid]() ^ /opt/homebrew/Cellar/nest/3.3_1/include/nest/connector_base.h:379:18: note: in instantiation of member function 'nest::neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6bnestml::send' requested here C[ lcid ].send( ^ /opt/homebrew/Cellar/nest/3.3_1/include/nest/connector_base.h:223:12: note: in instantiation of member function 'nest::Connector<nest::neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml>::send_to_all' requested here explicit Connector( const synindex syn_id ) ^ /opt/homebrew/Cellar/nest/3.3_1/include/nest/connector_model_impl.h:271:45: note: in instantiation of member function 'nest::Connector<nest::neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml>::Connector' requested here thread_local_connectors[ syn_id ] = new Connector< ConnectionT >( syn_id ); ^ /opt/homebrew/Cellar/nest/3.3_1/include/nest/connector_model_impl.h:252:3: note: in instantiation of member function 'nest::GenericConnectorModel<nest::neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml>::addconnection' requested here addconnection( src, tgt, thread_local_connectors, syn_id, connection, actual_receptor_type ); ^ /opt/homebrew/Cellar/nest/3.3_1/include/nest/connector_model.h:183:3: note: in instantiation of member function 'nest::GenericConnectorModel<nest::neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml>::add_connection' requested here GenericConnectorModel( const std::string name, ^ /opt/homebrew/Cellar/nest/3.3_1/include/nest/model_manager_impl.h:74:14: note: in instantiation of member function 'nest::GenericConnectorModel<nest::neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml>::GenericConnectorModel' requested here cf = new GenericConnectorModel< ConnectionT< TargetIdentifierIndex > >( name + "_hpc", ^ /opt/homebrew/Cellar/nest/3.3_1/include/nest/nest_impl.h:35:26: note: in instantiation of function template specialization 'nest::ModelManager::register_connection_model<nest::neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml>' requested here kernel().model_manager.register_connection_model< ConnectorModelT >( name, flags ); ^ /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/nestml_3401d9d2e34444829fe4d884092e3e6b_module.cpp:113:9: note: in instantiation of function template specialization 'nest::register_connection_model' requested here nest::register_connection_model< nest::neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml >( "neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml" ); ^ In file included from /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/nestml_3401d9d2e34444829fe4d884092e3e6b_module.cpp:52: /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml.h:512:7: warning: expression result unused [-Wunused-value] dynamic_cast<msn3401d9d2e34444829fe4d884092e3e6b_nestmlwith_neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestml&>(t);

/opt/homebrew/Cellar/nest/3.3_1/include/nest/connector_model_impl.h:276:14: note: in instantiation of member function 'nest::neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml::check_connection' requested here connection.check_connection( src, tgt, receptor_type, get_common_properties() ); ^ /opt/homebrew/Cellar/nest/3.3_1/include/nest/connector_model_impl.h:252:3: note: in instantiation of member function 'nest::GenericConnectorModel<nest::neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml>::addconnection' requested here addconnection( src, tgt, thread_local_connectors, syn_id, connection, actual_receptor_type ); ^ /opt/homebrew/Cellar/nest/3.3_1/include/nest/connector_model.h:183:3: note: in instantiation of member function 'nest::GenericConnectorModel<nest::neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml>::add_connection' requested here GenericConnectorModel( const std::string name, ^ /opt/homebrew/Cellar/nest/3.3_1/include/nest/model_manager_impl.h:74:14: note: in instantiation of member function 'nest::GenericConnectorModel<nest::neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml>::GenericConnectorModel' requested here cf = new GenericConnectorModel< ConnectionT< TargetIdentifierIndex > >( name + "_hpc", ^ /opt/homebrew/Cellar/nest/3.3_1/include/nest/nest_impl.h:35:26: note: in instantiation of function template specialization 'nest::ModelManager::register_connection_model' requested here kernel().model_manager.register_connection_model< ConnectorModelT >( name, flags ); ^ /Users/ewarusiecka/Documents/University/DTU/Special_course/MSN/target/nestml_3401d9d2e34444829fe4d884092e3e6b_module.cpp:113:9: note: in instantiation of function template specialization 'nest::register_connection_model' requested here nest::register_connection_model< nest::neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml >( "neuromodulated_stdp3401d9d2e34444829fe4d884092e3e6b_nestmlwith_msn3401d9d2e34444829fe4d884092e3e6b_nestml" ); ^ 15 warnings and 2 errors generated. make[2]: [CMakeFiles/nestml_3401d9d2e34444829fe4d884092e3e6b_module_module.dir/nestml_3401d9d2e34444829fe4d884092e3e6b_module.o] Error 1 make[1]: [CMakeFiles/nestml_3401d9d2e34444829fe4d884092e3e6b_module_module.dir/all] Error 2 make: *** [all] Error 2

And here's the neuron model:

neuron msn:
  state:
    V_m mV = -65.0 mV
    U_m real = 0.0
    I pA = 0.0 pA # input current
    dop real = 0.0
  end
  equations:
    kernel kernel_ampa = exp(-t/tau_decay_AMPA)
    kernel kernel_nmda = exp(-t/tau_decay_NMDA)
    kernel kernel_gaba = exp(-t/tau_decay_GABA_A)

    inline I_syn_ampa pA = convolve(kernel_ampa, spikes_ampa)
    inline I_syn_nmda pA = convolve(kernel_nmda, spikes_nmda)
    inline I_syn_gaba pA = convolve(kernel_gaba, spikes_gaba)

    inline ampa pA = I_syn_ampa * (E_rev_AMPA - V_m)
    inline nmda pA = I_syn_nmda * (E_rev_NMDA - V_m)
    inline I_gaba pA = I_syn_gaba * (E_rev_GABA_A - V_m)

    inline I_nmda pA = nmda * (1.0 + alpha_1*y1)
    inline I_ampa pA = ampa * (1.0 - alpha_2*y2)
    inline B real = 1.0/(1.0+(0.28)*exp(-0.062*V_m))

    inline I_syn pA = I_ampa + B*I_nmda + I_gaba
    inline v_r mV = vp * (1.0 + c_1 * y1)
    inline k real = Kplus * (1.0 - alpha * y2)

    V_m' = (k * (V_m - v_r) * (V_m - V_T)/mV - U_m*mV + ((I + I_e + I_syn)* GOhm))/ (C_m*(ms/pF))
    U_m' = a * (b * (V_m - v_r) - U_m*mV)/(mV * ms)
  end

  parameters:
    a real = 0.03
    b real = -2.0
    c mV = -50 mV
    d real = 100
    I_e pA = 0pA # constant external input current
    V_th mV = 35mV #V peak
    V_min mV = -inf * mV
    Kplus real = 0.7
    vp mV = -60.0 mV #resting potential
    V_T mV = -40.0 mV #threshold potential
    C_m pF = 100.0 pF # membrane capacitance
    c_1 real = 0.0289 # K
    c_2 real = 0.331 # L
    y1 real = 0.3 # active D1 receptors
    y2 real = 0.3 # active D2 receptors
    alpha_1 real = 0.5 # synaptic dopamine
    alpha_2 real = 0.5 # synaptic dopamine
    alpha real = 0.032
    tau_decay_AMPA ms = 2.0 ms
    tau_decay_GABA_A ms = 2.0 ms
    tau_decay_NMDA ms = 2.0 ms
    E_rev_AMPA real = 0.0
    E_rev_GABA_A real = 0.0
    E_rev_NMDA real = 0.0

  end
  input:
    spikes_ampa mV <-spike
    spikes_nmda mV <-spike
    spikes_gaba mV <-spike
    I_stim pA <-continuous
  end

  output: spike

  update:
    integrate_odes()
    # Add synaptic current

    # lower bound of membrane potential
    V_m = (V_m < V_min)?V_min:V_m

    # threshold crossing
    if V_m >= 30mV:
      dop = d * (1.0 - c_2 * y1)
      V_m = c
      U_m += dop
      emit_spike()
    end
  end
end
clinssen commented 1 year ago

@ewa8: thanks for the detailed report! The error is buried pretty deep in there. The issue that for NEST Simulator, each synapse model needs to have one particular parameter that specifies the synaptic delay and is decorated with the string @nest::delay. This is right now missing from your model, it should work if you add that. (Please see the existing synapse models in models/synapses/*.nestml for examples).

To give a more friendly error message in the future, I have created #837.