genn-team / genn

GeNN is a GPU-enhanced Neuronal Network simulation environment based on code generation for Nvidia CUDA.
http://genn-team.github.io/
GNU Lesser General Public License v2.1
231 stars 57 forks source link

genn-buildmodel.sh appears to fail when spaces in file path #424

Closed tnowotny closed 3 years ago

tnowotny commented 3 years ago

It appears that genn-buildmodel.sh fails when the model source is in a location with a path name that contains spaces.

neworderofjamie commented 3 years ago

What platform's this on?

tnowotny commented 3 years ago

macbook pro

tnowotny commented 3 years ago
m900050:neurotechTutorial tn41$ genn-buildmodel.sh LIFRing
/Users/tn41/localdisk_projects/develop/genn/bin/genn-buildmodel.sh: line 52: pushd: /Users/tn41/Box: No such file or directory
genn-buildmodel.sh:52: error 50: command failure

where the working directory is

/Users/tn41/Box Sync/workshops/2021/06-Neurotech/demo/neurotechTutorial
tnowotny commented 3 years ago

the error occurs here https://github.com/genn-team/genn/blob/7cd8c549f45a6c6a3840e6aaa51c8ae6e849c20d/bin/genn-buildmodel.sh#L52 but to be honest I am not sure what this pushd / popd logic is trying to achieve to begin with? git blame says it was introduced by you, @jamesturner246, 5 years ago?

neworderofjamie commented 3 years ago

This seems to be the result of several different escaping issues:

  1. In genn-buildmodel.sh, some quotes are required (namely for that pushd)
  2. GNU make itself has very limited support for spaces in filenames (https://www.cmcrossroads.com/article/gnu-make-meets-file-names-spaces-them) and somewhere between bash and make OUT_PATH gets totally mangled. Escaping with \\ (which can be done in bash on Linux and Mac with something like ${OUT_PATH// /\\ }) as suggested by https://www.cmcrossroads.com/article/gnu-make-meets-file-names-spaces-them) might help

However, my quick attempts at fixing 1 and 2 have not succeeded.