Skip to content

Commit

Permalink
handle gcc versions with brew
Browse files Browse the repository at this point in the history
  • Loading branch information
edoapra committed Oct 8, 2024
1 parent ad4e8b5 commit 8beba17
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions travis/nwchem.bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,19 @@ if [[ "$FC" == "ifort" ]] || [[ "$FC" == "ifx" ]] ; then
#force icc on macos to cross-compile x86 on arm64
# icx not available on macos
if [[ "$os" == "Darwin" ]]; then
if [[ "$FC" != "gfortran" ]] && [[ "$FC" == "gfortran*" ]]; then
mygccver=$(echo "$FC"|cut -d - -f 2)
export PATH=$HOMEBREW_CELLAR/../opt/gcc@"$mygccver"/bin:$PATH
echo gfortran is $(gfortran -v)
echo gfortran-"$mygccver" is $(gfortran-"$mygccver" -v)
fi
if [[ "$FC" != "gcc" ]] && [[ "$FC" == "gcc*" ]]; then
mygccver=$(echo "$CC"|cut -d - -f 2)
HOMEBREW_NO_INSTALL_CLEANUP=1 HOMEBREW_NO_AUTO_UPDATE=1 brew reinstall gcc@"$mygccver" || true
export PATH=$HOMEBREW_CELLAR/../opt/gcc@"$mygccver"/bin:$PATH
echo gcc is $(gcc -v)
echo gcc-"$mygccver" is $(gcc-"$mygccver" -v)
fi
# CC=icc
# CXX=icc
# Intel MPI not available on macos
Expand All @@ -94,19 +107,6 @@ fi
if [[ "$os" == "Darwin" ]]; then
export NWCHEM_TARGET=MACX64
export DYLD_FALLBACK_LIBRARY_PATH=$TRAVIS_BUILD_DIR/lib:$DYLD_FALLBACK_LIBRARY_PATH
if [[ "$FC" != "gfortran" ]] && [[ "$FC" == "gfortran*" ]]; then
mygccver=$(echo "$FC"|cut -d - -f 2)
export PATH=$HOMEBREW_CELLAR/../opt/gcc@"$mygccver"/bin:$PATH
echo gfortran is $(gfortran -v)
echo gfortran-"$mygccver" is $(gfortran-"$mygccver" -v)
fi
if [[ "$FC" != "gcc" ]] && [[ "$FC" == "gcc*" ]]; then
mygccver=$(echo "$CC"|cut -d - -f 2)
HOMEBREW_NO_INSTALL_CLEANUP=1 HOMEBREW_NO_AUTO_UPDATE=1 brew reinstall gcc@"$mygccver" || true
export PATH=$HOMEBREW_CELLAR/../opt/gcc@"$mygccver"/bin:$PATH
echo gcc is $(gcc -v)
echo gcc-"$mygccver" is $(gcc-"$mygccver" -v)
fi
if [[ "$MPI_IMPL" == "openmpi" ]]; then
export PATH=/usr/local/opt/open-mpi/bin/:$PATH
fi
Expand Down

0 comments on commit 8beba17

Please sign in to comment.