SpineML / SpineML_2_BRAHMS

Code generation scripts to run a SpineML neural model using BRAHMS on standard CPUs
http://spineml.github.io/simulators/BRAHMS/
4 stars 3 forks source link

MODEL_DIR_XSL_FRIENDLY path breaks on OSX for WU components #14

Closed ajc158 closed 10 years ago

ajc158 commented 10 years ago

The changes to the path lead to incorrect characters being used instead of / on OSX, resulting in an inability to read binary connection files. Fix is to pass MODEL_DIR instead - but this might be undesirable?

sebjameswml commented 10 years ago

Yes; undesirable. The main reason for passing MODEL_DIR_XSL_FRIENDLY is so that if the MODEL_DIR contains spaces, these are correctly percent-encoded as %20 and continue to work correctly. It seems that the '/' being percent-encoded is upsetting OSX somehow? I'll try this out on my Mac.

sebjameswml commented 10 years ago

Hmm. I first found this necessary for OUTPUT_DIR, which is passed to the document() function in the xsl script. Passing a space into the document() function caused a problem.

Looking at the script, it may be that we CAN pass a space in where MODEL_DIR is used; the model dir is not passed to the document function.

sebjameswml commented 10 years ago

See line 14 of SpineML_2_BRAHMS_CL_neurons.xsl for the use of document() to process the output dir.

ajc158 commented 10 years ago

The problem is that when writing the component.cpp file XSLT is just pasting the XML safe version wholesale into the code, % values and all - and C++ doesn't know what to do with these. The lack of the replace function in XSLT 1.0 makes fixing this difficult, although it could be done using string handling in C++...

sebjameswml commented 10 years ago

Commit 7f081a4 in master changes this behaviour. I'll review all the uses of output dir, too.

sebjameswml commented 10 years ago

Confirmed that percent encoding is required in all cases where the output dir is passed to xsl.