Skip to content

Instantly share code, notes, and snippets.

@abzrg
Last active October 10, 2022 03:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abzrg/39101060b5f05d9b2d2d151a39fda158 to your computer and use it in GitHub Desktop.
Save abzrg/39101060b5f05d9b2d2d151a39fda158 to your computer and use it in GitHub Desktop.
swak4Foam patch for OpenFOAM-v2206 (for M1 Mac)
diff -r 481d96f16780 Allwclean
--- a/Allwclean Mon Jul 04 01:06:48 2022 +0200
+++ b/Allwclean Fri Sep 23 20:40:05 2022 +0330
@@ -13,7 +13,7 @@
find . -name "*.dep" -print -exec rm {} \;
-find . -name compile_commands.json -print0 | xargs --null rm -f
-find . -name .clangd -print0 | xargs --null rm -rf
+find . -name compile_commands.json -print0 | xargs -0 rm -f
+find . -name .clangd -print0 | xargs -0 rm -rf
rm -f foamVersionThisIsCompiledFor
diff -r 481d96f16780 Allwmake
--- a/Allwmake Mon Jul 04 01:06:48 2022 +0200
+++ b/Allwmake Fri Sep 23 20:40:05 2022 +0330
@@ -7,7 +7,7 @@
exit 42
fi
-PY_BINARY_PATH=$(which python)
+PY_BINARY_PATH=$(which python3)
if [[ $? != 0 ]]; then
echo "Some scripts require a binary 'python' to be installed"
echo "It doesn't matter if this is Python 2 or 3"
@@ -86,7 +86,7 @@
BEARPATH=$(which bear)
if [[ $? == 0 ]]; then
echo "Using ${BEARPATH} to build compilation database"
- export BEAR_COMPILE_PREFIX="bear --append --cdb=$(pwd)/compile_commands.json"
+ export BEAR_COMPILE_PREFIX="bear --append --output $(pwd)/compile_commands.json --"
else
echo "No 'bear' installed"
fi
diff -r 481d96f16780 AllwmakeAll
--- a/AllwmakeAll Mon Jul 04 01:06:48 2022 +0200
+++ b/AllwmakeAll Fri Sep 23 20:40:05 2022 +0330
@@ -1,6 +1,6 @@
#! /bin/bash
-./maintainanceScripts/compileRequirements.sh
+#./maintainanceScripts/compileRequirements.sh
if [ ! -e ./swakConfiguration ] ; then
echo "Using automatic swakConfiguration because none is there"
diff -r 481d96f16780 Libraries/languageIntegration/Allwmake
--- a/Libraries/languageIntegration/Allwmake Mon Jul 04 01:06:48 2022 +0200
+++ b/Libraries/languageIntegration/Allwmake Fri Sep 23 20:40:05 2022 +0330
@@ -13,26 +13,26 @@
wmake libso swakGeneralLanguageIntegration
-if [ "$SWAK_PYTHON2_INCLUDE" != "" ]
-then
- SOEXT=so
+# if [ "$SWAK_PYTHON2_INCLUDE" != "" ]
+# then
+# SOEXT=so
- if [ `uname -s`=="Darwin" ]; then
- SOEXT=dylib
- fi
+# if [ `uname -s`=="Darwin" ]; then
+# SOEXT=dylib
+# fi
- oldPython="$FOAM_USER_LIBBIN/libpythonIntegration.$SOEXT"
- if [ -e $oldPython ]
- then
- echo "Removing old python integration $oldPython"
- rm $oldPython
- fi
- wmake libso swakPythonIntegration
-else
- echo
- echo "SWAK_PYTHON2_INCLUDE not defined .... no Python2-Integration. Most people are fine without it"
- echo
-fi
+# oldPython="$FOAM_USER_LIBBIN/libpythonIntegration.$SOEXT"
+# if [ -e $oldPython ]
+# then
+# echo "Removing old python integration $oldPython"
+# rm $oldPython
+# fi
+# wmake libso swakPythonIntegration
+# else
+# echo
+# echo "SWAK_PYTHON2_INCLUDE not defined .... no Python2-Integration. Most people are fine without it"
+# echo
+# fi
if [ "$SWAK_PYTHON3_INCLUDE" != "" ]
then
diff -r 481d96f16780 Libraries/simpleFunctionObjects/functionObjectProxy/executeIfExecutableFitsFunctionObject/executeIfExecutableFitsFunctionObject.C
--- a/Libraries/simpleFunctionObjects/functionObjectProxy/executeIfExecutableFitsFunctionObject/executeIfExecutableFitsFunctionObject.C Mon Jul 04 01:06:48 2022 +0200
+++ b/Libraries/simpleFunctionObjects/functionObjectProxy/executeIfExecutableFitsFunctionObject/executeIfExecutableFitsFunctionObject.C Fri Sep 23 20:40:05 2022 +0330
@@ -37,7 +37,7 @@
#include "swakTime.H"
-#ifdef darwin
+#ifdef __APPLE__
#include "mach-o/dyld.h"
#endif
#ifdef __linux__
@@ -76,7 +76,7 @@
fileName exePath;
-#ifdef darwin
+#ifdef __APPLE__
{
char path[1024];
uint32_t size = sizeof(path);
diff -r 481d96f16780 Utilities/Allwmake
--- a/Utilities/Allwmake Mon Jul 04 01:06:48 2022 +0200
+++ b/Utilities/Allwmake Fri Sep 23 20:40:05 2022 +0330
@@ -19,7 +19,7 @@
wmake fieldReport
-wmake funkyPythonPostproc
+#wmake funkyPythonPostproc
if [[ $OPENFOAM_ORG > 8.99 ]];
then
diff -r 481d96f16780 maintainanceScripts/makeCopyrightEntries.py
--- a/maintainanceScripts/makeCopyrightEntries.py Mon Jul 04 01:06:48 2022 +0200
+++ b/maintainanceScripts/makeCopyrightEntries.py Fri Sep 23 20:40:05 2022 +0330
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
import sys,re
from os import listdir,path
diff -r 481d96f16780 maintainanceScripts/makeFoamVersionHeader.py
--- a/maintainanceScripts/makeFoamVersionHeader.py Mon Jul 04 01:06:48 2022 +0200
+++ b/maintainanceScripts/makeFoamVersionHeader.py Fri Sep 23 20:40:05 2022 +0330
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
# This is a bit warped because
# a. It has to support inconsistent version numbers
diff -r 481d96f16780 maintainanceScripts/makeSwakVersionFile.py
--- a/maintainanceScripts/makeSwakVersionFile.py Mon Jul 04 01:06:48 2022 +0200
+++ b/maintainanceScripts/makeSwakVersionFile.py Fri Sep 23 20:40:05 2022 +0330
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
import sys
from os import path
diff -r 481d96f16780 swakConfiguration.automatic
--- a/swakConfiguration.automatic Mon Jul 04 01:06:48 2022 +0200
+++ b/swakConfiguration.automatic Fri Sep 23 20:40:05 2022 +0330
@@ -1,26 +1,26 @@
# -*- shell-script -*-
-if [[ -z "$SWAK_PYTHON2VERSION" ]] ; then
- echo "Looking for Python 2"
- for p2 in 7 6
- do
- WHICHPATH=$(which 2>/dev/null python2.$p2-config)
- if [[ $? == 0 ]]; then
- echo "Found Python 2.$p2"
- SWAK_PYTHON2VERSION=$p2
- break
- fi
- done
-else
- echo "Python 2 preset to 2.$SWAK_PYTHON2VERSION"
-fi
+# if [[ -z "$SWAK_PYTHON2VERSION" ]] ; then
+# echo "Looking for Python 2"
+# for p2 in 7 6
+# do
+# WHICHPATH=$(which 2>/dev/null python2.$p2-config)
+# if [[ $? == 0 ]]; then
+# echo "Found Python 2.$p2"
+# SWAK_PYTHON2VERSION=$p2
+# break
+# fi
+# done
+# else
+# echo "Python 2 preset to 2.$SWAK_PYTHON2VERSION"
+# fi
-if [[ -n "$SWAK_PYTHON2VERSION" ]] ; then
- echo "Configuring Python 2.$SWAK_PYTHON2VERSION"
- export SWAK_PYTHON2_INCLUDE="$(python2.$SWAK_PYTHON2VERSION-config --cflags)"
- export SWAK_PYTHON2_LINK="$(python2.$SWAK_PYTHON2VERSION-config --ldflags)"
- echo "Using python2.$SWAK_PYTHON2VERSION at $WHICHPATH for python2"
-fi
+# if [[ -n "$SWAK_PYTHON2VERSION" ]] ; then
+# echo "Configuring Python 2.$SWAK_PYTHON2VERSION"
+# export SWAK_PYTHON2_INCLUDE="$(python2.$SWAK_PYTHON2VERSION-config --cflags)"
+# export SWAK_PYTHON2_LINK="$(python2.$SWAK_PYTHON2VERSION-config --ldflags)"
+# echo "Using python2.$SWAK_PYTHON2VERSION at $WHICHPATH for python2"
+# fi
if [[ -z "$SWAK_PYTHON3VERSION" ]] ; then
echo "Looking for Python 3"
@@ -76,10 +76,10 @@
export SWAK_COMPILE_GRAMMAR_OPTION="-O1"
-if [ "$WM_USE_HOMEBREW" = 1 ]
-then
- export SWAK_BISON=/usr/local/opt/bison27/bin/bison
-fi
+# if [ "$WM_USE_HOMEBREW" = 1 ]
+# then
+ export SWAK_BISON=/opt/homebrew/opt/bison/bin/bison
+# fi
# If enabled, uses a 30 delay for building Bison generated files.
# Useful only for checking if there are any race conditions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment