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

[foam-extend.org] foam-extend-3.2 compilation on windows

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 7, 2016, 06:41
Default foam-extend-3.2 compilation on windows
  #1
Member
 
KirMaks
Join Date: Aug 2016
Posts: 34
Rep Power: 7
kirmaks is on a distinguished road
Hallo,

I'm currently trying to compile foam-extend-3.2 on my Windows 7 x64 system with MinGW according to the recommendations from the official foam-extend-project site. The setting of the environmental variables is fine, the screenshot is attached, but I have some troubles when compiling:

1. Metis-5.1.0 gives me errors:

Code:
 
 [ 77%] Building C object programs/CMakeFiles/gpmetis.dir/cmdline_gpmetis.c.obj
c:/MinGW/msys/home/kirmaks/foam-extend-4.0/ThirdParty/mingwBuild/x64/build/metis-5.1.0/programs/cmdline_gpmetis.c: In function 'parse_cmdline':
c:/MinGW/msys/home/kirmaks/foam-extend-4.0/ThirdParty/mingwBuild/x64/build/metis-5.1.0/programs/cmdline_gpmetis.c:265:3: warning: implicit declaration of function 'gk_getopt_long_only' [-Wimplicit-function-declaration]
   while ((c = gk_getopt_long_only(argc, argv, "", long_options, &option_index)) != -1) {
   ^
c:/MinGW/msys/home/kirmaks/foam-extend-4.0/ThirdParty/mingwBuild/x64/build/metis-5.1.0/programs/cmdline_gpmetis.c:268:13: error: 'gk_optarg' undeclared (first use in this function)
         if (gk_optarg)
             ^
c:/MinGW/msys/home/kirmaks/foam-extend-4.0/ThirdParty/mingwBuild/x64/build/metis-5.1.0/programs/cmdline_gpmetis.c:268:13: note: each undeclared identifier is reported only once for each function it appears in
c:/MinGW/msys/home/kirmaks/foam-extend-4.0/ThirdParty/mingwBuild/x64/build/metis-5.1.0/programs/cmdline_gpmetis.c:355:12: error: 'gk_optind' undeclared (first use in this function)
   if (argc-gk_optind != 2) {
            ^
make[2]: *** [programs/CMakeFiles/gpmetis.dir/cmdline_gpmetis.c.obj] Error 1
make[1]: *** [programs/CMakeFiles/gpmetis.dir/all] Error 2
make: *** [all] Error 2
2. OpenFOAM does not find the header files and terminates compilation:

Code:
make: Nothing to be done for `all'.
+ wmakePrintBuild -check
same version as previous build
+ wmakeLnInclude foam
+ wmakeLnInclude meshTools
+ wmakeLnInclude OSspecific/MSWindows
+ wmake libo OSspecific/MSWindows
SOURCE=signals/sigFpe.C ;  g++ -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-200  -IlnInclude -I. -I/home/kirmaks/foam-extend-3.2/src/foam/lnInclude -I/home/kirmaks/foam-extend-3.2/src/OSspecific/MSWindows/lnInclude   -I/c/MinGW/OpenMPI_v1.6.2-x64/include -I/home/kirmaks/foam-extend-3.2/ThirdParty/packages/system/include -Dmingw -DBIG_ENDIAN=0 -DLITTLE_ENDIAN=1 -DBYTE_ORDER=BIG_ENDIAN -c $SOURCE -o Make/mingwGccDPOpt/sigFpe.o
In file included from signals/sigFpe.C:35:0:
signals/sigFpe.H:46:24: fatal error: OSspecific.H: No such file or directory
 #include "OSspecific.H"
                        ^
compilation terminated.
make: *** [Make/mingwGccDPOpt/sigFpe.o] Error 1
+ set +x
Note: ignore spurious warnings about missing mpicxx.h headers
+ wmake libso foam
SOURCE=global/global.Cver ; sed -e 's/VERSION_STRING/3.2/' -e 's/BUILD_STRING/3.2-334ba0562a2c/' $SOURCE > Make/mingwGccDPOpt/global.C; g++ -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-200 -DOMPI_SKIP_MPICXX -I/c/MinGW/OpenMPI_v1.6.2-x64/include    -I/home/kirmaks/foam-extend-3.2/ThirdParty/zlib-1.2.3 -IlnInclude -I. -I/home/kirmaks/foam-extend-3.2/src/foam/lnInclude -I/home/kirmaks/foam-extend-3.2/src/OSspecific/MSWindows/lnInclude   -I/c/MinGW/OpenMPI_v1.6.2-x64/include -I/home/kirmaks/foam-extend-3.2/ThirdParty/packages/system/include -Dmingw -DBIG_ENDIAN=0 -DLITTLE_ENDIAN=1 -DBYTE_ORDER=BIG_ENDIAN -c Make/mingwGccDPOpt/global.C -o Make/mingwGccDPOpt/global.o
Make/mingwGccDPOpt/global.C:36:25: fatal error: foamVersion.H: No such file or directory
 #include "foamVersion.H"
                         ^
compilation terminated.
make: *** [Make/mingwGccDPOpt/global.o] Error 1
+ decompositionMethods/AllwmakeLnInclude
+ wmakeLnInclude decompositionMethods
+ wmakeLnInclude metisDecomp
+ wmakeLnInclude parMetisDecomp
+ wmakeLnInclude scotchDecomp
+ decompositionMethods/Allwmake
+ wmakeLnInclude decompositionMethods
+ wmake libso decompositionMethods
SOURCE=decompositionMethod/decompositionMethod.C ;  g++ -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-200  -IlnInclude -I. -I/home/kirmaks/foam-extend-3.2/src/foam/lnInclude -I/home/kirmaks/foam-extend-3.2/src/OSspecific/MSWindows/lnInclude   -I/c/MinGW/OpenMPI_v1.6.2-x64/include -I/home/kirmaks/foam-extend-3.2/ThirdParty/packages/system/include -Dmingw -DBIG_ENDIAN=0 -DLITTLE_ENDIAN=1 -DBYTE_ORDER=BIG_ENDIAN -c $SOURCE -o Make/mingwGccDPOpt/decompositionMethod.o
In file included from decompositionMethod/decompositionMethod.C:29:0:
decompositionMethod/decompositionMethod.H:38:22: fatal error: polyMesh.H: No such file or directory
 #include "polyMesh.H"
                      ^
compilation terminated.
The output of setting environment:

Code:
Setting environment variables for user-defined installed system tools and utilities ...
Sourcing: /home/kirmaks/foam-extend-3.2/etc/bashrc
    MESQUITE_DIR is initialized to: /home/kirmaks/foam-extend-3.2/ThirdParty/packages/mesquite-2.1.2
    METIS_DIR is initialized to: /home/kirmaks/foam-extend-3.2/ThirdParty/packages/metis-5.1.0
    PARMETIS_DIR is initialized to: /home/kirmaks/foam-extend-3.2/ThirdParty/packages/parmetis-4.0.3
    PARMGRIDGEN_DIR is initialized to: /home/kirmaks/foam-extend-3.2/ThirdParty/packages/ParMGridGen-1.0
    LIBCCMIO_DIR is initialized to: 
    SCOTCH_DIR is initialized to: /home/kirmaks/foam-extend-3.2/ThirdParty/packages/scotch_6.0.4
    SCOTCH_DIR is initialized to: /home/kirmaks/foam-extend-3.2/ThirdParty/packages/scotch_6.0.4
    CMAKE_DIR is initialized to: 
    M4_DIR is initialized to: 
    BISON_DIR is initialized to: 
    FLEX_DIR is initialized to: /C/MinGW/msys//bin/..
    ZOLTAN_DIR is initialized to: 
    PYTHON_DIR is initialized to: 
    PYFOAM_DIR is initialized to: 
    PYFOAM_SITE_DIR is initialized to: /home/kirmaks/foam-extend-4.0/ThirdParty/PyFoamSiteScripts
    HWLOC_DIR is initialized to: 
    QT_DIR is initialized to: 
    PARAVIEW_DIR is initialized to: /c/Programs/ParaView-4.3.1
    LLVM_DIR is initialized to: 
    MESA_DIR is initialized to: 
Sourcing: /home/kirmaks/foam-extend-3.2/etc/aliases.sh
Adding user-defined installed system tools to PATH ...
Setting OpenMPI environment settings ...
Checking versions of installed system tools (based on PATH) ...
7-Zip:       /c/Program Files/7-Zip/7z.exe [ 7-Zip [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18]
Bison:       /bin/bison.exe [bison (GNU Bison) 2.4.2]
CMake:       /c/MinGW/cmake-3.6.1/bin/cmake.exe [cmake version 3.6.1]
Flex:        /bin/flex.exe [flex 2.5.35]
G++:         /c/MinGW/x86_64-4.8.2-win32-seh-rt_v3-rev4/mingw64/bin/g++.exe [g++.exe (x86_64-win32-seh-rev4, Built by MinGW-W64 project) 4.8.2]
GCC:         /c/MinGW/x86_64-4.8.2-win32-seh-rt_v3-rev4/mingw64/bin/gcc.exe [gcc.exe (x86_64-win32-seh-rev4, Built by MinGW-W64 project) 4.8.2]
GMake:       /mingw/Strawberry/c/bin/gmake.exe [GNU Make 4.1]
Git:         /c/MinGW/Git-2.10.0/cmd/git.exe [git version 2.10.0.windows.1]
Java:        /c/WINDOWS/system32/java.exe [java version "1.6.0_45"]
M4:          /bin/m4.exe [m4 (GNU M4) 1.4.14]
Make:        /bin/make.exe [GNU Make 3.81]
MinGW-w64:   /c/MinGW/x86_64-4.8.2-win32-seh-rt_v3-rev4/mingw64
OpenMPI:     /c/MinGW/OpenMPI_v1.6.2-x64/bin/mpirun.exe [mpirun.exe (OpenRTE) 1.6.2]
PEexports:   /mingw/Strawberry/c/bin/pexports.exe [PExports 0.46; Originally written 1998, Anders Norlander]
ParaView:    /c/MinGW/ParaView-5.1.2
Perl:        /c/MinGW/Strawberry/perl/bin/perl.exe [ This is perl 5, version 24, subversion 0 (v5.24.0) built for MSWin32-x64-multi-thread]
Python:      /c/MinGW/Python27/python.exe [Python 2.7.12]
Subversion:  /mingw/svn-1.8.16/bin/svn.exe [svn, Version 1.8.16 (r1740329)]
Vim:         /bin/vim.exe [VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Mar 19 2011 15:37:04)]
Wget:        /c/MinGW/wget-1.11.4/bin/wget.exe [GNU Wget 1.11.4 Copyright (C) 2008 Free Software Foundation, Inc.]

FOAM_INST_DIR=/home/kirmaks
WM_PROJECT_DIR=/home/kirmaks/foam-extend-3.2
WM_OSTYPE=MSWindows
ENVIRONMENT SETUP COMPLETE.
Had anyone something similar before? Best regards, Maks
kirmaks is offline   Reply With Quote

Old   September 8, 2016, 06:16
Default The second problem is solved
  #2
Member
 
KirMaks
Join Date: Aug 2016
Posts: 34
Rep Power: 7
kirmaks is on a distinguished road
Hallo, it seems that the root of the second problem is in the find.exe utility. The windows-version was taken by default in MinGW and the symbolic links to the headers were not created. So the solution to the second problem is to download the package findutils and add its bin to the windows-path.

However, I'm still in trouble with metis-5.1.

Best regards, Maks
kirmaks is offline   Reply With Quote

Old   September 15, 2016, 03:10
Default Now Scotch compiling problem :(
  #3
Member
 
KirMaks
Join Date: Aug 2016
Posts: 34
Rep Power: 7
kirmaks is on a distinguished road
Hallo, so I have solved the above listed problems with compiling metis, but now I get constantly problems with scotch and OpenMPI. I have already tried different versions of MinGW-64 with OpenMPI 1.6.1 and 1.6.2 for Win64 (I think this is the latest which can be found in Internet with windows installer), but I always get the error in the output:

Code:
make[1]: Entering directory `/home/kirmaks/foam-extend-4.0/ThirdParty/mingwBuild/x64/build/scotch_6.0.4/src/scotch'
make CC="mpicc" SCOTCHLIB=ptscotch \
     dggath    \
     dgmap    \
     dgord    \
     dgpart    \
     dgscat    \
     dgtst
make[2]: Entering directory `/home/kirmaks/foam-extend-4.0/ThirdParty/mingwBuild/x64/build/scotch_6.0.4/src/scotch'
mpicc -O0 -g3 --std=c99  -I/c/MinGW/OpenMPI_v1.6.2-x64/include -DCOMMON_RANDOM_FIXED_SEED -DCOMMON_STUB_FORK -DSCOTCH_PTSCOTCH -DSCOTCH_RENAME -D'pipe(pfds)=_pipe(pfds,1024,0x8000)' -DHAVE_STDINT_H=0 -DHAVE_UINT_T=1 -DSCOTCH_PTHREAD -I../../include -I../libscotch dggath.c -o dggath -L../../lib -lptscotch -lscotch -lptscotcherrexit  -L/c/MinGW/OpenMPI_v1.6.2-x64/bin -lm -lmpi -lmpid -L/home/kirmaks/foam-extend-4.0/ThirdParty/mingwBuild/x64/install/pthreads-w32-2-9-1-release/Pre-built.2/lib/x64 -lpthreadGC2 -lz
dggath.c:55:0: warning: "SCOTCH_PTSCOTCH" redefined
 #define SCOTCH_PTSCOTCH
 
<command-line>:0:0: note: this is the location of the previous definition
d000036.o:(.idata$5+0x0): multiple definition of `__imp_ompi_mpi_comm_world'
d000030.o:(.idata$5+0x0): first defined here
d000036.o:(.idata$6+0x0): multiple definition of `__nm_ompi_mpi_comm_world'
d000030.o:(.idata$6+0x0): first defined here
d000037.o:(.idata$5+0x0): multiple definition of `__imp_ompi_mpi_int'
d000031.o:(.idata$5+0x0): first defined here
d000037.o:(.idata$6+0x0): multiple definition of `__nm_ompi_mpi_int'
d000031.o:(.idata$6+0x0): first defined here
d000038.o:(.idata$5+0x0): multiple definition of `__imp_ompi_mpi_op_max'
d000032.o:(.idata$5+0x0): first defined here
d000038.o:(.idata$6+0x0): multiple definition of `__nm_ompi_mpi_op_max'
d000032.o:(.idata$6+0x0): first defined here
d000039.o:(.idata$5+0x0): multiple definition of `__imp_ompi_mpi_op_sum'
d000033.o:(.idata$5+0x0): first defined here
d000039.o:(.idata$6+0x0): multiple definition of `__nm_ompi_mpi_op_sum'
d000033.o:(.idata$6+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
make[2]: *** [dggath] Error 1
make[2]: Leaving directory `/home/kirmaks/foam-extend-4.0/ThirdParty/mingwBuild/x64/build/scotch_6.0.4/src/scotch'
make[1]: *** [ptscotch] Error 2
make[1]: Leaving directory `/home/kirmaks/foam-extend-4.0/ThirdParty/mingwBuild/x64/build/scotch_6.0.4/src/scotch'
make: *** [ptscotch] Error 2
What can be a reason of this? Thanks in advance, Maks
kirmaks is offline   Reply With Quote

Old   September 23, 2016, 03:41
Default Compiling but without RAS turbulence models
  #4
Member
 
KirMaks
Join Date: Aug 2016
Posts: 34
Rep Power: 7
kirmaks is on a distinguished road
Hallo again,

I have accomplished to make a clean compiling of the ThirdParty folders and I can get the OpenFOAM extend to compile. However I see a lot of messages "could not open..." in Allwmake.log and I don't have the turbulence models (RAS at least, possibly others also) as the result. The typical error messages are shown below. What does go wrong?

Best regards, Maks.

Code:
+ wmake libso finiteVolume
wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file fvMesh/fvMeshGeometry.C
could not open file SutherlandHodgman.H for source file fvMesh/fvMeshGeometry.C
could not open file GGIInterpolationQuickRejectTests.C for source file fvMesh/fvMeshGeometry.C
could not open file GGIInterpolationWeights.C for source file fvMesh/fvMeshGeometry.C
could not open file GGIInterpolate.C for source file fvMesh/fvMeshGeometry.C
could not open file ggiPolyPatchTemplates.C for source file fvMesh/fvMeshGeometry.C
could not open file cyclicGgiPolyPatch.H for source file fvMesh/fvMeshGeometry.C
could not open file cyclicGgiFvPatchField.C for source file fvMesh/fvMeshGeometry.C
Making dependency list for source file fvMesh/fvMesh.C
could not open file primitivePatchInterpolation.H for source file fvMesh/fvMesh.C
could not open file pointPatchInterpolate.C for source file fvMesh/fvMesh.C
could not open file volPointInterpolate.C for source file fvMesh/fvMesh.C
kirmaks is offline   Reply With Quote

Old   September 14, 2017, 12:59
Default Compiling foam-extend on Win7 with MinGW
  #5
New Member
 
Chris May
Join Date: Sep 2017
Posts: 2
Rep Power: 0
cjwdz is on a distinguished road
Hi, Maks. I'm also trying to compile foam-extend 4.0 on a win7 x64 system with mingw-w64&Msys2. I followed the official installation guide in doc/buildInstructions/Windows, but I ran into some compiling problems with Thirdparty tools including Metis-5.1.0. The error message is the same with those in your #1 post, so I'd like to know how you solved this Metis compiling problem. Thank you very much!
cjwdz is offline   Reply With Quote

Old   September 15, 2017, 02:49
Default
  #6
Member
 
KirMaks
Join Date: Aug 2016
Posts: 34
Rep Power: 7
kirmaks is on a distinguished road
Hi Chris,

I should say that finally I have installed the precompiled Win64 version of OpenFOAM from CFD Support because I had another problems with compilation of OF itself (some parts were OK, some not). It was already a long ago, but according to my notes the solution to the metis compilation problem was to uncomment the following lines in .\foam-extend-4.0\ThirdParty\mingwBuild\x64\patches\metis-5.1.0\GKlib\gk_getopt.h:

Code:
extern char *gk_optarg;
extern int gk_optind;
extern int gk_opterr;
extern int gk_optopt;
I hope it will help, best regards, Maksim

Last edited by kirmaks; September 15, 2017 at 02:50. Reason: Typo
kirmaks is offline   Reply With Quote

Old   September 15, 2017, 21:16
Default
  #7
New Member
 
Chris May
Join Date: Sep 2017
Posts: 2
Rep Power: 0
cjwdz is on a distinguished road
Thank you very much, Marksim.
Still I have some different problems with the scotch and left parts of installation, but it did work for compiling metis following your tips.
cjwdz is offline   Reply With Quote

Old   December 3, 2019, 21:20
Default The same errors about compiling of scotch
  #8
New Member
 
Zhiyong GU
Join Date: Apr 2018
Posts: 3
Rep Power: 5
THU_Gj is on a distinguished road
Hi Maks,

I'm also trying to compile foam extend 4.0 on Windows OS, and I'm suffering the same errors when compile the scotch. Would you please explain how can you solve these problems? Thank you very much!
THU_Gj is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[surface handling] surfaceFeatureExtract in Foam Extend 3.2 ashish.svm OpenFOAM Meshing & Mesh Conversion 2 October 12, 2017 09:54
[blockMesh] Errors during blockMesh meshing Madeleine P. Vincent OpenFOAM Meshing & Mesh Conversion 51 May 30, 2016 11:51
[blockMesh] non-orthogonal faces and incorrect orientation? nennbs OpenFOAM Meshing & Mesh Conversion 7 April 17, 2013 06:42
CFX11 + Fortran compiler ? Mohan CFX 20 March 30, 2011 19:56
[Other] StarToFoam error Kart OpenFOAM Meshing & Mesh Conversion 1 February 4, 2010 05:38


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