Page 1 of 1

Compile models from hoc code.. need an updated hack

Posted: Fri Sep 28, 2018 1:15 pm
by rcalinjageman
I am looking for an updated way to compile model files from within hoc code.

Why? I distribute a simulation that uses custom model files to students in one of my neuroscience courses. I want them to be able to download and unzip the files, then run a single hoc file without having to learn how to compile models for themselves. Students are working on their home machines, so I can't compile them for them.

Long ago I came across this hack, but it is not working on modern versions of neuron:

Code: Select all

      load_file("stdlib.hoc")
      s = new String()
      sprint(s.s, "sh mkdll.sh %s \"%s\" %d", $s1, $s2, unix_mac_pc())
      system(s.s, s.s)
Defining a string has changed, and it looks like aspects of the system call have changed, as even defining the string properly gives an error in the sprint line.

I wasn't easily able to find another way to do this, so I thought I'd ping the forum. Any help would be greatly appreciated.

Cheers,

Bob

Re: Compile models from hoc code.. need an updated hack

Posted: Tue Oct 02, 2018 2:48 pm
by hines
you are missing a declaration of s
objref s