CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   [OpenFOAM.com] Install v2006 on macOS Mojave failed (https://www.cfd-online.com/Forums/openfoam-installation/229531-install-v2006-macos-mojave-failed.html)

mderzhou August 13, 2020 04:17

Install v2006 on macOS Mojave failed
 
1 Attachment(s)
Hi,

I tried to install OpenFOAM v2006 from terminal on macOS Mojave. I followed the instruction https://develop.openfoam.com/Develop...p/doc/Build.md.

step1, source ~/OpenFOAM/OpenFOAM-v2006/etc/bashrc, it shows
Quote:

Darwin support is clang/llvm only
step2, foamSystemCheck, it shows
Quote:

Checking basic system...
-------------------------------------------------------------------------------
Shell: bash
Host: localhost
OS: Darwin version 18.6.0
User: yunong

System check: PASS
==================
Can continue to OpenFOAM installation.
step3, foam, it changes the directory to OpenFOAM;

step4, I got the trouble as shown below
Quote:

Compile OpenFOAM libraries

ln: OpenFOAM/lnInclude
ln: OSspecific/POSIX/lnInclude
wmake libo (POSIX)
clang++ -std=c++11 -m64 -pthread -ftrapping-math -DOPENFOAM=2006 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-undefined-var-template -Wno-unknown-warning-option -O3 -DNoRepository -ftemplate-depth-100 -iquote. -IlnInclude -I/Users/yunong/OpenFOAM/OpenFOAM-v2006/src/OpenFOAM/lnInclude -I/Users/yunong/OpenFOAM/OpenFOAM-v2006/src/OSspecific/POSIX/lnInclude -fPIC -c POSIX.C -o /Users/yunong/OpenFOAM/OpenFOAM-v2006/build/darwin64ClangDPInt32Opt/src/OSspecific/POSIX/POSIX.o
In file included from POSIX.C:37:
In file included from /Users/yunong/OpenFOAM/OpenFOAM-v2006/src/OpenFOAM/lnInclude/OSspecific.H:42:
In file included from /Users/yunong/OpenFOAM/OpenFOAM-v2006/src/OpenFOAM/lnInclude/fileNameList.H:49:
In file included from /Users/yunong/OpenFOAM/OpenFOAM-v2006/src/OpenFOAM/lnInclude/fileName.H:51:
In file included from /Users/yunong/OpenFOAM/OpenFOAM-v2006/src/OpenFOAM/lnInclude/word.H:46:
In file included from /Users/yunong/OpenFOAM/OpenFOAM-v2006/src/OpenFOAM/lnInclude/string.h:55:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:505:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string_view:176:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__string:57:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:642:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:70:9: error:
no member named 'memcpy' in the global namespace
using ::memcpy;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:71:9: error:
no member named 'memmove' in the global namespace
using ::memmove;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:72:9: error:
no member named 'strcpy' in the global namespace
using ::strcpy;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:73:9: error:
no member named 'strncpy' in the global namespace
using ::strncpy;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:74:9: error:
no member named 'strcat' in the global namespace
using ::strcat;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:75:9: error:
no member named 'strncat' in the global namespace
using ::strncat;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:76:9: error:
no member named 'memcmp' in the global namespace
using ::memcmp;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:77:9: error:
no member named 'strcmp' in the global namespace
using ::strcmp;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:78:9: error:
no member named 'strncmp' in the global namespace
using ::strncmp;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:79:9: error:
no member named 'strcoll' in the global namespace
using ::strcoll;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:80:9: error:
no member named 'strxfrm' in the global namespace
using ::strxfrm;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:81:9: error:
no member named 'memchr' in the global namespace
using ::memchr;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:82:9: error:
no member named 'strchr' in the global namespace
using ::strchr;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:83:9: error:
no member named 'strcspn' in the global namespace
using ::strcspn;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:84:9: error:
no member named 'strpbrk' in the global namespace
using ::strpbrk;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:85:9: error:
no member named 'strrchr' in the global namespace
using ::strrchr;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:86:9: error:
no member named 'strspn' in the global namespace
using ::strspn;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:87:9: error:
no member named 'strstr' in the global namespace
using ::strstr;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:89:9: error:
no member named 'strtok' in the global namespace
using ::strtok;
~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
I tried to find out the solution, and I think the problem is the string.H in the src/OpenFOAM/lnInclude folder due to the conflict with the standard c header file.

Then I tried to change the string.H to another name, but it doesn't work. Any help or suggestion on this issue would be greatly appreciated.

Best regards

HPE August 13, 2020 17:28

Would you mind to report the issue to the GitLab? Thanks.

Gang Wang August 17, 2021 04:42

Quote:

Originally Posted by mderzhou (Post 780306)
Hi,

I tried to install OpenFOAM v2006 from terminal on macOS Mojave. I followed the instruction https://develop.openfoam.com/Develop...p/doc/Build.md.

step1, source ~/OpenFOAM/OpenFOAM-v2006/etc/bashrc, it shows

step2, foamSystemCheck, it shows

step3, foam, it changes the directory to OpenFOAM;

step4, I got the trouble as shown below

I tried to find out the solution, and I think the problem is the string.H in the src/OpenFOAM/lnInclude folder due to the conflict with the standard c header file.

Then I tried to change the string.H to another name, but it doesn't work. Any help or suggestion on this issue would be greatly appreciated.

Best regards

Hi!

Did you solve this issue? I'm also bothered by this issue while installing OpenFOAM v2106 on the macOS bigsur.

Best regards,
Gang

Miguel Hernandez September 13, 2021 09:35

Quote:

Originally Posted by Gang Wang (Post 810450)
Hi!



Did you solve this issue? I'm also bothered by this issue while installing OpenFOAM v2106 on the macOS bigsur.



Best regards,

Gang



Hi!

I have problems too... I can not figure out how to compile OpenFOAM (9) on Bug Sur -Apple m1, compiling from source code...

Is there a guide to do it?

Thanks

Gang Wang September 13, 2021 09:51

Quote:

Originally Posted by Miguel Hernandez (Post 812084)
Hi!

I have problems too... I can not figure out how to compile OpenFOAM (9) on Bug Sur -Apple m1, compiling from source code...

Is there a guide to do it?

Thanks

Hi!

I've successfully installed the OpenFOAM v2106 on Big-sur. I think you need to create a virtual volume, by following the guidance here: https://github.com/mrklein/openfoam-os-x

Best regards,
Gang Wang

Gang Wang September 13, 2021 10:34

Quote:

Originally Posted by Miguel Hernandez (Post 812084)
Hi!

I have problems too... I can not figure out how to compile OpenFOAM (9) on Bug Sur -Apple m1, compiling from source code...

Is there a guide to do it?

Thanks

BTW, I didn't run the test on the M1 arm platform, so then you might try by urself. Good luck!

Best regards,
Gang

federico.carminati September 16, 2021 05:55

Same problem here
 
Hello,
is there any update on this? I have exactly the same problem even after applying the patch. Thanks for the help. Best regards

Federico Carminati

federico.carminati September 17, 2021 09:26

I believe the problem is due to the fact that in the OpenFoam files there are some files that are distinguishable only by their case. While this is perfectly file in most Linux systems, on the Mac by default the filesystem is case preserving but not distinguishing. This means that if you create a file, say “hello.dat”, it will be indistinguishable from a file “Hello.dat” in another directory. This probably causes some confusions in the include directives that pick up the wrong file and compilation fails. I found the (admittedly baroque) solution of creating a virtual file system on my Mac that is case discriminating and to compile OpenFoam there. The instructions (that I will post in the forum), are the following:

hdiutil create -size 5g -fs 'Case-sensitive Journaled HFS+' -volname openfoam openfoam
sudo hdiutil attach -mountpoint /usr/local/openfoam openfoam.dmg

cd /usr/local/openfoam

and there one can deploy the normal installation instructions. To increase portability of the openfoam project it would perhaps be worth considering to disambiguate files not only via their case, but by using different combinations of letters.

Miguel Hernandez September 17, 2021 13:53

Quote:

Originally Posted by federico.carminati (Post 812457)
I believe the problem is due to the fact that in the OpenFoam files there are some files that are distinguishable only by their case. While this is perfectly file in most Linux systems, on the Mac by default the filesystem is case preserving but not distinguishing. This means that if you create a file, say “hello.dat”, it will be indistinguishable from a file “Hello.dat” in another directory. This probably causes some confusions in the include directives that pick up the wrong file and compilation fails. I found the (admittedly baroque) solution of creating a virtual file system on my Mac that is case discriminating and to compile OpenFoam there. The instructions (that I will post in the forum), are the following:



hdiutil create -size 5g -fs 'Case-sensitive Journaled HFS+' -volname openfoam openfoam

sudo hdiutil attach -mountpoint /usr/local/openfoam openfoam.dmg



cd /usr/local/openfoam



and there one can deploy the normal installation instructions. To increase portability of the openfoam project it would perhaps be worth considering to disambiguate files not only via their case, but by using different combinations of letters.



Thank you Federico!

Where can I find the normal installation instructions?

federico.carminati September 17, 2021 15:49

I used these instructions

https://develop.openfoam.com/Develop...p/doc/Build.md

Best,

Miguel Hernandez September 18, 2021 07:39

Quote:

Originally Posted by federico.carminati (Post 812474)



Thank you! To be honest, is too difficult to me... i’ve tried several times, but nothing....

I found that docker for M1 SoC works, but openFoam image is always emulated, and so is very very slow...

I don’t know what to do....

federico.carminati September 18, 2021 07:40

I am really new to OF, but I have *a lot* of experience installing "stuff". Mind posting your problems? Might be I can be of help. Best,

Miguel Hernandez September 19, 2021 10:18

Quote:

Originally Posted by federico.carminati (Post 812502)
I am really new to OF, but I have *a lot* of experience installing "stuff". Mind posting your problems? Might be I can be of help. Best,

I'm sorry Federico but I think I need a lot of help :confused:
First: I create and mount an image disk as you suggested --> No problem with this.

And then?

I'm sorry but I'm new to install from terminal all this things, I'm getting confused in all the instruction reported in the guide you linked before.

Are the preliminaries necessary?

Maybe I need, if exist, a noob guide to do it...

federico.carminati September 19, 2021 10:50

Can you mount it on /usr/local/openfoam?

if yes do

cd /usr/local/openfoam
df -k .

and you should see "something" like

Filesystem 1024-blocks Used Available Capacity iused ifree %iused Mounted on
/dev/disk9s2 4382680 3621640 761040 83% 203807 4294763472 0% /usr/local/openfoam

Miguel Hernandez September 19, 2021 11:28

Quote:

Originally Posted by federico.carminati (Post 812537)
Can you mount it on /usr/local/openfoam?

if yes do

cd /usr/local/openfoam
df -k .

and you should see "something" like

Filesystem 1024-blocks Used Available Capacity iused ifree %iused Mounted on
/dev/disk9s2 4382680 3621640 761040 83% 203807 4294763472 0% /usr/local/openfoam

I a see a lot of disk... the last one is:

/dev/disk4s2 4906968 28840 4878128 1% 6 4294967273 0% /usr/local/openfoam

federico.carminati September 19, 2021 12:57

good, now download the two tar files here

Source: https://dl.openfoam.com/source/v2106/OpenFOAM-v2106.tgz

ThirdParty: https://dl.openfoam.com/source/v2106...arty-v2106.tgz

and untar them into

/usr/local/openfoam

if you do not know how to do that, download the files and let me know. Best,

Miguel Hernandez September 19, 2021 13:22

Thank you, you are very kind!

I think I've done it, I "untarned" both files... under /usr/local/openfoam I see (ls command):

OpenFOAM-v2106 ThirdParty-v2106

federico.carminati September 19, 2021 14:07

you are almost there!!

$ source /usr/local/openfoam/OpenFOAM-v2106/etc/bashrc
$ cd /usr/local/openfoam/OpenFOAM-v2106
$ foamSystemCheck
$ ./Allwmake -s -l

and go for a coffee ;-)

Miguel Hernandez September 19, 2021 14:57

Unfortunately it doesn't work...
Maybe with all the tries before, I messed up something...

A lot of warning in the log file, e.g.:

warning: overriding currently unsupported use of floating point exceptions on this target [-Wunsupported-floating-point-opt]

and errors, e.g.:

signals/feexceptErsatz.H:39:24: error: no member named '__control' in 'fenv_t'
old_excepts = fenv.__control & FE_ALL_EXCEPT;
~~~~ ^

federico.carminati September 20, 2021 03:13

Did you delete all your previous tries from disk? Best


All times are GMT -4. The time now is 05:38.