git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@9911 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
127
src/Depend.sh
127
src/Depend.sh
@ -1,54 +1,101 @@
|
|||||||
# Depend.sh = Install/unInstall files for dependent packages
|
# Depend.sh = Install/unInstall files for dependent packages
|
||||||
# all packages which contain one or more files that depend on
|
|
||||||
# other packages should be listed here, in both the 1 and 0 clauses
|
# parent package = has files that files in another package derive from
|
||||||
# this script is invoked after any parent package is installed/uninstalled
|
# child package = has files that derive from files in another package
|
||||||
|
# all parent/child package dependencies should be listed below
|
||||||
|
|
||||||
|
# this script is invoked after any package is installed/uninstalled
|
||||||
# this script re-installs child packages that depend on the parent,
|
# this script re-installs child packages that depend on the parent,
|
||||||
# but only if the child package is already installed
|
# but only if the child package is already installed
|
||||||
# this is necessary to insure the child package installs
|
# this is necessary to insure the child package installs
|
||||||
# only child files whose parent package files are now installed
|
# only child files whose parent package files are now installed
|
||||||
# decisions on installing individual child files are made by
|
# decisions on (un)installing individual child files are made by
|
||||||
# the Install.sh script in the child package
|
# the Install.sh script in the child package
|
||||||
|
|
||||||
if (test $1 = 1) then
|
# depend function: args = child-package 0/1
|
||||||
|
# checks if child-package is installed, if not just return
|
||||||
|
# if parent package is being installed, reinstall the child
|
||||||
|
# if parent package is being uninstalled, uninstall the child, reinstall it
|
||||||
|
|
||||||
if (test -e pair_lj_cut_gpu.h) then
|
depend () {
|
||||||
cd GPU; /bin/sh Install.sh 1; cd ..
|
cd $1
|
||||||
|
installed=0
|
||||||
|
for file in *.cpp *.h; do
|
||||||
|
if (test -e ../$file) then
|
||||||
|
installed=1
|
||||||
fi
|
fi
|
||||||
if (test -e pair_lj_cut_opt.h) then
|
done
|
||||||
cd OPT; /bin/sh Install.sh 1; cd ..
|
cd ..
|
||||||
|
if (test $installed = 0) then
|
||||||
|
return
|
||||||
fi
|
fi
|
||||||
if (test -e cg_cmm_params.h) then
|
|
||||||
cd USER-CG-CMM; /bin/sh Install.sh 1; cd ..
|
|
||||||
fi
|
|
||||||
if (test -e pair_lj_cut_cuda.h) then
|
|
||||||
cd USER-CUDA; /bin/sh Install.sh 1; cd ..
|
|
||||||
fi
|
|
||||||
if (test -e fix_imd.h) then
|
|
||||||
cd USER-MISC; /bin/sh Install.sh 1; cd ..
|
|
||||||
fi
|
|
||||||
# if (test -e thr_omp.h) then
|
|
||||||
# cd USER-OMP; /bin/sh Install.sh 1; cd ..
|
|
||||||
# fi
|
|
||||||
|
|
||||||
elif (test $1 = 0) then
|
if (test $2 = 1) then
|
||||||
|
echo " reinstalling package $1"
|
||||||
|
cd $1; /bin/sh Install.sh 1; cd ..
|
||||||
|
elif (test $2 = 0) then
|
||||||
|
echo " un/reinstalling package $1"
|
||||||
|
cd $1; /bin/sh Install.sh 0; /bin/sh Install.sh 1; cd ..
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
if (test -e pair_lj_cut_gpu.h) then
|
# add one if statement per parent package
|
||||||
cd GPU; /bin/sh Install.sh 0; /bin/sh Install.sh 1; cd ..
|
# add one depend() call per child package that depends on that parent
|
||||||
fi
|
# list of child packages:
|
||||||
if (test -e pair_lj_cut_opt.h) then
|
# GPU, OPT, USER-CUDA, USER-MISC, USER-OMP
|
||||||
cd OPT; /bin/sh Install.sh 0; /bin/sh Install.sh 1; cd ..
|
|
||||||
fi
|
|
||||||
if (test -e cg_cmm_params.h) then
|
|
||||||
cd USER-CG-CMM; /bin/sh Install.sh 0; /bin/sh Install.sh 1; cd ..
|
|
||||||
fi
|
|
||||||
if (test -e pair_lj_cut_cuda.h) then
|
|
||||||
cd USER-CUDA; /bin/sh Install.sh 0; /bin/sh Install.sh 1; cd ..
|
|
||||||
fi
|
|
||||||
if (test -e fix_imd.h) then
|
|
||||||
cd USER-MISC; /bin/sh Install.sh 0; /bin/sh Install.sh 1; cd ..
|
|
||||||
fi
|
|
||||||
# if (test -e thr_omp.h) then
|
|
||||||
# cd USER-OMP; /bin/sh Install.sh 0; /bin/sh Install.sh 1; cd ..
|
|
||||||
# fi
|
|
||||||
|
|
||||||
|
if (test $1 = "ASPHERE") then
|
||||||
|
depend GPU $2
|
||||||
|
depend USER-OMP $2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if (test $1 = "CLASS2") then
|
||||||
|
depend GPU $2
|
||||||
|
depend USER-CUDA $2
|
||||||
|
depend USER-OMP $2
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (test $1 = "COLLOID") then
|
||||||
|
depend GPU $2
|
||||||
|
depend USER-OMP $2
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (test $1 = "GRANULAR") then
|
||||||
|
depend USER-CUDA $2
|
||||||
|
depend USER-OMP $2
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (test $1 = "KSPACE") then
|
||||||
|
depend GPU $2
|
||||||
|
depend OPT $2
|
||||||
|
depend USER-CUDA $2
|
||||||
|
depend USER-OMP $2
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (test $1 = "MANYBODY") then
|
||||||
|
depend GPU $2
|
||||||
|
depend OPT $2
|
||||||
|
depend USER-CUDA $2
|
||||||
|
depend USER-MISC $2
|
||||||
|
depend USER-OMP $2
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (test $1 = "PERI") then
|
||||||
|
depend USER-OMP $2
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (test $1 = "RIGID") then
|
||||||
|
depend USER-OMP $2
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (test $1 = "USER-CG-CMM") then
|
||||||
|
depend GPU $2
|
||||||
|
depend USER-CUDA $2
|
||||||
|
depend USER-OMP $2
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (test $1 = "USER-MISC") then
|
||||||
|
depend GPU $2
|
||||||
|
depend USER-OMP $2
|
||||||
|
fi
|
||||||
|
|
||||||
|
|||||||
@ -193,7 +193,7 @@ yes-%:
|
|||||||
echo "Package $(@:yes-%=%) does not exist"; \
|
echo "Package $(@:yes-%=%) does not exist"; \
|
||||||
else \
|
else \
|
||||||
echo "Installing package $(@:yes-%=%)"; \
|
echo "Installing package $(@:yes-%=%)"; \
|
||||||
cd $(YESDIR); $(SHELL) Install.sh 1; cd ..; $(SHELL) Depend.sh 1; \
|
cd $(YESDIR); $(SHELL) Install.sh 1; cd ..; $(SHELL) Depend2.sh $(YESDIR) 1; \
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
no-%:
|
no-%:
|
||||||
@ -201,7 +201,7 @@ no-%:
|
|||||||
echo "Package $(@:no-%=%) does not exist"; \
|
echo "Package $(@:no-%=%) does not exist"; \
|
||||||
else \
|
else \
|
||||||
echo "Uninstalling package $(@:no-%=%)"; \
|
echo "Uninstalling package $(@:no-%=%)"; \
|
||||||
cd $(NODIR); $(SHELL) Install.sh 0; cd ..; $(SHELL) Depend.sh 0; \
|
cd $(NODIR); $(SHELL) Install.sh 0; cd ..; $(SHELL) Depend2.sh $(NODIR) 0; \
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
# status = list src files that differ from package files
|
# status = list src files that differ from package files
|
||||||
|
|||||||
Reference in New Issue
Block a user