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

wmake in openfoam mac 1.7.x

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 23, 2011, 17:40
Question wmake in openfoam mac 1.7.x
  #1
Member
 
Ammar Tareen
Join Date: Jan 2011
Location: Boston University
Posts: 61
Rep Power: 15
atareen64 is on a distinguished road
Dear All,

I'm using the mac port of openfoam (1.7.x) and I need to use 'wmake' to make some custom solvers and things like that. For instance I copied the file src/thermophysicalModel/basic to the ~OpenFOAM/username-1.7.x directory and (with out making any changes) compiled it with wmake libso and it worked fine on my linux machine. I did the same process on my mac but it didn't compile and gave me a ton of various errors.

I can look in the folder hierarchy to try to make sure that incorrect paths aren't causing the problem, but I think that might not be the problem. Does any body have any advice on how I can compile custom code on the mac port? Because I'm totally lost and need help.

Any help appreciated!
Thanks!
Ammar.
atareen64 is offline   Reply With Quote

Old   July 4, 2011, 17:23
Default
  #2
Member
 
Ammar Tareen
Join Date: Jan 2011
Location: Boston University
Posts: 61
Rep Power: 15
atareen64 is on a distinguished road
Anybody? Any help would be greatly appreciated!
atareen64 is offline   Reply With Quote

Old   July 4, 2011, 20:56
Default
  #3
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
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
Greetings Ammar,

OK, I dont have a Mac but I can try and guide you through some details.

So, first of all, please answer the following questions:
  1. Are you using a pre-made DMG disk image with the OpenFOAM build ready to be used?
  2. Or did you build everything yourself?
  3. Is your user folder for OpenFOAM in the same disk image as the OpenFOAM source?
  4. Is the disk image/partition of that user folder in case sensitive file name mode?
  5. Have you installed the whole software artillery necessary for building OpenFOAM? I vaguely remember that the stuff came from MacPorts and that gcc had to come from XCode or somewhere else... like I said, I don't have a Mac

A few things for you to test:
  1. Try building one of the test applications available in the folder OpenFOAM-1.7.x/applications in both Linux and Mac machines.
  2. Try following this tutorial to the letter in Linux: http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam - then either do it again on the Mac, or copy the source code for this custom solver from the Linux machine to the Mac and build it on the Mac.
Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   July 5, 2011, 12:13
Default
  #4
Member
 
Ammar Tareen
Join Date: Jan 2011
Location: Boston University
Posts: 61
Rep Power: 15
atareen64 is on a distinguished road
Dear Bruno,

Thanks for replying. Here are the answers:

1) Yes, I used a pre-made disk image with open foam ready to use.
2) No.
3) No my user folder has a different path i.e. /Users/myName/OpenFOAM/...
4) Yes the dmg is in a case sensitive partition on my mac.
5) Yes I have xCode and gcc.

Essentially, wmake seems to work but it finishes with errors which I can't seem to understand. I've built a ton of my own code in linux systems, e.g. compiled custom solvers and all that but because I have a lot of macs I am forced to use OF on macs.

Here's the weird part: if I take one of the solvers that already works and try to recompile them, either in the openfoam home directory or some other place, that doesn't even work. So I'm beginning to wonder whether the complete functionality of wmake was ported in OF 1.7.x.

Any way, I can post a log file containing one of the errors and I can also post a link here of the pre-made OF mac dmg so other people can help me use wmake.

Thanks so much for helping!

-Ammar.
atareen64 is offline   Reply With Quote

Old   July 6, 2011, 11:08
Default
  #5
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by atareen64 View Post
Dear Bruno,

Thanks for replying. Here are the answers:

1) Yes, I used a pre-made disk image with open foam ready to use.
2) No.
3) No my user folder has a different path i.e. /Users/myName/OpenFOAM/...
4) Yes the dmg is in a case sensitive partition on my mac.
5) Yes I have xCode and gcc.

Essentially, wmake seems to work but it finishes with errors which I can't seem to understand. I've built a ton of my own code in linux systems, e.g. compiled custom solvers and all that but because I have a lot of macs I am forced to use OF on macs.

Here's the weird part: if I take one of the solvers that already works and try to recompile them, either in the openfoam home directory or some other place, that doesn't even work. So I'm beginning to wonder whether the complete functionality of wmake was ported in OF 1.7.x.

Any way, I can post a log file containing one of the errors and I can also post a link here of the pre-made OF mac dmg so other people can help me use wmake.

Thanks so much for helping!

-Ammar.
I have never worked with the prebuilt images so I can't comment on that (and I don't know which patches are applied there). Could you just share with us the first few error messages in your log-file?

Basically if OF is set up correctly then everything should work exactly like on a linux-machine

Bernhard
gschaider is offline   Reply With Quote

Old   July 6, 2011, 12:30
Default log file attached
  #6
Member
 
Ammar Tareen
Join Date: Jan 2011
Location: Boston University
Posts: 61
Rep Power: 15
atareen64 is on a distinguished road
Thanks for your comment. I will re-setup OF on my mac so that it looks exactly like my linux machine. In the meanwhile here the log file containing the wmake errors. basically I copied sonicFoam into my $FOAM_RUN/applications directory and tried recompiling it with the name testSonicFoam. I was able to do this on my linux machine but didn't work on the mac. Kindly tell me what you can make of the errors so I can find the solution.

I'm attaching two log files because one log file exceeds the upload size limit. But basically the message starts in log file 1 and continues in log file 2.
Attached Files
File Type: txt log.txt (77.3 KB, 7 views)
File Type: txt log2.txt (23.7 KB, 2 views)
atareen64 is offline   Reply With Quote

Old   July 6, 2011, 17:27
Default
  #7
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by atareen64 View Post
Thanks for your comment. I will re-setup OF on my mac so that it looks exactly like my linux machine. In the meanwhile here the log file containing the wmake errors. basically I copied sonicFoam into my $FOAM_RUN/applications directory and tried recompiling it with the name testSonicFoam. I was able to do this on my linux machine but didn't work on the mac. Kindly tell me what you can make of the errors so I can find the solution.

I'm attaching two log files because one log file exceeds the upload size limit. But basically the message starts in log file 1 and continues in log file 2.
The error messages are redundant. The next time please post only the first few here. I have no intention to wade through other peoples log-files

The files climits and cstdlib that are missing should be found somewhere in /usr/include. Obviously your compiler doesn't. There is something broken on the non-OF level. Try compiling a simple C++-"Hello world" program with those compiler switches and see what happens

Bernhard
gschaider is offline   Reply With Quote

Old   July 11, 2011, 14:47
Default
  #8
Member
 
Ammar Tareen
Join Date: Jan 2011
Location: Boston University
Posts: 61
Rep Power: 15
atareen64 is on a distinguished road
Dear Bernhard, (or anybody)

Thanks for your help. So here's what I did: I setup a "Hello world" solver with practically no code, just an empty helloWorld.C file which only returns 0 in its main; the solver directory also contains a make folder containing the files 'options' and 'files', which don't really use or call any libraries. So basically they are pretty much empty too. Now when I run wmake in this folder, the helloWorld solver compiles. Which is good because it tells me wmake works fine.

The problem: after setting up the empty folder, I wanted it to do something, e.g. print a statement. So I added two lines in my helloWorld.C file:

#include <iostream>

int main(){
std:: cout << "hello world!\n";
return 0;
}

When I do wmake now, it gives me the following error:

helloWorld.C:37:20: error: iostream: No such file or directory
make: *** [Make/darwinIntel64DPOpt/helloWorld.o] Error 1

Now of course the helloWorld.C file works when I compile it separately using g++, but how can I get it to work using wmake? Please help.

I know it can't see the <iostream>, but where do I need to put it so that program can see the #include <iostream>

Thanks!
~Ammar.

Last edited by atareen64; July 11, 2011 at 15:07.
atareen64 is offline   Reply With Quote

Old   July 11, 2011, 15:12
Default
  #9
Member
 
Ammar Tareen
Join Date: Jan 2011
Location: Boston University
Posts: 61
Rep Power: 15
atareen64 is on a distinguished road
I should also mention that the same changes worked on my linux machine. This is a little annoying ...
atareen64 is offline   Reply With Quote

Old   July 11, 2011, 17:48
Default
  #10
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by atareen64 View Post
Dear Bernhard, (or anybody)

Thanks for your help. So here's what I did: I setup a "Hello world" solver with practically no code, just an empty helloWorld.C file which only returns 0 in its main; the solver directory also contains a make folder containing the files 'options' and 'files', which don't really use or call any libraries. So basically they are pretty much empty too. Now when I run wmake in this folder, the helloWorld solver compiles. Which is good because it tells me wmake works fine.

The problem: after setting up the empty folder, I wanted it to do something, e.g. print a statement. So I added two lines in my helloWorld.C file:

#include <iostream>

int main(){
std:: cout << "hello world!\n";
return 0;
}

When I do wmake now, it gives me the following error:

helloWorld.C:37:20: error: iostream: No such file or directory
make: *** [Make/darwinIntel64DPOpt/helloWorld.o] Error 1

Now of course the helloWorld.C file works when I compile it separately using g++, but how can I get it to work using wmake? Please help.

I know it can't see the <iostream>, but where do I need to put it so that program can see the #include <iostream>

Thanks!
~Ammar.
I was asking you for the "Hello world"-example because the missing headers (string, climits ...) are part of the standard compiler-installation and if they are missing then this is usually a sign for a messed up compiler installation (on any system).

For your test did you use the same compiler as your OF-installation? Because llvm-g++ is not exactly the same as g++ ....

To be sure retest with the exact compiler settings that is used for your OF-stuff, like this:
Code:
/usr/bin/llvm-g++ -DdarwinIntel64 -DWM_DP -arch x86_64 -fPIC --sysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O2  -DNoRepository -ftemplate-depth-40 -I/Users/opencrunch/OpenFOAM/OpenFOAM-1.7.x/src/thermophysicalModels/basic/lnInclude     -I/Users/opencrunch/OpenFOAM/OpenFOAM-1.7.x/src/turbulenceModels/compressible/turbulenceModel     -I/Users/opencrunch/OpenFOAM/OpenFOAM-1.7.x/src/finiteVolume/lnInclude -IlnInclude -I. -I/Users/opencrunch/OpenFOAM/OpenFOAM-1.7.x/src/OpenFOAM/lnInclude -I/Users/opencrunch/OpenFOAM/OpenFOAM-1.7.x/src/OSspecific/POSIX/lnInclude   -Ddarwin helloWorld.C -o helloWorld
gschaider is offline   Reply With Quote

Old   July 12, 2011, 12:02
Default Thank you!
  #11
Member
 
Ammar Tareen
Join Date: Jan 2011
Location: Boston University
Posts: 61
Rep Power: 15
atareen64 is on a distinguished road
Dear Bernhard,

Thanks for your help. You were basically right, my compiler was messed up. I installed the whole openfoam thing on a another mac and it worked without any trouble. I'll now just need to reinstall the compiler on my machine.

Thanks a lot for your help.
Warm regards,
Ammar.
atareen64 is offline   Reply With Quote

Reply

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
OpenFOAM 1.7.1 installation problem on OpenSUSE 11.3 flakid OpenFOAM Installation 16 December 28, 2010 09:48
Problems Installing OF 1.6 32 bit bucksfan OpenFOAM Installation 19 August 4, 2009 02:36
OpenFOAM15 installables are incomplete problem with paraFoam tryingof OpenFOAM Bugs 17 December 7, 2008 05:41
Problem of compilation OF 14Allwmake command not found erik_d OpenFOAM Bugs 13 September 13, 2008 22:45
[OpenFOAM] ParaFoam error message joey ParaView 1 October 2, 2006 14:28


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