termux-packages/packages/openfoam/etc-bashrc.patch
Henrik Grimler cb8e5946b2 openfoam: update to 21.06
Finally a working build :)

Tests done: run cavity tutorial on aarch64 and arm.

TODO/things that would be nice to test:

* Check if we actually need to set WM_{CC,CXX,CFLAGS,CXXFLAGS} in
  etc/config.sh/settings.
* Test compilation with Gcc on device
* Look at the __libc_malloc->malloc patch in sigFpe.C again, and try
  to upstream the fix so that it isn't as glibc specific.

We need to remove -std=c++11 from CXXFLAGS, or else we get errors when building with
our (rather new) version of CGAL, for example:

/data/data/com.termux/files/usr/include/CGAL/array.h:72:44: error: no template named 'index_sequence' in namespace 'std'
make_filled_array_aux(const T& value, std::index_sequence<Is...>)
                                      ~~~~~^

/data/data/com.termux/files/usr/include/CGAL/number_utils.h:320:10: warning: 'decltype(auto)' type specifier is a C++14 extension [-Wc++14-extensions]
  decltype(auto) approximate_sqrt(const NT& nt)
           ^
/data/data/com.termux/files/usr/include/CGAL/number_utils.h:320:1: error: deduced return types are a C++14 extension
  decltype(auto) approximate_sqrt(const NT& nt)
  ^
2021-12-04 14:36:37 +01:00

41 lines
1.7 KiB
Diff

--- ./etc/bashrc.orig 2021-12-01 03:15:49.000000000 +0100
+++ ./etc/bashrc 2021-12-01 03:15:49.000000000 +0100
@@ -68,7 +68,7 @@
# [WM_COMPILER] - Compiler:
# = Gcc | Clang | Icc | Icx | Cray | Amd | Arm | Pgi | Fujitsu |
# Gcc<digits> | Clang<digits>
-export WM_COMPILER=Gcc
+export WM_COMPILER=Clang
# [WM_PRECISION_OPTION] - Floating-point precision:
# = DP | SP | SPDP
@@ -112,8 +112,8 @@
# --
projectDir="${BASH_SOURCE:-${ZSH_NAME:+$0}}";
[ -n "$projectDir" ] && projectDir="$(\cd $(dirname $projectDir)/.. && \pwd -L)" ||\
-projectDir="$HOME/OpenFOAM/OpenFOAM-$WM_PROJECT_VERSION"
-# projectDir="/opt/openfoam/OpenFOAM-$WM_PROJECT_VERSION"
+# projectDir="$HOME/OpenFOAM/OpenFOAM-$WM_PROJECT_VERSION"
+projectDir="@TERMUX_PREFIX@/opt/OpenFOAM-$WM_PROJECT_VERSION"
# projectDir="/usr/local/OpenFOAM/OpenFOAM-$WM_PROJECT_VERSION"
################################################################################
# Or optionally hard-coded (eg, with autoconfig)
@@ -162,7 +162,7 @@
# Capture values of old directories to be cleaned from PATH, LD_LIBRARY_PATH
foamOldDirs="$WM_PROJECT_DIR $WM_THIRD_PARTY_DIR \
- $HOME/$WM_PROJECT/$USER $FOAM_USER_APPBIN $FOAM_USER_LIBBIN \
+ $HOME/$WM_PROJECT/termux $FOAM_USER_APPBIN $FOAM_USER_LIBBIN \
$WM_PROJECT_SITE $FOAM_SITE_APPBIN $FOAM_SITE_LIBBIN \
$FOAM_MODULE_APPBIN $FOAM_MODULE_LIBBIN"
@@ -170,7 +170,7 @@
export WM_PROJECT_DIR="$projectDir"
# [WM_PROJECT_USER_DIR] - Location of user files
-export WM_PROJECT_USER_DIR="$HOME/$WM_PROJECT/$USER-$WM_PROJECT_VERSION"
+export WM_PROJECT_USER_DIR="$HOME/$WM_PROJECT/termux-$WM_PROJECT_VERSION"
# [WM_PROJECT_SITE] - Location of site-specific (group) files
# Default (unset) implies WM_PROJECT_DIR/site