Commit Graph

60 Commits

Author SHA1 Message Date
Bartosz Kosiorek
cb811d11ce Help: Improve description of modules 2019-04-23 10:39:34 +02:00
Brad King
214fcefa52 Remove now-unused code once used for MIPSpro on IRIX
In commit beb991110d (Remove now-unused code once used on IRIX,
2019-01-11, v3.14.0-rc1~167^2) we removed remnants of IRIX support.
Also remove remnants of MIPSpro compiler support.
2019-02-21 11:12:51 -05:00
Brad King
a67d1e824c Merge topic 'FindOpenMP-log-errors'
272c4c3dee FindOpenMP: Log error output
db0445f0c8 FindOpenMP: Fix warnings with -Wstrict-prototypes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Christian Pfeiffer <cpfeiffer@live.de>
Merge-request: !2574
2018-11-07 07:46:40 -05:00
Ivan Pozdeev
272c4c3dee FindOpenMP: Log error output 2018-11-07 07:38:54 -05:00
Ivan Pozdeev
db0445f0c8 FindOpenMP: Fix warnings with -Wstrict-prototypes
With -Wstrict-prototype -Werror, the check would fail
2018-11-07 07:38:54 -05:00
Kitware Robot
df4ed1e9ff Help: Convert remaining modules to block-style comments 2018-10-22 11:09:34 -04:00
Brad King
826bf5c454 FindOpenMP: Avoid warning in check code
The test code added by commit v3.12.0-rc1~411^2~1 (FindOpenMP: Verify in
test source that OMP library is linked, 2018-03-01) leaves an unused
variable warning.  This breaks the check with `-Werror`.  Remove the
variable and leave just the function call, which should still check that
the OMP library is linked.

Fixes: #18102
2018-06-27 15:24:22 -04:00
Brad King
6ff8e34e5e Merge topic 'FindOpenMP-Intel-Windows'
0c7433e874 FindOpenMP: Fix support for Intel on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1957
2018-04-17 07:29:33 -04:00
Roland Schulz
0c7433e874 FindOpenMP: Fix support for Intel on Windows
The change in commit v3.11.0-rc1~334^2 (FindOpenMP: Use NO_DEFAULT_PATH
where appropriate, 2017-11-15) broke partial support for Intel on Windows.
Since `OpenMP_${LANG}_IMPLICIT_LINK_DIRS` is empty for this compiler
the `find_library` call without `NO_DEFAULT_PATH` worked accidentally
in environments with the needed libraries in the search path already.

Fix support for Intel on Windows by simply removing our explicit search
for the `libiomp5md` library.  In cases that it is needed, the compiler
already inserts metadata in `.obj` files to tell the MSVC linker to use
the library.

Suggested-by: Christian Pfeiffer <cpfeiffer@live.de>
Fixes: #17910
2018-04-16 14:11:12 -04:00
Henry Fredrick Schreiner
e3cd7c1e01 FindOpenMP: Add support for AppleClang compiler
This is possible using an external `omp` library and by passing
the flag past the compiler driver via `-Xclang -fopenmp`.

Fixes: #17775
2018-03-07 08:27:35 -05:00
Henry Fredrick Schreiner
b4c539e651 FindOpenMP: Verify in test source that OMP library is linked 2018-03-07 08:25:45 -05:00
Henry Fredrick Schreiner
7dd8c7a680 FindOpenMP: Improve inclusion of helper modules
Use `CMAKE_CURRENT_LIST_DIR` instead of `CMAKE_ROOT`.
Do not include modules inside a loop.
2018-03-07 08:24:27 -05:00
Christian Pfeiffer
ffa6f8752b FindOpenMP: Employ genex where possible
Fixes: #17610
2018-01-19 16:38:52 +01:00
Christian Pfeiffer
8e6d6337cd Merge topic 'fomp-cmp0012'
36cc4378 FindOpenMP: Enable policy CMP0012

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1490
2017-11-17 07:20:37 -05:00
Christian Pfeiffer
36cc43788a FindOpenMP: Enable policy CMP0012
Fixes: #17476
2017-11-16 15:22:37 +01:00
Christian Pfeiffer
98314d536e FindOpenMP: Use NO_DEFAULT_PATH where appropriate
OpenMP libraries must always be found in the implicit linking
directories of a compiler when using the OpenMP compile flag. If a suitable OpenMP library is also found in for example some CMAKE_PREFIX_PATH, this can lead to the module finding the incorrect library.
On the other hand, CMAKE_PREFIX_PATH can't ever be a location that we
need to consider since the OpenMP compile flag would not work if we
needed to.
2017-11-15 15:05:41 +01:00
Brad King
fe4d6f1fd6 Merge topic 'omp-oacc-werror-return-type'
15da0ba3 Find{OpenMP,OpenACC}: Fix detection with -Werror=return-type

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1406
2017-10-25 08:12:30 -04:00
Christian Pfeiffer
15da0ba3a2 Find{OpenMP,OpenACC}: Fix detection with -Werror=return-type
Explicitly return a value from `main` in our test sources.

Fixes: #17391
2017-10-24 10:55:06 -04:00
Brad King
1f436c5803 Merge topic 'findopenmp-lib-paths'
f4cc7109 FindOpenMP: Improve OMP libraries search

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1385
2017-10-18 09:35:29 -04:00
Christian Pfeiffer
f4cc71099a FindOpenMP: Improve OMP libraries search
This supports libraries given as full path and filters libraries given
in CMAKE_<LANG>_STANDARD_LIBRARIES.

Fixes: #17351
2017-10-17 09:53:57 -04:00
Brad King
e67eb42fa1 Merge topic 'findopenmp-fix-verbose'
e25d88ec FindOpenMP: Fix link flags being used for compile

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1348
2017-10-06 07:15:24 -04:00
Christian Pfeiffer
e25d88ecb9 FindOpenMP: Fix link flags being used for compile
Fixes: #17307
2017-10-05 17:02:56 +02:00
Christian Pfeiffer
3120615739 FindOpenMP: Fix version if OpenMP doesn't work 2017-10-04 19:53:48 +02:00
Brad King
dd5324ab1e FindOpenMP: Avoid CMP0054 warnings
When invoked in projects that don't set CMP0054 to NEW, FindOpenMP
triggers a warning:

    CMake Warning (dev) at .../Modules/FindOpenMP.cmake:... (if):
      Policy CMP0054 is not set...Quoted variables like "c" will no
      longer be dereferenced when the policy is set to NEW.  Since
      the policy is not set the OLD behavior will be used.

Set the policy within the module's scope to avoid this.

Fixes: #17292
2017-09-22 13:50:35 -04:00
Christian Pfeiffer
d25f30a6f8 FindOpenMP: Add support for components
Language specific components are added to FindOpenMP to ease consumption
of the module's results.
2017-09-14 18:11:28 +02:00
Christian Pfeiffer
23530151b2 FindOpenMP: Minor environmental improvements
A backup flag for Cray compilers was added and the OpenMP 5.0 Preview 1
document was added to the specification map.
2017-09-14 18:02:50 +02:00
Brad King
e4a78435c1 Merge topic 'findopenmp-found'
91fbda82 FindOpenMP: Restore OpenMP_FOUND result variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1233
2017-09-06 10:47:31 -04:00
Christian Pfeiffer
91fbda8247 FindOpenMP: Restore OpenMP_FOUND result variable
The overhaul in commit v3.9.0-rc1~207^2~1 (FindOpenMP: Complete
overhaul, 2017-04-24) documented this variable but accidentally left it
unset.

Fixes: #17251
2017-09-05 09:54:48 -04:00
Tin Huynh
d8e03e9ba6 FindOpenMP: Add Flang flag. 2017-08-31 15:27:18 -04:00
Christian Pfeiffer
80ca9ac84b FindOpenMP: Cache compilation results 2017-05-08 18:52:48 +02:00
Christian Pfeiffer
ec5c6bc9bc FindOpenMP: Refine list of flags to try 2017-05-08 18:26:17 +02:00
Christian Pfeiffer
28d8383797 separgs: Use NATIVE_COMMAND where appropriate 2017-04-26 20:34:23 +02:00
Christian Pfeiffer
bb032c1bf5 FindOpenMP: Complete overhaul. 2017-04-25 09:11:55 -04:00
Lucas Czech
9dc7a2ed2c FindOpenMP: Add iomp5 variant of Clang OpenMP flags
Try `-fopenmp=libiomp5` in addition to `-fopenmp=libomp`.  Leave the
latter as the default that we try first when the compiler id is `Clang`.
If that does not work we will still fall back to trying all the
candidates and eventually get to the iomp5 variant.
2017-02-23 09:59:46 -05:00
Brad King
86578eccf2 Simplify CMake per-source license notices
Per-source copyright/license notice headers that spell out copyright holder
names and years are hard to maintain and often out-of-date or plain wrong.
Precise contributor information is already maintained automatically by the
version control tool.  Ultimately it is the receiver of a file who is
responsible for determining its licensing status, and per-source notices are
merely a convenience.  Therefore it is simpler and more accurate for
each source to have a generic notice of the license name and references to
more detailed information on copyright holders and full license terms.

Our `Copyright.txt` file now contains a list of Contributors whose names
appeared source-level copyright notices.  It also references version control
history for more precise information.  Therefore we no longer need to spell
out the list of Contributors in each source file notice.

Replace CMake per-source copyright/license notice headers with a short
description of the license and links to `Copyright.txt` and online information
available from "https://cmake.org/licensing".  The online URL also handles
cases of modules being copied out of our source into other projects, so we
can drop our notices about replacing links with full license text.

Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority
of the replacements mechanically.  Manually fix up shebang lines and trailing
newlines in a few files.  Manually update the notices in a few files that the
script does not handle.
2016-09-27 15:14:44 -04:00
Sujin Philip
73e9f36ea6 FindOpenMP: Detect version (specification date) from compiler
Port changes from VTK commit fda6a31cb9 (Added Improved FindOpenMP
module, 2015-04-23).  Improve use of try_compile to avoid needing
to pass OpenMP flags as libraries.
2016-07-13 11:49:01 -04:00
Brad King
8f1103c0fd FindOpenMP: Cleanup all variables unconditionally 2016-07-13 11:02:01 -04:00
Brad King
ec963f04cb FindOpenMP: Improve documentation formatting
Also drop link to OpenMP compilers because our supported list may
not include all compilers.
2016-07-13 10:56:46 -04:00
Chris Pavlina
1549927d7d FindOpenMP: Add Clang support 2015-12-10 14:19:35 -05:00
Nils Gladitz
7d633ebfa0 FindOpenMP: Use fixed form Fortran test program
This prevents the test program from failing when build as Fortran 77.

Suggested-by: Alin Marin Elena <alinm.elena@gmail.com>
2014-11-20 14:54:11 +01:00
Nicolas Bock
d067840854 FindOpenMP: Add support for Fortran (#14656) 2014-08-18 11:25:21 -04:00
Adam Strzelecki
4671f3ab7d FindOpenMP: ICC 15 deprecates -openmp, use -qopenmp
Intel Composer XE 2015 Beta 2 deprecates all options starting with -o
for sake of compatibility with other compilers expecting anything goes
after -o... is output file name.
2014-06-27 09:30:51 -04:00
Clinton Stimpson
83934757c9 Find*: Make find_package(.. QUIET) affect Check* modules.
Fixes issues #14812 and #14813 where find_package(OpenMP QUIET) and
find_package(Qt4 QUIET) would still print out messages when calling
check*() functions.

Also a partial fix for  #14445 where building CMake
(without cmake-gui) when Qt5 is installed and Qt4 is not installed
and warnings come out of FindQt4.cmake.
2014-03-29 20:22:54 -06:00
Brad King
3993300ad3 Merge topic 'openmp-cray'
ebf70b0 FindOpenMP: fix detecting compilers that do not need any special flag (#14567)
2013-11-14 11:28:24 -05:00
Rolf Eike Beer
ebf70b037d FindOpenMP: fix detecting compilers that do not need any special flag (#14567) 2013-11-13 21:41:33 +01:00
Kitware Robot
f051814ed0 Convert builtin help to reStructuredText source files
Run the convert-help.bash script to convert documentation:

 ./convert-help.bash "/path/to/CMake-build/bin"

Then remove it.
2013-10-15 14:12:03 -04:00
Rolf Eike Beer
77fd5e51ab FindOpenMP: improve documentation (#13895) 2013-02-13 19:38:00 +01:00
Rolf Eike Beer
8ebf74b02f Find* (and some other): use ${CMAKE_CURRENT_LIST_DIR} in include()
This solves a lots of warnings, e.g. in the FindModulesExecuteAll test. If the
installed version on the system is rather old this may even lead to bugs, e.g.
https://bugs.gentoo.org/show_bug.cgi?id=436540
2012-11-04 05:55:37 +01:00
Kitware Robot
9db3116226 Remove CMake-language block-end command arguments
Ancient versions of CMake required else(), endif(), and similar block
termination commands to have arguments matching the command starting the
block.  This is no longer the preferred style.

Run the following shell code:

for c in else endif endforeach endfunction endmacro endwhile; do
    echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/'
done >convert.sed &&
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
egrep -z -v 'Tests/CMakeTests/While-Endwhile-' |
xargs -0 sed -i -f convert.sed &&
rm convert.sed
2012-08-13 14:19:16 -04:00
Kitware Robot
7bbaa4283d Remove trailing whitespace from most CMake and C/C++ code
Our Git commit hooks disallow modification or addition of lines with
trailing whitespace.  Wipe out all remnants of trailing whitespace
everywhere except third-party code.

Run the following shell code:

git ls-files -z -- \
 bootstrap doxygen.config '*.readme' \
 '*.c' '*.cmake' '*.cpp' '*.cxx' \
 '*.el' '*.f' '*.f90' '*.h' '*.in' '*.in.l' '*.java' \
 '*.mm' '*.pike' '*.py' '*.txt' '*.vim' |
egrep -z -v '^(Utilities/cm|Source/(kwsys|CursesDialog/form)/)' |
egrep -z -v '^(Modules/CPack\..*\.in)' |
xargs -0 sed -i 's/ \+$//'
2012-08-13 14:18:39 -04:00