CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Installation

[OpenFOAM.org] Installing OpenFOAM 4.1 on Mac OS Sierra

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 28, 2017, 17:31
Default Installing OpenFOAM 4.1 on Mac OS Sierra
  #1
New Member
 
Suffolk
Join Date: Nov 2015
Posts: 26
Rep Power: 11
spitchers is on a distinguished road
Hi everyone,

Could anyone point me in the right directions as how to install OpenFOAM 4.1 no Mac OS Sierra. I have tried the way explained on the OpenFOAM website but it doesn't seem to be working for me. Also I don't want to use the Docker environment. I just want to compile it in my Home directory and use the commands from the terminal like I do on my Linux system!

Any help would be much appreciated. I have installed MacPorts and all other obvious dependencies.
spitchers is offline   Reply With Quote

Old   April 29, 2017, 18:44
Default
  #2
Senior Member
 
khedar
Join Date: Oct 2016
Posts: 111
Rep Power: 10
khedar is on a distinguished road
Try this..
https://github.com/mrklein/openfoam-...ion-&-Homebrew


I installed on my air using this. It basically creates a disk of 8gb which you mount on staring your mac and then use the normal commands for running OF cases.
khedar is offline   Reply With Quote

Old   April 30, 2017, 12:26
Default
  #3
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi all,

@spitchers

Could you elaborate on "but it doesn't seem to be working for me"? Foundation thinks Docker is THE way and even proposes to use Docker on distributives, which are not Ubuntu.

Since you specified version (4.1), maybe this guide will be more suitable. Though currently 4.x is 4.1 with bug-fixes, so in theory it should be more stable.
alexeym is offline   Reply With Quote

Old   May 1, 2017, 15:45
Default
  #4
New Member
 
Suffolk
Join Date: Nov 2015
Posts: 26
Rep Power: 11
spitchers is on a distinguished road
I have tried both links and it is littered with errors. Has either of you installed OpenFOAM 4.0/4.1 on MAC OS SIERRA ? It may be an issue on my end. I will continue to look into it.
spitchers is offline   Reply With Quote

Old   May 1, 2017, 15:50
Default
  #5
Senior Member
 
khedar
Join Date: Oct 2016
Posts: 111
Rep Power: 10
khedar is on a distinguished road
What errors? Would be more useful if you elaborate. As I said in my previous post, I have installed using the link i posted on macOS Sierra and it worked without problems if my memory serves me right(I installed 4-5 months back.)

EDIT: I installed 4.x though.

Last edited by khedar; May 1, 2017 at 15:51. Reason: OF Version added.
khedar is offline   Reply With Quote

Old   May 1, 2017, 15:54
Default
  #6
New Member
 
Suffolk
Join Date: Nov 2015
Posts: 26
Rep Power: 11
spitchers is on a distinguished road
The first error occurs when I try to apply the Patch. I get the following error:

Code:
Shauns-MacBook-Pro:OpenFOAM-4.x Shaun$ git apply OpenFOAM-4.0.patch
error: patch failed: applications/utilities/postProcessing/dataConversion/foamToEnsight/Make/options:1
error: applications/utilities/postProcessing/dataConversion/foamToEnsight/Make/options: patch does not apply
error: patch failed: etc/bashrc:42
error: etc/bashrc: patch does not apply
error: patch failed: etc/config.sh/mpi:37
error: etc/config.sh/mpi: patch does not apply
error: patch failed: src/renumber/SloanRenumber/Make/options:1
error: src/renumber/SloanRenumber/Make/options: patch does not apply
I then get the following error:

Code:
Shauns-MacBook-Pro:OpenFOAM-4.x Shaun$ source etc/bashrc

    Your "Darwin" operating system is not supported by this release
    of OpenFOAM. For further assistance, please contact www.OpenFOAM.org
And subsequently the ./Allwmake command fails.

Thank you for your help.
spitchers is offline   Reply With Quote

Old   May 1, 2017, 16:03
Default
  #7
Senior Member
 
khedar
Join Date: Oct 2016
Posts: 111
Rep Power: 10
khedar is on a distinguished road
If patch application failed than it does not make any sense to go any further since it is sure to give errors. We need to find out why patch is not working first. Could you run 'history' command in the terminal and paste it here (It prints all the commands you executed in the past some time.)
khedar is offline   Reply With Quote

Old   May 2, 2017, 04:17
Default
  #8
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

@Suffolk

Could you explain WHY you are trying to apply patch for the version 4.0 on 4.x source tree (and I really do not know why we need to GUESS it from your command line)?
alexeym is offline   Reply With Quote

Old   May 25, 2017, 13:50
Default
  #9
New Member
 
Suffolk
Join Date: Nov 2015
Posts: 26
Rep Power: 11
spitchers is on a distinguished road
Sorry I am new to Mac OS and have little coding experience. I don't understand the errors I am getting so it is hard for me to give you the correct information to help me. Hence why I just copied and pasted everything from the command line.

Here is a snippet from my log Allmake File:

Code:
/bin/sh: -c: line 0: syntax error near unexpected token `;'
/bin/sh: -c: line 0: `; flex -+ -o/Users/Shaun/OpenFOAM/OpenFOAM-3.0.x/platforms/darwin64ClangDPInt64Opt/src/surfMesh/surfaceFormats/stl/STLsurfaceFormatASCII.L.C -f surfaceFormats/stl/STLsurfaceFormatASCII.L ; xcrun c++ -arch x86_64 -std=c++14 -Ddarwin64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=64 -Wall -Wextra -Wno-unused-parameter -Wno-overloaded-virtual -Wno-unused-variable -Wno-unused-local-typedef -Wno-invalid-offsetof -Wno-deprecated-register -Wno-undefined-var-template -O3  -DNoRepository -ftemplate-depth-100 -I/Users/Shaun/OpenFOAM/OpenFOAM-3.0.x/src/fileFormats/lnInclude -IlnInclude -I. -I/Users/Shaun/OpenFOAM/OpenFOAM-3.0.x/src/OpenFOAM/lnInclude -I/Users/Shaun/OpenFOAM/OpenFOAM-3.0.x/src/OSspecific/POSIX/lnInclude   -fPIC -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -Wno-shift-negative-value -c /Users/Shaun/OpenFOAM/OpenFOAM-3.0.x/platforms/darwin64ClangDPInt64Opt/src/surfMesh/surfaceFormats/stl/STLsurfaceFormatASCII.L.C -o /Users/Shaun/OpenFOAM/OpenFOAM-3.0.x/platforms/darwin64ClangDPInt64Opt/src/surfMesh/surfaceFormats/stl/STLsurfaceFormatASCII.o'
make: *** [/Users/Shaun/OpenFOAM/OpenFOAM-3.0.x/platforms/darwin64ClangDPInt64Opt/src/surfMesh/surfaceFormats/stl/STLsurfaceFormatASCII.o] Error 2
make: *** Waiting for unfinished jobs....
I have tried downloading both 4.x and 3.0.x and have been given the same error. I compiled with Clang, should I try Gcc?

I hope this helps.
spitchers is offline   Reply With Quote

Old   May 26, 2017, 06:32
Default
  #10
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

Gcc won't help, you can try but you will end up with the same error. As a workaround, you can turn on "quiet rules" by:

Code:
export WM_QUIET_RULES=Y
or wait till I update patches (couple of days). Since I do not like all these noise in my build logs, I did not even test build process without quiet rules.

A couple of questions.

1. AFAIK there is official BDSM kit (aka Docker image) from Foundation for people on macOS. Did you try it? It seems to be aimed at people with no experience in either macOS or programming.

2. There is bug tracker on Github, why not use it to report problems with installation?
alexeym is offline   Reply With Quote

Old   June 1, 2017, 15:13
Default
  #11
New Member
 
Suffolk
Join Date: Nov 2015
Posts: 26
Rep Power: 11
spitchers is on a distinguished road
Thank you for your help. I turned on quiet rules and it got over my previous error. It then compiled for about 1 hour and just stopped.

Some of the commands like blockMesh simpleFoam and others are working fine but not all commands. It's looking very promising though as it may have ran out because of a lack of memory available or something similar. I will try again tonight.

Could you please let me know when you have updated the patches.


Sent from my iPhone using CFD Online Forum mobile app
spitchers is offline   Reply With Quote

Old   June 2, 2017, 04:16
Default
  #12
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

Without context it is difficult to diagnose the problem. I have updated patches, so you have to start from scratch: delete partly-built version, download sources, apply patch, build.
alexeym is offline   Reply With Quote

Old   June 5, 2017, 13:40
Default
  #13
New Member
 
Suffolk
Join Date: Nov 2015
Posts: 26
Rep Power: 11
spitchers is on a distinguished road
Thank you for all your help Alexeym. I shall try again tonight with a fresh build. I spent most of the weekend installing gmsh and openCASCADE from source files. I don't like the packaged version of gmsh because when I was trying to mesh with a lot of cells , the gui would crash. So I installed it from scratch. All dependencies from mac ports, then built openCASCADE using cmake, then built gmsh the same way. I ran the gmsh command and meshed over night and it worked just fine! I was also able to save the log file. I'm starting to get the hang of it and it's feeling just like using a well-built UNIX OS.

I was very surprised that the GUI's of paraFoam and gmsh seem to run smoother on my MacBook Pro than they do on my workstation. I really have no idea why?

So my final step is to install OpenFOAM and I'm all set to go. I will keep you updated.


Sent from my iPhone using CFD Online Forum mobile app
spitchers is offline   Reply With Quote

Old   July 25, 2017, 04:54
Default 64bit Version
  #14
New Member
 
Suffolk
Join Date: Nov 2015
Posts: 26
Rep Power: 11
spitchers is on a distinguished road
Hi, I successfully installed OpenFOAM a while back. However only the 32bit version. I keep getting an error while trying the 64bit version. I have installed the packages scotch64.rb and metis64.rb, however I still get an error. Is there any flags or altercations I need to add to the patch ? I have Version 4.x installed.
spitchers is offline   Reply With Quote

Old   July 25, 2017, 05:02
Default
  #15
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

Could you be more specific? I.e. at least show the error.

And are you sure your models do not fit into 32-bit integers?
alexeym is offline   Reply With Quote

Old   July 25, 2017, 05:07
Default
  #16
New Member
 
Suffolk
Join Date: Nov 2015
Posts: 26
Rep Power: 11
spitchers is on a distinguished road
Here is a snippet from the log file. Thank you for your help My mesh will be 15Million Cells max, however I was told that a 64bit version would be more efficient and the 32bit version would "cap" my RAM usage. Is this correct?


Code:
/Users/shaunpitchers/OpenFOAM/OpenFOAM-4.x/src/parallel/decompose/scotchDecomp
xcrun c++ -arch x86_64 -std=c++14 -Ddarwin64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=64 -Wall -Wextra -Wno-unused-parameter -Wno-overloaded-virtual -Wno-unused-variable -Wno-unused-local-typedef -Wno-invalid-offsetof -Wno-deprecated-register -Wno-undefined-var-template -O3  -DNoRepository -ftemplate-depth-100 -DOMPI_SKIP_MPICXX -I/usr/local/Cellar/open-mpi/2.1.1/include -I/usr/local/opt/scotch/include -I../decompositionMethods/lnInclude -IlnInclude -I. -I/Users/shaunpitchers/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude -I/Users/shaunpitchers/OpenFOAM/OpenFOAM-4.x/src/OSspecific/POSIX/lnInclude   -fPIC -c scotchDecomp.C -o /Users/shaunpitchers/OpenFOAM/OpenFOAM-4.x/platforms/darwin64ClangDPInt64Opt/src/parallel/decompose/scotchDecomp/scotchDecomp.o
scotchDecomp.C:333:9: error: no matching function for call to 'SCOTCH_graphBuild'
        SCOTCH_graphBuild
        ^~~~~~~~~~~~~~~~~
/usr/local/opt/scotch/include/scotch.h:181:29: note: candidate function not viable: no known conversion from 'const_iterator' (aka 'const long long *') to 'const SCOTCH_Num *const' (aka 'const int *const') for 4th argument
int                         SCOTCH_graphBuild   (SCOTCH_Graph * const, const SCOTCH_Num, const SCOTCH_Num, const SCOTCH_Num * const, const SCOTCH_Num * const, const SCOTCH_Num * const, const SCOTCH_Num * const, const SCOTCH_Num, const SCOTCH_Num * const, const SCOTCH_Num * const);
                            ^
scotchDecomp.C:375:13: error: no matching function for call to 'SCOTCH_archCmpltw'
            SCOTCH_archCmpltw(&archdat, nProcessors_, processorWeights.begin()),
            ^~~~~~~~~~~~~~~~~
/usr/local/opt/scotch/include/scotch.h:156:29: note: candidate function not viable: no known conversion from 'iterator' (aka 'long long *') to 'const SCOTCH_Num *const' (aka 'const int *const') for 3rd argument
int                         SCOTCH_archCmpltw   (SCOTCH_Arch * const, const SCOTCH_Num, const SCOTCH_Num * const);
                            ^
scotchDecomp.C:443:9: error: no matching function for call to 'SCOTCH_graphMap'
        SCOTCH_graphMap
        ^~~~~~~~~~~~~~~
/usr/local/opt/scotch/include/scotch.h:210:29: note: candidate function not viable: no known conversion from 'iterator' (aka 'long long *') to 'SCOTCH_Num *const' (aka 'int *const') for 4th argument
int                         SCOTCH_graphMap     (SCOTCH_Graph * const, const SCOTCH_Arch * const, SCOTCH_Strat * const, SCOTCH_Num * const);
                            ^
3 errors generated.
make: *** [/Users/shaunpitchers/OpenFOAM/OpenFOAM-4.x/platforms/darwin64ClangDPInt64Opt/src/parallel/decompose/scotchDecomp/scotchDecomp.o] Error 1
spitchers is offline   Reply With Quote

Old   July 26, 2017, 06:43
Default
  #17
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
You confuse a little bit different bits

In terms of OpenFOAM 32 and 64 are the length of label type (WM_LABEL_SIZE parameter). This type is used to address lists and maximum values for 32 and 64 bits are (snippet from stdint.h):

Code:
#define INT32_MAX        2147483647
#define INT64_MAX        9223372036854775807LL
Another bits (WM_ARCH_OPTION) are caping memory addressing capabilities of the code. Still, even with 32-bit you can address up to 4G.

Though it seems certain pieces of build logic were lost during patches cleanup (since in provided error message include paths are from scotch compiled with 32-bit ints). I will take a look and update patches as soon as possible.
alexeym is offline   Reply With Quote

Old   July 26, 2017, 06:59
Default
  #18
New Member
 
Suffolk
Join Date: Nov 2015
Posts: 26
Rep Power: 11
spitchers is on a distinguished road
Thank you very much for your reply!

I built the code using 32bit label size for now as its working just fine. I have 16GB of RAM and my last simulation was using about 9GB so I think its okay.

I would like to extend my thanks for all your help during this thread. It has helped me a lot and now I have OpenFOAM built at home and at work I am learning at a much faster rate and will hopefully will be starting a PhD in a very similar area next year. You have been a life saver!

Best Regards,

Shaun
spitchers is offline   Reply With Quote

Old   August 11, 2017, 11:01
Default
  #19
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
You are welcome.

In what country they kill people without PhD?

I have updated patches, there was slight glitch in configuration logic, so it always selected 32-bit int packages even during build with WM_LABEL_SIZE=64.
alexeym is offline   Reply With Quote

Reply

Tags
installation, mac os, openfoam


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Docker] Running OpenFoam 4.1 from script without user intervention fnellmeldin OpenFOAM Running, Solving & CFD 9 June 7, 2017 19:04
Differences in interPhaseChangeFoam between OpenFOAM 2.3 and OpenFOAM 4.1 Mashiro5 OpenFOAM Running, Solving & CFD 2 May 29, 2017 05:13
[OpenFOAM.org] -bash: fluentMeshToFoam: command not found, after installing OpenFoam 2.3.x on Mac jundong OpenFOAM Installation 1 July 1, 2015 14:31
[swak4Foam] Installing swak4Foam to OpenFOAM in mac Kaquesang OpenFOAM Community Contributions 22 January 21, 2013 12:51
New OpenFOAM Forum Structure jola OpenFOAM 2 October 19, 2011 07:55


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