CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   [foam-extend.org] Installing Foam-Extend-5.0 on Mac M1 (https://www.cfd-online.com/Forums/openfoam-installation/245247-installing-foam-extend-5-0-mac-m1.html)

dlahaye September 23, 2022 12:13

Installing Foam-Extend-5.0 on Mac M1
 
Greetings,

I fail to make etc/bashrc run as part of the installation of Foam-Extend-5.0 on Mac M1. Suggestions are welcome. Thx.

dlahaye September 27, 2022 06:06

Anyone , please? Thank you.

reverseila December 27, 2022 13:06

The bashrc file needs to be changed to check for new arm64 arch.

Code:

# etc/bashrc
# ------------
...

Darwin)
    # this makes certain things easier
    export WM_ARCH_BASE=darwin

    case `uname -p` in

...
        #  for m1 mac: `uname -p` == arm
        arm)
            export $WM_ARCH=darwin

...

There are also some errors (sed command) in the foamCleanPath script (at least this happened on my machine).

Code:

# etc/bashrc
# ------------
...
cleanProg=$WM_PROJECT_DIR/bin/foamCleanPath


#- Clean PATH
cleanEnv=`$cleanProg "$PATH" "$foamOldDirs"` && PATH="$cleanEnv"  # sed: -e expression #1, char 47: unknown option to `s'

...


#- Clean PATH
cleanEnv=`$cleanProg "$PATH"` && PATH="$cleanEnv"  #  sed: -e expression #1, char 47: unknown option to `s'

...


With some printf debugging (into stderr) I found the problematic sed command in this line of code

Code:

# bin/foamCleanPath
# ---------------------
...

        duplicate=`echo " $dirList " | sed -ne "s@ $dir @DUP@p"`
        #                                        ^      ^  ^
        # I replaced the delimiter '@' with '|' (pipe) and error was gone
...

Also, the wmake rules directory for the arch+compiler (for example darwin64Clang) should be created.


All times are GMT -4. The time now is 18:28.