Skip to content
Snippets Groups Projects
Commit 1dedccb8 authored by Giovanni Bussi's avatar Giovanni Bussi
Browse files

Allow space in build directory

Now plumed should work if built on a directory which has a space in the path.
Notice that install directory should still not contain spaces.
This is because of some difficulties in making the
src/lib/Makefile rules compatible with names with spaces.

Addresses #157
parent 43a266dd
No related branches found
No related tags found
No related merge requests found
...@@ -259,7 +259,7 @@ case "$action" in ...@@ -259,7 +259,7 @@ case "$action" in
fi fi
echo "" echo ""
if grep -q "D__PLUMED_MPI=1" $PLUMED_ROOT/src/config/compile_options.sh ; then if grep -q "D__PLUMED_MPI=1" "$PLUMED_ROOT"/src/config/compile_options.sh ; then
echo "PLUMED is compiled with MPI support so you can configure $engine with MPI" echo "PLUMED is compiled with MPI support so you can configure $engine with MPI"
else else
echo "PLUMED is compiled WITHOUT MPI support so you CANNOT configure $engine with MPI" echo "PLUMED is compiled WITHOUT MPI support so you CANNOT configure $engine with MPI"
......
#! /bin/bash #! /bin/bash
source $PLUMED_ROOT/src/config/compile_options.sh source "$PLUMED_ROOT"/src/config/compile_options.sh
if [ "$1" = --description ] ; then if [ "$1" = --description ] ; then
echo "compile a .cpp file into a shared library" echo "compile a .cpp file into a shared library"
......
...@@ -17,5 +17,5 @@ directive=$1 ...@@ -17,5 +17,5 @@ directive=$1
classname=$2 classname=$2
sed "s/TEMPLATE/$directive/g sed "s/TEMPLATE/$directive/g
s/Template/$classname/g" $PLUMED_ROOT/src/colvar/Template.cpp > ${classname}.cpp s/Template/$classname/g" "$PLUMED_ROOT"/src/colvar/Template.cpp > ${classname}.cpp
#! /bin/bash #! /bin/bash
${PLUMED_ROOT}/patches/patch.sh "$@" "${PLUMED_ROOT}"/patches/patch.sh "$@"
...@@ -51,7 +51,7 @@ Makefile.conf.xxd: ../../Makefile.conf ...@@ -51,7 +51,7 @@ Makefile.conf.xxd: ../../Makefile.conf
# file to import compilation options inside a bash script # file to import compilation options inside a bash script
compile_options.sh: compile_options.sh:
@echo Building compile_options.sh, a sourceable bash script with some compilation options @echo Building compile_options.sh, a sourceable bash script with some compilation options
@echo "compile='"$(CXX) -c -I'$$PLUMED_ROOT'/src $(CPPFLAGS) $(CXXFLAGS) -o"'" > $@ @echo "compile='"$(CXX) -c -I'"$$PLUMED_ROOT"'/src $(CPPFLAGS) $(CXXFLAGS) -o"'" > $@
@echo "link='"$(LDSO) -o"'" >> $@ @echo "link='"$(LDSO) -o"'" >> $@
@echo "soext='"$(SOEXT)"'" >> $@ @echo "soext='"$(SOEXT)"'" >> $@
......
...@@ -210,7 +210,7 @@ int CLToolMain::run(int argc, char **argv,FILE*in,FILE*out,Communicator& pc){ ...@@ -210,7 +210,7 @@ int CLToolMain::run(int argc, char **argv,FILE*in,FILE*out,Communicator& pc){
fprintf(out," plumed %s\n", manual.c_str()); fprintf(out," plumed %s\n", manual.c_str());
} }
for(unsigned j=0;j<availableShell.size();++j){ for(unsigned j=0;j<availableShell.size();++j){
string cmd="env PLUMED_ROOT="+root+" "+root+"/scripts/"+availableShell[j]+".sh --description"; string cmd="env PLUMED_ROOT=\""+root+"\" \""+root+"/scripts/"+availableShell[j]+".sh\" --description";
FILE *fp=popen(cmd.c_str(),"r"); FILE *fp=popen(cmd.c_str(),"r");
string line,manual; string line,manual;
while(Tools::getline(fp,line))manual+=line; while(Tools::getline(fp,line))manual+=line;
...@@ -241,7 +241,7 @@ int CLToolMain::run(int argc, char **argv,FILE*in,FILE*out,Communicator& pc){ ...@@ -241,7 +241,7 @@ int CLToolMain::run(int argc, char **argv,FILE*in,FILE*out,Communicator& pc){
if(find(availableShell.begin(),availableShell.end(),command)!=availableShell.end()){ if(find(availableShell.begin(),availableShell.end(),command)!=availableShell.end()){
plumed_massert(in==stdin,"shell tools can only work on stdin"); plumed_massert(in==stdin,"shell tools can only work on stdin");
plumed_massert(out==stdout,"shell tools can only work on stdin"); plumed_massert(out==stdout,"shell tools can only work on stdin");
string cmd="env PLUMED_ROOT="+root+" "+root+"/scripts/"+command+".sh"; string cmd="env PLUMED_ROOT=\""+root+"\" \""+root+"/scripts/"+command+".sh\"";
for(int j=i+1;j<argc;j++) cmd+=string(" ")+argv[j]; for(int j=i+1;j<argc;j++) cmd+=string(" ")+argv[j];
system(cmd.c_str()); system(cmd.c_str());
return 0; return 0;
......
...@@ -206,7 +206,7 @@ $(PLUMED_MAIN_STATIC): $(OBJ_MAIN) $(OBJ_KERNEL) $(OBJ_WRAPPER) ...@@ -206,7 +206,7 @@ $(PLUMED_MAIN_STATIC): $(OBJ_MAIN) $(OBJ_KERNEL) $(OBJ_WRAPPER)
$(LD) $(LDFLAGS) $^ -o $@ $(LIBS) $(DYNAMIC_LIBS) $(LD) $(LDFLAGS) $^ -o $@ $(LIBS) $(DYNAMIC_LIBS)
$(PLUMED_MAIN_SHARED): $(OBJ_MAIN) $(PLUMED_SHARED_OBJ) $(PLUMED_MAIN_SHARED): $(OBJ_MAIN) $(PLUMED_SHARED_OBJ)
$(LD) $(LDFLAGS) $(OBJ_MAIN) $(realpath $(PLUMED_SHARED_OBJ)) -o $@ $(LIBS) $(LD) $(LDFLAGS) $(OBJ_MAIN) "$(realpath $(PLUMED_SHARED_OBJ))" -o $@ $(LIBS)
$(PLUMED_MAIN_RUNTIME): $(OBJ_MAIN) $(OBJ_DYNAMIC_WRAPPER) $(PLUMED_MAIN_RUNTIME): $(OBJ_MAIN) $(OBJ_DYNAMIC_WRAPPER)
$(LD) $(LDFLAGS) $^ -o $@ $(LIBS) $(LD) $(LDFLAGS) $^ -o $@ $(LIBS)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment