Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
6630fb2b
Commit
6630fb2b
authored
6 years ago
by
Mark OLESEN
Committed by
Andrew Heather
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
STYLE: adjust wording in compilation notes
parent
e91ec257
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/cross-compile-mingw.md
+40
-45
40 additions, 45 deletions
doc/cross-compile-mingw.md
with
40 additions
and
45 deletions
doc/cross-compile-mingw.md
+
40
−
45
View file @
6630fb2b
Notes for cross-compiling with mingw
.
#
Notes for cross-compiling with mingw
On openSUSE use the packages:
## Host setup
On openSUSE use the packages for compilation:
```
```
mingw64-cross-binutils
mingw64-cross-binutils
mingw64-cross-cpp
mingw64-cross-cpp
...
@@ -16,41 +18,32 @@ mingw64-winpthreads-devel
...
@@ -16,41 +18,32 @@ mingw64-winpthreads-devel
mingw64-libfftw3
mingw64-libfftw3
mingw64-fftw3-devel
mingw64-fftw3-devel
```
```
This setup is missing
`zlib`
, so download that manually and compile as a
This setup is missing zlib, so download that manually and compile as a
*static*
library.
*static*
library.
```
```
CC="$(wmake -show-c) CFLAGS="$(wmake -show-cflags) ./configure --static
CC="$(wmake -show-c)" CFLAGS="$(wmake -show-cflags)" ./configure --static
make
```
```
The resulting output files (zconf.h zlib.h) and (libz.a) either need
The resulting output files (zconf.h zlib.h) and (libz.a) either need
to be installed in system locations where OpenFOAM can find
i
t, or if
to be installed in system locations where OpenFOAM can find t
hem
, or if
they are to be shipped directly with OpenFOAM, they can also be placed
they are to be shipped directly with OpenFOAM, they can also be placed
in the
`src/OpenFOAM/include`
and
`platforms/XXX/lib`
paths.
in the
`src/OpenFOAM/include`
and
`platforms/XXX/lib`
paths.
When using the cross-compiled executables and libraries, additional
If the header files are only needed during compilation, it can be a
runtime libraries are required. On openSUSE these are provided by the
fairly convenient hack to simply place copies of them in the
packages:
`src/OSspecific/MSwindows`
directory.
```
mingw64-libgcc_s_seh1
mingw64-libstdc++6
```
In a few locations within OpenFOAM, flex is used to generate code. The
Flex is used in a few locations within OpenFOAM for generating code.
generated C++ code requires the
`FlexLexer.h`
header file.
The generated C++ code requires the
`FlexLexer.h`
header file, but
This is normally located under
`/usr/include/FlexLexer.h`
, which will
its
`/usr/include`
location will be ignored by the cross-compiler.
be ignored by the cross-compiler.
As a
fairly
ugly hack, a copy of this file can be made in a standard
As a
nother
ugly hack, a copy of this file can be made in a standard
project include location. For example,
project include location. For example,
```
```
mkdir src/OpenFOAM/lnInclude
ln -s /usr/include/FlexLexer.h src/OSspecific/MSwindows
cp /usr/include/FlexLexer.h src/OpenFOAM/lnInclude
```
```
The last point to consider when cross-compiling is the behaviour of
The last point to consider when cross-compiling is the behaviour of
the OpenFOAM tools used during compilation. These are found under
the OpenFOAM tools used during compilation. These are found under
`wmake/src`
. When these are compiled they will create executables that
`wmake/src`
. When these are compiled they will create executables that
...
@@ -80,30 +73,16 @@ cp wmake/platforms/linux64Gcc/* wmake/platforms/linux64Mingw/
...
@@ -80,30 +73,16 @@ cp wmake/platforms/linux64Gcc/* wmake/platforms/linux64Mingw/
The
`wmake/platforms/linux64Mingw/`
directory should now contain
The
`wmake/platforms/linux64Mingw/`
directory should now contain
native and cross-compiled tools:
native and cross-compiled tools:
```
```
dirToString
dirToString dirToString.exe
wmkdep
wmkdep wmkdep.exe
wmkdepend
wmkdepend wmkdepend.exe
dirToString.exe
wmkdep.exe
wmkdepend.exe
```
```
The native tools are the one that will (automatically) be used
The native tools are the one that will (automatically) be used
throughout the balance of the cross-compilation process.
throughout the balance of the cross-compilation process.
Adjust paths for third-party sources. Eg, in
`etc/config.sh/FFTW`
you
may wish to have the following:
```
fftw_version=fftw-system
export FFTW_ARCH_PATH=/usr/x86_64-w64-mingw32/sys-root/mingw
```
The settings for cross-compilation are normally defined in the
The settings for cross-compilation are normally defined in the
`etc/pref.sh`
file with contents like this:
`etc/pref.sh`
file with contents like this:
```
```
# For mingw cross-compile
# For mingw cross-compile
...
@@ -114,7 +93,6 @@ export WM_LABEL_SIZE=32
...
@@ -114,7 +93,6 @@ export WM_LABEL_SIZE=32
# other settings...
# other settings...
```
```
Additional adjustments may be required in some other places. For example
Additional adjustments may be required in some other places. For example
in
`etc/config.sh/FFTW`
in
`etc/config.sh/FFTW`
```
```
...
@@ -123,9 +101,26 @@ export FFTW_ARCH_PATH=/usr/x86_64-w64-mingw32/sys-root/mingw
...
@@ -123,9 +101,26 @@ export FFTW_ARCH_PATH=/usr/x86_64-w64-mingw32/sys-root/mingw
```
```
Known limitations (2019-05-01)
## Run-time setup
When using the cross-compiled executables and libraries, the
corresponding runtime libraries will be required.
These will need to be copied across from the Linux host system to the
target machine.
On openSUSE these runtime libraries are provided by the packages:
```
mingw64-libgcc_s_seh1
mingw64-libstdc++6
```
When running, the
`WM_PROJECT_DIR`
environment must be set.
OpenFOAM will otherwise not be able to locate its files.
## Known limitations (2019-05-01)
-
No CGAL support (ie, no foamyHexMesh)
-
kahip does not build
-
No ParaView plugin, runTimepostProcessing
-
boost should build ok, but no CGAL support (ie, no foamyHexMesh)
-
no ParaView plugin, runTimePostProcessing
-
reacting EulerFoam solvers have too many interdependencies and do
-
reacting EulerFoam solvers have too many interdependencies and do
not yet compile.
not yet compile
cleanly
.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment