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

Use symbolic links in /tmp to fix "path name spaces problem" #444

Merged
merged 2 commits into from
Jul 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions bin/genn-buildmodel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,20 @@ done
if [[ -z "$MODEL" ]]; then
genn_error $LINENO 2 "no model file given"
fi
pushd $OUT_PATH > /dev/null
OUT_PATH="$PWD"

# Use pushd to get an absolute path and symbolic links in /tmp to avoid problems
# with spaces in the path names
pushd "$OUT_PATH" > /dev/null
OUT_PATH=$(mktemp -u /tmp/genn.XXXXXXXX)
ln -s "$PWD" $OUT_PATH
popd > /dev/null
pushd $(dirname $MODEL) > /dev/null
MACROS="MODEL=$PWD/$(basename $MODEL) GENERATOR_PATH=$OUT_PATH BUILD_MODEL_INCLUDE=$BUILD_MODEL_INCLUDE CXX_STANDARD=$CXX_STANDARD"
MODEL_PATH=$(mktemp -u /tmp/genn.XXXXXXXX)
ln -s "$PWD" $MODEL_PATH
MACROS="MODEL=$MODEL_PATH/$(basename $MODEL) GENERATOR_PATH=$OUT_PATH BUILD_MODEL_INCLUDE=$BUILD_MODEL_INCLUDE CXX_STANDARD=$CXX_STANDARD"
GENERATOR=./generator
popd > /dev/null

if [[ -n "$DEBUG" ]]; then
MACROS="$MACROS DEBUG=1";
GENERATOR="$GENERATOR"_debug
Expand Down Expand Up @@ -91,4 +98,8 @@ else
"$GENERATOR" "$BASEDIR/../" "$OUT_PATH" "$FORCE_REBUILD"
fi

# Remove the symbolic links in tmp to clean up
rm $OUT_PATH
rm $MODEL_PATH

echo "model build complete"