forked from ORNL/AdditiveFOAM
-
Notifications
You must be signed in to change notification settings - Fork 0
Library Cleaning and Minimal OF Build Scripts #26
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
Open
kincaidkc
wants to merge
7
commits into
of11
Choose a base branch
from
of11-min-build
base: of11
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5845dff
Strip unused libraries from make files, add minimal build script
kincaidkc fdadde3
Change build script name to differentiate from stock build script
kincaidkc 224f27e
Add minimal ThirdParty script
kincaidkc 3451d91
Changes to build scripts, successfully compiles on cluster
fff0afc
Revert changes to tutorial files
bd67278
Remove comments and build foamDictionary
c2488ed
Add note about not compiling AMR libraries
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| #!/bin/sh | ||
| cd ${0%/*} || exit 1 # Run from this directory | ||
|
|
||
| # Perform various checks | ||
| wmakeCheckPwd "$WM_PROJECT_DIR" || { | ||
| echo "Allwmake error: Current directory is not \$WM_PROJECT_DIR" | ||
| echo " The environment variables are inconsistent with the installation." | ||
| echo " Check the OpenFOAM entries in your dot-files and source them." | ||
| exit 1 | ||
| } | ||
|
|
||
| [ -n "$FOAM_EXT_LIBBIN" ] || { | ||
| echo "Allwmake error: FOAM_EXT_LIBBIN not set" | ||
| echo " Check the OpenFOAM entries in your dot-files and source them." | ||
| exit 1 | ||
| } | ||
|
|
||
| # Compile wmake support applications | ||
| (cd wmake/src && make) | ||
|
|
||
| # Compile ThirdParty libraries and applications | ||
| if [ -d "$WM_THIRD_PARTY_DIR" ] | ||
| then | ||
| echo "Performing minimal ThirdParty Allwmake..." | ||
| $WM_THIRD_PARTY_DIR/MinimalThirdPartyAllwmake | ||
| else | ||
| echo "Allwmake: no ThirdParty directory found - skipping" | ||
| fi | ||
|
|
||
| ############################################################## | ||
| # This section taken from src/Allwmake # | ||
| ############################################################## | ||
|
|
||
| # Compile OpenFOAM libraries and applications | ||
| cd src | ||
|
|
||
| # Only required libraries for AdditiveFOAM are: | ||
| # 1. finiteVolume | ||
| # 2. dynamicMesh | ||
| # 3. meshTools | ||
| # We will build only these libraries and their dependencies, | ||
| # as well as libraries for tools such as blockMesh, AMR, | ||
| # and dynamic load balancing | ||
|
|
||
| # Update OpenFOAM version strings if required | ||
| wmakePrintBuild -check || wrmo OpenFOAM/global/global.o 2>/dev/null | ||
|
|
||
| Pstream/Allwmake -j $targetType $* | ||
|
|
||
| OSspecific/${WM_OSTYPE:-POSIX}/Allwmake -j $targetType $* | ||
| wmake -j $targetType OpenFOAM | ||
|
|
||
| wmake -j $targetType fileFormats | ||
| wmake -j $targetType surfMesh | ||
| wmake -j $targetType triSurface | ||
| wmake -j $targetType genericPatches | ||
| wmake -j $targetType meshTools | ||
|
|
||
| dummyThirdParty/Allwmake -j $targetType $* | ||
|
|
||
| wmake -j $targetType finiteVolume | ||
| wmake -j $targetType lagrangian/basic | ||
| wmake -j $targetType genericPatchFields | ||
|
|
||
| wmake -j $targetType mesh/extrudeModel | ||
| wmake -j $targetType dynamicMesh | ||
|
|
||
| parallel/Allwmake -j $targetType $* | ||
|
|
||
| wmake -j $targetType fvMeshStitchers | ||
| fvMeshTopoChangers/Allwmake -j $targetType $* | ||
| wmake -j $targetType fvMeshDistributors | ||
|
|
||
| wmake -j $targetType mesh/blockMesh | ||
|
|
||
| ############################################################## | ||
| # This section taken from applications/Allwmake # | ||
| ############################################################## | ||
|
|
||
| # Compile OpenFOAM libraries and applications | ||
| #applications/Allwmake $targetType $* | ||
| cd ../applications | ||
|
|
||
| # Build blockMesh, parallel processing utilities | ||
|
|
||
| wmake -j $targetType utilities/mesh/generation/blockMesh | ||
|
|
||
| wmake -j $targetType utilities/parallelProcessing/decomposePar | ||
| wmake -j $targetType utilities/parallelProcessing/reconstructPar | ||
|
|
||
| wmake -j $targetType utilities/miscellaneous/foamDictionary | ||
| #------------------------------------------------------------------------------ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,244 @@ | ||
| #!/bin/sh | ||
| #------------------------------------------------------------------------------ | ||
| # ========= | | ||
| # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | ||
| # \\ / O peration | | ||
| # \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation | ||
| # \\/ M anipulation | | ||
| #------------------------------------------------------------------------------ | ||
| # License | ||
| # This file is part of OpenFOAM. | ||
| # | ||
| # OpenFOAM is free software: you can redistribute it and/or modify it | ||
| # under the terms of the GNU General Public License as published by | ||
| # the Free Software Foundation, either version 3 of the License, or | ||
| # (at your option) any later version. | ||
| # | ||
| # OpenFOAM is distributed in the hope that it will be useful, but WITHOUT | ||
| # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| # for more details. | ||
| # | ||
| # You should have received a copy of the GNU General Public License | ||
| # along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. | ||
| # | ||
| # Script | ||
| # Allwmake | ||
| # | ||
| # Description | ||
| # Build script for ThirdParty | ||
| # | ||
| #------------------------------------------------------------------------------ | ||
| # run from third-party directory only | ||
| cd ${0%/*} || exit 1 | ||
| wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || { | ||
| echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR" | ||
| echo " The environment variables are inconsistent with the installation." | ||
| echo " Check the OpenFOAM entries in your dot-files and source them." | ||
| exit 1 | ||
| } | ||
| [ -n "$FOAM_EXT_LIBBIN" ] || { | ||
| echo "Error: FOAM_EXT_LIBBIN not set" | ||
| echo " Check the OpenFOAM entries in your dot-files and source them." | ||
| exit 1 | ||
| } | ||
| . etc/tools/ThirdPartyFunctions | ||
| #------------------------------------------------------------------------------ | ||
|
|
||
| # export WM settings in a form that GNU configure recognizes | ||
| [ -n "$WM_CC" ] && export CC="$WM_CC" | ||
| [ -n "$WM_CXX" ] && export CXX="$WM_CXX" | ||
| [ -n "$WM_CFLAGS" ] && export CFLAGS="$WM_CFLAGS" | ||
| [ -n "$WM_CXXFLAGS" ] && export CXXFLAGS="$WM_CXXFLAGS" | ||
| [ -n "$WM_LDFLAGS" ] && export LDFLAGS="$WM_LDFLAGS" | ||
|
|
||
| echo | ||
| echo ======================================== | ||
| echo Start ThirdParty Allwmake | ||
| echo ======================================== | ||
| echo | ||
|
|
||
| # Assume MPI is present on the system | ||
|
|
||
| # get SCOTCH_VERSION, SCOTCH_ARCH_PATH | ||
| if settings=`$WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch` | ||
| then | ||
| . $settings | ||
| else | ||
| echo | ||
| echo "Error: no config.sh/scotch settings" | ||
| echo | ||
| fi | ||
|
|
||
| # building scotch is still a bit of a pain | ||
| echo ======================================== | ||
| echo "Build Scotch decomposition library $SCOTCH_VERSION" | ||
| echo " $SCOTCH_ARCH_PATH" | ||
|
|
||
| # this needs generalizing for any compiler, since it's hard-coded to GCC | ||
| scotchMakefile=../../etc/wmakeFiles/scotch/Makefile.inc.i686_pc_linux2.shlib-OpenFOAM | ||
|
|
||
| if [ -f $SCOTCH_ARCH_PATH/include/scotch.h \ | ||
| -a -r $FOAM_EXT_LIBBIN/libscotch.so \ | ||
| -a -r $FOAM_EXT_LIBBIN/libscotcherrexit.so ] | ||
| then | ||
| echo " scotch header in $SCOTCH_ARCH_PATH/include" | ||
| echo " scotch libs in $FOAM_EXT_LIBBIN" | ||
| echo | ||
| else | ||
| ( | ||
| set -x | ||
| cd $SCOTCH_VERSION/src || exit 1 | ||
|
|
||
| prefixDIR=$SCOTCH_ARCH_PATH | ||
| libDIR=$FOAM_EXT_LIBBIN | ||
|
|
||
| mkdir -p $prefixDIR 2>/dev/null | ||
| mkdir -p $libDIR 2>/dev/null | ||
|
|
||
| configOpt="prefix=$prefixDIR libdir=$libDIR" | ||
|
|
||
| if [ -f $scotchMakefile ] | ||
| then | ||
| rm -f Makefile.inc | ||
| ln -s $scotchMakefile Makefile.inc | ||
| fi | ||
|
|
||
| [ -f Makefile.inc ] || { | ||
| echo " Error: scotch needs an appropriate Makefile.inc" | ||
| exit 1 | ||
| } | ||
|
|
||
| # handle non-gcc compilers | ||
| unset configEnv | ||
| [ "${WM_CC:-gcc}" != gcc ] && configEnv="CC=$WM_CC CCS=$WM_CC" | ||
|
|
||
| make realclean 2>/dev/null # for safety | ||
|
|
||
| make -j $WM_NCOMPPROCS $configEnv scotch \ | ||
| && make $configOpt install | ||
|
|
||
| # cleanup, could also remove Makefile.inc | ||
| make realclean 2>/dev/null | ||
| ) | ||
| fi | ||
|
|
||
| # verify existence of scotch include | ||
| [ -f $SCOTCH_ARCH_PATH/include/scotch.h ] || { | ||
| echo | ||
| echo " WARNING: required include file 'scotch.h' not found!" | ||
| echo | ||
| } | ||
|
|
||
|
|
||
| # build ptscotch if MPI (ThirdParty or system) is available | ||
| if [ "${FOAM_MPI:-dummy}" != dummy ] | ||
| then | ||
| echo ======================================== | ||
| echo "Build PTScotch decomposition library $SCOTCH_VERSION (uses MPI)" | ||
| echo " $SCOTCH_ARCH_PATH" | ||
| echo | ||
|
|
||
| if [ -f $SCOTCH_ARCH_PATH/include/$FOAM_MPI/ptscotch.h \ | ||
| -a -r $FOAM_EXT_LIBBIN/$FOAM_MPI/libptscotch.so \ | ||
| -a -r $FOAM_EXT_LIBBIN/$FOAM_MPI/libptscotcherrexit.so ] | ||
| then | ||
| echo " ptscotch header in $SCOTCH_ARCH_PATH/include/$FOAM_MPI" | ||
| echo " ptscotch libs in $FOAM_EXT_LIBBIN/$FOAM_MPI" | ||
| echo | ||
| else | ||
| ( | ||
| set -x | ||
| cd $SCOTCH_VERSION/src || exit 1 | ||
|
|
||
| prefixDIR=$SCOTCH_ARCH_PATH | ||
| libDIR=$FOAM_EXT_LIBBIN/$FOAM_MPI | ||
| incDIR=$SCOTCH_ARCH_PATH/include/$FOAM_MPI | ||
|
|
||
| mkdir -p $prefixDIR 2>/dev/null | ||
| mkdir -p $libDIR 2>/dev/null | ||
|
|
||
| configOpt="prefix=$prefixDIR libdir=$libDIR includedir=$incDIR" | ||
|
|
||
| if [ -f $scotchMakefile ] | ||
| then | ||
| rm -f Makefile.inc | ||
| ln -s $scotchMakefile Makefile.inc | ||
| fi | ||
|
|
||
| [ -f Makefile.inc ] || { | ||
| echo " Error: scotch needs an appropriate Makefile.inc" | ||
| exit 1 | ||
| } | ||
|
|
||
| # handle non-gcc compilers | ||
| unset configEnv | ||
| [ "${WM_CC:-gcc}" != gcc ] && configEnv="CC=$WM_CC CCS=$WM_CC" | ||
|
|
||
| make realclean 2>/dev/null # for safety | ||
|
|
||
| make -j $WM_NCOMPPROCS $configEnv ptscotch \ | ||
| && make $configOpt install | ||
|
|
||
| # cleanup, could also remove Makefile.inc | ||
| make realclean 2>/dev/null | ||
| ) | ||
| fi | ||
|
|
||
| # verify existence of scotch include | ||
| [ -f $SCOTCH_ARCH_PATH/include/$FOAM_MPI/ptscotch.h ] || { | ||
| echo | ||
| echo " WARNING: required include file 'ptscotch.h' not found!" | ||
| echo | ||
| } | ||
| fi | ||
|
|
||
| # Zoltan is optional | ||
| echo ======================================== | ||
| echo Build Zoltan decomposition | ||
|
|
||
| # Get ZOLTAN_VERSION, ZOLTAN_ARCH_PATH | ||
| if settings=`$WM_PROJECT_DIR/bin/foamEtcFile config.sh/zoltan` | ||
| then | ||
| . $settings | ||
| fi | ||
| if [ -d "$ZOLTAN_VERSION" ] | ||
| then | ||
|
|
||
| if [ -f $ZOLTAN_ARCH_PATH/include/zoltan.h \ | ||
| -a -r $FOAM_EXT_LIBBIN/$FOAM_MPI/libzoltan.a ] | ||
| then | ||
| echo " Zoltan header in $ZOLTAN_ARCH_PATH/include" | ||
| echo " Zoltan libs in $FOAM_EXT_LIBBIN/$FOAM_MPI" | ||
| echo | ||
| else | ||
| ( | ||
| set -x | ||
| cd $ZOLTAN_VERSION || exit 1 | ||
| mkdir -p build | ||
| cd build | ||
| ../configure \ | ||
| --prefix=$ZOLTAN_ARCH_PATH \ | ||
| --libdir=$FOAM_EXT_LIBBIN/$FOAM_MPI \ | ||
| --with-mpi=/usr/local/mpi \ | ||
| --with-mpi-compilers=no \ | ||
| --with-mpi-libdir=/usr/local/mpi/lib \ | ||
| --disable-zoltan-cppdriver \ | ||
| --with-ccflags=-fPIC --with-cxxflags=-fPIC | ||
| make everything | ||
| make install | ||
| ) | ||
| fi | ||
| else | ||
| echo " optional component Zoltan was not found" | ||
| fi | ||
|
|
||
|
|
||
| echo | ||
| echo ======================================== | ||
| echo Done ThirdParty Allwmake | ||
| echo ======================================== | ||
| echo | ||
|
|
||
|
|
||
| #------------------------------------------------------------------------------ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@colemanjs we need to figure out why i needed to manually specify these. when you get a chance could you pull this repo and test if you can get it to work with the original
$MPI_ARCH_PATHvariable (as is done in the mainThirdParty/Allwmakescript)? if so which module(s) did you need?