CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Installation on Windows, Mac and other Unsupported Platforms

OF 1.9 (aka OF 2.1) on Mac OS X

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

Like Tree25Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   February 22, 2013, 19:39
Default
  #241
Senior Member
 
Matthew Denno
Join Date: Feb 2010
Posts: 138
Rep Power: 8
mgdenno is on a distinguished road
Quote:
Originally Posted by perjorgen View Post
I found the error: The Make/options has been changed so the patch was rejected
I manually added the necessary link files and it worked
perjorgen,

I am having the same problem. I have the options, options.rej, options.org files open, but I am not too familiar with patching files. Would you be able to share what your patched options file looks like?

Thanks
mgdenno is offline   Reply With Quote

Old   February 23, 2013, 05:03
Default
  #242
New Member
 
Per Jørgensen
Join Date: Mar 2012
Posts: 12
Rep Power: 6
perjorgen is on a distinguished road
Quote:
Originally Posted by mgdenno View Post
perjorgen,

I am having the same problem. I have the options, options.rej, options.org files open, but I am not too familiar with patching files. Would you be able to share what your patched options file looks like?

Thanks
Sure:


EXE_INC = \
-IphaseModel/lnInclude \
-ImultiphaseSystem/lnInclude \
-ImultiphaseFixedFluxPressure \
/*-IkineticTheoryModels/lnInclude*/ \
-IinterfacialModels/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/incompressible/LES/LESModel \
-I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude

EXE_LIBS = \
-lmultiphaseSystem \
-lcompressibleMultiPhaseModel \
-linterfaceProperties \
-lincompressibleTransportModels \
-lcompressibleMultiphaseEulerianInterfacialModels \
-lincompressibleTurbulenceModel \
/*-lcompressibleKineticTheoryModel*/ \
-lincompressibleLESModels \
-lincompressibleRASModels \
-lfiniteVolume
perjorgen is offline   Reply With Quote

Old   February 23, 2013, 05:09
Default AVX on OS X
  #243
New Member
 
Per Jørgensen
Join Date: Mar 2012
Posts: 12
Rep Power: 6
perjorgen is on a distinguished road
Hi

I would like to compile an optimized OpenFOAM using AVX instruction set.
But the OS X assembler does not recognize AVX. I found a suggested fix but it does not seem to work
Does anyone have had success in compiling OpenFOAM with AVX on OS X?

Best regards,

Per
perjorgen is offline   Reply With Quote

Old   February 23, 2013, 19:53
Default
  #244
Senior Member
 
Matthew Denno
Join Date: Feb 2010
Posts: 138
Rep Power: 8
mgdenno is on a distinguished road
perjorgen,

Thanks for the file contents.

Matt
mgdenno is offline   Reply With Quote

Old   February 24, 2013, 08:33
Default
  #245
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,926
Rep Power: 41
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by perjorgen View Post
Hi

I would like to compile an optimized OpenFOAM using AVX instruction set.
But the OS X assembler does not recognize AVX. I found a suggested fix but it does not seem to work
Does anyone have had success in compiling OpenFOAM with AVX on OS X?

Best regards,

Per
It seems that AVX-support is in gcc since version 4.6 and googling for "AVX MacPorts" gives a number of interesting links. Amongst them:
http://stackoverflow.com/questions/9...-mac-os-x-lion

Note: I'm currently having strange problems compiling OF with gcc-mp-4.7 but 4.6 works (clang needs some changes, but then the compiler runs out of memory when compiling the swak-parsers with -O2 .... on a 8 Gig machine ... so it is unusable for me)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   February 24, 2013, 17:51
Default
  #246
New Member
 
Per Jørgensen
Join Date: Mar 2012
Posts: 12
Rep Power: 6
perjorgen is on a distinguished road
Quote:
Originally Posted by gschaider View Post
It seems that AVX-support is in gcc since version 4.6 and googling for "AVX MacPorts" gives a number of interesting links. Amongst them:
http://stackoverflow.com/questions/9...-mac-os-x-lion

Note: I'm currently having strange problems compiling OF with gcc-mp-4.7 but 4.6 works (clang needs some changes, but then the compiler runs out of memory when compiling the swak-parsers with -O2 .... on a 8 Gig machine ... so it is unusable for me)
I've tried the workaraound but when ask for the assembler version I get the same version number (1.38) that doesn't understand AVX
perjorgen is offline   Reply With Quote

Old   February 27, 2013, 17:13
Default Mountain Lion
  #247
New Member
 
Thomas Olsen
Join Date: Feb 2013
Posts: 6
Rep Power: 5
tholsen is on a distinguished road
Greetings,

I'm another newbie to OpenFOAM and I have a problem with the mpi.h header file not being found.

My make.log file gives:

Code:
+ wmakeLnInclude OSspecific/POSIX
+ Pstream/Allwmake
+ wmake libso dummy
'${HOME}/OpenFOAM/OpenFOAM-2.1.x/platforms/darwinIntel64Gcc46DPOpt/lib/dummy/libPstream.dylib' is up to date.
+ case "$WM_MPLIB" in
+ set +x

Note: ignore spurious warnings about missing mpicxx.h headers

wmake libso mpi
SOURCE=UIPread.C ;  g++-mp-4.6 -m64 -fsignaling-nans  -ftrapping-math -DdarwinIntel64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O2  -DNoRepository -ftemplate-depth-100   -IlnInclude -I. -I${HOME}/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude -I${HOME}/OpenFOAM/OpenFOAM-2.1.x/src/OSspecific/POSIX/lnInclude   -fPIC -Ddarwin -c $SOURCE -o Make/darwinIntel64Gcc46DPOptMACPORTOPENMPI/UIPread.o
SOURCE=UOPwrite.C ;  g++-mp-4.6 -m64 -fsignaling-nans  -ftrapping-math -DdarwinIntel64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O2  -DNoRepository -ftemplate-depth-100   -IlnInclude -I. -I${HOME}/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude -I${HOME}/OpenFOAM/OpenFOAM-2.1.x/src/OSspecific/POSIX/lnInclude   -fPIC -Ddarwin -c $SOURCE -o Make/darwinIntel64Gcc46DPOptMACPORTOPENMPI/UOPwrite.o
UIPread.C:29:17: fatal error: mpi.h: No such file or directory
compilation terminated.
UOPwrite.C:29:17: fatal error: mpi.h: No such file or directory
compilation terminated.
make: *** [Make/darwinIntel64Gcc46DPOptMACPORTOPENMPI/UIPread.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [Make/darwinIntel64Gcc46DPOptMACPORTOPENMPI/UOPwrite.o] Error 1
I followed the instructions at http://openfoamwiki.net/index.php/Ho...enFOAM_v21_Mac

I'm using openmpi 1.6.3 from macports and gcc-mp-4.6, g++-mp-4.6, and openmpicc for scotch-5.1.11. I set WM_MPLIB=SYSTEMOPENMPI as discussed in this thread and the patch for config/settings.sh changes this to export WM_MPLIB=MACPORTOPENMPI

I think that these are all the relevant points for openmpi from macports.

If you need any more information, just ask.

Thank you,

Tom
Attached Files
File Type: gz make.log.tar.gz (74.5 KB, 2 views)
tholsen is offline   Reply With Quote

Old   March 1, 2013, 07:09
Default
  #248
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,926
Rep Power: 41
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by tholsen View Post
Greetings,

I'm another newbie to OpenFOAM and I have a problem with the mpi.h header file not being found.

My make.log file gives:

Code:
+ wmakeLnInclude OSspecific/POSIX
+ Pstream/Allwmake
+ wmake libso dummy
'${HOME}/OpenFOAM/OpenFOAM-2.1.x/platforms/darwinIntel64Gcc46DPOpt/lib/dummy/libPstream.dylib' is up to date.
+ case "$WM_MPLIB" in
+ set +x

Note: ignore spurious warnings about missing mpicxx.h headers

wmake libso mpi
SOURCE=UIPread.C ;  g++-mp-4.6 -m64 -fsignaling-nans  -ftrapping-math -DdarwinIntel64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O2  -DNoRepository -ftemplate-depth-100   -IlnInclude -I. -I${HOME}/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude -I${HOME}/OpenFOAM/OpenFOAM-2.1.x/src/OSspecific/POSIX/lnInclude   -fPIC -Ddarwin -c $SOURCE -o Make/darwinIntel64Gcc46DPOptMACPORTOPENMPI/UIPread.o
SOURCE=UOPwrite.C ;  g++-mp-4.6 -m64 -fsignaling-nans  -ftrapping-math -DdarwinIntel64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O2  -DNoRepository -ftemplate-depth-100   -IlnInclude -I. -I${HOME}/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude -I${HOME}/OpenFOAM/OpenFOAM-2.1.x/src/OSspecific/POSIX/lnInclude   -fPIC -Ddarwin -c $SOURCE -o Make/darwinIntel64Gcc46DPOptMACPORTOPENMPI/UOPwrite.o
UIPread.C:29:17: fatal error: mpi.h: No such file or directory
compilation terminated.
UOPwrite.C:29:17: fatal error: mpi.h: No such file or directory
compilation terminated.
make: *** [Make/darwinIntel64Gcc46DPOptMACPORTOPENMPI/UIPread.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [Make/darwinIntel64Gcc46DPOptMACPORTOPENMPI/UOPwrite.o] Error 1
I followed the instructions at http://openfoamwiki.net/index.php/Ho...enFOAM_v21_Mac

I'm using openmpi 1.6.3 from macports and gcc-mp-4.6, g++-mp-4.6, and openmpicc for scotch-5.1.11. I set WM_MPLIB=SYSTEMOPENMPI as discussed in this thread and the patch for config/settings.sh changes this to export WM_MPLIB=MACPORTOPENMPI

I think that these are all the relevant points for openmpi from macports.

If you need any more information, just ask.

Thank you,

Tom
Which shell are you using? The ${HOME} in the output puzzle me

To clarify: forget about SYSTEMOPENMPI. MACPORTOPENMPI should be the value

The compiler calls for me look something like this:
Code:
SOURCE=UOPwrite.C ; ccache g++-mp-4.6 -m64 -fsignaling-nans  -ftrapping-math -DdarwinIntel64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O2  -DNoRepository -ftemplate-depth-100 -DOMPI_SKIP_MPICXX -I/opt/local/include/openmpi -IlnInclude -I. -I/Users/bgschaid/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude -I/Users/bgschaid/OpenFOAM/OpenFOAM-2.1.x/src/OSspecific/POSIX/lnInclude   -fPIC -Ddarwin -c $SOURCE -o Make/darwinIntel64Gcc46DPOptMACPORTOPENMPI/UOPwrite.o
So it seems like your version doesn't pick up anything about the correct location of openmpi

BTW: which version of the patch are you using? MACPORTOPENMPI is only in newer versions
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   March 1, 2013, 16:04
Default
  #249
New Member
 
Thomas Olsen
Join Date: Feb 2013
Posts: 6
Rep Power: 5
tholsen is on a distinguished road
Quote:
Originally Posted by gschaider View Post
Which shell are you using? The ${HOME} in the output puzzle me
I'm using the GNU bash shell, version 3.2.48(1)-release (x86_64-apple-darwin12). I simply eliminated my path and replaced it with ${HOME} in the make.log file.

Quote:
To clarify: forget about SYSTEMOPENMPI. MACPORTOPENMPI should be the value

The compiler calls for me look something like this:
Code:
SOURCE=UOPwrite.C ; ccache g++-mp-4.6 -m64 -fsignaling-nans  -ftrapping-math -DdarwinIntel64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O2  -DNoRepository -ftemplate-depth-100 -DOMPI_SKIP_MPICXX -I/opt/local/include/openmpi -IlnInclude -I. -I/Users/bgschaid/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude -I/Users/bgschaid/OpenFOAM/OpenFOAM-2.1.x/src/OSspecific/POSIX/lnInclude   -fPIC -Ddarwin -c $SOURCE -o Make/darwinIntel64Gcc46DPOptMACPORTOPENMPI/UOPwrite.o
So it seems like your version doesn't pick up anything about the correct location of openmpi

BTW: which version of the patch are you using? MACPORTOPENMPI is only in newer versions
I used the following patches:
Code:
ThirdParty-2.1.0-Mac.patch
OpenFOAM-2.1.x-Mac_20130125.patch
OpenFOAM-2.1.x-Mac-gcc46.patch
The OpenFOAM-2.1.x-Mac_20130125 appears to be the important one. Have you released any patches since that one? BTW, I didn't receive any error messages from the ports except for the ThirdParty-2.1.0-Mac.patch final patch for Makefile.inc. I had to link Makefile.inc to ../../etc/wmakeFiles/scotch/Makefile.inc.i686_mac_darwin.shlib-OpenFOAM or

Code:
ln -s ../../etc/wmakeFiles/scotch/Makefile.inc.i686_mac_darwin.shlib-OpenFOAM Makefile.inc
Yes, my version doesn't pick up anything about MACPORTOPENMPI. I'll try replacing SYSTEMOPENMPI with MACPORTOPENMPI to see what happens. Well, I still got the same error, which isn't much of a surprise. Have you released any patches since January 25, 2013? Is there a thread on the OpenFOAM installation forum that just gives the patches for Mac OS X?

Also, what is the ccache command for in the code section of your reply above?

Code:
SOURCE=UOPwrite.C ; ccache g++-mp-4.6 -m64 -fsignaling-nans  -ftrapping-math -DdarwinIntel64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O2  -DNoRepository -ftemplate-depth-100 -DOMPI_SKIP_MPICXX -I/opt/local/include/openmpi -IlnInclude -I. -I/Users/bgschaid/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude -I/Users/bgschaid/OpenFOAM/OpenFOAM-2.1.x/src/OSspecific/POSIX/lnInclude   -fPIC -Ddarwin -c $SOURCE -o Make/darwinIntel64Gcc46DPOptMACPORTOPENMPI/UOPwrite.o

Thanks for all your help.
tholsen is offline   Reply With Quote

Old   March 2, 2013, 16:31
Default Mountain Lion
  #250
New Member
 
Thomas Olsen
Join Date: Feb 2013
Posts: 6
Rep Power: 5
tholsen is on a distinguished road
Greetings,

I used `git pull` to update the sources and created mplibMACPORTOPENMPI in ${HOME}/OpenFOAM/OpenFOAM-2.1.x/wmake/rules/darwinIntel64Gcc46/. The mplibMACPORTOPENMPI contains
Code:
PFLAGS     = -DOMPI_SKIP_MPICXX
PINC       = -I$(MPI_ARCH_PATH)/include/openmpi
PLIBS      = -L$(MPI_ARCH_PATH)/lib -lmpi
Now OpenFOAM compiles and I'm testing it now. I'll let you know if I run into any problems with the test cases.

Thanks again for all the help given in this thread.

Tom
tholsen is offline   Reply With Quote

Old   March 6, 2013, 07:42
Default
  #251
nik
New Member
 
nicolas
Join Date: Oct 2009
Posts: 24
Rep Power: 8
nik is on a distinguished road
Hi,

I am trying to compile OF2.1.1 on my mac Mountain Lion. Because I am using homebrew, and since it is recommended not to have both (homebrew and macports), I have installed gcc 4.6.3 using homebrew. I also installed Open MPI 1.6.4, since according to a previous post (#236) from Bernard "OpenMPI: the latest is OK".

I have used the following patches:
ThirdParty-2.1.0-Mac.patch
OpenFOAM-2.1.x-Mac.patch
OpenFOAM-2.1.x-Mac-gcc46.patch
OpenFOAM-2.1.x-Mac_20130125.patch

Regarding the ThirdParty patch, I linked Makefile.inc to ../../etc/wmakeFiles/scotch/Makefile.inc.i686_mac_darwin.shlib-OpenFOAM following a previous post (#249).

I have also changed in files wmake/rules/darwinIntel64Gcc46/c and wmake/rules/darwinIntel64Gcc46/c++:
Code:
cc          = gcc-mp-4.6 -m64 -fsignaling-nans  -ftrapping-math
CC          = g++-mp-4.6 -m64 -fsignaling-nans  -ftrapping-math
to
Code:
cc          = gcc-4.6 -m64 -fsignaling-nans  -ftrapping-math
CC          = g++-4.6 -m64 -fsignaling-nans  -ftrapping-math
correspondingly.

I am getting some errors which I cannot figure how to solve. This is the first error I get.

Code:
SOURCE=fileStat.C ;  g++-4.6 -m64 -fsignaling-nans  -ftrapping-math -DdarwinIntel64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O2  -DNoRepository -ftemplate-depth-100  -IlnInclude -I. -I/Users/nicolas/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude -I/Users/nicolas/OpenFOAM/OpenFOAM-2.1.1/src/OSspecific/POSIX/lnInclude   -fPIC -Ddarwin -c $SOURCE -o Make/darwinIntel64Gcc46DPOpt/fileStat.o
signals/sigFpe.C: In destructor 'Foam::sigFpe::~sigFpe()':
signals/sigFpe.C:175:12: error: 'system_malloc_' was not declared in this scope
signals/sigFpe.C:189:36: error: 'mach_task_self' was not declared in this scope
signals/sigFpe.C:190:32: warning: use of old-style cast [-Wold-style-cast]
signals/sigFpe.C:193:21: warning: use of old-style cast [-Wold-style-cast]
signals/sigFpe.C:193:36: warning: use of old-style cast [-Wold-style-cast]
signals/sigFpe.C:194:17: error: 'vm_protect' was not declared in this scope
signals/sigFpe.C:201:36: error: 'mach_task_self' was not declared in this scope
signals/sigFpe.C:202:32: warning: use of old-style cast [-Wold-style-cast]
signals/sigFpe.C:205:21: warning: use of old-style cast [-Wold-style-cast]
signals/sigFpe.C:206:17: error: 'vm_protect' was not declared in this scope
signals/sigFpe.C: In member function 'void Foam::sigFpe::set(bool)':
signals/sigFpe.C:355:12: error: 'system_malloc_' was not declared in this scope
signals/sigFpe.C:375:32: error: 'mach_task_self' was not declared in this scope
signals/sigFpe.C:376:28: warning: use of old-style cast [-Wold-style-cast]
signals/sigFpe.C:379:17: warning: use of old-style cast [-Wold-style-cast]
signals/sigFpe.C:379:32: warning: use of old-style cast [-Wold-style-cast]
signals/sigFpe.C:380:13: error: 'vm_protect' was not declared in this scope
signals/sigFpe.C:382:9: error: 'system_malloc_' was not declared in this scope
signals/sigFpe.C:383:22: error: 'nan_malloc_' is not a member of 'Foam::sigFpe'
signals/sigFpe.C:387:32: error: 'mach_task_self' was not declared in this scope
signals/sigFpe.C:388:28: warning: use of old-style cast [-Wold-style-cast]
signals/sigFpe.C:391:17: warning: use of old-style cast [-Wold-style-cast]
signals/sigFpe.C:392:13: error: 'vm_protect' was not declared in this scope
make: *** [Make/darwinIntel64Gcc46DPOpt/sigFpe.o] Error 1
I have also attached the log file.

Thanks,
Nicolas
Attached Files
File Type: gz make.log.tar.gz (81.7 KB, 2 views)
nik is offline   Reply With Quote

Old   March 7, 2013, 08:37
Default
  #252
New Member
 
Thomas Olsen
Join Date: Feb 2013
Posts: 6
Rep Power: 5
tholsen is on a distinguished road
Quote:
Originally Posted by nik View Post
Hi,

I am trying to compile OF2.1.1 on my mac Mountain Lion. Because I am using homebrew, and since it is recommended not to have both (homebrew and macports), I have installed gcc 4.6.3 using homebrew. I also installed Open MPI 1.6.4, since according to a previous post (#236) from Bernard "OpenMPI: the latest is OK".

I have used the following patches:
ThirdParty-2.1.0-Mac.patch
OpenFOAM-2.1.x-Mac.patch
OpenFOAM-2.1.x-Mac-gcc46.patch
OpenFOAM-2.1.x-Mac_20130125.patch

Regarding the ThirdParty patch, I linked Makefile.inc to ../../etc/wmakeFiles/scotch/Makefile.inc.i686_mac_darwin.shlib-OpenFOAM following a previous post (#249).

I have also changed in files wmake/rules/darwinIntel64Gcc46/c and wmake/rules/darwinIntel64Gcc46/c++:
Code:
cc          = gcc-mp-4.6 -m64 -fsignaling-nans  -ftrapping-math
CC          = g++-mp-4.6 -m64 -fsignaling-nans  -ftrapping-math
to
Code:
cc          = gcc-4.6 -m64 -fsignaling-nans  -ftrapping-math
CC          = g++-4.6 -m64 -fsignaling-nans  -ftrapping-math
correspondingly.

I am getting some errors which I cannot figure how to solve. This is the first error I get.

Code:
SOURCE=fileStat.C ;  g++-4.6 -m64 -fsignaling-nans  -ftrapping-math -DdarwinIntel64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O2  -DNoRepository -ftemplate-depth-100  -IlnInclude -I. -I/Users/nicolas/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude -I/Users/nicolas/OpenFOAM/OpenFOAM-2.1.1/src/OSspecific/POSIX/lnInclude   -fPIC -Ddarwin -c $SOURCE -o Make/darwinIntel64Gcc46DPOpt/fileStat.o
signals/sigFpe.C: In destructor 'Foam::sigFpe::~sigFpe()':
signals/sigFpe.C:175:12: error: 'system_malloc_' was not declared in this scope
signals/sigFpe.C:189:36: error: 'mach_task_self' was not declared in this scope
signals/sigFpe.C:190:32: warning: use of old-style cast [-Wold-style-cast]
signals/sigFpe.C:193:21: warning: use of old-style cast [-Wold-style-cast]
signals/sigFpe.C:193:36: warning: use of old-style cast [-Wold-style-cast]
signals/sigFpe.C:194:17: error: 'vm_protect' was not declared in this scope
signals/sigFpe.C:201:36: error: 'mach_task_self' was not declared in this scope
signals/sigFpe.C:202:32: warning: use of old-style cast [-Wold-style-cast]
signals/sigFpe.C:205:21: warning: use of old-style cast [-Wold-style-cast]
signals/sigFpe.C:206:17: error: 'vm_protect' was not declared in this scope
signals/sigFpe.C: In member function 'void Foam::sigFpe::set(bool)':
signals/sigFpe.C:355:12: error: 'system_malloc_' was not declared in this scope
signals/sigFpe.C:375:32: error: 'mach_task_self' was not declared in this scope
signals/sigFpe.C:376:28: warning: use of old-style cast [-Wold-style-cast]
signals/sigFpe.C:379:17: warning: use of old-style cast [-Wold-style-cast]
signals/sigFpe.C:379:32: warning: use of old-style cast [-Wold-style-cast]
signals/sigFpe.C:380:13: error: 'vm_protect' was not declared in this scope
signals/sigFpe.C:382:9: error: 'system_malloc_' was not declared in this scope
signals/sigFpe.C:383:22: error: 'nan_malloc_' is not a member of 'Foam::sigFpe'
signals/sigFpe.C:387:32: error: 'mach_task_self' was not declared in this scope
signals/sigFpe.C:388:28: warning: use of old-style cast [-Wold-style-cast]
signals/sigFpe.C:391:17: warning: use of old-style cast [-Wold-style-cast]
signals/sigFpe.C:392:13: error: 'vm_protect' was not declared in this scope
make: *** [Make/darwinIntel64Gcc46DPOpt/sigFpe.o] Error 1
I have also attached the log file.

Thanks,
Nicolas
Hi Nicolas,

Did you apply both the OpenFOAM-2.1.x-Mac.patch and the OpenFOAM-2.1.x-Mac_20130125.patch to the same OpenFOAM-2.1.x file? Did you see any errors when you applied the OpenFOAM-2.1.x-Mac_20130125.patch? If so, you should probably restart and just use the OpenFOAM-2.1.x-Mac_20130125.path. Also, you may want to use the sources in the git repository. See http://www.openfoam.org/download/git.php and use 2.1.x instead of 2.2.0 for the git pull command. The version of git provided with Mountain Lion works fine. You can also try 2.2.0 and apply the patches using the 2.2.0 sources provided at openfoam.org. I haven't tried this yet. Also, check with gschaider about any patches he may be working on for 2.2.0. I hope this helps.

Good luck,

Tom
tholsen is offline   Reply With Quote

Old   March 7, 2013, 08:47
Default
  #253
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,926
Rep Power: 41
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by nik View Post
Hi,

I am trying to compile OF2.1.1 on my mac Mountain Lion. Because I am using homebrew, and since it is recommended not to have both (homebrew and macports), I have installed gcc 4.6.3 using homebrew. I also installed Open MPI 1.6.4, since according to a previous post (#236) from Bernard "OpenMPI: the latest is OK".

I have used the following patches:
ThirdParty-2.1.0-Mac.patch
OpenFOAM-2.1.x-Mac.patch
OpenFOAM-2.1.x-Mac-gcc46.patch
OpenFOAM-2.1.x-Mac_20130125.patch

Regarding the ThirdParty patch, I linked Makefile.inc to ../../etc/wmakeFiles/scotch/Makefile.inc.i686_mac_darwin.shlib-OpenFOAM following a previous post (#249).

I have also changed in files wmake/rules/darwinIntel64Gcc46/c and wmake/rules/darwinIntel64Gcc46/c++:
Code:
cc          = gcc-mp-4.6 -m64 -fsignaling-nans  -ftrapping-math
CC          = g++-mp-4.6 -m64 -fsignaling-nans  -ftrapping-math
to
Code:
cc          = gcc-4.6 -m64 -fsignaling-nans  -ftrapping-math
CC          = g++-4.6 -m64 -fsignaling-nans  -ftrapping-math
correspondingly.

I am getting some errors which I cannot figure how to solve. This is the first error I get.

Code:
SOURCE=fileStat.C ;  g++-4.6 -m64 -fsignaling-nans  -ftrapping-math -DdarwinIntel64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O2  -DNoRepository -ftemplate-depth-100  -IlnInclude -I. -I/Users/nicolas/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude -I/Users/nicolas/OpenFOAM/OpenFOAM-2.1.1/src/OSspecific/POSIX/lnInclude   -fPIC -Ddarwin -c $SOURCE -o Make/darwinIntel64Gcc46DPOpt/fileStat.o
signals/sigFpe.C: In destructor 'Foam::sigFpe::~sigFpe()':
signals/sigFpe.C:175:12: error: 'system_malloc_' was not declared in this scope
signals/sigFpe.C:189:36: error: 'mach_task_self' was not declared in this scope
signals/sigFpe.C:190:32: warning: use of old-style cast [-Wold-style-cast]
signals/sigFpe.C:193:21: warning: use of old-style cast [-Wold-style-cast]
signals/sigFpe.C:193:36: warning: use of old-style cast [-Wold-style-cast]
signals/sigFpe.C:194:17: error: 'vm_protect' was not declared in this scope
signals/sigFpe.C:201:36: error: 'mach_task_self' was not declared in this scope
signals/sigFpe.C:202:32: warning: use of old-style cast [-Wold-style-cast]
signals/sigFpe.C:205:21: warning: use of old-style cast [-Wold-style-cast]
signals/sigFpe.C:206:17: error: 'vm_protect' was not declared in this scope
signals/sigFpe.C: In member function 'void Foam::sigFpe::set(bool)':
signals/sigFpe.C:355:12: error: 'system_malloc_' was not declared in this scope
signals/sigFpe.C:375:32: error: 'mach_task_self' was not declared in this scope
signals/sigFpe.C:376:28: warning: use of old-style cast [-Wold-style-cast]
signals/sigFpe.C:379:17: warning: use of old-style cast [-Wold-style-cast]
signals/sigFpe.C:379:32: warning: use of old-style cast [-Wold-style-cast]
signals/sigFpe.C:380:13: error: 'vm_protect' was not declared in this scope
signals/sigFpe.C:382:9: error: 'system_malloc_' was not declared in this scope
signals/sigFpe.C:383:22: error: 'nan_malloc_' is not a member of 'Foam::sigFpe'
signals/sigFpe.C:387:32: error: 'mach_task_self' was not declared in this scope
signals/sigFpe.C:388:28: warning: use of old-style cast [-Wold-style-cast]
signals/sigFpe.C:391:17: warning: use of old-style cast [-Wold-style-cast]
signals/sigFpe.C:392:13: error: 'vm_protect' was not declared in this scope
make: *** [Make/darwinIntel64Gcc46DPOpt/sigFpe.o] Error 1
I have also attached the log file.

Thanks,
Nicolas
Problems are the missing symbols: system_malloc_ and vm_protect. These are defined in system headers. My guess is that the homebrew-compile doesn't set certain #defines and therefor these parts of the system headers fall through. You can try calling the compiler with -E look at the output and see which parts of the headers are "blanked out". Then you can get the predefined preprocessor-symbols (don't remember what switch that was "man cpp" is your friend), see which are missing and add them with -D

Or you can install the gcc46 from MacPorts (due to the name it will live happily besides your Homebrew-compiler)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   March 7, 2013, 08:49
Default
  #254
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,926
Rep Power: 41
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by tholsen View Post
Hi Nicolas,

Did you apply both the OpenFOAM-2.1.x-Mac.patch and the OpenFOAM-2.1.x-Mac_20130125.patch to the same OpenFOAM-2.1.x file? Did you see any errors when you applied the OpenFOAM-2.1.x-Mac_20130125.patch? If so, you should probably restart and just use the OpenFOAM-2.1.x-Mac_20130125.path. Also, you may want to use the sources in the git repository. See http://www.openfoam.org/download/git.php and use 2.1.x instead of 2.2.0 for the git pull command. The version of git provided with Mountain Lion works fine. You can also try 2.2.0 and apply the patches using the 2.2.0 sources provided at openfoam.org. I haven't tried this yet. Also, check with gschaider about any patches he may be working on for 2.2.0. I hope this helps.

Good luck,

Tom
Does the 2.2-git work for you? I only get a page "There is nothing to see. Move along"
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   March 7, 2013, 11:00
Default
  #255
nik
New Member
 
nicolas
Join Date: Oct 2009
Posts: 24
Rep Power: 8
nik is on a distinguished road
Thank you very much Tom.

I just used the patches, as I should have used them in the first place, and now it compiles. Silly me. I also had to modify the Make/options file based on post #242.

Perhaps it would be nice, if the wikipage gets updated. Anyway, in case there are other noobie's like me, below I give an up-to-date summary of the steps that worked for me (based on posts #236, #242, #249 and the wiki-page). Just a reminder I use Mountain Lion 10.8.2. The following steps start after one creates the sparse disk-image, and unpack both OpenFOAM and ThirdParty, as explained in the wiki-page.

Code:
cd
ln -s /Volumes/OpenFOAM-v2.1 OpenFOAM

cd ~/OpenFOAM/ThirdParty-2.1.1/scotch_5.1.11/src
ln -s ../../etc/wmakeFiles/scotch/Makefile.inc.i686_mac_darwin.shlib-OpenFOAM Makefile.inc

cd ~/OpenFOAM/ThirdParty-2.1.1
patch -p1 < ../ThirdParty-2.1.0-Mac.patch

cd ~/OpenFOAM/OpenFOAM-2.1.1
patch -p1 < ../OpenFOAM-2.1.x-Mac_20130125.patch 

chmod a+x bin/addr2line4Mac.py

cd ~/OpenFOAM/OpenFOAM-2.1.1/wmake/rules
rm darwinIntel64Gcc46
ln -s darwinIntel64Gcc darwinIntel64Gcc46
...Edit bashrc following instructions from wiki-page and then...

Code:
source ~/OpenFOAM/OpenFOAM-2.1.1/etc/bashrc
Following posts #242 and #240, one needs to modify the Make/options file of the multiphaseEulerFoam application. I use vi...

Code:
vi ~/OpenFOAM/OpenFOAM-2.1.1/applications/solvers/multiphase/multiphaseEulerFoam/Make/options
...Here one needs to add these two libraries "incompressibleTurbulenceModel" and "incompressibleRASModels" in existing "options" file. Just copy and paste from post #242. After that compile...

Code:
cd ~/OpenFOAM/OpenFOAM-2.1.1
./Allwmake 2>&1 | tee make.log
Thats all.

Nicolas
nik is offline   Reply With Quote

Old   March 7, 2013, 11:40
Default
  #256
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,926
Rep Power: 41
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by nik View Post
Thank you very much Tom.

I just used the patches, as I should have used them in the first place, and now it compiles. Silly me. I also had to modify the Make/options file based on post #242.

Perhaps it would be nice, if the wikipage gets updated. Anyway, in case there are other noobie's like me, below I give an up-to-date summary of the steps that worked for me (based on posts #236, #242, #249 and the wiki-page). Just a reminder I use Mountain Lion 10.8.2. The following steps start after one creates the sparse disk-image, and unpack both OpenFOAM and ThirdParty, as explained in the wiki-page.
"would be nice, if the wikipage gets updated": I've said it a number of times: the Wiki-page is a community effort. If you think that the information is outdated feel free to update it. In fact: I think the best writers for these instructions are those who struggled with the instructions because to them it is clear what was not clear to them. For me it is more "Case-sensitve filesystem, get sources, apply patch, compile. Enough said" so I'd be a terrible writer for these instructions (look at older versions of the "How to install on Mac": you'll see what I mean). The other thing is that my (admittedly arrogant) point of view is "I develop the patches. I publish them. But writing documentation is something I only do for customers"
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   March 7, 2013, 18:56
Default Final patch for 2.1
  #257
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,926
Rep Power: 41
gschaider will become famous soon enoughgschaider will become famous soon enough
As today the git for 2.2 was opened and usually OpenCFD doesn't push any changes to the "old" git anymore I decided to make a final patch for 2.1 (you find it attached). The only major change to the previous patch is that if the paraview application is installed as paraview (No version number like older binaries did) in the applications folder it will be added to the path (also pvpython etc which come with the latest paraview)

OpenFOAM-2.1.x_Mac-20130307.patch
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   March 11, 2013, 11:11
Default
  #258
New Member
 
Join Date: Mar 2013
Posts: 10
Rep Power: 5
peter_t is on a distinguished road
hi there,
I think there is something wrong with my open mpi. When I type mpirun -V I get bash: mpirun: command not found. When I try to source bashrc by typing . OpenFOAM/OpenFOAM-2.1.0/etc/bashrc as instructed I get the same response. please help
peter_t is offline   Reply With Quote

Old   March 11, 2013, 11:58
Default
  #259
New Member
 
Join Date: Mar 2013
Posts: 10
Rep Power: 5
peter_t is on a distinguished road
Here is my compilation log. seems to be some error with scotch?
Attached Files
File Type: gz make.log.tar.gz (42.2 KB, 2 views)
peter_t is offline   Reply With Quote

Old   March 11, 2013, 12:36
Default
  #260
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,926
Rep Power: 41
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by peter_t View Post
hi there,
I think there is something wrong with my open mpi. When I type mpirun -V I get bash: mpirun: command not found. When I try to source bashrc by typing . OpenFOAM/OpenFOAM-2.1.0/etc/bashrc as instructed I get the same response. please help
MacPorts prefixes all OpenMPI-commands with open. So mpirun is found as openmpirun.

I think they do it to make it possible to have a MPIch-installation at the same time
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Reply

Tags
compilation error

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extend Project 1.6-ext Binary Release for Mac OS X hjasak OpenFOAM Announcements from Other Sources 26 November 5, 2013 17:50
Openfoam mac: Compiling custom libraries atareen64 OpenFOAM 3 April 14, 2011 11:01
OpenFOAM-1.6 on Mac OS X 10.6.1 elvisjohndowson OpenFOAM 6 October 21, 2009 15:45
Mac Simple Install Request or Processing Assistance Help sjohnson OpenFOAM Installation 4 December 12, 2008 08:46
MAC + SOLA for free surface T Main CFD Forum 1 April 11, 2001 13:43


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