Commit Graph

48 Commits

Author SHA1 Message Date
Todd Gamblin 8756e77fb4 Fix issues with removing try_compile input file.
- Don't remove input file
- Put output in ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}
- Remove try_compile variable from the cache after using
2011-06-21 14:02:01 -07:00
Todd Gamblin e00d2c4d51 Try regular compiler when no MPI compiler.
If FindMPI can't interrogate any of the available compilers, it attempts to compile simple MPI
programs with CMAKE_${lang}_COMPILER.  If this works, it uses that as MPI_${lang}_COMPILER.

This allows MPI to be discovered on Cray XT/XE systems, where modules are used and cc, CC, and ftn
compilers *are* MPI compilers.
2011-06-21 10:14:01 -07:00
Todd Gamblin a55da06948 Added backward compatibility for input as well as output vars.
Users can now supply MPI_COMPILER, MPI_INCLUDE_PATH, MPI_LIBRARY,
and others as with the old FindMPI.  These are mapped to their
respective equivalents for C and CXX.  Fortran is not touched, as
there was no Fortran support in the old FindMPI.
2011-04-24 18:55:23 +09:00
Brad King a32a633225 FindMPI: Fix documentation formatting
Adjust whitespace to make the output of "--help-module FindMPI" look
good.  Also separate the comment containing the copyright and license
notice so it does not appear in the documentation.
2011-03-16 10:11:33 -04:00
Todd Gamblin 706b73e848 FindMPI: Handle multiple languages
Adds support for:

- MPI_<lang>_COMPILER and other useful variables for C, CXX, Fortran
- Better compiler interrogation (handles mvapich)
- Supports specifying an MPI compiler name directly on the command line
  without and absolute path, e.g.: cmake -D MPI_CXX_COMPILER=mpixlC
- Better compiler name searching tries to match MPI compiler to regular
  CMAKE_<lang>_COMPILER_ID, if it's available.

Gets rid of:

- MPI_LIBRARY, MPI_EXTRA_LIBRARY cache variables.  These and other old
  vars are still exported for backward compatibility, but they're not
  cached.
2011-03-15 15:07:34 -04:00
Brad King c4275592a8 Modules: Include builtin FindPackageHandleStandardArgs directly
The FindPackageHandleStandardArgs module was originally created outside
of CMake.  It was added for CMake 2.6.0 by commit e118a627 (add a macro
FIND_PACKAGE_HANDLE_STANDARD_ARGS..., 2007-07-18).  However, it also
proliferated into a number of other projects that at the time required
only CMake 2.4 and thus could not depend on CMake to provide the module.
CMake's own find modules started using the module in commit b5f656e0
(use the new FIND_PACKAGE_HANDLE_STANDARD_ARGS in some of the FindXXX
modules..., 2007-07-18).

Then commit d358cf5c (add 2nd, more powerful mode to
find_package_handle_standard_args, 2010-07-29) added a new feature to
the interface of the module that was fully optional and backward
compatible with all existing users of the module.  Later commit 5f183caa
(FindZLIB: use the FPHSA version mode, 2010-08-04) and others shortly
thereafter started using the new interface in CMake's own find modules.
This change was also backward compatible because it was only an
implementation detail within each module.

Unforutnately these changes introduced a problem for projects that still
have an old copy of FindPackageHandleStandardArgs in CMAKE_MODULE_PATH.
When any such project uses one of CMake's builtin find modules the line

  include(FindPackageHandleStandardArgs)

loads the copy from the project which does not have the new interface!
Then the including find module tries to use the new interface with the
old module and fails.

Whether this breakage can be considered a backward incompatible change
in CMake is debatable.  The situation is analagous to copying a standard
library header from one version of a compiler into a project and then
observing problems when the next version of the compiler reports errors
in its other headers that depend on its new version of the original
header.  Nevertheless it is a change to CMake that causes problems for
projects that worked with previous versions.

This problem was discovered during the 2.8.3 release candidate cycle.
It is an instance of a more general problem with projects that provide
their own versions of CMake modules when other CMake modules depend on
them.  At the time we resolved this instance of the problem with commit
b0118402 (Use absolute path to FindPackageHandleStandardArgs.cmake
everywhere, 2010-09-28) for the 2.8.3 release.

In order to address the more general problem we introduced policy
CMP0017 in commit db44848f (Prefer files from CMAKE_ROOT when including
from CMAKE_ROOT, 2010-11-17).  That change was followed by commit
ce28737c (Remove usage of CMAKE_CURRENT_LIST_DIR now that we have
CMP0017, 2010-12-20) which reverted the original workaround in favor of
using the policy.  However, existing project releases do not set the
policy behavior to NEW and therefore still exhibit the problem.

We introduced in commit a364daf1 (Allow users to specify defaults for
unset policies, 2011-01-03) an option for users to build existing
projects by adding -DCMAKE_POLICY_DEFAULT_CMP0017=NEW to the command
line.  Unfortunately this solution still does not allow such projects to
build out of the box, and there is no good way to suggest the use of the
new option.

The only remaining solution to keep existing projects that exhibit this
problem building is to restore the change originally made in commit
b0118402 (Use absolute path to FindPackageHandleStandardArgs.cmake
everywhere, 2010-09-28).  This also avoids policy CMP0017 warnings for
this particular instance of the problem the policy addresses.
2011-01-20 10:56:49 -05:00
Alex Neundorf ce28737c93 Remove usage of CMAKE_CURRENT_LIST_DIR now that we have CMP0017
This puts the new search behaviour for included files in action, i.e.
now when a file from Modules/ include()s another file, it also gets the
one from Modules/ included, i.e. the one it expects.

Alex
2011-01-04 08:20:08 -05:00
David Cole b0fb2ad3e1 Merge topic 'AddCMAKE_CURRENT_LIST_DIR'
b011840 Use absolute path to FindPackageHandleStandardArgs.cmake everywhere
41e4f1a Add automatic variable CMAKE_CURRENT_LIST_DIR(dir of CMAKE_CURRENT_LIST_FILE)
f9fc79c Remove trailing whitespace
2010-10-19 15:53:16 -04:00
David Partyka 35d2770df9 Update module to locate newely released MS MPI HPC Pack R2. 2010-10-11 09:20:07 -04:00
Alex Neundorf b01184022b Use absolute path to FindPackageHandleStandardArgs.cmake everywhere
This is to avoid getting an (older) copy of FPHSA.cmake which is
e.g. installed with KDE 4.5.0 and 4.5.1.

Alex
2010-09-28 22:30:31 +02:00
Brad King a56969f3d3 FindMPI: Recoginze -f flags from mpicc (#10771)
Parse compiler flags like "-fmessage-length=0 -fstack-protector
-funwind-tables -fasynchronous-unwind-tables -fno-strict-aliasing" from
the output of "mpicc -show".  We already handle preprocessor definition
arguments like -DUSE_STDARG.  Honor '-f' flags too.
2010-09-20 09:08:08 -04:00
Todd Gamblin 2cde67a781 Modules: Fix spelling 'To distributed' -> 'To distribute' 2010-08-09 08:48:31 -04:00
Brad King f315c29966 Merge branch 'FindMPI-flag-parsing' 2010-07-06 10:19:48 -04:00
Brad King 96c7cb26e9 FindMPI: Fix parsing of mpicc -Wl,-L link flags (#9093)
Commit d84cbd0f (FindMPI: Parse mpicc flags more carefully, 2010-06-24)
broke parsing of '-L' flags appearing after '-Wl,' by expecting a
preceding space.  Update the regular expression to allow '-Wl,-L' too.
2010-06-29 10:59:52 -04:00
Brad King cea9389cc9 FindMPI: Trust mpicc -showme on BlueGene/L
Do not hard-code known BlueGene/L MPI libraries.  We do not know their
location so the linker cannot find them without the proper -L search
path.  The MPI compiler tells us about the libraries anyway, and if it
does not then the user can fix the problem locally by editing the
MPI_EXTRA_LIBRARY cache entry.
2010-06-28 11:42:34 -04:00
Brad King 8460059a72 FindMPI: Failure is not an error if not REQUIRED 2010-06-28 11:35:18 -04:00
Brad King d84cbd0f77 FindMPI: Parse mpicc flags more carefully (#9093)
Extend the fix from commit 68c7d3e2 (FindMPI: Do not parse -l in middle
of library name, 2010-06-24).  Parse -D, -I, -L, and -Wl only with
preceding spaces or at the beginning of the string.
2010-06-25 08:00:38 -04:00
Brad King 68c7d3e2ce FindMPI: Do not parse -l in middle of library name
We parse the output of 'mpicc -shome:link' to look for -l options
specifying libraries.  Fix the parsing regex to avoid matching the
string '-l' in the middle of a library name.
2010-06-24 11:07:19 -04:00
David Partyka 01f022c49c Add a new registry key to check for the location of MPICH2. 2010-03-11 10:42:07 -05:00
Dave Partyka 3154cde792 BUG: rename MPI_PACKAGE_DIR and MPI_PREFIX_PATH vars to be prefixed with _ to prevent conflicts with known variable names in other projects. 2009-11-13 10:57:01 -05:00
Dave Partyka 279e4ec33b BUG: fix MPI_BASE_DIR var to be called _MPI_BASE_DIR to prevent conflicts with known variable names in other projects. 2009-11-13 10:52:28 -05:00
Dave Partyka 39e88bbe99 COMP: need to add quotes when using get_filename_component otherwise it will try to process NOT FOUND rather than an empty string when MPIEXEC is not found. 2009-10-27 13:10:01 -04:00
Dave Partyka c283fe2d26 COMP: fix syntax error. 2009-10-27 12:57:30 -04:00
Dave Partyka 4915e92998 ENH: Improvements in finding MPI on windows. ENH: reorganized searching mpi for mpi components (include,lib,bin) using a single set of search paths instead of seperately mainted lists of paths for each. 2009-10-27 12:43:50 -04:00
Brad King c4bb9c9d42 Convert CMake find-modules to BSD License
This adds copyright/license notification blocks CMake's find-modules.
Many of the modules had no notices at all.  Some had notices referring
to the BSD license already.  This commit normalizes existing notices and
adds missing notices.
2009-09-28 11:45:50 -04:00
David Cole b71332914f Oops. Close strings with double quotes. Where they're supposed to be. 2009-09-04 18:19:06 -04:00
David Cole 5655ac46f0 Add MPICH2 and Microsoft HPC paths, add paths to find mpiexec. Now it works better automatically on Windows. Thanks to Dave Partyka for developing the patch. 2009-09-04 18:02:05 -04:00
Douglas Gregor fa458957ab ENH: Use the HINTS feature of find_library to find the right libraries for
MPI, and act a bit more intelligently when MPI cannot be found.
2008-07-18 08:17:23 -04:00
Douglas Gregor 7e5921eff4 BUG: As a last resort, FindMPI will look for mpi.h in the path 2008-04-22 09:54:23 -04:00
Douglas Gregor cecb98c618 BUG: Use -showme:incdirs and -showme:libdirs when we need them 2008-04-22 09:41:07 -04:00
Douglas Gregor 1100b52c7e ENH: Deal with 32-bit and 64-bit variants of Microsoft's MPI properly 2008-04-10 16:54:20 -04:00
Douglas Gregor 5b3e62c7bc ENH: Enhance FindMPI module by properly handling backward compatibility with the older module, adding documentation, and coping with multiple include and linker paths 2008-03-31 10:55:32 -04:00
Bill Hoffman a8ecf11edf ENH: remove use of undefined cdr 2008-03-24 15:41:16 -04:00
Bill Hoffman 29fe247016 ENH: add new version of FindMPI, fix it to work with MPICH2 on windows 2008-03-07 19:58:29 -05:00
Alexander Neundorf b82b47e329 STYLE: use FIND_PACKAGE_HANDLE_STANDARD_ARGS() also in FindMPI.cmake
-remove unnecessary ELSE() in FindThreads.cmake

Alex
2007-08-06 11:02:58 -04:00
Alexander Neundorf 10e3efa6b5 ENH: add support for BlueGene/L
Alex
2007-06-22 10:22:27 -04:00
Alexander Neundorf 8f7b0291d8 STYLE: use the newer FIND_XXX syntax, which should find MPI in even more
directories and doesn't require to list standard directories like /usr/lib,
etc.

Alex
2007-04-30 17:03:53 -04:00
Bill Hoffman cf8625cf52 ENH: add support for finding mpich2 on windows 2006-11-02 19:58:14 -05:00
Bill Hoffman 7603244509 ENH: use program files env for searching 2006-02-28 10:27:30 -05:00
Ken Martin 74eaecfc3e ENH: cleanups 2005-12-15 14:17:43 -05:00
Bill Hoffman b7fa820118 ENH: add documentation support for modules 2005-12-14 13:51:08 -05:00
Bill Hoffman 4a1412b0cb BUG: fix for bugs 125 - 128, and a fix for the bug introduced by the bug fix for but 92. & was being replaced with &amp, but after double quote was replaced with &quot causing it to be &amp;quot. Also add more search paths for mpi 2003-08-07 09:19:39 -04:00
Andy Cedilnik 555a7f88aa Add mpi search paths for Debian 2002-04-18 15:58:11 -04:00
Berk Geveci 807dea6374 Added doc. 2001-12-12 13:57:41 -05:00
Berk Geveci 0857a830b8 Added support for a 2nd mpi library (usually mpi++) 2001-12-12 11:51:03 -05:00
Bill Hoffman f07ee5b817 ENH: change find library and find program to look for more than one name 2001-05-09 14:53:32 -04:00
Ken Martin 0e77477a78 minor fixes 2001-05-02 17:33:26 -04:00
Ken Martin 13f68ae1f2 new module 2001-05-02 17:07:09 -04:00