CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (http://www.cfd-online.com/Forums/openfoam-installation/)
-   -   wmake in openfoam mac 1.7.x (http://www.cfd-online.com/Forums/openfoam-installation/89856-wmake-openfoam-mac-1-7-x.html)

atareen64 June 23, 2011 16:40

wmake in openfoam mac 1.7.x
 
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 July 4, 2011 16:23

Anybody? Any help would be greatly appreciated!

wyldckat July 4, 2011 19:56

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

atareen64 July 5, 2011 11:13

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.

gschaider July 6, 2011 10:08

Quote:

Originally Posted by atareen64 (Post 314801)
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

atareen64 July 6, 2011 11:30

log file attached
 
2 Attachment(s)
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.

gschaider July 6, 2011 16:27

Quote:

Originally Posted by atareen64 (Post 314954)
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

atareen64 July 11, 2011 13:47

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.

atareen64 July 11, 2011 14:12

I should also mention that the same changes worked on my linux machine. This is a little annoying ...

gschaider July 11, 2011 16:48

Quote:

Originally Posted by atareen64 (Post 315722)
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

atareen64 July 12, 2011 11:02

Thank you!
 
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.


All times are GMT -4. The time now is 06:43.