|
[Sponsors] |
June 23, 2011, 17:40 |
wmake in openfoam mac 1.7.x
|
#1 |
Member
Ammar Tareen
Join Date: Jan 2011
Location: Boston University
Posts: 61
Rep Power: 15 |
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. |
|
July 4, 2011, 17:23 |
|
#2 |
Member
Ammar Tareen
Join Date: Jan 2011
Location: Boston University
Posts: 61
Rep Power: 15 |
Anybody? Any help would be greatly appreciated!
|
|
July 4, 2011, 20:56 |
|
#3 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
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:
A few things for you to test:
Bruno
__________________
|
|
July 5, 2011, 12:13 |
|
#4 |
Member
Ammar Tareen
Join Date: Jan 2011
Location: Boston University
Posts: 61
Rep Power: 15 |
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. |
|
July 6, 2011, 11:08 |
|
#5 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Basically if OF is set up correctly then everything should work exactly like on a linux-machine Bernhard |
||
July 6, 2011, 12:30 |
log file attached
|
#6 |
Member
Ammar Tareen
Join Date: Jan 2011
Location: Boston University
Posts: 61
Rep Power: 15 |
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. |
|
July 6, 2011, 17:27 |
|
#7 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
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 |
||
July 11, 2011, 14:47 |
|
#8 |
Member
Ammar Tareen
Join Date: Jan 2011
Location: Boston University
Posts: 61
Rep Power: 15 |
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. |
|
July 11, 2011, 15:12 |
|
#9 |
Member
Ammar Tareen
Join Date: Jan 2011
Location: Boston University
Posts: 61
Rep Power: 15 |
I should also mention that the same changes worked on my linux machine. This is a little annoying ...
|
|
July 11, 2011, 17:48 |
|
#10 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
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 |
||
July 12, 2011, 12:02 |
Thank you!
|
#11 |
Member
Ammar Tareen
Join Date: Jan 2011
Location: Boston University
Posts: 61
Rep Power: 15 |
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. |
|
|
|
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 |