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

OpenFOAM on MinGW crosscompiler hosted on Linux

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

Reply
 
LinkBack Thread Tools Display Modes
Old   March 29, 2008, 13:50
Default Excuse the misspelling of your
  #21
Senior Member
 
gocarts's Avatar
 
Richard Smith
Join Date: Mar 2009
Location: Enfield, NH, USA
Posts: 138
Blog Entries: 4
Rep Power: 9
gocarts is on a distinguished road
Excuse the misspelling of your name, sorry Takuya.

Rich
__________________
Symscape, Computational Fluid Dynamics for all
gocarts is offline   Reply With Quote

Old   April 1, 2008, 16:52
Default Hi, Richard, Thank you so m
  #22
New Member
 
Allen Zhao
Join Date: Mar 2009
Location: Westmont, IL, USA
Posts: 26
Rep Power: 9
allenzhao is on a distinguished road
Hi, Richard,

Thank you so much for your work. Sorry that I was sidetrip to another project these days and have not tested your patch.

Just tested your patch on a SuSE 10.2 box, and it went much further than before. There is only one roadblock left, though:

SOURCE=interfaceProperties.C ; mingw32-g++ -Dlinux -DDP -DWIN32 -DLITTLE_ENDIAN -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -O3 -DNDEBUG -DNoRepository -ftemplate-depth-40 -I/User/allen/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude -IlnInclude -I. -I/User/allen/OpenFOAM/OpenFOAM-1.4.1/src/OSspecific/MSwindows/lnInclude -I/User/allen/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude -c $SOURCE -o Make/linuxmingw32DPOpt/interfaceProperties.o
In file included from /User/allen/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/Time.H:47,
from /User/allen/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/GeometricField.C:28,
from /User/allen/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/GeometricField.H:570,
from /User/allen/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/GeometricScalarField. H:39,
from /User/allen/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/GeometricFields.H:35,
from /User/allen/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude/volFields.H:38,
from interfaceProperties.H:42,
from interfaceProperties.C:35:
/User/allen/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/cpuTime.H:40:23: error: sys/times.h: No such file or directory
In file included from /User/allen/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/Time.H:47,
from /User/allen/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/GeometricField.C:28,
from /User/allen/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/GeometricField.H:570,
from /User/allen/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/GeometricScalarField. H:39,
from /User/allen/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/GeometricFields.H:35,
from /User/allen/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude/volFields.H:38,
from interfaceProperties.H:42,
from interfaceProperties.C:35:
/User/allen/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/cpuTime.H:57: error: field 'startTime_' has incomplete type
/User/allen/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/cpuTime.H:58: error: field 'lastTime_' has incomplete type
/User/allen/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/cpuTime.H:59: error: field 'newTime_' has incomplete type
make: *** [Make/linuxmingw32DPOpt/interfaceProperties.o] Error 1

------------------------------------------
It sounds like the <sys/times.h> is not available. I checked the following location:

hurricane:/usr/mingw/i686-pc-mingw32/include # ls sys/time*.h
sys/time.h sys/timeb.h

My minGW problem?

Here is my MinGW installation:
hurricane:/User/allen/OpenFOAM/OpenFOAM-1.4.1 # mingw32-gcc --version
mingw32-gcc (GCC) 4.2.1-sjlj (mingw32-2)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I grab the source code from MinGW's site. Maybe I should just grab a vanilla gnu c as you have mentioned?
allenzhao is offline   Reply With Quote

Old   April 1, 2008, 18:25
Default Still have the same issue (
  #23
New Member
 
Allen Zhao
Join Date: Mar 2009
Location: Westmont, IL, USA
Posts: 26
Rep Power: 9
allenzhao is on a distinguished road
Still have the same issue (<sys/times.h> missing) when using a 4.2.3 MinGW compiler (compiled from vanilla gnu C).

Any suggestions?

I notice that the Linux' /usr/include/sys/ indeed has times.h there. But the MinGW gcc does not have it.

Can it be my MinGW build process?
allenzhao is offline   Reply With Quote

Old   April 1, 2008, 18:50
Default Hi Allen, From the look of
  #24
Senior Member
 
gocarts's Avatar
 
Richard Smith
Join Date: Mar 2009
Location: Enfield, NH, USA
Posts: 138
Blog Entries: 4
Rep Power: 9
gocarts is on a distinguished road
Hi Allen,

From the look of your error message:
/User/allen/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/cpuTime.H:57: error: field 'startTime_' has incomplete type

I think you've got include files in the wrong place. I'm guessing that is probably due to you having compiled another platform with this build prior to applying the patch (v4). I suggest you remove all lnInclude directories by using wcleanLnInclude in the top OpenFOAM directory. Also make sure that the Unix directory is deleted from src/OpenFOAM/OSspecific.

Hopefully it's this include issue and not your MinGW configuration.

Rich
__________________
Symscape, Computational Fluid Dynamics for all
gocarts is offline   Reply With Quote

Old   April 2, 2008, 12:17
Default Hi, Rich, Thanks for the po
  #25
New Member
 
Allen Zhao
Join Date: Mar 2009
Location: Westmont, IL, USA
Posts: 26
Rep Power: 9
allenzhao is on a distinguished road
Hi, Rich,

Thanks for the pointers.

Well, tried from scratch again, and still got the same errors.

Where do you have struct tms defined in your MinGW header? In my MinGW, /usr/local/mingw/mingw32/include/ should be the location, and there is not <sys/times.h> there. Do you see times.h in your path?

Maybe I miss something in my MinGW installation.

Best regards,

Allen
allenzhao is offline   Reply With Quote

Old   April 2, 2008, 12:56
Default Hi Allen, There shouldn't b
  #26
Senior Member
 
gocarts's Avatar
 
Richard Smith
Join Date: Mar 2009
Location: Enfield, NH, USA
Posts: 138
Blog Entries: 4
Rep Power: 9
gocarts is on a distinguished road
Hi Allen,

There shouldn't be a reference to <sys/times.h> or tms in your OpenFOAM MinGW build - they only apply to Unix. So I think your MinGW configuration is fine.

Somehow it seems that your MinGW OpenFOAM build is pointing to src/OSspecific/Unix, whereas it should be pointing to src/OSspecific/MSwindows.

Check when compiling a source file that the build line includes:
-I<openfoam-home>/src/MSwindows/lnInclude

Check that the environment variable:
export WM_OS_SPECIFIC=OSspecific/MSwindows
is set in:
.OpenFOAM-1.4.1/bashrc-mingw32

and that you have sourced it prior to compiling.

Anyone else seen this problem or has a suggestion as to how to avoid it?

Rich
__________________
Symscape, Computational Fluid Dynamics for all
gocarts is offline   Reply With Quote

Old   April 2, 2008, 14:48
Default Hi, Rich, Just check my Ope
  #27
New Member
 
Allen Zhao
Join Date: Mar 2009
Location: Westmont, IL, USA
Posts: 26
Rep Power: 9
allenzhao is on a distinguished road
Hi, Rich,

Just check my OpenFOAM directory, before patching, I have:
<openfoam-home>/OpenFOAM-1.4.1/src/OpenFOAM/OSspecific/Unix/
OSspecific.H Unix.H cpuTime fileStat.C printStack.C timer.C
Unix.C clockTime dummyPrintStack.C fileStat.H signals timer.H

After OSspecific is removed and a the v4-patch is applied, I have this now:

<openfoam-home>/OpenFOAM-1.4.1/src/OpenFOAM/OSspecific
OSspecific.H

I do not see the MSwindows directory. Any pointers? This seems to be the source of the trouble.

The bashrc-mingw32 does contains the following line:

# Operating System/Platform from Unix or MSwindows
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export WM_OS_SPECIFIC=OSspecific/MSwindows

Best regards,

Allen Zhao
allenzhao is offline   Reply With Quote

Old   April 2, 2008, 15:07
Default Hi Allen, Sorry, I mistyped
  #28
Senior Member
 
gocarts's Avatar
 
Richard Smith
Join Date: Mar 2009
Location: Enfield, NH, USA
Posts: 138
Blog Entries: 4
Rep Power: 9
gocarts is on a distinguished road
Hi Allen,

Sorry, I mistyped where the MSwindows directory now lives - no longer under src/OpenFOAM. It should be:
OpenFOAM-1.4.1/src/OSspecific/MSwindows

There should be a single file in the old OSspecific directory:
OpenFOAM-1.4.1/src/OpenFOAM/OSspecific/OSspecific.H
as you correctly have.

Sorry for the confusion.

If you are still having problems, please post the error message from the compiler - especially with relation to which files it can't find.

Rich
__________________
Symscape, Computational Fluid Dynamics for all
gocarts is offline   Reply With Quote

Old   April 2, 2008, 16:02
Default Something interesting with the
  #29
New Member
 
Allen Zhao
Join Date: Mar 2009
Location: Westmont, IL, USA
Posts: 26
Rep Power: 9
allenzhao is on a distinguished road
Something interesting with the OpenFOAM source structure:

After unpack the big tar.gz file to OpenFOAM-1.4.1/ directory, I do not see src/OSspecific/ there, but rather src/OpenFOAM/OSspecific/ and src/OpenFOAM/OSspecific/Unix/

Just read the v4-mingw-openfoam-1-4-1.patch which use "src/OSspecific/" everywhere.

I follow the http://www.symscape.com/openfoam-on-windows, first renamed src/OpenFOAM/OSspecific to src/OpenFOAM/OSspecific.orig, and then did `patch -p0 < v4-mingw-openfoam-1-4-1.patch`. This recreates the src/OSspecific directory, but there is only one file in it.

Obviously I must have applied your patch incorrectly. ;(
allenzhao is offline   Reply With Quote

Old   April 2, 2008, 16:10
Default That's correct. src/OpenFOA
  #30
Senior Member
 
gocarts's Avatar
 
Richard Smith
Join Date: Mar 2009
Location: Enfield, NH, USA
Posts: 138
Blog Entries: 4
Rep Power: 9
gocarts is on a distinguished road
That's correct.

src/OpenFOAM/OSspecific/Unix is gone and OSspecific.H is the only file in the src/OpenFOAM/OSspecific directory.

src/OSspecific is created by the patch with subdirectories MSwindows and Unix that contain platform specific sources.

Note src/OSspecific and src/OpenFOAM/OSspecific are different locations.
__________________
Symscape, Computational Fluid Dynamics for all
gocarts is offline   Reply With Quote

Old   April 2, 2008, 16:14
Default Another thought. It's not e
  #31
Senior Member
 
gocarts's Avatar
 
Richard Smith
Join Date: Mar 2009
Location: Enfield, NH, USA
Posts: 138
Blog Entries: 4
Rep Power: 9
gocarts is on a distinguished road
Another thought.

It's not enough to just rename src/OpenFOAM/OSspecific, you have to move it out of the OpenFOAM distribution, otherwise the symbolic link builder will find it and add links to it - this could be the cause of your problems.
__________________
Symscape, Computational Fluid Dynamics for all
gocarts is offline   Reply With Quote

Old   April 2, 2008, 17:06
Default Hi, Nice piece of kit! W
  #32
Member
 
Jason Dale
Join Date: Mar 2009
Location: UK
Posts: 69
Rep Power: 9
jason is on a distinguished road
Hi,

Nice piece of kit!

Would love to get it working but my limited linux knowledge isn't helping....all day!

My problem is that i get stuck at the building gcc stage. For OpenSUSE 10.3 32bit, it worked ok for this config

MINGW_URL="http://heanet.dl.sourceforge.net/sourceforge/mingw"

GCC_CORE_ARCHIVE="gcc-core-3.4.5-20060117-1-src.tar.gz"
GCC_GPP_ARCHIVE="gcc-g++-3.4.5-20060117-1-src.tar.gz"
GCC_G77_ARCHIVE=""
GCC_OBJC_ARCHIVE=""
GCC_JAVA_ARCHIVE=""
GCC_ADA_ARCHIVE=""
GCC_PATCH=""

BINUTILS_ARCHIVE="binutils-2.18.50-20080109-src.tar.gz"
MINGW_ARCHIVE="mingw-runtime-3.9.tar.gz"
W32API_ARCHIVE="w32api-3.9.tar.gz"

But then when I tried to compile OF, after a few seconds it crashed. So, I figured the gcc was so out of date from gcc so I have been trying gcc-xxx-4.2.1.tar.gz, the same as the OF 1.4.1 distribution (hope Im doing this right???)

Next config is here, downloaded from different places:

GCC_CORE_ARCHIVE="gcc-core-4.2.1.tar.gz"
GCC_GPP_ARCHIVE="gcc-g++-4.2.1.tar.gz"
GCC_GPP_ARCHIVE=""
GCC_G77_ARCHIVE=""
GCC_OBJC_ARCHIVE=""
GCC_JAVA_ARCHIVE=""
GCC_ADA_ARCHIVE=""
GCC_PATCH=""

BINUTILS_ARCHIVE="binutils-2.18.50-20080109-src.tar.gz"
MINGW_ARCHIVE="mingw-runtime-3.14-src.tar.gz"
W32API_ARCHIVE="w32api-3.11-src.tar.gz"

Earlier, the compiler complained complained that MPRF was buggy so I updated GMP and MPRF and got a bit further. But now it seems to crash out at a point that mentions time.h??? (I saw this mentioned above)

Here is my make.log file
make.log.zip
the error is at the end

and configure.log
config.log

Now I'm stuck, would greatly appreciate some help...

Thanks

Jason
jason is offline   Reply With Quote

Old   April 2, 2008, 17:17
Default Hi Jason, Rather than compi
  #33
Senior Member
 
gocarts's Avatar
 
Richard Smith
Join Date: Mar 2009
Location: Enfield, NH, USA
Posts: 138
Blog Entries: 4
Rep Power: 9
gocarts is on a distinguished road
Hi Jason,

Rather than compile your own MinGW cross-compiler, I'd suggest using the pre-compiled binaries Bernhard mentioned at:
http://sourceforge.net/projects/mingw-cross/

There's a chance I just got lucky when I compiled my own from scratch. If it helps I'm using Ubuntu 7.10 32bit.

Rich
__________________
Symscape, Computational Fluid Dynamics for all
gocarts is offline   Reply With Quote

Old   April 2, 2008, 17:39
Default Hi, Rich, Thank you so much
  #34
New Member
 
Allen Zhao
Join Date: Mar 2009
Location: Westmont, IL, USA
Posts: 26
Rep Power: 9
allenzhao is on a distinguished road
Hi, Rich,

Thank you so much for the pointers. You must be right about the renaming of src/OpenFOAM/OSspecific. Once I removed the directory completely, I bypassed the road block and started to have codes compiled.

Thanks again.
allenzhao is offline   Reply With Quote

Old   April 2, 2008, 18:05
Default Hi Rich, Yes I also tried
  #35
Member
 
Jason Dale
Join Date: Mar 2009
Location: UK
Posts: 69
Rep Power: 9
jason is on a distinguished road
Hi Rich,

Yes I also tried those too but maybe I made a mistake and got lost along the way. Is it the rpm's I need to download? I tried to install those but then my machine complained that the dependencies were not available or something.

Could you list the exact files that I need to download and then what do I do after that? Install them and then just type ./Allmake? Will try it again tomorrow, maybe it was the updates that I needed that stopped that one working...

Thanks

Jason
jason is offline   Reply With Quote

Old   April 2, 2008, 18:37
Default Hi Jason, I'll have to defe
  #36
Senior Member
 
gocarts's Avatar
 
Richard Smith
Join Date: Mar 2009
Location: Enfield, NH, USA
Posts: 138
Blog Entries: 4
Rep Power: 9
gocarts is on a distinguished road
Hi Jason,

I'll have to defer you to Bernhard or Takuya for details on the pre-compiled MinGW compiler.

Once you think the MinGW compiler is ready for action I'd suggest you compile a simple program such as:

#include <iostream>

int main(int argc, char* argv)
{
std::cout << "Hello World, I'm alive!" << std::endl
return 0;
}


Transfer the compiled binary to your windows environment and make sure it works. Then it should be as easy as:
cd <openfoam-home>; ./Allwmake

Rich
__________________
Symscape, Computational Fluid Dynamics for all
gocarts is offline   Reply With Quote

Old   April 2, 2008, 18:42
Default Anyone spot the mistakes? a
  #37
Senior Member
 
gocarts's Avatar
 
Richard Smith
Join Date: Mar 2009
Location: Enfield, NH, USA
Posts: 138
Blog Entries: 4
Rep Power: 9
gocarts is on a distinguished road
Anyone spot the mistakes?

argv should be argv[]
std::endl should be std::endl;

Hope that's it.
__________________
Symscape, Computational Fluid Dynamics for all
gocarts is offline   Reply With Quote

Old   April 3, 2008, 08:18
Default Hi Jason, Richard, The mingw-
  #38
Super Moderator
 
Takuya OSHIMA
Join Date: Mar 2009
Location: Niigata City, Japan
Posts: 518
Blog Entries: 1
Rep Power: 12
7islands is on a distinguished road
Hi Jason, Richard,
The mingw-cross packages I used were binutils, gcc-core, gcc-g++, gcc-gfortran, runtime, w32api, but I don't know if all of them were indeed required. If it helps I did all under Ubuntu 7.10 on VMware.

You have to adjust compiler executable names mingw32-gcc, mingw32-g++, mingw32-ld in OpenFOAM-1.4.1/wmake/rules/linuxmingw32/{c,c++,general} and OpenFOAM-1.4.1/.OpenFOAM-1.4.1/bashrc-ming32 to i386-mingw32-gcc, i386-mingw32-g++, i386-ming32-ld.

Takuya
7islands is offline   Reply With Quote

Old   April 3, 2008, 10:05
Default Thanks Takuya, I'm getting
  #39
Member
 
Jason Dale
Join Date: Mar 2009
Location: UK
Posts: 69
Rep Power: 9
jason is on a distinguished road
Thanks Takuya,

I'm getting closer!

If I download the rpms and try to install with the software installer I get the error here:

Dependency Resolution Failed
Unresolved dependencies:
Installing mingw-binutils-2.18.50-4.fc8.i386[Local packages]
There are no installable providers of rtld(GNU_HASH) for mingw-binutils-2.18.50-4.fc8.i386[Local packages]

If I log out and log in as root and extract the rpms to the correct locations, then, log out again , the executables i386-mingw32-xxx can be found by the system. If I compile this

#include <iostream>
using namespace std;

int main ()
{
cout << "Hello World!";
return 0;
}

by typing for example

>g++ helloworld.cpp

I get an executable a.out it it runs fine. All good so far..

When I type

>i386-mingw32-g++ helloworld.cpp

I get the following error

i386-mingw32-g++: error trying to exec 'cc1plus': execvp: No such file or directory (I also get this when trying with OF)

I also had to download the mingw-gcc-objc rpm to make sure that this file cc1plus is there.

Is this because I didn't install the mingw correctly, just extracted the files?

Any idea what I can do?

Regards

Jason
jason is offline   Reply With Quote

Old   April 3, 2008, 10:10
Default Jason, I think your problem
  #40
New Member
 
Allen Zhao
Join Date: Mar 2009
Location: Westmont, IL, USA
Posts: 26
Rep Power: 9
allenzhao is on a distinguished road
Jason,

I think your problem is due to the fact that those rpm are built on Fedora Core 8 box (FC8). Although the glibc version should be very close to OpenSUSE 10.3, but who knows?

Just my 2 cents.

Regards,

Allen
allenzhao is offline   Reply With Quote

Reply

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
OpenFOAM 15x MinGW Windows Port gocarts OpenFOAM Installation 1 April 17, 2009 10:41
divide by zero FPE issue in OpenFOAM 141 MingW port allenzhao OpenFOAM Installation 9 September 22, 2008 17:13
OpenFOAM on SuSE Linux 100 musahossein OpenFOAM Installation 4 June 20, 2008 16:47
OpenFoam and Linux Tomislav Maric Main CFD Forum 13 October 25, 2007 04:45
OpenFOAM and linux distros billy OpenFOAM 8 September 8, 2005 01:43


All times are GMT -4. The time now is 14:37.