Skip to content

Commit

Permalink
Merge pull request #6 from gerlero/fix-5
Browse files Browse the repository at this point in the history
Fix missing library errors when using tutorial run scripts
  • Loading branch information
gerlero authored Feb 17, 2022
2 parents 9baeaca + d401c8c commit 2caf657
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
1 change: 1 addition & 0 deletions Brewfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
brew "bash"
brew "open-mpi"
brew "libomp"
brew "adios2"
Expand Down
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SHELL = /bin/zsh
SHELL = bash

FOAM_VERSION = 2112

Expand Down Expand Up @@ -89,6 +89,7 @@ $(BUILD_DMG_FILE): $(SOURCE_TARBALL) $(DEPENDENCIES)
-kahip-path '$$(brew --prefix)/opt/kahip' \
-metis-path '$$(brew --prefix)/opt/metis' \
-scotch-path '$$(brew --prefix)/opt/scotch'
echo 'export FOAM_DYLD_LIBRARY_PATH="$$DYLD_LIBRARY_PATH"' >> $(VOLUME)/etc/bashrc
cd $(VOLUME) && source etc/bashrc && foamSystemCheck && ( ./Allwmake -j $(WMAKE_NJOBS) -s -q -k; ./Allwmake -j $(WMAKE_NJOBS) -s )
hdiutil detach $(VOLUME)

Expand Down Expand Up @@ -116,6 +117,15 @@ test-dmg:
&& decomposePar \
&& mpirun -np 4 --oversubscribe laplacianFoam -parallel \
&& reconstructPar
source $(VOLUME)/etc/bashrc && cp -r "$$FOAM_TUTORIALS"/basic/laplacianFoam/flange $(TEST_DIR)/flange2
source $(VOLUME)/etc/bashrc && cd $(TEST_DIR)/flange2 \
&& foamDictionary -entry numberOfSubdomains -set 2 system/decomposeParDict \
&& $(SHELL) -e ./Allrun-parallel \
&& reconstructPar
source $(VOLUME)/etc/bashrc && cp -r "$$FOAM_TUTORIALS"/incompressible/simpleFoam/backwardFacingStep2D $(TEST_DIR)/
source $(VOLUME)/etc/bashrc && cd $(TEST_DIR)/backwardFacingStep2D \
&& $(SHELL) -e ./Allrun \
&& ! grep 'FOAM Warning' log.simpleFoam
hdiutil detach $(VOLUME)

clean-build:
Expand Down
17 changes: 7 additions & 10 deletions openfoam
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@

FOAM_VERSION={{FOAM_VERSION}}

DMG_FILE="${0:A:h}/../Resources/OpenFOAM-v$FOAM_VERSION.dmg"

echo "Mounting the OpenFOAM-v$FOAM_VERSION volume..."
hdiutil attach "$DMG_FILE" -quiet
echo "You can safely unmount the volume from the Finder after use."

echo "Activating the OpenFOAM environment..."
source "/Volumes/OpenFOAM-v$FOAM_VERSION/etc/bashrc"

echo "---------------------------------------------------------------------------"
echo " | °°° OpenFOAM-v$FOAM_VERSION.app °°° "
echo " ( ) | https://github.com/gerlero/openfoam$FOAM_VERSION-app "
Expand All @@ -19,4 +10,10 @@ echo " ( ) | Precompiled OpenFOAM v$FOAM_VERSION for macOS
echo " | Built from the OpenFOAM source code (www.openfoam.com) "
echo "---------------------------------------------------------------------------"

$SHELL "$@"
echo "Mounting the OpenFOAM-v$FOAM_VERSION volume..."
DMG_FILE="${0:A:h}/../Resources/OpenFOAM-v$FOAM_VERSION.dmg"
hdiutil attach "$DMG_FILE" -quiet
echo "You can safely unmount the volume from the Finder after use."

echo "Activating the OpenFOAM environment..."
"/Volumes/OpenFOAM-v$FOAM_VERSION/etc/openfoam" "$@"
Binary file modified screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2caf657

Please sign in to comment.