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

Question about openFOAM installation on Mac

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 21, 2014, 17:22
Default Question about openFOAM installation on Mac
  #1
New Member
 
Join Date: Jan 2013
Posts: 11
Rep Power: 13
MohandeseIrani is on a distinguished road
Hello you guys,

I want to install openFOAM v2.3.0 on MacBook Pro with Yosemite 10.10. I followed the instructions from this web-site : http://openfoamwiki.net/index.php/In...OpenFOAM_2.2.2

everything seemed to run smooth, except for after about 2 hours compiling, it was not successfully finished! I attached my log-file here and appreciate some tips from you. The log-file was too big and I had to split it into two files, the first one comes with this post and the other one with the next!

Thank you and
best regards
Attached Files
File Type: gz log_part1.tar.gz (92.3 KB, 6 views)
MohandeseIrani is offline   Reply With Quote

Old   October 21, 2014, 17:23
Default Question about openFOAM installation on Mac
  #2
New Member
 
Join Date: Jan 2013
Posts: 11
Rep Power: 13
MohandeseIrani is on a distinguished road
This is the part-2 of my log file.

Thanks again and
best regards
Attached Files
File Type: gz log_part2.tar.gz (57.6 KB, 5 views)
MohandeseIrani is offline   Reply With Quote

Old   October 22, 2014, 01:40
Default
  #3
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,

I was able to find 2 errors in your log files (for the future: there's no need to tar single file, just use gzip, so others can view it with zless without need to untar it).

1. Strange libmpi.1.dylib in /usr/local/lib that lead to errors during build of scotch library. A don't know why it's there, if you've installed it with package manager, maybe it's worth using WM_MPLIB=SYSTEMOPENMPI in etc/bashrc.

2. Strange flex behavior, it seems you're using gcc and flex from different SDKs.

Can you post output of the command:

Code:
$ flex --version
?
alexeym is offline   Reply With Quote

Old   October 22, 2014, 04:24
Default
  #4
New Member
 
Join Date: Jan 2013
Posts: 11
Rep Power: 13
MohandeseIrani is on a distinguished road
Quote:
Originally Posted by alexeym View Post
Hi,

I was able to find 2 errors in your log files (for the future: there's no need to tar single file, just use gzip, so others can view it with zless without need to untar it).

1. Strange libmpi.1.dylib in /usr/local/lib that lead to errors during build of scotch library. A don't know why it's there, if you've installed it with package manager, maybe it's worth using WM_MPLIB=SYSTEMOPENMPI in etc/bashrc.

2. Strange flex behavior, it seems you're using gcc and flex from different SDKs.

Can you post output of the command:

Code:
$ flex --version
?
dear alexeym,

1. about your 1st point, I set the WM_MPLIB in my bashrc file once to OPENMPI and the other time to SYSTEMOPENMPI. The compile procedure has terminated a lot quicker (within 10 minutes) as it was set to SYSTEMOPENMPI, so I used OPENMPI. by the way I have no clue about the difference of these two.

2. This is the output of flex --version
flex 2.5.35 Apple(flex-31)

than you very much for your kind answer
best regards
MohandeseIrani is offline   Reply With Quote

Old   October 22, 2014, 05:38
Default
  #5
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,

You've got somehow OpenMPI installed and it's not compatible with your gcc installation. The same thing with flex (well, not exactly, as you've got flex with Apple's CLT).

Also as you've got gcc 4.8 installed I guess you've followed installation instructions with a bit of improvisation. Can you describe the exact process of installation? (Also I've seen such kind of build errors when people tried to mix Macports and Homebrew software, I hope this is not the case).
alexeym is offline   Reply With Quote

Old   October 22, 2014, 06:00
Default
  #6
New Member
 
Join Date: Jan 2013
Posts: 11
Rep Power: 13
MohandeseIrani is on a distinguished road
Quote:
Originally Posted by alexeym View Post
Hi,

You've got somehow OpenMPI installed and it's not compatible with your gcc installation. The same thing with flex (well, not exactly, as you've got flex with Apple's CLT).

Also as you've got gcc 4.8 installed I guess you've followed installation instructions with a bit of improvisation. Can you describe the exact process of installation? (Also I've seen such kind of build errors when people tried to mix Macports and Homebrew software, I hope this is not the case).
Okay, here are the instructions I followed:

1. Installation of Command line tools for OS X and MacPorts. Both ran smoothly with no errors.

2.Doing the following in terminal:
sudo port selfupdate
sudo port install gcc46 openmpi boost cgal ccache flex bison

Note that the gcc46 couldn't have been installed on my system (Yosemite), I don't know why, so I got the gcc48 installed on my system and installed the openmpi, boost, coal, flex and bison after that.
The other strange thing was that, I wanted to set the compiler to gcc48, so I typed this in terminal: sudo port select gcc mp-gcc48
and got the following : Selecting 'mp-gcc48' for 'gcc' succeeded. 'mp-gcc48' is now active.
but yet when I check the version of gcc in terminal by using gcc --version, I get the following:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer//usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.0.0
Thread model: posix

3- Creation of the sparse image and copy the source files and doing the patches.

4- Creation of the following symlink:
#Current Folder: ~/OpenFOAM/OpenFOAM-2.3/wmake/rules
ln -s darwinIntel64Gcc/ darwinIntel64Gcc48 (I entered Gcc48 as I had installed gcc4.8)

5- gave write permission to addr2line4Mac.py: chmod a+x bin/addr2line4Mac.py

6- edit bashrc as following:
export WM_COMPILER=Gcc48
export WM_MPLIB=OPENMPI

and add these at the end of bashrc
export WM_CC='gcc-mp-4.8'
export WM_CXX='g++-mp-4.8'
export WM_NCOMPPROCS=4
ulimit -n 1024

7-Symlink to mpirun, this was somewhere else in my computer:
#Current Folder: ~/OpenFOAM/OpenFOAM-2.2.2/bin
ln -s /opt/local/libexec/openmpi-mp/mpirun mpirun

8-edit the following file
#Current Folder: ~/OpenFOAM/OpenFOAM-2.2.2
sudo nano src/renumber/SloanRenumber/Make/options
from : -L$(BOOST_ARCH_PATH)/lib -lboost_thread \
to : -L$(BOOST_ARCH_PATH)/lib -lboost_thread-mt \

9- source the basic with . etc/bashrc

10-compile with ./Allwmake 2>&1 | tee logName.log
MohandeseIrani is offline   Reply With Quote

Old   October 22, 2014, 08:27
Default
  #7
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
Well...

1. As you've installed all dependencies (openmpi, boost etc.) using Macports, you don't need ThirdParty tarball.

2. Even though you've installed gcc and flex using Macports, you're still using Apple's version of gcc and flex. In case of gcc, you've solved it using

Code:
export WM_CC='gcc-mp-4.8'
export WM_CXX='g++-mp-4.8'
in case of flex, you've decided to continue using Apple's version of it, but gcc from Macports and flex from Apple are a little bit incompatible (and vice-a-verse clang doesn't like flex from Macports).

Maybe it's just a question of environment variables (so after you reopen terminal, you'll be using Macport's gcc and flex). Maybe it's something else.

As I don't use Macports, can't suggest you anything but wait till somebody using Yosemite, Macports, and OpenFOAM to reproduce your problem and suggest a solution.
alexeym is offline   Reply With Quote

Old   October 22, 2014, 10:02
Default
  #8
New Member
 
Join Date: Jan 2013
Posts: 11
Rep Power: 13
MohandeseIrani is on a distinguished road
I have a question for you. As fr as I know, flex is not installed by default on Yosemite. The place my flex is located is under /opt/local/bin and when I check the creation time of this file, this is exactly the time that I installed flex by means of MacPorts.
Yet, in /opt/local/var/macports/software/flex folder, there exist a file named flex-2.5.37_1.darwin_14.x86_64.tbz2 (notice the difference between version of this file and the one I get from flex --version!)
Anyhow, extracting this file, gives me the opt directory with its bin, local, etc .. files. when I again check the version of this flex exec, it gives me the version 2.5.35! how could it be?
There is only one flex exec existing on my computer (as I searched for all)!
what's wrong here??
MohandeseIrani is offline   Reply With Quote

Old   October 22, 2014, 15:40
Default
  #9
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
Well, flex is not a part of Yosemite but part of Apple's CLT. Are you sure your flex is under /opt/local/bin? What's the output of

Code:
$ which flex
?

In my case (though I do not use Macports and did not install flex additionally) it is /usr/bin/flex (i.e. a part of CLT). With Xcode 6.1 it is:

Code:
myself at computer in ~$ flex --version
flex 2.5.35 Apple(flex-31)
alexeym is offline   Reply With Quote

Old   October 22, 2014, 18:49
Default
  #10
New Member
 
Join Date: Jan 2013
Posts: 11
Rep Power: 13
MohandeseIrani is on a distinguished road
man, I really appreciate your help. the output of which flex is /usr/local/bin/flex
any lead?
MohandeseIrani is offline   Reply With Quote

Old   October 23, 2014, 02:34
Default
  #11
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
As there's a mess with software tools versions, please post the output of the following commands:

Code:
$ gcc-mp-4.8 --version
$ flex --version
$ port installed
(though as flex is in /usr/local/bin, it seems to be installed by Macports, gcc-mp-4.8 also seems to be from Macports; so you can try to compile OpenFOAM again using WM_MPLIB=SYSTEMOPENMPI)
alexeym is offline   Reply With Quote

Old   October 23, 2014, 05:46
Default
  #12
New Member
 
Join Date: Jan 2013
Posts: 11
Rep Power: 13
MohandeseIrani is on a distinguished road
ok, there you go:

Input : gcc-mp-4.8 --version
Output : gcc-mp-4.8 (MacPorts gcc48 4.8.3_0) 4.8.3
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Input: flex --version
Output: flex 2.5.35

Input: port installed
Output: The following ports are currently installed:
autoconf @2.69_2 (active)
automake @1.14.1_2 (active)
bison @2.7.1_0 (active)
boost @1.56.0_1+no_single+no_static+python27 (active)
bzip2 @1.0.6_0 (active)
ccache @3.1.9_0 (active)
cctools @855_1+llvm35 (active)
cctools-headers @855_0 (active)
cgal @4.4_0 (active)
cloog @0.18.2_0 (active)
cmake @3.0.2_0 (active)
curl @7.38.0_0+ssl (active)
curl-ca-bundle @7.38.0_0 (active)
db48 @4.8.30_3 (active)
db_select @0.1_2 (active)
dyld-headers @239.3_0 (active)
eigen3 @3.2.2_0 (active)
expat @2.1.0_0 (active)
flex @2.5.37_1 (active)
gcc48 @4.8.3_0 (active)
gcc49 @4.9.1_0 (active)
gcc_select @0.1_8 (active)
gdbm @1.11_0 (active)
gettext @0.19.2_0 (active)
glpk @4.48_0 (active)
gmp @6.0.0_1 (active)
gperf @3.0.4_2 (active)
hwloc @1.8.1_0 (active)
icu @53.1_1 (active)
isl @0.13_0 (active)
ld64 @236.3_1+llvm35 (active)
libarchive @3.1.2_0 (active)
libcxx @183506_1 (active)
libedit @20121213-3.0_0 (active)
libffi @3.1_4 (active)
libgcc @4.9.1_0 (active)
libiconv @1.14_0 (active)
libidn @1.29_0 (active)
libmpc @1.0.2_0 (active)
libtool @2.4.2_4 (active)
libxml2 @2.9.1_0 (active)
llvm-3.5 @3.5-r216817_0+assertions (active)
llvm_select @1.0_0 (active)
lzo2 @2.06_0 (active)
m4 @1.4.17_0 (active)
mpfr @3.1.2-p10_0 (active)
mpi-doc @3.1.2_0 (active)
mpi_select @0.0_3 (active)
ncurses @5.9_2 (active)
openmpi @1.7.5_3 (active)
openmpi-default @1.7.5_3+gcc48 (active)
openssl @1.0.1i_0 (active)
perl5 @5.12.4_0+perl5_16 (active)
perl5.16 @5.16.3_0 (active)
pkgconfig @0.28_0 (active)
ppl @1.1_0 (active)
python27 @2.7.8_2 (active)
python_select @0.3_3 (active)
sqlite3 @3.8.6_0 (active)
xz @5.0.7_0 (active)
zlib @1.2.8_0 (active)
MohandeseIrani is offline   Reply With Quote

Old   October 23, 2014, 06:12
Default
  #13
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
Well, gcc is OK, but you've got strange problem with flex: version of the flex in PATH is 2.5.35 and version of the tool installed using Macports is 2.5.37_1. So you've got several solutions:

1. Get rid of /usr/local/bin/flex Either by deleting it or by moving /opt/local/bin (where Macport's flex resides) upper in PATH hierarchy; i.e. somewhere in the end of your .profile you can put a line:

Code:
export $PATH=/opt/local/bin:$PATH
2. Go to .../OpenFOAM-2.3.0/wmake/rules/General (the folder with wmake rules), and put absolute path of the flex (/opt/local/bin/flex) utility in flex and flex++ files. I.e. instead of

Code:
.SUFFIXES: .l

ltoo = flex -o$*.c $$SOURCE ; $(cc) $(cFLAGS) -c $*.c -o $@

.l.dep:
        $(MAKE_DEP)
you should have

Code:
.SUFFIXES: .l

ltoo = /opt/local/bin/flex -o$*.c $$SOURCE ; $(cc) $(cFLAGS) -c $*.c -o $@

.l.dep:
        $(MAKE_DEP)
in .../OpenFOAM-2.3.0/wmake/rules/General/flex file.

Also I guess there's certain procedure of setting default MPI in Macports (something like sudo port select --set mpi openmpi) or you can create symlinks like you did on step 7 but this time create symlinks for mpiexec, mpirun, and mpicc. Though I'm not quite sure in this part as I don't remember what names are used in wmake rules in Bernhard Gschaider's patch.

After that you can repeat step 9 and 10 that you've already done.
alexeym is offline   Reply With Quote

Old   October 26, 2014, 01:47
Default
  #14
New Member
 
Sriram Krishnaswamy
Join Date: Dec 2012
Location: Gainesville, USA
Posts: 3
Rep Power: 13
kesari is on a distinguished road
Quote:
2. Go to .../OpenFOAM-2.3.0/wmake/rules/General (the folder with wmake rules), and put absolute path of the flex (/opt/local/bin/flex) utility in flex and flex++ files.
I had the exact same problem and this solution seems to be working. At least it is getting compiled without any errors. Will post update once, and if, it is successful.

The reason for this error is the unavailability of patch for gcc46 as seen from this link - https://trac.macports.org/ticket/43978

Update: It worked. I had also set the defaults for ports as python27 (for python) and openmpi for (mpirun).

Last edited by kesari; October 26, 2014 at 02:48.
kesari is offline   Reply With Quote

Old   October 28, 2014, 09:28
Default
  #15
New Member
 
Join Date: Jan 2013
Posts: 11
Rep Power: 13
MohandeseIrani is on a distinguished road
After installing 1000 times the flex, openmpi and ........ I decided to re-install my operating system.
A friend of mine suggested using homeBrew instead of MacPorts (Which was absolutely a great Idea), and I found another instructions for installing openFoam and followed it, and it worked like magic!!
Thank you for your kind help (I can assume that if you had my Mac in your hands, you could definitely fix it), I'll leave this new instruction here, for new users, willing to install OpenFOAM on OS greater than 10.8
https://github.com/mrklein/openfoam-...20+%20Homebrew

best regards,
MohandeseIrani is offline   Reply With Quote

Reply

Tags
openfoam, yosemite

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Frequently Asked Questions about Installing OpenFOAM wyldckat OpenFOAM Installation 3 November 14, 2023 11:58
OpenFOAM 2.2.2 source pack installation on Xubuntu 13.10 zordiack OpenFOAM Installation 1 October 26, 2013 13:08
Is it a good idea to use OpenFoam on a Mac (OS 10.7.5) or on Windows7? bzz77 OpenFOAM Installation 4 November 21, 2012 17:06
OpenFOAM 1.7 installation on Mac pepe.aero OpenFOAM Installation 0 April 16, 2011 12:32
64bitrhel5 OF installation instructions mirko OpenFOAM Installation 2 August 12, 2008 18:07


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