|
[Sponsors] |
Cross-compiling OpenFOAM 1.6 on Linux for Windows 32 and 64bits with Mingw-w64 |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 24, 2010, 04:57 |
|
#21 |
New Member
Thomas Frank Petersen
Join Date: May 2010
Posts: 5
Rep Power: 16 |
Hi Bruno.
Wow, thank you very much for your quick and detailed reply. I'm impressed! Just a quick update, I am using Ubuntu 10.04 LTS. I am trying out your suggestions today and will let you know the results. Regards, Thomas |
|
October 24, 2010, 08:16 |
|
#22 | ||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Thomas,
Quote:
Quote:
I've given it some thought and I think I know why the patches have worked for me and not for you and Billy: I've always been using 2 or more cores for building the whole thing, while you guys use only one core. This means that with me, libscotcherr gets built in parallel and ends before libscotch is built, therefore with me this issue has never happened before! But for you guys, with single core, libscotch had to be built before libscotcherr. This is not much of a problem in Linux (except in Fedora 13), since libraries can have loose links, but with Windows DLLs, there has to be a very clear existence of the necessary libraries! I'll update the patches ASAP to fix this problem. But hopefully things should now go well for you Thomas, since the instructions I gave you are the ones I'm going to follow to fix the patches But nonetheless, please give me some feedback if it has worked or not! Best regards, Bruno
__________________
|
|||
October 24, 2010, 15:58 |
|
#23 |
New Member
Thomas Frank Petersen
Join Date: May 2010
Posts: 5
Rep Power: 16 |
Hi again Bruno.
Ok short update. Everything seems to work! Scotch build without problems and openFOAM has just finished building INCLUDING snappyHexMesh.exe. I'm currently compiling the documentation and the tutorials and haven't tested OF yet but will get back to you when I get a chance to test the build. With regards to the error DOS_Mode.bat gives I have uploaded a screen shot of it, however because of my OS (Win 7), it is Danish. A rough translation would be: Procedureentrypoint_ZTVN10_cxxabiv117_class_type_i nfoE was not found in DLL-library libstdc++-6.dll. I believe the error is because I have a python distribution installed which has a local copy libstdc++-6.dll which is on the Windows PATH. When DOS_Mode.bat sets an additional PATH to the OF version of libstdc++-6.dll you get problems. I tested my previous compilations of OF at work where they ran without any problems, so I believe the above error is only a problem at my home computer. Kind regards, Thomas. |
|
October 24, 2010, 16:23 |
|
#24 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Thomas,
Sweet! Once again, thanks for the feedback As for that error with "libstdc++.dll", the trick is to:
By the way, I haven't checked this in Windows, because I mainly use Windows in English, so if you have any problems using ParaView 3.8.0 to open the ".foam" files, it's likely due to your Windows being in Danish. In Linux I know this is an issue with locales different from English (explained here), so you can try the same trick in Windows:
Best regards, Bruno
__________________
|
|
October 25, 2010, 16:09 |
|
#25 |
New Member
Thomas Frank Petersen
Join Date: May 2010
Posts: 5
Rep Power: 16 |
Hi Bruno.
I have tested the new compilation of OF and everything works, including snappyHexMesh! Your tip about putting %PATH% at the end of the line in setvars.bat also worked perfectly. Thank you very much for all your help. I haven't found out if there's any problems with parafoam. I simply use paraView and foamToVtk, but thanks for the tip though. I have a few final comments on the build. 1) When I run any openFOAM command in get the following warning. // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // --> FOAM Warning : From function openLibrary(const fileName& libName) in file MSwindows.C at line 1142 \ LoadLibrary failed. "Error 126: Det angivne modul blev ikke fundet. " Is that a problem or just part the porting from linux to Windows? 2) In the section "9.2 Packing up and leaving for Windows" I think I have found a small error. The code : Code:
tar -chjf OpenFOAM.$WM_OPTIONS.tar.bz2 OpenFOAM-1.7.0/applications/bin/$WM_OPTIONS \ OpenFOAM-1.7.0/etc OpenFOAM-1.7.0/bin OpenFOAM-1.7.0/lib/$WM_OPTIONS \ OpenFOAM-1.7.0/doc/Guides-a4 ThirdParty-1.7.0/platforms/$WM_ARCH$WM_COMPILER/mpich2-1.2.1p1 \ $USER-1.7.0/applications/bin/$WM_OPTIONS $USER-1.7.0/tutorials ThirdParty-1.7.0/mpich2-1.1.1p1/source Code:
tar -chjf OpenFOAM.$WM_OPTIONS.tar.bz2 OpenFOAM-1.7.0/applications/bin/$WM_OPTIONS \ OpenFOAM-1.7.0/etc OpenFOAM-1.7.0/bin OpenFOAM-1.7.0/lib/$WM_OPTIONS \ OpenFOAM-1.7.0/doc/Guides-a4 ThirdParty-1.7.0/platforms/$WM_ARCH$WM_COMPILER/mpich2-1.2.1p1 \ $USER-1.7.0/applications/bin/$WM_OPTIONS $USER-1.7.0/tutorials ThirdParty-1.7.0/mpich2-1.2.1p1/source Again thank you very much for all you help. Kind regards, Thomas. |
|
October 25, 2010, 18:08 |
|
#26 | ||||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Thomas,
Quote:
Quote:
Quote:
Quote:
And Thank You as well, because it's good thing you reported about all of these issues! The release we made of blueCFD 1.7-1 had none of these issues, because I fixed them as I found them and always used multi-core, so none of these issues ended up in the final product... but the documentation in the wiki didn't get the same testing treatment Hopefully tomorrow I'll get to fixing these issues. Best regards, Bruno
__________________
|
|||||
October 26, 2010, 03:46 |
|
#27 |
New Member
Thomas Frank Petersen
Join Date: May 2010
Posts: 5
Rep Power: 16 |
Hi Bruno.
I did run Code:
cd $FOAM_LIBBIN cp libgnurx-0.dll libregex.dll Regards, Thomas. |
|
June 4, 2012, 07:07 |
|
#28 |
New Member
Le Phi Long
Join Date: Feb 2011
Posts: 18
Rep Power: 15 |
I have try and get some bugs, this is my build log
Code:
======================================== Start ThirdParty Allwmake ======================================== ======================================== Compile zlib library '/home/longlp/OpenFOAM/OpenFOAM-1.7.0/lib/linuxmingw-w64DPOpt/libz.dll' is up to date. ======================================== Compile regex library regex already installed... run ./AllwcleanRegEx if you feel that it needs rebuilding! ======================================== Copying gcc related DLLs ======================================== Compile specific mpi libraries Setup MPICH2 stubs... [1m Generating MPICH2 stub... [0m [1m MPICH2 stub is already built and ready to use. [0m ======================================== Build Scotch decomposition library have scotch shared libraries ======================================== Build PTScotch decomposition library (requires MPI) have ptscotch shared libraries ======================================== Build Metis decomposition + cd metis-5.0pre2 + cpMakeFiles metis + set +x + wmake libso GKlib '/home/longlp/OpenFOAM/OpenFOAM-1.7.0/lib/linuxmingw-w64DPOpt/libGKlib.dll' is up to date. + wmake libso libmetis linuxmingw-w64DPOpt/options:10: *** missing separator. Stop. wmake error: file 'Make/linuxmingw-w64DPOpt/objectFiles' could not be created //Start error from here ======================================== Build ParMetis decomposition. Requires MPI. + cd ParMetis-3.1 + WM_OPTIONS_LOCAL=linuxmingw-w64DPOptMPICH + cpMakeFiles ParMetis + set +x + wmake libso METISLib '/home/longlp/OpenFOAM/OpenFOAM-1.7.0/lib/linuxmingw-w64DPOpt/mpich2-1.4.1p1/libmetis-parmetis.dll' is up to date. + wmake libso ParMETISLib linuxmingw-w64DPOpt/options:10: *** missing separator. Stop. wmake error: file 'Make/linuxmingw-w64DPOpt/objectFiles' could not be created + unset WM_OPTIONS_LOCAL ======================================== Build ParMGridGen + cd ParMGridGen-1.0 + cpMakeFiles ParMGridGen + set +x + wmake libso MGridGen/IMlib '/home/longlp/OpenFOAM/OpenFOAM-1.7.0/lib/linuxmingw-w64DPOpt/libIMlib.dll' is up to date. + wmake libso MGridGen/Lib '/home/longlp/OpenFOAM/OpenFOAM-1.7.0/lib/linuxmingw-w64DPOpt/libMGridGen.dll' is up to date. ======================================== Done ThirdParty Allwmake ======================================== + wmakePrintBuild -check no git description found + /bin/rm -f OpenFOAM/Make/linuxmingw-w64DPOpt/global.? + wmakeLnInclude OpenFOAM + wmakeLnInclude OSspecific/MSwindows + Pstream/Allwmake + buildMode=libso + echo mingw-w64 + grep mingw + [ x != xmingw-w64 ] + [ = LINKTOPSTREAM ] + buildMode=libo + wmake libo dummy '/home/longlp/OpenFOAM/OpenFOAM-1.7.0/lib/linuxmingw-w64DPOpt/dummy/libPstream.o' is up to date. + set +x Note: ignore spurious warnings about missing mpicxx.h headers + wmake libo mpi '/home/longlp/OpenFOAM/OpenFOAM-1.7.0/lib/linuxmingw-w64DPOpt/mpich2-1.4.1p1/libPstream.o' is up to date. + unset buildMode + wmake libo OSspecific/MSwindows '/home/longlp/OpenFOAM/OpenFOAM-1.7.0/lib/linuxmingw-w64DPOpt/libOSspecific.o' is up to date. + wmake libso OpenFOAM linuxmingw-w64DPOpt/options:13: *** missing separator. Stop. wmake error: file 'Make/linuxmingw-w64DPOpt/objectFiles' could not be created + echo mingw-w64 + grep mingw + [ x != xmingw-w64 ] + export WM_PSTREAMLINK=LINKTOPSTREAM + cd Pstream + ./Allwmake + buildMode=libso + echo mingw-w64 + grep mingw + [ x != xmingw-w64 ] + [ LINKTOPSTREAM = LINKTOPSTREAM ] + buildMode=libso + wmake libso dummy x86_64-w64-mingw32-g++ -Dlinux -DWM_DP -DWIN64 -DLITTLE_ENDIAN -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -O2 -DNDEBUG -fno-strict-aliasing -DNoRepository -ftemplate-depth-40 -IlnInclude -I. -I/home/longlp/OpenFOAM/OpenFOAM-1.7.0/src/OpenFOAM/lnInclude -I/home/longlp/OpenFOAM/OpenFOAM-1.7.0/src/OSspecific/MSwindows/lnInclude -I/home/longlp/OpenFOAM/ThirdParty-1.7.0/zlib-1.2.5 -I/home/longlp/OpenFOAM/ThirdParty-1.7.0/platforms/linuxmingw-w64/mingw-libgnurx-2.5.1/include /home/longlp/OpenFOAM/OpenFOAM-1.7.0/lib/linuxmingw-w64DPOpt/OFversion.o -Wl,--output-def,/home/longlp/OpenFOAM/OpenFOAM-1.7.0/lib/linuxmingw-w64DPOpt/dummy/libPstream.def,--out-implib,/home/longlp/OpenFOAM/OpenFOAM-1.7.0/lib/linuxmingw-w64DPOpt/dummy/libPstream.a,--enable-auto-import,--strip-all -shared Pstream.o IPread.o OPwrite.o -L/home/longlp/OpenFOAM/OpenFOAM-1.7.0/lib/linuxmingw-w64DPOpt -lOpenFOAM -o /home/longlp/OpenFOAM/OpenFOAM-1.7.0/lib/linuxmingw-w64DPOpt/dummy/libPstream.dll /home/longlp/OpenFOAM/ThirdParty-1.7.0/platforms/linuxmingw-w64/mingw/lib/gcc/x86_64-w64-mingw32/4.5.0/../../../../x86_64-w64-mingw32/bin/ld: cannot find -lOpenFOAM collect2: ld returned 1 exit status make: *** [/home/longlp/OpenFOAM/OpenFOAM-1.7.0/lib/linuxmingw-w64DPOpt/dummy/libPstream.dll] Error 1 + set +x ........ and more after use Code:
./build-mingw45 Code:
cd $WM_DIR/rules sed -i -e 's=-O2 -DNDEBUG=-O2 -DNDEBUG -fno-strict-aliasing=' "$WM_ARCH$WM_COMPILER/c++Opt" Code:
./Allwmake |
|
June 4, 2012, 07:23 |
|
#29 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Mr.Cloud,
That's an old issue, due to the evolution of the "cpp" binary. Edit the file "$WM_DIR/rules/$WM_ARCH$WM_COMPILER/general" and make the 1st line look like the first one from here: https://github.com/OpenCFD/OpenFOAM-...nuxGcc/general Namely this one: Code:
CPP = cpp -traditional-cpp $(GFLAGS) Bruno
__________________
Last edited by wyldckat; June 6, 2012 at 19:17. Reason: one " too many... |
|
June 4, 2012, 22:22 |
|
#30 | |
New Member
Le Phi Long
Join Date: Feb 2011
Posts: 18
Rep Power: 15 |
Quote:
Code:
CPP = cpp -traditional-cpp $(GFLAGS) LD = x86_64-w64-mingw32-ld PROJECT_LIBS = -l$(WM_PROJECT) -L$(FOAM_MPI_LIBBIN) -lPstream PROJECT_INC += -I$(WM_THIRD_PARTY_DIR)/zlib-1.2.5 \ -I$(WM_THIRD_PARTY_DIR)/platforms/$(WM_ARCH)$(WM_COMPILER)/mingw-libgnurx-2.5.1/include include $(GENERAL_RULES)/standard include $(RULES)/X include $(RULES)/c include $(RULES)/c++ SO = dll EXE_EXT = .exe # Ensure we know what OS we are compiling for # during MakefileFiles and MakefileOptions GFLAGS += -DWIN64 -DLITTLE_ENDIAN Code:
/* NOTE: make any changes to this file in wmakeFiles/ */ sinclude $(GENERAL_RULES)/mplib$(WM_MPLIB) sinclude $(RULES)/mplib$(WM_MPLIB) EXE_INC = $(PFLAGS) $(PINC) LIB_LIBS = $(PLIBS) /*neutralize this variable...*/ PROJECT_LIBS = |
||
June 6, 2012, 19:24 |
|
#31 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Le Phi Long,
OK, I finally managed to get around to test this. Run the following commands: Code:
foam3rdParty ./Allclean ./Allwmake ./Allwmake Now you can move onto the OpenFOAM folder: Code:
foam wclean all ./Allwmake > make.log 2>&1 Best regards, Bruno
__________________
|
|
June 6, 2012, 23:34 |
|
#32 |
New Member
Le Phi Long
Join Date: Feb 2011
Posts: 18
Rep Power: 15 |
Oh... THanks you so much Bruno... I have done follow you, and it got no error so far...
|
|
August 29, 2012, 06:51 |
|
#33 | ||
New Member
Le Phi Long
Join Date: Feb 2011
Posts: 18
Rep Power: 15 |
Quote:
I user the mingw-w64, with this version, i was success in build a OF1.7.x version. Looking for your tutorial like version 1.7, so detail and comfortable. This is the begin... Quote:
|
|||
August 30, 2012, 00:43 |
|
#34 | |
New Member
Le Phi Long
Join Date: Feb 2011
Posts: 18
Rep Power: 15 |
This is my buildlog so far.
Here is the full log https://docs.google.com/document/d/1...-D3iu1mh0/edit I terminated it when i got these errors. Quote:
|
||
August 31, 2012, 07:49 |
|
#35 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Mr.Cloud,
If you still have problems with this, I suggest you start a new thread for the instructions you are following, instead of asking the same question on multiple threads (the duplicate question I'm talking about is this one: http://www.cfd-online.com/Forums/ope...tml#post379260 ) Best regards, Bruno
__________________
|
|
September 3, 2012, 22:43 |
|
#36 |
New Member
Le Phi Long
Join Date: Feb 2011
Posts: 18
Rep Power: 15 |
Ok... Thanks for your reply Bruno. From now i will post my problems to this thread "OF 2.1.0 under Windows XP or Windows 7", it look suitable with my problem than this. And can you come there, and have a look at my problem?
Thanks you so much. And st, please forgive for my poor English. |
|
October 24, 2012, 08:10 |
Problem when patching ThirdParty-1.7.0
|
#37 |
Member
Anonymous
Join Date: Jul 2009
Posts: 44
Rep Power: 17 |
Hi,
I am trying to cross compile OpenFoam1.7 in cygwin, I therefore used the wiki instructions on: Code:
http://openfoamwiki.net/index.php/Tip_Using_Cygwin_for_cross-compiling_OpenFOAM Code:
http://openfoamwiki.net/index.php/Tip_Cross_Compiling_OpenFOAM_1.7_in_Linux_For_Windows_with_MinGW In one of the first steps of the second link, however, when patching ThirdParty-1.7.0, I get the error_ Code:
... patching file ThirdParty-1.7.0/wmakeFiles/ParMetis/METISLib/options patching file ThirdParty-1.7.0/wmakeFiles/ParMetis/ParMETISLib/options can't find file to patch at input line 18082 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff --git a/scotch_5.1/src/libscotch/Makefile b/scotch_5.1/src/libscotch/Makefile |index d18c9be..e8244ce 100644 |--- a/scotch_5.1/src/libscotch/Makefile |+++ b/scotch_5.1/src/libscotch/Makefile -------------------------- File to patch: Anybody any clue? (I don't know anything about linux so I'm following the wiki instructions like a blind robot... ..and hope to end up with win32 executables ) |
|
October 24, 2012, 15:53 |
|
#38 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings gerritgroot,
I did a quick test in Ubuntu and it's very simple:
Best regards, Bruno PS: I moved your post to this thread, because this is the thread dedicated to questions for the patches posted for that series of instruction pages.
__________________
|
|
October 25, 2012, 07:07 |
"File to patch?"
|
#39 |
Member
Anonymous
Join Date: Jul 2009
Posts: 44
Rep Power: 17 |
Muito obrigado Bruno,
I never thought it would be that simple. I'm sure more questions will come up as this is all new to me. Gerrit. BTW: It took me some time to find my own messages back. Isn't there a button like "my messages" somewhere? (I've seen that on other forums) |
|
October 25, 2012, 12:21 |
|
#40 |
Member
Anonymous
Join Date: Jul 2009
Posts: 44
Rep Power: 17 |
Hi,
As was to be expected, I got stuck again. I hope you can help me out. First of all some downloads didn't work. I solved this by placing the compressed files under the "download" directory: Code:
./home/MyUser/OpenFOAM/ThirdParty-1.7.0/download Code:
make of binutils failed - log available: /home/MyUser/OpenFOAM/buildLogs/binutils-mingw32_configure.log Code:
checking build system type... i686-pc-cygwin checking host system type... i686-pc-cygwin checking target system type... i686-pc-mingw32 checking for a BSD-compatible install... /bin/install -c checking whether ln works... yes checking whether ln -s works... yes checking for a sed that does not truncate output... /bin/sed checking for gawk... gawk checking to see if cat works as expected... /home/MyUser/OpenFOAM/ThirdParty-1.7.0/binutils-2.20.1/configure: 3590: test: a: unexpected operator no configure: error: The cat command does not ignore carriage return characters. Please either mount the build directory in binary mode or run the following commands before running any configure script: set -o igncr export SHELLOPTS Code:
set -o igncr export SHELLOPTS And ran the script again Code:
./build-mingw44 How can I solve this? |
|
Tags |
mingw-w32, mingw-w64, mingw32 |
|
|