这是indexloc提供的服务,不要输入任何密码
Skip to content

Provide only standalone apps #97

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 12 additions & 17 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
run: |
make deps --dry-run $MAKE_VARS > make_deps.txt
make build --dry-run $MAKE_VARS > make_build.txt
- name: Restore cached build
- name: Look up cached build
if: inputs.use-cached
id: cache_build
uses: actions/cache/restore@v3
Expand All @@ -58,7 +58,7 @@ jobs:
restore-keys:
build-${{ inputs.openfoam-version }}-${{ hashFiles('make_build.txt', 'Brewfile', format('OpenFOAM-v${0}.tgz.sha256', inputs.openfoam-version), 'configure.sh') }}-
lookup-only: true
- name: Restore cached deps
- name: Look up cached deps
if: inputs.use-cached && steps.cache_build.outputs.cache-matched-key == ''
id: cache_deps
uses: actions/cache/restore@v3
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
run: |
make deps --dry-run $MAKE_VARS > make_deps.txt
make build --dry-run $MAKE_VARS > make_build.txt
- name: Restore cached build
- name: Restore cached build if available
if: inputs.use-cached
id: cache_build
uses: actions/cache/restore@v3
Expand Down Expand Up @@ -124,11 +124,11 @@ jobs:
key: build-${{ inputs.openfoam-version }}-${{ hashFiles('make_build.txt', 'Brewfile', format('OpenFOAM-v${0}.tgz.sha256', inputs.openfoam-version), 'configure.sh') }}-${{ github.run_id }}
- name: Make apps
run: |
make zip $MAKE_VARS DEPENDENCIES_KIND=both
make zip $MAKE_VARS
- name: Upload apps artifact
uses: actions/upload-artifact@v3
with:
name: apps-${{ inputs.openfoam-version }}
name: app-${{ inputs.openfoam-version }}
path: build/*-app-*.zip
if-no-files-found: error

Expand All @@ -137,39 +137,34 @@ jobs:
strategy:
matrix:
os: [macos-11, macos-12, macos-13]
dependencies-kind: [standalone, homebrew]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download apps artifact
- name: Download app artifact
uses: actions/download-artifact@v3
with:
name: apps-${{ inputs.openfoam-version }}
name: app-${{ inputs.openfoam-version }}
path: build
- name: Unzip app
run: |
unzip *-app-${{ matrix.dependencies-kind }}-*.zip
unzip *-app-*.zip
working-directory: build
- name: Install Homebrew dependencies
if: matrix.dependencies-kind == 'homebrew'
run: |
brew bundle --verbose
- name: Test
run: |
make test $MAKE_VARS DEPENDENCIES_KIND=${{ matrix.dependencies-kind }}
make test $MAKE_VARS

release:
needs: test
if: inputs.release
runs-on: ubuntu-latest
steps:
- name: Download apps artifact
- name: Download app artifact
uses: actions/download-artifact@v3
with:
name: apps-${{ inputs.openfoam-version }}
- name: Upload apps to release
name: app-${{ inputs.openfoam-version }}
- name: Upload app to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion Brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ tap "gerlero/openfoam"

# Required dependencies
brew "open-mpi"
brew "libomp"

# Optional dependencies (enabled by default)
brew "libomp"
brew "boost"
brew "fftw"
brew "kahip"
Expand Down
39 changes: 25 additions & 14 deletions configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,22 @@ bin/tools/foamConfigurePaths \
-scotch-path $PWD/usr/opt/scotch-no-pthread


OPENMPI_PATH="$PWD/usr/opt/open-mpi"
GMP_PATH="$PWD/usr/opt/gmp"
MPFR_PATH="$PWD/usr/opt/mpfr"

sed -i '' "s|\# export GMP_ARCH_PATH=...|export GMP_ARCH_PATH=\"$GMP_PATH\"|" etc/config.sh/CGAL
sed -i '' "s|\# setenv GMP_ARCH_PATH ...|setenv GMP_ARCH_PATH \"$GMP_PATH\"|" etc/config.csh/CGAL

sed -i '' "s|\# export MPFR_ARCH_PATH=...|export MPFR_ARCH_PATH=\"$MPFR_PATH\"|" etc/config.sh/CGAL
sed -i '' "s|\# setenv MPFR_ARCH_PATH ...|setenv MPFR_ARCH_PATH \"$MPFR_PATH\"|" etc/config.csh/CGAL


MPI_PATH="$PWD/usr/opt/open-mpi"
BASH_PATH="$PWD/usr/opt/bash"

PATH_EXTRA="$BASH_PATH/bin:$OPENMPI_PATH/bin"
MANPATH_EXTRA="$BASH_PATH/share/man:$OPENMPI_PATH/share/man"
INFOPATH_EXTRA="$BASH_PATH/share/info:$OPENMPI_PATH/share/info"
PATH_EXTRA="$BASH_PATH/bin:$MPI_PATH/bin"
MANPATH_EXTRA="$BASH_PATH/share/man:$MPI_PATH/share/man"
INFOPATH_EXTRA="$BASH_PATH/share/info:$MPI_PATH/share/info"

echo "export PATH=\"$PATH_EXTRA\${PATH+:\$PATH}\"" >> etc/prefs.sh
echo "setenv PATH $PATH_EXTRA:\$PATH" >> etc/prefs.csh
Expand All @@ -29,17 +39,18 @@ echo "setenv INFOPATH $INFOPATH_EXTRA\`[ \${?INFOPATH} == 1 ] && echo \":\${INFO


LIBOMP_PATH="$PWD/usr/opt/libomp"
GMP_PATH="$PWD/usr/opt/gmp"
MPFR_PATH="$PWD/usr/opt/mpfr"

CPATH_EXTRA="$LIBOMP_PATH/include:$GMP_PATH/include:$MPFR_PATH/include"
LIBRARY_PATH_EXTRA="$LIBOMP_PATH/lib:$GMP_PATH/lib:$MPFR_PATH/lib"

echo "export CPATH=\"$CPATH_EXTRA\${CPATH+:\$CPATH}\"" >> etc/prefs.sh
echo "setenv CPATH \"$CPATH_EXTRA\`[ \${?CPATH} == 1 ] && echo \":\${CPATH}\"\`\"" >> etc/prefs.csh

echo "export LIBRARY_PATH=\"$LIBRARY_PATH_EXTRA\${LIBRARY_PATH+:\$LIBRARY_PATH}\"" >> etc/prefs.sh
echo "setenv LIBRARY_PATH \"$LIBRARY_PATH_EXTRA\`[ \${?LIBRARY_PATH} == 1 ] && echo \":\${LIBRARY_PATH}\"\`\"" >> etc/prefs.csh
if [ -f "$LIBOMP_PATH/include/omp.h" ]; then
echo "export CPATH=\"$LIBOMP_PATH/include\${CPATH+:\$CPATH}\"" >> etc/prefs.sh
echo "setenv CPATH \"$LIBOMP_PATH/include\`[ \${?CPATH} == 1 ] && echo \":\${CPATH}\"\`\"" >> etc/prefs.csh

echo "export LIBRARY_PATH=\"$LIBOMP_PATH/lib\${LIBRARY_PATH+:\$LIBRARY_PATH}\"" >> etc/prefs.sh
echo "setenv LIBRARY_PATH \"$LIBOMP_PATH/lib\`[ \${?LIBRARY_PATH} == 1 ] && echo \":\${LIBRARY_PATH}\"\`\"" >> etc/prefs.csh
else
echo "OpenMP not found at $LIBOMP_PATH. Disabling OpenMP support" >&2
echo "export WM_COMPILE_CONTROL=\"\$WM_COMPILE_CONTROL ~openmp\"" >> etc/prefs.sh
echo "setenv WM_COMPILE_CONTROL \"\$WM_COMPILE_CONTROL ~openmp\"" >> etc/prefs.csh
fi


# Workaround for https://develop.openfoam.com/Development/openfoam/-/issues/1664
Expand Down