git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@9931 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp 2013-05-29 15:04:29 +00:00
parent a882513801
commit 61213fbfb6
1 changed files with 40 additions and 0 deletions

40
src/USER-OMP/Package.sh Normal file
View File

@ -0,0 +1,40 @@
# Update package files in LAMMPS
# Copy package file to src if it doesn't exists or is different.
# But only copy the file, if a non-OpenMP version exists and
# remove OpenMP versions that have no matching serial file
# installed, e.g. after a package has been removed.
for file in *_omp.cpp *_omp.h ; do
# these are special cases and handled below
if (test $file = "thr_omp.h") || (test $file = "thr_omp.cpp") then
continue
fi
# derive name of non-OpenMP version
ofile=`echo $file | sed -e 's,\(.*\)_omp\.h,\1.h,' -e 's,\(.*\)_omp\.cpp,\1.cpp,'`
if (test ! -e ../$ofile) then
if (test -e ../$file) then
echo " removing src/$file"
rm -f ../$file
fi
else
if (test ! -e ../$file) then
echo " creating src/$file"
cp $file ..
elif ! cmp -s $file ../$file ; then
echo " updating src/$file"
cp $file ..
fi
fi
done
# special case for files not covered by the automatic script above
for file in thr_data.h thr_data.cpp thr_omp.h thr_omp.cpp; do
if (test ! -e ../$file) then
echo " creating src/$file"
cp $file ..
elif ! cmp -s $file ../$file ; then
echo " updating src/$file"
cp $file ..
fi
done