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

Model broke NEURON CI #1

Open
JCGoran opened this issue Jul 16, 2024 · 0 comments
Open

Model broke NEURON CI #1

JCGoran opened this issue Jul 16, 2024 · 0 comments

Comments

@JCGoran
Copy link

JCGoran commented Jul 16, 2024

The model is failing in the CI with:

%model_dir%/arm64/wrap.cpp:244:5: error: no matching function for call to 'install_vector_method'
    install_vector_method(\"WrapAround\",WrapAround);
    ^~~~~~~~~~~~~~~~~~~~~
/include/oc_ansi.h:98:6: note: candidate function not viable: no known conversion from 'void (void *)' to 'double (*)(void *)' for 2nd argument
void install_vector_method(const char*, double (*)(void*));
     ^
1 error generated.

Looking at the NEURON docs, I managed to fix this by using the following diff:

diff --git a/mod/wrap.mod b/mod/wrap.mod
index ff25070..21f1e6f 100755
--- a/mod/wrap.mod
+++ b/mod/wrap.mod
@@ -26,18 +26,19 @@ double* Wrap(double* x,int n,int flen){
   return y;
 }
 
-void WrapAround(void* vv) {
+double WrapAround(void* vv) {
   double* x,*y;
   int vsz,fsz,i;
   vsz = vector_instance_px(vv,&x);
   fsz = (int) *getarg(1);
   if(fsz > vsz) {
     printf("WrapAround ERRA: invalid filter len %d > vector len %d!\n",fsz,vsz);
-    return;
+    return -1;
   }
   y = Wrap(x,vsz,fsz);
   for(i=0;i<vsz;i++) x[i]=y[i];
   free(y);
+  return 0;
 }
 
 ENDVERBATIM

Unfortunately, this isn't the only fix needed, as then we get:

-> \u001b[32mCompiling\u001b[0m %model_dir%/arm64/DynamicNetStim.cpp
%model_dir%/arm64/DynamicNetStim.cpp:416:7: error: functions that differ only in their return type cannot be overloaded
void* nrn_random_arg(int argpos);
~~~~~ ^
/include/nrnrandom.h:6:7: note: previous declaration is here
Rand* nrn_random_arg(int);
~~~~~ ^
%model_dir%/arm64/DynamicNetStim.cpp:428:13: warning: 'nrn_random_pick' is deprecated: non-void* overloads are preferred [-Wdeprecated-declarations]
                _lerand = nrn_random_pick(_p_donotuse);
                          ^
/include/nrnrandom.h:19:3: note: 'nrn_random_pick' has been explicitly marked deprecated here
[[deprecated(\"non-void* overloads are preferred\")]] double nrn_random_pick(void* r);
  ^
1 warning and 1 error generated

I think the DynamicNetStim mod file needs some additional fixes for random number generation as described here.

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

1 participant