Commit Graph

54 Commits

Author SHA1 Message Date
Mark Olesen
79993bba43 CONFIG: support explicit selection of 'ld' linker
- for clang-based compilers the default linker may be lld or simply ld.
  Support '+link-ld' to explicitly select use of the ld linker.

- consolidate linker rules into single files

STYLE: adjust SPDX Identifier
2023-12-15 16:17:12 +01:00
Mark Olesen
9f7cfa9419 ENH: support libz disabling via WM_COMPILE_CONTROL (as ~libz)
- eg, for partially incomplete systems (without libz devel header)

ENH: clearer binding of dummy Pstream in OpenFOAM/Make/options

- link of dummy stub Pstream now contingent on linking libOpenFOAM as
  well. This makes the purpose slightly clearer

ENH: cleaner option naming/handling in wmake script

- allow special purpose -no-openfoam option.
  Eg, compiling test programs without OpenFOAM and Pstream libraries
  but using the rest of the wmake system.

ENH: add +openmp support into WM_COMPILE_CONTROL (#2633)

- this adds compile/link flags for openmp.
  For single-use, can also use 'wmake -openmp'.

  If both +openmp and ~openmp are specified in WM_COMPILE_CONTROL
  the ~openmp will have priority.

  This is actually done indirectly since ~openmp will set empty
  COMP_OPENMP, LINK_OPENMP internal variables, which the +openmp then
  adds to the c++FLAGS and linkexe targets (ie, won't actually add
  anything).

ENH: add +ccache or ccache=... support into WM_COMPILE_CONTROL (#2633)

- with the first version (+ccache), simply use ccache from the path
  without any extra options.

- with the second version (ccache=...), can be more specific about
  what is called.

  Using "+ccache" is identical to "ccache=ccache", but the later could
  be used in other ways. For example,

     ccache=/strange/install/path/ccache
     ccache=</path/my-tooling --option>

  Have the choice of unquoted, single or double quoted or '< >' quoted

STYLE: relocate FOAM_EXTRA_LDFLAGS in general makefile

- removes clutter for different linkers (eg, gold, mold, ldd)
  making it easier to extend for other linkers.

STYLE: protect makefile checks with 'strip' function
2022-11-15 14:00:18 +01:00
Mark Olesen
793f4e3a37 CONFIG: add support for WM_COMPILE_OPTION='Dbg'
- uses '-g -DFULLDEBUG' (like Debug), but with -O3 (like Opt).

  This adds in debug symbols and FULLDEBUG code segments (good for
  code development) but retains -O3 optimizations and code paths and
  avoids the much slower -O0 associated with 'Debug'.

- add in central wmake/General/common/{c,c++}XXX tuning,
  which helps reduce the number of nearly identical files

ENH: add support for wmake -debug-Og
2022-09-09 11:55:33 +02:00
Mark Olesen
2c77514417 CONFIG: support wmake -debug-O0, -debug-O1 etc.
- rearranged order of flags so that FOAM_EXTRA_CXXFLAGS is added
  after the WARN/OPT/DBUG flags

CONFIG: drop wmake rules for PGI compiler (defunct)
2022-06-02 22:37:00 +02:00
Mark Olesen
2698cab01c ENH: extend use of WM_COMPILER_CONTROL to manage compiler versions
- for compilers such as gcc and clang, may have several different
  variants installed on the computer. Use WM_COMPILER_CONTROL to
  specify the preferred variant.

  Eg,
      WM_COMPILER=Gcc
      WM_COMPILER_CONTROL="version=8"

      will compile with "gcc-8" and "g++-8"

  Good practice would be to tag output directory names with the
  version too. Eg

      WM_COMPILER=Clang110
      WM_COMPILER_CONTROL="version=11.0"

STYLE: modify message for change of gcc -> clang (darwin)
2021-11-02 17:30:06 +01:00
Mark Olesen
c91fc6f41c CONFIG: rationalize mpi config tuning (#1910)
- prefix FOAM_MPI and library directories with 'sys-' for system
  versions for uniform identication.

  WM_MPLIB      | libdir (FOAM_MPI)  | old naming |
  SYSTEMMPI     | sys-mpi            | mpi        |
  SYSTEMOPENMPI | sys-openmpi        | openmpi-system |

- prefix preferences with 'prefs.' to make them more easily
  identifiable, and update bin/tools/create-mpi-config accordingly

      Old name: config.{csh,sh}/openmpi
      New name: config.{csh,sh}/prefs.openmpi

- additional mpi preferences now available:
    * prefs.intelmpi
    * prefs.mpich
    ...

CONFIG: added hook for EASYBUILDMPI (eb-mpi), somewhat like USERMPI

- EasyBuild uses mpicc when compiling, so no explicit wmake rules are
  used

ENH: support different major versions for system openmpi

- for example, with

     WM_MPLIB=SYSTEMOPENMPI2

  defines FOAM_MPI=sys-openmpi2 and thus creates lib/sys-openmpi2

ENH: centralize handling of mpi as 'mpi-rules'

    Before:
        sinclude $(GENERAL_RULES)/mplib$(WM_MPLIB)
        sinclude $(DEFAULT_RULES)/mplib$(WM_MPLIB)

        ifeq (,$(FOAM_MPI_LIBBIN))
            FOAM_MPI_LIBBIN := $(FOAM_LIBBIN)/$(FOAM_MPI)
        endif

    After:
        include $(GENERAL_RULES)/mpi-rules

- also allows variants such as SYSTEMOPENMPI2 to be handled separately
2020-11-11 18:36:01 +01:00
Mark Olesen
9423d2bd83 CONFIG: improve support for compiler/link options (#1830)
- introduce WM_COMPILE_CONTROL variable to convey control information
  into the build rules.

  The convention (as per spack):
      - '+' to select a feature
      - '~' to deselect a feature

  Eg, to select the gold linker, and disable openmp
  (spaces are not required):

      WM_COMPILE_CONTROL="+gold ~openmp"

CONFIG: accept FOAM_EXTRA_LDFLAGS for AMD, gold, Mingw linkers

CONFIG: generalize PROJECT_LIBS (-ldl used almost universally)
2020-09-07 09:45:51 +02:00
Mark Olesen
78dc8c6ba6 CONFIG: refactor common link rules, support FOAM_EXTRA_CFLAGS (#1256)
- additional cgal-headers-only rules (future use)

COMP: add -lgmp for CGAL with mpfr linkage
2020-05-06 13:10:30 +02:00
Mark Olesen
739bc3c4af COMP: add -pthread compile/link dependency for std::thread (#614) 2020-02-07 11:06:06 +01:00
Mark Olesen
d4a0dc631c CONFIG: relax requirement on C compile option
- with 1906, OpenFOAM is purely C++ code and the last toolchain bits C
  code have been avoided. Thus relax the wmake C rule for including
  WM_COMPILE_OPTION. This makes it much easier to add different
  compiler options with fewer files.

  For example, for Broadwell-specific options:

      cd wmake/rules/linux64Gcc
      cp c++Opt c++OptBdw

      edit this file and then use WM_COMPILE_OPTION=OptBdw

- ensure that WM_COMPILE_OPTION is always non-empty
2019-08-07 09:22:09 +02:00
Mark Olesen
787325a916 COMP: manage cpu architecture with cARCH, c++ARCH internal make variables
- allows better separation from compiler settings

- use -fPIC instead of legacy -KPIC for intel compiler
2019-04-12 12:59:11 +02:00
Mark Olesen
ef6c2ef590 CONFIG: combine wmake rules for KNL architecture as a compile option
- instead of

      WM_COMPILER=GccKNL WM_COMPILE_OPTION=Opt

      -> linux64GccKNLDPInt32Opt

  now specify

      WM_COMPILER=Gcc  WM_COMPILE_OPTION=OptKNL

      -> linux64GccDPInt32OptKNL

This makes it easier (and more obvious) for adding different tweaks
without needing to generate too many files.
Eg,

    cd wmake/rules/linux64Gcc

    cp cOpt   cOptBdw
    cp c++Opt c++OptBdw

    edit these two files and then use WM_COMPILE_OPTION=OptBdw

CONFIG: provide some default c/c++ flags in General compiler rules

- can make is easier when deriving new compile options, and ensures
  that '-02' is enabled as an initial default.
2019-01-25 17:39:05 +01:00
Mark Olesen
2db4b0867e CONFIG: consolidate C++ flags per compiler type
- easier to ensure that flags are consistent
2018-03-21 11:50:57 +01:00
Mark Olesen
451f8e0357 Merge remote-tracking branch 'origin/master' into develop 2018-03-07 18:08:07 +01:00
Mark Olesen
7f7f9336c8 COMP: add -fpermissive to c++LESSWARN flags (closes #744)
- downgrades some diagnostics about nonconformant code from errors to
  warnings. Oddly enough, the errors actually arise from STL library
  elements shipped with gcc itself. Affects kahip compilation with
  gcc-6, gcc-7
2018-02-28 14:31:48 +01:00
Mark Olesen
1b9aec2a3d CONP: suppress register warnings for clang only 2018-01-30 06:49:32 +01:00
Mark Olesen
995c55b60e CONFIG: add clang third-party lib to LD_LIBRARY_PATH
- required if there is no system openmp and libomp or libgomp are
  only found in the clang hierarchy

STYLE: add some notes in the openmp rules.

- the _OPENMP macro is now used in low-level testing files
2017-12-19 16:07:15 +01:00
Mark Olesen
405cf8129a CONFIG: update some wmake rules
- initial settings for ADIOS2, linuxARM64Gcc, linuxARM64Clang
2017-12-07 15:41:58 +00:00
Mark Olesen
e1167d9592 ENH: provide openmp compile and link flags.
- the USE_OMP preprocessor symbol is also defined with the openmp
  compile flag to allow conditional compilation of openmp-specific
  code.
2017-10-23 09:38:43 +02:00
Mark Olesen
a531168ae4 COMP: reinstate rules for various C++ suffixes (issue #607) 2017-09-29 18:07:42 +02:00
Henry Weller
0fdcb12759 Updated to avoid warnings from gcc-7.1.1 2017-07-31 13:46:42 +01:00
Henry Weller
7996a9138f C++11: Update compilation rules to specify C++11 support and conformance
The change from C++0x to C++11 allows all of C++11 functionality to be
used in OpenFOAM, in particular constructor delegation which avoids code
duplication or constructor helper functions.  However, this also means a
change to the minimum gcc version supported which is now 4.7 rather than
4.5.

Note that gcc-4.7 does not support the entire C++11 standard but does
support all of the functionality currently needed for further OpenFOAM
development.  The minimum gcc-version which supports the entire C++11
standard is 4.8 which is now the recommended minimum gcc version.
2016-08-05 16:28:19 +01:00
Henry Weller
c3a03105c4 wmake: Add support for compiler type default rules
which may be optionally overridden by version-specific rules.

For example the default rules for gcc on GNU/Linux x86_64 are in the
wmake/rules/linux64Gcc directory.  If there is a need to change any of
the rules for a specific version of gcc, e.g. gcc-4.8.4 the directory
wmake/rules/linux64Gcc48 may be created into which any of the language
files may be provided containing the rules to override the defaults.
2016-01-24 14:10:07 +00:00
Henry Weller
acb9ec8b46 wmake/rules: Add -std=c++0x to formally enable support for of C++11 features
The c++0x is used rather than c++11 to support gcc-4.5.?
2016-01-10 19:17:31 +00:00
Henry Weller
91e04d69c1 Resolve various unimportant warning messages from Gcc, Clang and Icpc 2015-07-19 11:31:49 +01:00
Henry Weller
7b605ce50e Updated warning suppression for CGAL 2015-07-17 23:10:10 +01:00
Henry Weller
6dc3a889df Suppress compiler warnings from CGAL 2015-07-17 21:38:25 +01:00
Henry Weller
94401af010 Resolved issues with virtual function inheritance and warning from clang
Also removed __GNUC__ conditional compilation statements which are no
longer needed.
2015-07-17 12:11:37 +01:00
Henry
296a302867 Renamed -frounded-math option 2014-12-16 08:37:25 +00:00
Henry
95dcfa46aa Move gcc-specific options to the appropriate wmake rules files 2014-12-15 22:39:21 +00:00
Henry
844b283030 New version of wmake supporting out-of-tree object and dependency files 2014-12-14 21:42:18 +00:00
mattijs
a78139ea1c COMP: wmake/rules/linux*Gcc*: clean compilation on ubuntu 11.10 2011-10-25 15:35:13 +01:00
Henry
1d69807a3a wmake rules: Remove dependency on libiberty which is no longer needed 2011-03-07 12:57:41 +00:00
graham
98f97e7852 COMP: CGAL 3.7 now used. Template depth required to increased > 75, made 100. 2011-01-07 14:24:17 +00:00
mattijs
f113dad6b9 COMP: Fedore13 has linkage with --no-add-needed as default. This disallows indirectly loaded libraries. 2010-08-31 16:27:15 +01:00
mattijs
69526c6c1c BUG: various reinterpret_cast to enable strict-aliasing 2010-08-19 15:44:17 +01:00
graham
7faf359bc1 COMP: adding -traditional-cpp to CPP variable. 2010-07-21 10:58:53 +01:00
Mark Olesen
0d44584112 ENH: rationalize wmake rules to avoid unnecessary duplication
- main mplib rules located in GENERAL_RULES with specializations
  (if any) under RULES. Modest change in a few options files, but
  cleans up the rules directories.

  previously in options:
      include $(RULES)/mplib$(WM_MPLIB)

  now in options:
      sinclude $(GENERAL_RULES)/mplib$(WM_MPLIB)
      sinclude $(RULES)/mplib$(WM_MPLIB)

  For GNU make it would be permissible to write both in a single line.
2010-04-22 15:01:07 +02:00
Mark Olesen
0686bdf1e9 ENH: simplify cpp rules to avoid absolute paths and multiple GFLAGS.
- otherwise /lib/cpp may need a different library binding than
  currently available and results in this type of error:

  /usr/lib64/gcc/x86_64-suse-linux/4.4/cc1:
  /data/app/OpenFOAM/ThirdParty-1.6.x/platforms/linux64/gcc-4.3.3/lib64/libstdc++.so.6:
  version `GLIBCXX_3.4.11' not found (required by
  /usr/lib64/libppl_c.so.2)

ENH: remove unused flex++ rule for SiCortex that was identical to the
general one anyhow.
2010-03-29 10:59:35 +02:00
Mark Olesen
0b9e5ea11a ENH: link to general mplib* rules where possible.
ENH: generalize rule for X11

ENH: Avoid move in flex/flex++ rule.
2010-03-26 11:48:23 +01:00
Mark Olesen
46d96dc855 BUG: remove old wmake/rules/*/{dirToString,wmkdep} binaries 2010-03-25 14:42:29 +01:00
mattijs
85a481906a ENH: Added new WM_MPLIB setting.
This signals that we are using the system installed openmpi version.
2010-03-01 15:14:03 +00:00
mattijs
192f8ae542 Changed tecio build options to use local file 2009-12-14 11:20:22 +00:00
mattijs
db34f04131 added tecio compilation rules to wmake 2009-12-08 11:40:00 +00:00
mattijs
9c1d1dc7b9 skip c++ include for mpi.h 2009-10-06 14:43:42 +01:00
andy
6c13d978cf extending template max depth to 60 2009-09-17 11:52:09 +01:00
Mark Olesen
efce737693 Add provisioning for gcc-4.4.1
- compile into linux64Gcc44, linuxGcc44 to avoid clashes during testing
- continue to use gmp-4.2.4 since gmp-4.3.x might be miscompiled with
  a system gcc-4.3.2
2009-07-29 09:59:16 +02:00
Mark Olesen
0e5e84f4ed removed last remnants of LAM support 2009-07-15 12:26:12 +02:00
Henry Weller
3345fd8378 Removed support for cint. 2009-06-22 21:03:57 +01:00
mattijs
b773710d06 remove opteron and no-gcse switch
modified:   SiCortex64Gcc/cOpt
	modified:   SunOS64Gcc/cOpt
	modified:   linux64Gcc/c++Opt
	modified:   linux64Gcc/cOpt
	modified:   linux64Gcc/general
	modified:   linux64Gcc42/c++Opt
	modified:   linux64Gcc42/cOpt
	modified:   linuxGcc/c++
	modified:   linuxGcc/cDebug
	modified:   linuxGcc/general
	modified:   linuxIA64Gcc/cOpt
2009-04-28 22:20:12 +01:00