README.md 5.12 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
# OpenFOAM® ThirdParty

OpenFOAM depends to a certain extent on third-party libraries
(*opensource only*). It also provides some interfaces to *opensource* or
*proprietary* libraries. This third-party package contains configurations and
scripts for building third-party packages. It should normally only be used in
conjunction with the corresponding OpenFOAM version.

## Configuration of Third-Party Versions

11
12
For most of the build scripts, the default software version
is provided by an appropriate OpenFOAM `etc/config.sh/...` entry.
13
14
15
16
This approach avoids duplicate entries for the default versions and
ensures the best overall consistency between the OpenFOAM installation
and its corresponding third-party installation.

17
18
19
20
Nonethess, the distributed make scripts can generally be used for a
variety of versions of the third-party libraries, with the software
version specified on the command-line.

21
22
23
24
---

## Before Starting

25
0. Review the [system requirements][link openfoam-require]
26
27
28
29
30
31
   and decide on the following:
   * compiler type/version (you may need a third-party compiler installation).
   * MPI type/version.
   * ParaView type/version.
   * CMake type/version, ...
1. Adjust the OpenFOAM `etc/bashrc`, `etc/config.sh/...` or equivalent
32
   `prefs.sh` files to reflect your preferred [configuration][link openfoam-config].
33
2. Source the updated OpenFOAM environment
34
35
36

---

37
38
39
40
## Building

Many components of ThirdParty are *optional* or are invoked
automatically as part of the top-level OpenFOAM `Allwmake`.
41
Nonetheless it may be necessary or useful to build particular
42
43
ThirdParty components prior to building OpenFOAM itself.

44
### Sequence
45
46

1. `makeGcc` _or_ `makeLLVM` *(optional)*
47
48
2. `makeCmake`  *(optional)*
3. `Allwmake`
49
   - This will be automatically invoked by the top-level OpenFOAM `Allwmake`.
50
4. `makeParaView`  *(optional)*
51
5. Any other additional optional components
52

53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
If the `Allwmake` is being invoked directly (not from the OpenFOAM `Allwmake`),
it may be necessary to bootstrap the binary parts of the `wmake` toolchain
manually before proceeding. This is done with the following command:
```
$WM_PROJECT_DIR/wmake/src/Allmake
```

**It normally advisable to skip the ParaView compilation initially**.

Building ParaView from source tends to be the most difficult part of
any third-party compilation.

For general functionality, the paraview version distributed with
the operating system or a [binary package][download ParaView]
may be sufficient for your needs.


### Details

- More details can be found the [ThirdParty BUILD.md][link third-build] information.
- Some configuration details can be found in the
  [OpenFOAM etc/README.md][link openfoam-config] information.


### Other

When building other libraries directly, with autoconfig or cmake, it
will be useful or necessary to use the same compiler and compiler
settings as are used by OpenFOAM itself. These are obtained from the
`wmake` show options and can be used to set corresponding environment
variables. For example,
```
CC="$(wmake -show-c)" CFLAGS="$(wmake -show-cflags)" ./configure
```

Here is the correspondence to commonly used environment variables

| Env variable      | Obtaining from wmake      | Meaning               |
|-------------------|---------------------------|-----------------------|
| CC                | `wmake -show-c`           | C compiler            |
| CFLAGS            | `wmake -show-cflags`      | C compiler flags      |
| CXX               | `wmake -show-cxx`         | C++ compiler          |
| CXXFLAGS          | `wmake -show-cxxflags`    | C++ compiler flags    |
| | `wmake -show-cflags-arch`   | Architecture information when linking |
| | `wmake -show-cxxflags-arch` | Architecture information when linking |


In some situations it can also be useful to have the compiler and flags
together (similar to `mpicc -show` and `mpicxx -show`):
```
wmake -show-compile-c
wmake -show-compile-cxx
```
106

107
<!-- Quick links -->
108

109
[download ParaView]: https://www.paraview.org/download/
110

Mark OLESEN's avatar
Mark OLESEN committed
111
112
113
114

<!-- OpenFOAM -->

[link AddOns]: https://develop.openfoam.com/Community/OpenFOAM-addOns
115
116
117
118
119
120
[link openfoam-build]: https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/doc/BUILD.md
[link openfoam-config]: https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/etc/README.md
[link openfoam-require]: https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/doc/Requirements.md
[link third-build]: https://develop.openfoam.com/Development/ThirdParty-plus/blob/develop/BUILD.md
[link third-require]: https://develop.openfoam.com/Development/ThirdParty-plus/blob/develop/Requirements.md
[link third-readme]: https://develop.openfoam.com/Development/ThirdParty-plus/blob/develop/README.md
121

122
---
123
124
125
126

<!-- Standard Footer -->
## Additional OpenFOAM Links

Mark OLESEN's avatar
Mark OLESEN committed
127
128
129
- [Community AddOns][link AddOns] repository
- [Download](http://www.openfoam.com/download) and
  [installation instructions](http://www.openfoam.com/code/build-guide.php)
130
- [Documentation](http://www.openfoam.com/documentation)
Mark OLESEN's avatar
Mark OLESEN committed
131
- [Reporting bugs/issues](http://www.openfoam.com/code/bug-reporting.php) (including bugs/suggestions/feature requests) in OpenFOAM
132
133
134
135
- [Contacting OpenCFD](http://www.openfoam.com/contact)

---

136
Copyright 2016-2019 OpenCFD Ltd