Skip to content

Commit

Permalink
corrections in the scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Iximiel committed Aug 30, 2024
1 parent a6551cb commit bafc045
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ jobs:
id: plumed
- name: run plumed
run: |
echo "plumed path:${{ steps.plumed.outputs.path }}"
ls ${{ steps.plumed.outputs.path }}/bin
echo "plumed path:${{ steps.plumed.outputs.plumed_prefx }}"
ls ${{ steps.plumed.outputs.plumed_prefx }}/bin
head ${{ steps.plumed.outputs.dependency_file }}
plumed --version
Expand Down
22 changes: 13 additions & 9 deletions install-plumed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,12 @@ if [[ -n "$SUFFIX" ]]; then
program_name=$program_name$SUFFIX
fi

#just to be sure
prefix=${PREFIX-~/opt}
if [[ -n "$PREFIX" ]]; then
plumed_options="$plumed_options --prefix=\"$PREFIX\""
plumed_options="$plumed_options --prefix=\"$prefix\""
fi

if [[ -n "$MODULES" ]]; then
plumed_options="$plumed_options --enable-modules=$MODULES"
fi
Expand All @@ -55,7 +58,7 @@ git checkout --quiet $version

if [[ -n $DEPPATH ]]; then
mkdir -pv "$DEPPATH"
dependencies_file="${DEPPATH}/_data/extradeps${version}.json"
dependencies_file="${DEPPATH}/extradeps${version}.json"
echo "Creating a dependencies file at $dependencies_file"
# This gets all the dependency information in plumed
{
Expand Down Expand Up @@ -92,14 +95,15 @@ if [[ -n $DEPPATH ]]; then
fi
hash=$(git rev-parse HEAD)

if [[ -f ${PREFIX}/lib/$program_name/$hash ]]; then
if [[ -f ${prefix}/lib/$program_name/$hash ]]; then
echo "ALREADY AVAILABLE, NO NEED TO REINSTALL"
else
#remove the conflicting old installation
rm -fr "$PREFIX/lib/$program_name"
rm -fr "$PREFIX/bin/$program_name"
rm -fr "$PREFIX/include/$program_name"
rm -fr "$PREFIX"/lib/lib$program_name.so*
rm -fr "${prefix:?}/lib/$program_name"
rm -fr "${prefix:?}/bin/$program_name"
rm -fr "${prefix:?}/include/$program_name"
rm -fr "${prefix:?}"/lib/lib$program_name.so*
#{var:?} makes the shell fail to avoid "explosive" deletions in lib and bin

cat <<EOF
./configure --prefix="$HOME/opt" --enable-modules=all --enable-boost_serialization --enable-fftw --program-suffix=$SUFFIX --enable-libtorch LDFLAGS=-Wl,-rpath,$LD_LIBRARY_PATH
Expand All @@ -110,8 +114,8 @@ set +x
make -j 5
make install
touch "${PREFIX}/lib/$program_name/$hash"
touch "${prefix}/lib/$program_name/$hash"
EOF
fi

echo "plumed_path=${PREFIX}" >>$GITHUB_OUTPUT
echo "plumed_path=${prefix}" >>$GITHUB_OUTPUT

0 comments on commit bafc045

Please sign in to comment.