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

[OpenFOAM.org] Trying to build OpenFOAM 3.0.x with MacPorts

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By jjstickel

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 17, 2015, 17:24
Default Trying to build OpenFOAM 3.0.x with MacPorts
  #1
New Member
 
Jonathan
Join Date: Jan 2015
Posts: 20
Rep Power: 11
jjstickel is on a distinguished road
gschaider have you made a patch for 3.0.x? Thanks.

[Moderator note: Posts on this topic were moved from here: http://www.cfd-online.com/Forums/ope...oam-2-4-a.html]

Last edited by wyldckat; February 7, 2016 at 15:24. Reason: see "Moderator note:"
jjstickel is offline   Reply With Quote

Old   November 22, 2015, 10:01
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quote:
Originally Posted by jjstickel View Post
gschaider have you made a patch for 3.0.x? Thanks.
Quick answer: I can't answer for Bernhard, but I believe he's been pretty busy with a ton of work, based on what I've seen of his time spent here on the forum lately. Which in a sense is great, because it can mean that this way he's able to put more time into PyFoam and swak4Foam

Either way, Bernhard did mention in the past that he would happy to let anyone take over the work of providing said patches (I can't find the post for it right now ). And I know that Alexey Matveichev has been putting a lot of work into maintaining patches for both OpenFOAM and foam-extend: https://github.com/mrklein/openfoam-os-x/wiki - Alexey's patches are designed to work with Homebrew, but due to how there have been recent issues with Macports (something something db48 something something), it might be best to switch to Homebrew and using Alexey's patches.
wyldckat is offline   Reply With Quote

Old   November 30, 2015, 11:56
Default
  #3
New Member
 
Jonathan
Join Date: Jan 2015
Posts: 20
Rep Power: 11
jjstickel is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Quick answer: I can't answer for Bernhard, but I believe he's been pretty busy with a ton of work, based on what I've seen of his time spent here on the forum lately. Which in a sense is great, because it can mean that this way he's able to put more time into PyFoam and swak4Foam

Either way, Bernhard did mention in the past that he would happy to let anyone take over the work of providing said patches (I can't find the post for it right now ). And I know that Alexey Matveichev has been putting a lot of work into maintaining patches for both OpenFOAM and foam-extend: https://github.com/mrklein/openfoam-os-x/wiki - Alexey's patches are designed to work with Homebrew, but due to how there have been recent issues with Macports (something something db48 something something), it might be best to switch to Homebrew and using Alexey's patches.
It is understandable when folks become too busy to continue with volunteer contributions. I am rather vested in using Macports (for several other computational science applications), and unfortunately Macports and Homewbrew do not mix well. BTW, the db48 Macports issue is really a nonissue (I didn't see it; others that did reported they could ignore it and OpenFOAM still worked). Nonetheless, I tried adapting the patch from mrklein for OpenFOAM-3.x and Macports without success.

Ideally, we should work on a patch that applies to both Homebrew and Macports. I'm willing to help, but doing it on my own is beyond me.

Last edited by jjstickel; November 30, 2015 at 13:39.
jjstickel is offline   Reply With Quote

Old   November 30, 2015, 13:38
Default
  #4
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

Things to be adapted between patches:

1. Paths to third-party packages
2. wmake rules

Since you are "rather invested" in Macports I gues, you can retrieve package installation prefix using port command. wmake rules could be taken from earlier OpenFOAM versions (or adapted from Linux rules). IIRC conditional compilation rules with __clang__ symbol are used only to suppress diagnostics in certain places.

What were you problems during adaptation?
alexeym is offline   Reply With Quote

Old   December 1, 2015, 10:46
Default
  #5
New Member
 
Jonathan
Join Date: Jan 2015
Posts: 20
Rep Power: 11
jjstickel is on a distinguished road
Quote:
Originally Posted by alexeym View Post
Hi,

Things to be adapted between patches:

1. Paths to third-party packages
2. wmake rules

Since you are "rather invested" in Macports I gues, you can retrieve package installation prefix using port command. wmake rules could be taken from earlier OpenFOAM versions (or adapted from Linux rules). IIRC conditional compilation rules with __clang__ symbol are used only to suppress diagnostics in certain places.

What were you problems during adaptation?
To be consistent with my other Macports-installed software, I'd like to compile OpenFOAM with gcc(-49). The previous Macports-enabled OpenFOAM patches have extensive additions to etc/config/settings.sh to help with this, along with files in wmake/rules. I tried copying this stuff over to your (homebrew with clang) patch, but I either messed it up or there is some subtle difference with OpenFOAM-3.x. I've botched my build tree since my attempt, and so I can't report the build error at the moment.

I do see the homebrew specific lines in the other /etc/config/ files and was able to adapt them to Macports. I don't think that is the issue.
jjstickel is offline   Reply With Quote

Old   February 7, 2016, 12:13
Default OpenFOAM 3.0.x on Mac OS X and Macports
  #6
New Member
 
Join Date: Feb 2014
Posts: 17
Rep Power: 12
ChGr is on a distinguished road
Hey!

I'm looking for a way to compile OF 3.0.x on Mac OS X with Macports. Mr. Klein is providing a way of compiling OF 3.0.x using Homebrew (https://github.com/mrklein/openfoam-os-x).

Is there a patch for compiling with Macports instead of Homebrew?
ChGr is offline   Reply With Quote

Old   February 19, 2016, 17:02
Default success with MacPorts!
  #7
New Member
 
Jonathan
Join Date: Jan 2015
Posts: 20
Rep Power: 11
jjstickel is on a distinguished road
Working from Alexey's patch (with Homebrew focus), I have successfully compiled OpenFOAM-3.0.1 with MacPorts-supplied dependencies. This is with OS X Yosemite, 10.10.5; Xcode-7.2.1. Patch attached.

Important note: this patch has a few things hardcoded and needs improvement to apply to different use cases. For example, cgal, metis, and scotch version numbers are hardcoded in their respective config files in etc/config. It also presumes that Macports is located in /opt/local/.

Also, perhaps of more significance, this patch only works for Apple Clang as the compiler, and with openmpi (not mpich). The previous 2.x patches provided by Bernhard Gschaider had a lot of extra code to enable use of gcc and either mpich or openmpi. I do not have the bandwidth to get that stuff included (I barely got this far).

From Macports, you will need:
Code:
scotch -mpich +openmpi
cgal
metis
ccache
bison
boost
Note the lack of compiler variants, especially on scotch. If you add a compiler variant, it will get the compiler from Macports and will likely cause trouble with building openfoam using apple clang. I got an error with macports' flex installed, so I uninstalled it.

Good luck!
Attached Files
File Type: patch OpenFOAM-3.0.1_alt_mp.patch (88.3 KB, 38 views)
wyldckat likes this.
jjstickel is offline   Reply With Quote

Old   March 18, 2016, 05:27
Default
  #8
Member
 
Join Date: Aug 2012
Posts: 33
Rep Power: 13
gigilentini8 is on a distinguished road
Any idea why is it not working with clang-3.8 from macports?

(EDIT: I actually get the same errors even if I use the apple clang compiler. any clue?)

Code:
OpenFOAM/OpenFOAM-3.0.x/platforms/darwin64ClangDPInt32Opt/src/surfMesh/surfaceFormats/stl/STLsurfaceFormatASCII.L.C:5494:8: error: member reference
      type 'std::istream *' (aka 'basic_istream<char> *') is a pointer; maybe you meant to use '->'?
                        yyin.rdbuf(std::cin.rdbuf());
and many others similar to this...

Quote:
Originally Posted by jjstickel View Post
Working from Alexey's patch (with Homebrew focus), I have successfully compiled OpenFOAM-3.0.1 with MacPorts-supplied dependencies. This is with OS X Yosemite, 10.10.5; Xcode-7.2.1. Patch attached.

Important note: this patch has a few things hardcoded and needs improvement to apply to different use cases. For example, cgal, metis, and scotch version numbers are hardcoded in their respective config files in etc/config. It also presumes that Macports is located in /opt/local/.

Also, perhaps of more significance, this patch only works for Apple Clang as the compiler, and with openmpi (not mpich). The previous 2.x patches provided by Bernhard Gschaider had a lot of extra code to enable use of gcc and either mpich or openmpi. I do not have the bandwidth to get that stuff included (I barely got this far).

From Macports, you will need:
Code:
scotch -mpich +openmpi
cgal
metis
ccache
bison
boost
Note the lack of compiler variants, especially on scotch. If you add a compiler variant, it will get the compiler from Macports and will likely cause trouble with building openfoam using apple clang. I got an error with macports' flex installed, so I uninstalled it.

Good luck!
gigilentini8 is offline   Reply With Quote

Old   March 18, 2016, 11:46
Default
  #9
New Member
 
Jonathan
Join Date: Jan 2015
Posts: 20
Rep Power: 11
jjstickel is on a distinguished road
Quote:
Originally Posted by gigilentini8 View Post
Any idea why is it not working with clang-3.8 from macports?

(EDIT: I actually get the same errors even if I use the apple clang compiler. any clue?)

Code:
OpenFOAM/OpenFOAM-3.0.x/platforms/darwin64ClangDPInt32Opt/src/surfMesh/surfaceFormats/stl/STLsurfaceFormatASCII.L.C:5494:8: error: member reference
      type 'std::istream *' (aka 'basic_istream<char> *') is a pointer; maybe you meant to use '->'?
                        yyin.rdbuf(std::cin.rdbuf());
and many others similar to this...
Sorry, I don't know. I found that OpenFOAM throws various errors for different compilers. Did you apply the patch? Are you sure you are using Apple clang? What is the output of "which clang"?
jjstickel is offline   Reply With Quote

Old   March 18, 2016, 18:14
Default
  #10
Member
 
Join Date: Aug 2012
Posts: 33
Rep Power: 13
gigilentini8 is on a distinguished road
Quote:
Originally Posted by jjstickel View Post
Sorry, I don't know. I found that OpenFOAM throws various errors for different compilers. Did you apply the patch? Are you sure you are using Apple clang? What is the output of "which clang"?
yep
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.3.0
Thread model: posix

are you using repos version or 3.0.1?
gigilentini8 is offline   Reply With Quote

Old   March 21, 2016, 08:37
Default
  #11
New Member
 
Jonathan
Join Date: Jan 2015
Posts: 20
Rep Power: 11
jjstickel is on a distinguished road
Quote:
Originally Posted by gigilentini8 View Post
yep
are you using repos version or 3.0.1?
OpenFOAM-3.0.1
jjstickel is offline   Reply With Quote

Reply


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
[swak4Foam] swak4Foam and OpenFoam 3.0.x fs82 OpenFOAM Community Contributions 38 September 10, 2018 17:44
[OpenFOAM.org] OpenFOAM 3.0.x compilation error on OpenSUSE 13.1 Wang@nitech OpenFOAM Installation 3 January 22, 2016 09:02
OpenFoam 1.6-ext - RPM build errors preibie OpenFOAM 12 September 8, 2011 03:12
OpenFOAM static build on Cray XT5 asaijo OpenFOAM Installation 9 April 6, 2011 12:21
How to Install OpenFOAM on 64 Ubuntu 9.04 hansel OpenFOAM Installation 62 March 19, 2010 14:43


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