CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Installation (
-   -   OpenFOAM Cygwin port updated to 13 (

brooksmoses April 10, 2006 22:51

I've now updated Petr Vita's p
I've now updated Petr Vita's patch to work with OpenFOAM-1.3, and have produced source and binary distribution files for it. Those are now available at

In addition, for those still using OpenFOAM-1.2, I've incorporated the latest bugfixes for the bugs that Philippe Straet reported, and there are updated packages for that on the site as well.

These are not quite complete ports; we haven't yet tried to port FoamX or ParaFoam/ParaView. Also, Petr is still working on getting the parallel code to work; hopefully that will be working soon. However, everything else should be working.


There are a few changes to the Cygwin port that are new with OpenFOAM-1.3. First, I've rearranged how the dependency loop between dummy/libPstream and libOpenFOAM is resolved; on Cygwin, we now compile libOpenFOAM first, and link dummy/libPstream to it. This simplifies the relevant Make/files files quite a bit, and should be vastly easier for the OpenFOAM team to keep up to date if Hrv incorporates these changes into the main tree.

As with the OpenFOAM-1.2 port, I've compiled a set of patch files that contain the various changes; those are also linked and described at the above page. I've tried to separate the "bulk" changes (e.g., the changes to dozens of Make/options files) from the "interesting" changes, so as to make the patch files readable. This time around, it turns out that all the renaming that I did to make things work on a case-insensitive filesystem does not affect any of the other changes; thus, one should be able to apply patches 0.2 through 0.5 to an unmodified OpenFOAM-1.3 source tree.

In addition, most of the changes have been wrapped with "#ifdef cygwin" or such if they seem likely to affect compilation on other platforms, and the source tree from this port (either with the renamed files, or generated via patch files as above) should compile cleanly on any supported platform. I'm actually not sure if we need to wrap the Make/options changes in "#ifdef cygwin", but that's how Petr did it, so I'm keeping it that way for simplicity.

As always, feel free to report bugs, suggestions, or questions in this thread.

niklas April 11, 2006 02:44

Just one important thing. M
Just one important thing.

My managed mount was set to /manage, with this name
I will hit a filename length limit for one file (its one character too long)
So it is really important to keep the name as short as possible, setting it to /m instead allows me
to unpack it as usual.


brooksmoses April 11, 2006 03:10

Ah, right -- I forgot to menti
Ah, right -- I forgot to mention this! The packages that I've created have all the relevant source files renamed so that they don't require usage of a managed mount at all, for anything. They work fine in a case-insensitive normal Windows filesystem.

Of course, if you're using the official OpenFOAM source distribution and just applying the patches, then you will need a managed mount. If you do that, don't apply patch 0.1 (it's changing all the #includes because of the renamed files), and please let me know how it works in the end, because I haven't tried it yet!

pvita April 12, 2006 12:00

Hi Brooks, Niklas and the rest
Hi Brooks, Niklas and the rest of the OpenFOAM world!

I tested OpenFOAM distribution from Brooks (based on OpenFOAM-1.3.cygwin-src-0.5.tar.gz, gcc-4.1.0.cygwin-OpenFOAM.tar.gz and OpenFOAM-1.3.Docs.tar.gz) under my Windows 2000 Professional and can confirm that it works with small changes. I am attaching all these changes in a patch form that can be applied on any Windows platform and that solves following problems:
  • Cygwin environment detection: fixed a detection of Cygwin environment to provide an unified and general way.
  • OpenFOAM-1.3/Allwmake: Added somehow dropped code to compile sources of wmake system, library and applications.
  • thermophysicalModel/NSRDSfunctions: Fixed an unknown problem that emerges at least on my rig. The fix is very general and should work on all Cygwin platforms.
The patch uses actual Brooks nomenclature and should applied as the last one in the line. OpenFOAM-1.3.cygwin-src-0.6.diff


brooksmoses April 12, 2006 15:29

Petr - Thanks for the patch
Petr -

Thanks for the patch! The fix for the Cygwin environment detection should have been included already; I'm not sure how it slipped out.

I have no clue what's going on with the NSRDSfunctions, since it doesn't do that on any of my test machines, but since it seems to reliably do that on yours, I can include the change. Are you doing this on a managed mount or an unmanaged one? Perhaps this is getting into the filename length limit Niklas mentioned?

I also admit to being somewhat confused by what's going on in the Allwmake patch. Your patch doesn't add the code to compile the wmake system, library, or applications -- it simply removes whitespace from those three lines (which do already exist), and moves them around. And it's incorporating code that was in the doc/Allwmake file -- it looks like this change is for a case where you've moved your Doxygen directory from the doc directory to the root OpenFOAM-1.3 directory?

I'll get these into the packaged distribution shortly!

pvita April 13, 2006 03:40

Greetings! In that version

In that version from OpenFOAM-1.3.cygwin-src-0.5.tar.gz was the fix just partialy implemented and still the old detection through CYGWIN_NT-5.0 or CYGWIN_NT-5.1 or etc. was used at least in OpenFOAM-1.3/.OpenFOAM-1.3/bashrc and OpenFOAM-1.3/.OpenFOAM-1.3/cshrc.

Well, in the case of Allwmake something got screwed as I see. I checked it once again and you are right. However I have no idea how I got on my installation contents I was repairing. There was some modification of Doxygen directory rights and fully missing compilation applications and OpenFOAM libraries. *scratches on the head* This part is somehow strange... Throw it out, please.

Problem with NSRDSfunctions is very strange one to mee as well. I am using non-managed mounts now but I do not think it is bound to lenght of filenames either as normally just limited part of functions get compiled and part simply not without reason. It could be somebody will replicate it. But who knows.


pvita April 13, 2006 03:54

I posted that I do not know wh
I posted that I do not know where it is comming from those changes in Allwmake I had to repair. Well, I know it now. :-) It is contained in your documents distribution OpenFOAM-1.3.Docs.tar.gz. I have unpacked the sources first, then documents distribution and it replaced original Allwmake. You should probably correct it removing Allwmake from documents distribution completly.


brooksmoses April 13, 2006 04:13

Oh, I see what I did! When I
Oh, I see what I did! When I created the Docs distribution, I got it mixed up so it puts everything into the OpenFOAM-1.3 root directory instead of OpenFOAM-1.3/doc -- and thus what should be OpenFOAM-1.3/doc/Allwmake overwrites OpenFOAM-1.3/Allwmake from the source distribution. So it's a complete mess, and that's only one of the symptoms.

Anyhow, it should be fixed now.

On the NSRDS functions: what are the symptoms of what happens with them if you don't use this patch? Does it fail at compilation, or only when you try to use them (and, if so, with which testcase)?

niklas April 19, 2006 02:12

I've tried out Brooks stuff an
I've tried out Brooks stuff and it works great.
There is one point I'd like to see improved though,
to better handle cross platform development,
and that is the way includes have been modified.

#include "vector.H" -> #include "vector.hh"

would be nice if instead it was

#ifdef cygwin
#include "vector.hh"
#include "vector.H"

I have no objections to renaming the files,
but its messy sitting writing/testing code on a windows PC and running it on another.

Great work though Brooks.


pvita April 19, 2006 03:41

Niklas -- Nice to see you a
Niklas --

Nice to see you again between those who tries to get Cygwin port working!

Brooks --

I have noticed that there is a OpenFOAM Wiki running. Well, it is my shame ignoring it so hard as it is loved child of Bernhard, my collegue. Whatever! There is a section know as Main HowTos that contain already some HOWTOs inside. One of them is named Compiling OpenFOAM under Unix. Maybe we should put content of your website there to centralize it... What you think about it?


brooksmoses April 19, 2006 04:08

Niklas: That sort of #ifdef co
Niklas: That sort of #ifdef construct is definitely how I do things in my own user applications outside the OpenFOAM source tree, yes, for exactly that reason. I'm not quite sure how it's useful to do it in the OpenFOAM tree itself, though -- are you editing the OpenFOAM files and transferring them back and forth? If so, don't you already have problems with some of the files having different names? I was thinking that it made more sense to have the modified tree be self-consistent, so that if someone unpacked it into a non-Cygwin machine it would still compile properly. (And it does; I tested it a couple of days ago.)

Petr: Yes, I think that it would be useful to move at least some of the content of my site to the Wiki. I probably won't have a chance to think about it for a week or two, though, but I'll make a note to work on it when I have time.

niklas April 19, 2006 04:19

Petr: Hehe, This is probab

This is probably going to upset a few and come out wrong, but Im gonna go ahead and say it anyway so
that you know where I stand.

I'm deliberately keeping a very low profile for this windows port thingy since
windows users in general are clicky-this-mesh, clicky-that-run, clicky-produce-nice-pics users who know very little (I might be wrong, but that is my experience) and
I dont like supporting them because they seldom
understand the complexity of CFD and/or OpenFOAM,
know very little about computers and
in general require, and often demand!!!, alooot of time to support.

Time I do not have.

Yup, havent got that far yet, but the amount of fiddling will be less


gschaider April 19, 2006 04:50

Niklas comment about the Windo
Niklas comment about the Windows-users: I understand (and partially share) your sentiments, but I don't think it will be so bad for one reason: AFAIK nobody plans to port FoamX to cygwin (don't know if this is even possible). So if a disclaimer "...but the GUI is only available on Linux." is prepended to the Cygwin-README the pointAndClick-crowd will either go away or move to Linux (and will want support for their Linux-problems ;) ).

pvita April 19, 2006 06:32

Niklas -- Well, we need tes
Niklas --

Well, we need testers, nobody asks you to support anybody if you have no time. That is your decision. I do not really understood message of your statement. And as Bernhard said, AFAIK there is no really plan for FoamX port.


niklas April 19, 2006 07:01

Well, we need testers, nobody
Well, we need testers, nobody asks you to support anybody if you have no time.
That is nice to hear.

Anyway, my point (although I have to admit not entirely clear) was that I never went away -
as your previous post 'nice to see you again' suggested.
I just haven't posted my solutions here, hoping that you would solve it all and get all the questions

I think you're both doing a great job.


brooksmoses April 19, 2006 14:01

Thanks for the compliments, Ni
Thanks for the compliments, Niklas! And, yes, that's part of the reason that I've tried to make it very clear on my file-distribution page that this is an unofficial port -- I very much want to make it clear that it's not something the OpenFOAM team provides support for.

look May 3, 2006 05:49

Hi, When I compiled OpenFOAM
When I compiled OpenFOAM with ./Allwmake. I have a problem like this:

/home/user/OpenFOAM/OpenFOAM-1.3/wmake/wmake: line 140: make: command not found

/home/user/OpenFOAM/OpenFOAM-1.3/wmake/wmake: cannot make, file Make/cygwinGcc4DPOpt/objectFiles was not created successfully

Could someone teach me what is going on and how to solve it?
Thank you very much.

pvita May 3, 2006 06:13

Look -- Have a look once ag
Look --

Have a look once again at Brook's website where you downloaded your files from and read section Dependencies. There are written down some packages you need to install in your Cygwin to able to compile OpenFOAM 1.3 at all. Check if all packages are installed. Your error message says on its first line ...make: command not found informing you that make is not provided.


look May 3, 2006 06:27

Dear Petr Vita: I really ne
Dear Petr Vita:

I really neglect this.
Thank for your help.


look May 4, 2006 05:39

Hi, When I use wmake to compi
When I use wmake to compiled icoFoam,I have a problem like this:

g++: error trying to exec 'as': execvp: No such file or directory
make: *** [Make/cygwinGcc4DPOpt/icoFoam.o] Error 1

I don't know what is wrong.
Can someone help me ?
Thank you.


All times are GMT -4. The time now is 19:56.