Fix cmake warnings, FindPASTIX/FindPTSCOTCH.
We were getting a lot of warnings due to nested `find_package` calls within `Find***.cmake` files. The recommended approach is to use [`find_dependency`](https://cmake.org/cmake/help/latest/module/CMakeFindDependencyMacro.html) in package configuration files. I made this change for all instances. Case mismatches between `Find<Package>.cmake` and calling `find_package(<PACKAGE>`) also lead to warnings. Fixed for `FindPASTIX.cmake` and `FindSCOTCH.cmake`. `FindBLASEXT.cmake` was broken due to calling `find_package_handle_standard_args(BLAS ...)`. The package name must match, otherwise the `find_package(BLASEXT)` falsely thinks the package wasn't found. I changed to `BLASEXT`, but then also copied that value to `BLAS_FOUND` for compatibility. `FindPastix.cmake` had a typo that incorrectly added `PTSCOTCH` when looking for the `SCOTCH` component. `FindPTSCOTCH` incorrectly added `***-NOTFOUND` to include/library lists, corrupting them. This led to cmake errors down-the-line. Fixes #2288.
This commit is contained in:
		
							parent
							
								
									8cf6cb27ba
								
							
						
					
					
						commit
						1cdec38653
					
				| @ -147,6 +147,7 @@ mark_as_advanced(BLAS_VERBOSE) | |||||||
| 
 | 
 | ||||||
| include(CheckFunctionExists) | include(CheckFunctionExists) | ||||||
| include(CheckFortranFunctionExists) | include(CheckFortranFunctionExists) | ||||||
|  | include(CMakeFindDependencyMacro) | ||||||
| 
 | 
 | ||||||
| set(_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) | set(_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) | ||||||
| 
 | 
 | ||||||
| @ -509,9 +510,9 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") | |||||||
| 
 | 
 | ||||||
|     if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX) |     if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX) | ||||||
|       if(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED) |       if(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED) | ||||||
| 	find_package(Threads) | 	find_dependency(Threads) | ||||||
|       else() |       else() | ||||||
| 	find_package(Threads REQUIRED) | 	find_dependency(Threads REQUIRED) | ||||||
|       endif() |       endif() | ||||||
| 
 | 
 | ||||||
|       set(BLAS_SEARCH_LIBS "") |       set(BLAS_SEARCH_LIBS "") | ||||||
|  | |||||||
| @ -41,18 +41,19 @@ | |||||||
| #  License text for the above reference.) | #  License text for the above reference.) | ||||||
| 
 | 
 | ||||||
| # macro to factorize this call | # macro to factorize this call | ||||||
|  | include(CMakeFindDependencyMacro) | ||||||
| macro(find_package_blas) | macro(find_package_blas) | ||||||
|   if(BLASEXT_FIND_REQUIRED) |   if(BLASEXT_FIND_REQUIRED) | ||||||
|     if(BLASEXT_FIND_QUIETLY) |     if(BLASEXT_FIND_QUIETLY) | ||||||
|       find_package(BLAS REQUIRED QUIET) |       find_dependency(BLAS REQUIRED QUIET) | ||||||
|     else() |     else() | ||||||
|       find_package(BLAS REQUIRED) |       find_dependency(BLAS REQUIRED) | ||||||
|     endif() |     endif() | ||||||
|   else() |   else() | ||||||
|     if(BLASEXT_FIND_QUIETLY) |     if(BLASEXT_FIND_QUIETLY) | ||||||
|       find_package(BLAS QUIET) |       find_dependency(BLAS QUIET) | ||||||
|     else() |     else() | ||||||
|       find_package(BLAS) |       find_dependency(BLAS) | ||||||
|     endif() |     endif() | ||||||
|   endif() |   endif() | ||||||
| endmacro() | endmacro() | ||||||
| @ -316,7 +317,7 @@ if(BLA_VENDOR MATCHES "Intel*") | |||||||
| 	"\n   (see BLAS_SEQ_LIBRARIES and BLAS_PAR_LIBRARIES)") | 	"\n   (see BLAS_SEQ_LIBRARIES and BLAS_PAR_LIBRARIES)") | ||||||
|       message(STATUS "BLAS sequential libraries stored in BLAS_SEQ_LIBRARIES") |       message(STATUS "BLAS sequential libraries stored in BLAS_SEQ_LIBRARIES") | ||||||
|     endif() |     endif() | ||||||
|     find_package_handle_standard_args(BLAS DEFAULT_MSG |     find_package_handle_standard_args(BLASEXT DEFAULT_MSG | ||||||
|       BLAS_SEQ_LIBRARIES |       BLAS_SEQ_LIBRARIES | ||||||
|       BLAS_LIBRARY_DIRS |       BLAS_LIBRARY_DIRS | ||||||
|       BLAS_INCLUDE_DIRS) |       BLAS_INCLUDE_DIRS) | ||||||
| @ -324,14 +325,14 @@ if(BLA_VENDOR MATCHES "Intel*") | |||||||
|       if(NOT BLASEXT_FIND_QUIETLY) |       if(NOT BLASEXT_FIND_QUIETLY) | ||||||
| 	message(STATUS "BLAS parallel libraries stored in BLAS_PAR_LIBRARIES") | 	message(STATUS "BLAS parallel libraries stored in BLAS_PAR_LIBRARIES") | ||||||
|       endif() |       endif() | ||||||
|       find_package_handle_standard_args(BLAS DEFAULT_MSG |       find_package_handle_standard_args(BLASEXT DEFAULT_MSG | ||||||
| 	BLAS_PAR_LIBRARIES) | 	BLAS_PAR_LIBRARIES) | ||||||
|     endif() |     endif() | ||||||
|   else() |   else() | ||||||
|     if(NOT BLASEXT_FIND_QUIETLY) |     if(NOT BLASEXT_FIND_QUIETLY) | ||||||
|       message(STATUS "BLAS sequential libraries stored in BLAS_SEQ_LIBRARIES") |       message(STATUS "BLAS sequential libraries stored in BLAS_SEQ_LIBRARIES") | ||||||
|     endif() |     endif() | ||||||
|     find_package_handle_standard_args(BLAS DEFAULT_MSG |     find_package_handle_standard_args(BLASEXT DEFAULT_MSG | ||||||
|       BLAS_SEQ_LIBRARIES |       BLAS_SEQ_LIBRARIES | ||||||
|       BLAS_LIBRARY_DIRS |       BLAS_LIBRARY_DIRS | ||||||
|       BLAS_INCLUDE_DIRS) |       BLAS_INCLUDE_DIRS) | ||||||
| @ -343,14 +344,14 @@ elseif(BLA_VENDOR MATCHES "ACML*") | |||||||
|       "\n   (see BLAS_SEQ_LIBRARIES and BLAS_PAR_LIBRARIES)") |       "\n   (see BLAS_SEQ_LIBRARIES and BLAS_PAR_LIBRARIES)") | ||||||
|     message(STATUS "BLAS sequential libraries stored in BLAS_SEQ_LIBRARIES") |     message(STATUS "BLAS sequential libraries stored in BLAS_SEQ_LIBRARIES") | ||||||
|   endif() |   endif() | ||||||
|   find_package_handle_standard_args(BLAS DEFAULT_MSG |   find_package_handle_standard_args(BLASEXT DEFAULT_MSG | ||||||
|     BLAS_SEQ_LIBRARIES |     BLAS_SEQ_LIBRARIES | ||||||
|     BLAS_LIBRARY_DIRS) |     BLAS_LIBRARY_DIRS) | ||||||
|   if(BLAS_PAR_LIBRARIES) |   if(BLAS_PAR_LIBRARIES) | ||||||
|     if(NOT BLASEXT_FIND_QUIETLY) |     if(NOT BLASEXT_FIND_QUIETLY) | ||||||
|       message(STATUS "BLAS parallel libraries stored in BLAS_PAR_LIBRARIES") |       message(STATUS "BLAS parallel libraries stored in BLAS_PAR_LIBRARIES") | ||||||
|     endif() |     endif() | ||||||
|     find_package_handle_standard_args(BLAS DEFAULT_MSG |     find_package_handle_standard_args(BLASEXT DEFAULT_MSG | ||||||
|       BLAS_PAR_LIBRARIES) |       BLAS_PAR_LIBRARIES) | ||||||
|   endif() |   endif() | ||||||
| elseif(BLA_VENDOR MATCHES "IBMESSL*") | elseif(BLA_VENDOR MATCHES "IBMESSL*") | ||||||
| @ -360,21 +361,24 @@ elseif(BLA_VENDOR MATCHES "IBMESSL*") | |||||||
|       "\n   (see BLAS_SEQ_LIBRARIES and BLAS_PAR_LIBRARIES)") |       "\n   (see BLAS_SEQ_LIBRARIES and BLAS_PAR_LIBRARIES)") | ||||||
|     message(STATUS "BLAS sequential libraries stored in BLAS_SEQ_LIBRARIES") |     message(STATUS "BLAS sequential libraries stored in BLAS_SEQ_LIBRARIES") | ||||||
|   endif() |   endif() | ||||||
|   find_package_handle_standard_args(BLAS DEFAULT_MSG |   find_package_handle_standard_args(BLASEXT DEFAULT_MSG | ||||||
|     BLAS_SEQ_LIBRARIES |     BLAS_SEQ_LIBRARIES | ||||||
|     BLAS_LIBRARY_DIRS) |     BLAS_LIBRARY_DIRS) | ||||||
|   if(BLAS_PAR_LIBRARIES) |   if(BLAS_PAR_LIBRARIES) | ||||||
|     if(NOT BLASEXT_FIND_QUIETLY) |     if(NOT BLASEXT_FIND_QUIETLY) | ||||||
|       message(STATUS "BLAS parallel libraries stored in BLAS_PAR_LIBRARIES") |       message(STATUS "BLAS parallel libraries stored in BLAS_PAR_LIBRARIES") | ||||||
|     endif() |     endif() | ||||||
|     find_package_handle_standard_args(BLAS DEFAULT_MSG |     find_package_handle_standard_args(BLASEXT DEFAULT_MSG | ||||||
|       BLAS_PAR_LIBRARIES) |       BLAS_PAR_LIBRARIES) | ||||||
|   endif() |   endif() | ||||||
| else() | else() | ||||||
|   if(NOT BLASEXT_FIND_QUIETLY) |   if(NOT BLASEXT_FIND_QUIETLY) | ||||||
|     message(STATUS "BLAS sequential libraries stored in BLAS_SEQ_LIBRARIES") |     message(STATUS "BLAS sequential libraries stored in BLAS_SEQ_LIBRARIES") | ||||||
|   endif() |   endif() | ||||||
|   find_package_handle_standard_args(BLAS DEFAULT_MSG |   find_package_handle_standard_args(BLASEXT DEFAULT_MSG | ||||||
|     BLAS_SEQ_LIBRARIES |     BLAS_SEQ_LIBRARIES | ||||||
|     BLAS_LIBRARY_DIRS) |     BLAS_LIBRARY_DIRS) | ||||||
| endif() | endif() | ||||||
|  | 
 | ||||||
|  | # Callers expect BLAS_FOUND to be set as well. | ||||||
|  | set(BLAS_FOUND BLASEXT_FOUND) | ||||||
|  | |||||||
| @ -41,7 +41,8 @@ set(COMPUTECPP_BITCODE "spir64" CACHE STRING | |||||||
|   "Bitcode type to use as SYCL target in compute++") |   "Bitcode type to use as SYCL target in compute++") | ||||||
| mark_as_advanced(COMPUTECPP_BITCODE) | mark_as_advanced(COMPUTECPP_BITCODE) | ||||||
| 
 | 
 | ||||||
| find_package(OpenCL REQUIRED) | include(CMakeFindDependencyMacro) | ||||||
|  | find_dependency(OpenCL REQUIRED) | ||||||
| 
 | 
 | ||||||
| # Find ComputeCpp package | # Find ComputeCpp package | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -22,7 +22,8 @@ if( NOT FFTW_ROOT AND ENV{FFTWDIR} ) | |||||||
| endif() | endif() | ||||||
| 
 | 
 | ||||||
| # Check if we can use PkgConfig | # Check if we can use PkgConfig | ||||||
| find_package(PkgConfig) | include(CMakeFindDependencyMacro) | ||||||
|  | find_dependency(PkgConfig) | ||||||
| 
 | 
 | ||||||
| #Determine from PKG | #Determine from PKG | ||||||
| if( PKG_CONFIG_FOUND AND NOT FFTW_ROOT ) | if( PKG_CONFIG_FOUND AND NOT FFTW_ROOT ) | ||||||
|  | |||||||
| @ -65,8 +65,9 @@ endif() | |||||||
| 
 | 
 | ||||||
| # Optionally use pkg-config to detect include/library dirs (if pkg-config is available) | # Optionally use pkg-config to detect include/library dirs (if pkg-config is available) | ||||||
| # ------------------------------------------------------------------------------------- | # ------------------------------------------------------------------------------------- | ||||||
| include(FindPkgConfig) | include(CMakeFindDependencyMacro) | ||||||
| find_package(PkgConfig QUIET) | # include(FindPkgConfig) | ||||||
|  | find_dependency(PkgConfig QUIET) | ||||||
| if( PKG_CONFIG_EXECUTABLE AND NOT HWLOC_GIVEN_BY_USER ) | if( PKG_CONFIG_EXECUTABLE AND NOT HWLOC_GIVEN_BY_USER ) | ||||||
| 
 | 
 | ||||||
|   pkg_search_module(HWLOC hwloc) |   pkg_search_module(HWLOC hwloc) | ||||||
|  | |||||||
| @ -26,6 +26,7 @@ | |||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| include(CheckFunctionExists) | include(CheckFunctionExists) | ||||||
|  | include(CMakeFindDependencyMacro) | ||||||
| 
 | 
 | ||||||
| # This macro checks for the existence of the combination of fortran libraries | # This macro checks for the existence of the combination of fortran libraries | ||||||
| # given by _list.  If the combination is found, this macro checks (using the | # given by _list.  If the combination is found, this macro checks (using the | ||||||
| @ -88,7 +89,7 @@ macro(check_lapack_libraries DEFINITIONS LIBRARIES _prefix _name _flags _list _b | |||||||
|     set(${LIBRARIES}    ${_libraries_found}) |     set(${LIBRARIES}    ${_libraries_found}) | ||||||
|     # Some C++ linkers require the f2c library to link with Fortran libraries. |     # Some C++ linkers require the f2c library to link with Fortran libraries. | ||||||
|     # I do not know which ones, thus I just add the f2c library if it is available. |     # I do not know which ones, thus I just add the f2c library if it is available. | ||||||
|     find_package( F2C QUIET ) |     find_dependency( F2C QUIET ) | ||||||
|     if ( F2C_FOUND ) |     if ( F2C_FOUND ) | ||||||
|       set(${DEFINITIONS}  ${${DEFINITIONS}} ${F2C_DEFINITIONS}) |       set(${DEFINITIONS}  ${${DEFINITIONS}} ${F2C_DEFINITIONS}) | ||||||
|       set(${LIBRARIES}    ${${LIBRARIES}} ${F2C_LIBRARIES}) |       set(${LIBRARIES}    ${${LIBRARIES}} ${F2C_LIBRARIES}) | ||||||
| @ -135,9 +136,9 @@ endmacro() | |||||||
| 
 | 
 | ||||||
| # LAPACK requires BLAS | # LAPACK requires BLAS | ||||||
| if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) | if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) | ||||||
|   find_package(BLAS) |   find_dependency(BLAS) | ||||||
| else() | else() | ||||||
|   find_package(BLAS REQUIRED) |   find_dependency(BLAS REQUIRED) | ||||||
| endif() | endif() | ||||||
| 
 | 
 | ||||||
| if (NOT BLAS_FOUND) | if (NOT BLAS_FOUND) | ||||||
|  | |||||||
| @ -118,7 +118,7 @@ if( PASTIX_FIND_COMPONENTS ) | |||||||
|     if (${component} STREQUAL "SCOTCH") |     if (${component} STREQUAL "SCOTCH") | ||||||
|       set(PASTIX_LOOK_FOR_SCOTCH ON) |       set(PASTIX_LOOK_FOR_SCOTCH ON) | ||||||
|     endif() |     endif() | ||||||
|     if (${component} STREQUAL "SCOTCH") |     if (${component} STREQUAL "PTSCOTCH") | ||||||
|       set(PASTIX_LOOK_FOR_PTSCOTCH ON) |       set(PASTIX_LOOK_FOR_PTSCOTCH ON) | ||||||
|     endif() |     endif() | ||||||
|     if (${component} STREQUAL "METIS") |     if (${component} STREQUAL "METIS") | ||||||
| @ -133,14 +133,14 @@ endif() | |||||||
| 
 | 
 | ||||||
| # Required dependencies | # Required dependencies | ||||||
| # --------------------- | # --------------------- | ||||||
| 
 | include(CMakeFindDependencyMacro) | ||||||
| if (NOT PASTIX_FIND_QUIETLY) | if (NOT PASTIX_FIND_QUIETLY) | ||||||
|   message(STATUS "Looking for PASTIX - Try to detect pthread") |   message(STATUS "Looking for PASTIX - Try to detect pthread") | ||||||
| endif() | endif() | ||||||
| if (PASTIX_FIND_REQUIRED) | if (PASTIX_FIND_REQUIRED) | ||||||
|   find_package(Threads REQUIRED QUIET) |   find_dependency(Threads REQUIRED QUIET) | ||||||
| else() | else() | ||||||
|   find_package(Threads QUIET) |   find_dependency(Threads QUIET) | ||||||
| endif() | endif() | ||||||
| set(PASTIX_EXTRA_LIBRARIES "") | set(PASTIX_EXTRA_LIBRARIES "") | ||||||
| if( THREADS_FOUND ) | if( THREADS_FOUND ) | ||||||
| @ -198,9 +198,9 @@ if (NOT PASTIX_FIND_QUIETLY) | |||||||
|   message(STATUS "Looking for PASTIX - Try to detect HWLOC") |   message(STATUS "Looking for PASTIX - Try to detect HWLOC") | ||||||
| endif() | endif() | ||||||
| if (PASTIX_FIND_REQUIRED) | if (PASTIX_FIND_REQUIRED) | ||||||
|   find_package(HWLOC REQUIRED QUIET) |   find_dependency(HWLOC REQUIRED QUIET) | ||||||
| else() | else() | ||||||
|   find_package(HWLOC QUIET) |   find_dependency(HWLOC QUIET) | ||||||
| endif() | endif() | ||||||
| 
 | 
 | ||||||
| # PASTIX depends on BLAS | # PASTIX depends on BLAS | ||||||
| @ -209,9 +209,9 @@ if (NOT PASTIX_FIND_QUIETLY) | |||||||
|   message(STATUS "Looking for PASTIX - Try to detect BLAS") |   message(STATUS "Looking for PASTIX - Try to detect BLAS") | ||||||
| endif() | endif() | ||||||
| if (PASTIX_FIND_REQUIRED) | if (PASTIX_FIND_REQUIRED) | ||||||
|   find_package(BLASEXT REQUIRED QUIET) |   find_dependency(BLASEXT REQUIRED QUIET) | ||||||
| else() | else() | ||||||
|   find_package(BLASEXT QUIET) |   find_dependency(BLASEXT QUIET) | ||||||
| endif() | endif() | ||||||
| 
 | 
 | ||||||
| # Optional dependencies | # Optional dependencies | ||||||
| @ -230,9 +230,9 @@ if (NOT MPI_FOUND AND PASTIX_LOOK_FOR_MPI) | |||||||
|     set(MPI_C_COMPILER mpicc) |     set(MPI_C_COMPILER mpicc) | ||||||
|   endif() |   endif() | ||||||
|   if (PASTIX_FIND_REQUIRED AND PASTIX_FIND_REQUIRED_MPI) |   if (PASTIX_FIND_REQUIRED AND PASTIX_FIND_REQUIRED_MPI) | ||||||
|     find_package(MPI REQUIRED QUIET) |     find_dependency(MPI REQUIRED QUIET) | ||||||
|   else() |   else() | ||||||
|     find_package(MPI QUIET) |     find_dependency(MPI QUIET) | ||||||
|   endif() |   endif() | ||||||
|   if (MPI_FOUND) |   if (MPI_FOUND) | ||||||
|     mark_as_advanced(MPI_LIBRARY) |     mark_as_advanced(MPI_LIBRARY) | ||||||
| @ -272,10 +272,10 @@ if( NOT STARPU_FOUND AND PASTIX_LOOK_FOR_STARPU) | |||||||
|   endif() |   endif() | ||||||
|   # set the list of optional dependencies we may discover |   # set the list of optional dependencies we may discover | ||||||
|   if (PASTIX_FIND_REQUIRED AND PASTIX_FIND_REQUIRED_STARPU) |   if (PASTIX_FIND_REQUIRED AND PASTIX_FIND_REQUIRED_STARPU) | ||||||
|     find_package(STARPU ${PASTIX_STARPU_VERSION} REQUIRED |     find_dependency(STARPU ${PASTIX_STARPU_VERSION} REQUIRED | ||||||
|       COMPONENTS ${STARPU_COMPONENT_LIST}) |       COMPONENTS ${STARPU_COMPONENT_LIST}) | ||||||
|   else() |   else() | ||||||
|     find_package(STARPU ${PASTIX_STARPU_VERSION} |     find_dependency(STARPU ${PASTIX_STARPU_VERSION} | ||||||
|       COMPONENTS ${STARPU_COMPONENT_LIST}) |       COMPONENTS ${STARPU_COMPONENT_LIST}) | ||||||
|   endif() |   endif() | ||||||
| 
 | 
 | ||||||
| @ -288,9 +288,9 @@ if (NOT SCOTCH_FOUND AND PASTIX_LOOK_FOR_SCOTCH) | |||||||
|     message(STATUS "Looking for PASTIX - Try to detect SCOTCH") |     message(STATUS "Looking for PASTIX - Try to detect SCOTCH") | ||||||
|   endif() |   endif() | ||||||
|   if (PASTIX_FIND_REQUIRED AND PASTIX_FIND_REQUIRED_SCOTCH) |   if (PASTIX_FIND_REQUIRED AND PASTIX_FIND_REQUIRED_SCOTCH) | ||||||
|     find_package(SCOTCH REQUIRED QUIET) |     find_dependency(SCOTCH REQUIRED QUIET) | ||||||
|   else() |   else() | ||||||
|     find_package(SCOTCH QUIET) |     find_dependency(SCOTCH QUIET) | ||||||
|   endif() |   endif() | ||||||
| endif() | endif() | ||||||
| 
 | 
 | ||||||
| @ -301,9 +301,9 @@ if (NOT PTSCOTCH_FOUND AND PASTIX_LOOK_FOR_PTSCOTCH) | |||||||
|     message(STATUS "Looking for PASTIX - Try to detect PTSCOTCH") |     message(STATUS "Looking for PASTIX - Try to detect PTSCOTCH") | ||||||
|   endif() |   endif() | ||||||
|   if (PASTIX_FIND_REQUIRED AND PASTIX_FIND_REQUIRED_PTSCOTCH) |   if (PASTIX_FIND_REQUIRED AND PASTIX_FIND_REQUIRED_PTSCOTCH) | ||||||
|     find_package(PTSCOTCH REQUIRED QUIET) |     find_dependency(PTSCOTCH REQUIRED QUIET) | ||||||
|   else() |   else() | ||||||
|     find_package(PTSCOTCH QUIET) |     find_dependency(PTSCOTCH QUIET) | ||||||
|   endif() |   endif() | ||||||
| endif() | endif() | ||||||
| 
 | 
 | ||||||
| @ -314,9 +314,9 @@ if (NOT METIS_FOUND AND PASTIX_LOOK_FOR_METIS) | |||||||
|     message(STATUS "Looking for PASTIX - Try to detect METIS") |     message(STATUS "Looking for PASTIX - Try to detect METIS") | ||||||
|   endif() |   endif() | ||||||
|   if (PASTIX_FIND_REQUIRED AND PASTIX_FIND_REQUIRED_METIS) |   if (PASTIX_FIND_REQUIRED AND PASTIX_FIND_REQUIRED_METIS) | ||||||
|     find_package(METIS REQUIRED QUIET) |     find_dependency(METIS REQUIRED QUIET) | ||||||
|   else() |   else() | ||||||
|     find_package(METIS QUIET) |     find_dependency(METIS QUIET) | ||||||
|   endif() |   endif() | ||||||
| endif() | endif() | ||||||
| 
 | 
 | ||||||
| @ -79,20 +79,21 @@ if( PTSCOTCH_FIND_COMPONENTS ) | |||||||
| endif() | endif() | ||||||
| 
 | 
 | ||||||
| # PTSCOTCH depends on Threads, try to find it | # PTSCOTCH depends on Threads, try to find it | ||||||
|  | include(CMakeFindDependencyMacro) | ||||||
| if (NOT THREADS_FOUND) | if (NOT THREADS_FOUND) | ||||||
|   if (PTSCOTCH_FIND_REQUIRED) |   if (PTSCOTCH_FIND_REQUIRED) | ||||||
|     find_package(Threads REQUIRED) |     find_dependency(Threads REQUIRED) | ||||||
|   else() |   else() | ||||||
|     find_package(Threads) |     find_dependency(Threads) | ||||||
|   endif() |   endif() | ||||||
| endif() | endif() | ||||||
| 
 | 
 | ||||||
| # PTSCOTCH depends on MPI, try to find it | # PTSCOTCH depends on MPI, try to find it | ||||||
| if (NOT MPI_FOUND) | if (NOT MPI_FOUND) | ||||||
|   if (PTSCOTCH_FIND_REQUIRED) |   if (PTSCOTCH_FIND_REQUIRED) | ||||||
|     find_package(MPI REQUIRED) |     find_dependency(MPI REQUIRED) | ||||||
|   else() |   else() | ||||||
|     find_package(MPI) |     find_dependency(MPI) | ||||||
|   endif() |   endif() | ||||||
| endif() | endif() | ||||||
| 
 | 
 | ||||||
| @ -148,18 +149,18 @@ else() | |||||||
|     foreach(ptscotch_hdr ${PTSCOTCH_hdrs_to_find}) |     foreach(ptscotch_hdr ${PTSCOTCH_hdrs_to_find}) | ||||||
|       set(PTSCOTCH_${ptscotch_hdr}_DIRS "PTSCOTCH_${ptscotch_hdr}_DIRS-NOTFOUND") |       set(PTSCOTCH_${ptscotch_hdr}_DIRS "PTSCOTCH_${ptscotch_hdr}_DIRS-NOTFOUND") | ||||||
|       find_path(PTSCOTCH_${ptscotch_hdr}_DIRS |       find_path(PTSCOTCH_${ptscotch_hdr}_DIRS | ||||||
| 	NAMES ${ptscotch_hdr} |         NAMES ${ptscotch_hdr} | ||||||
| 	HINTS ${PTSCOTCH_DIR} |         HINTS ${PTSCOTCH_DIR} | ||||||
| 	PATH_SUFFIXES "include" "include/scotch") |         PATH_SUFFIXES "include" "include/scotch") | ||||||
|       mark_as_advanced(PTSCOTCH_${ptscotch_hdr}_DIRS) |       mark_as_advanced(PTSCOTCH_${ptscotch_hdr}_DIRS) | ||||||
|     endforeach() |     endforeach() | ||||||
|   else() |   else() | ||||||
|     foreach(ptscotch_hdr ${PTSCOTCH_hdrs_to_find}) |     foreach(ptscotch_hdr ${PTSCOTCH_hdrs_to_find}) | ||||||
|       set(PTSCOTCH_${ptscotch_hdr}_DIRS "PTSCOTCH_${ptscotch_hdr}_DIRS-NOTFOUND") |       set(PTSCOTCH_${ptscotch_hdr}_DIRS "PTSCOTCH_${ptscotch_hdr}_DIRS-NOTFOUND") | ||||||
|       find_path(PTSCOTCH_${ptscotch_hdr}_DIRS |       find_path(PTSCOTCH_${ptscotch_hdr}_DIRS | ||||||
| 	NAMES ${ptscotch_hdr} |         NAMES ${ptscotch_hdr} | ||||||
| 	HINTS ${_inc_env} |         HINTS ${_inc_env} | ||||||
| 	PATH_SUFFIXES "scotch") |         PATH_SUFFIXES "scotch") | ||||||
|       mark_as_advanced(PTSCOTCH_${ptscotch_hdr}_DIRS) |       mark_as_advanced(PTSCOTCH_${ptscotch_hdr}_DIRS) | ||||||
|     endforeach() |     endforeach() | ||||||
|   endif() |   endif() | ||||||
| @ -171,7 +172,6 @@ foreach(ptscotch_hdr ${PTSCOTCH_hdrs_to_find}) | |||||||
|   if (PTSCOTCH_${ptscotch_hdr}_DIRS) |   if (PTSCOTCH_${ptscotch_hdr}_DIRS) | ||||||
|     list(APPEND PTSCOTCH_INCLUDE_DIRS "${PTSCOTCH_${ptscotch_hdr}_DIRS}") |     list(APPEND PTSCOTCH_INCLUDE_DIRS "${PTSCOTCH_${ptscotch_hdr}_DIRS}") | ||||||
|   else () |   else () | ||||||
|     set(PTSCOTCH_INCLUDE_DIRS "PTSCOTCH_INCLUDE_DIRS-NOTFOUND") |  | ||||||
|     if (NOT PTSCOTCH_FIND_QUIETLY) |     if (NOT PTSCOTCH_FIND_QUIETLY) | ||||||
|       message(STATUS "Looking for ptscotch -- ${ptscotch_hdr} not found") |       message(STATUS "Looking for ptscotch -- ${ptscotch_hdr} not found") | ||||||
|     endif() |     endif() | ||||||
| @ -229,16 +229,16 @@ else() | |||||||
|     foreach(ptscotch_lib ${PTSCOTCH_libs_to_find}) |     foreach(ptscotch_lib ${PTSCOTCH_libs_to_find}) | ||||||
|       set(PTSCOTCH_${ptscotch_lib}_LIBRARY "PTSCOTCH_${ptscotch_lib}_LIBRARY-NOTFOUND") |       set(PTSCOTCH_${ptscotch_lib}_LIBRARY "PTSCOTCH_${ptscotch_lib}_LIBRARY-NOTFOUND") | ||||||
|       find_library(PTSCOTCH_${ptscotch_lib}_LIBRARY |       find_library(PTSCOTCH_${ptscotch_lib}_LIBRARY | ||||||
| 	NAMES ${ptscotch_lib} |         NAMES ${ptscotch_lib} | ||||||
| 	HINTS ${PTSCOTCH_DIR} |         HINTS ${PTSCOTCH_DIR} | ||||||
| 	PATH_SUFFIXES lib lib32 lib64) |         PATH_SUFFIXES lib lib32 lib64) | ||||||
|     endforeach() |     endforeach() | ||||||
|   else() |   else() | ||||||
|     foreach(ptscotch_lib ${PTSCOTCH_libs_to_find}) |     foreach(ptscotch_lib ${PTSCOTCH_libs_to_find}) | ||||||
|       set(PTSCOTCH_${ptscotch_lib}_LIBRARY "PTSCOTCH_${ptscotch_lib}_LIBRARY-NOTFOUND") |       set(PTSCOTCH_${ptscotch_lib}_LIBRARY "PTSCOTCH_${ptscotch_lib}_LIBRARY-NOTFOUND") | ||||||
|       find_library(PTSCOTCH_${ptscotch_lib}_LIBRARY |       find_library(PTSCOTCH_${ptscotch_lib}_LIBRARY | ||||||
| 	NAMES ${ptscotch_lib} |         NAMES ${ptscotch_lib} | ||||||
| 	HINTS ${_lib_env}) |         HINTS ${_lib_env}) | ||||||
|     endforeach() |     endforeach() | ||||||
|   endif() |   endif() | ||||||
| endif() | endif() | ||||||
| @ -255,7 +255,6 @@ foreach(ptscotch_lib ${PTSCOTCH_libs_to_find}) | |||||||
|     list(APPEND PTSCOTCH_LIBRARIES "${PTSCOTCH_${ptscotch_lib}_LIBRARY}") |     list(APPEND PTSCOTCH_LIBRARIES "${PTSCOTCH_${ptscotch_lib}_LIBRARY}") | ||||||
|     list(APPEND PTSCOTCH_LIBRARY_DIRS "${${ptscotch_lib}_lib_path}") |     list(APPEND PTSCOTCH_LIBRARY_DIRS "${${ptscotch_lib}_lib_path}") | ||||||
|   else () |   else () | ||||||
|     list(APPEND PTSCOTCH_LIBRARIES "${PTSCOTCH_${ptscotch_lib}_LIBRARY}") |  | ||||||
|     if (NOT PTSCOTCH_FIND_QUIETLY) |     if (NOT PTSCOTCH_FIND_QUIETLY) | ||||||
|       message(STATUS "Looking for ptscotch -- lib ${ptscotch_lib} not found") |       message(STATUS "Looking for ptscotch -- lib ${ptscotch_lib} not found") | ||||||
|     endif() |     endif() | ||||||
|  | |||||||
| @ -71,11 +71,12 @@ if( SCOTCH_FIND_COMPONENTS ) | |||||||
| endif() | endif() | ||||||
| 
 | 
 | ||||||
| # SCOTCH may depend on Threads, try to find it | # SCOTCH may depend on Threads, try to find it | ||||||
|  | include(CMakeFindDependencyMacro) | ||||||
| if (NOT THREADS_FOUND) | if (NOT THREADS_FOUND) | ||||||
|   if (SCOTCH_FIND_REQUIRED) |   if (SCOTCH_FIND_REQUIRED) | ||||||
|     find_package(Threads REQUIRED) |     find_dependency(Threads REQUIRED) | ||||||
|   else() |   else() | ||||||
|     find_package(Threads) |     find_dependency(Threads) | ||||||
|   endif() |   endif() | ||||||
| endif() | endif() | ||||||
| 
 | 
 | ||||||
| @ -67,8 +67,9 @@ set(CXX_STANDARD_REQUIRED ON) | |||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| # Find OpenCL package | # Find OpenCL package | ||||||
|  | include(CMakeFindDependencyMacro) | ||||||
| if(TRISYCL_OPENCL) | if(TRISYCL_OPENCL) | ||||||
|   find_package(OpenCL REQUIRED) |   find_dependency(OpenCL REQUIRED) | ||||||
|   if(UNIX) |   if(UNIX) | ||||||
|     set(BOOST_COMPUTE_INCPATH /usr/include/compute CACHE PATH |     set(BOOST_COMPUTE_INCPATH /usr/include/compute CACHE PATH | ||||||
|       "Path to Boost.Compute headers (default is: /usr/include/compute)") |       "Path to Boost.Compute headers (default is: /usr/include/compute)") | ||||||
| @ -77,11 +78,11 @@ endif() | |||||||
| 
 | 
 | ||||||
| # Find OpenMP package | # Find OpenMP package | ||||||
| if(TRISYCL_OPENMP) | if(TRISYCL_OPENMP) | ||||||
|   find_package(OpenMP REQUIRED) |   find_dependency(OpenMP REQUIRED) | ||||||
| endif() | endif() | ||||||
| 
 | 
 | ||||||
| # Find Boost | # Find Boost | ||||||
| find_package(Boost 1.58 REQUIRED COMPONENTS chrono log) | find_dependency(Boost 1.58 REQUIRED COMPONENTS chrono log) | ||||||
| 
 | 
 | ||||||
| # If debug or trace we need boost log | # If debug or trace we need boost log | ||||||
| if(TRISYCL_DEBUG OR TRISYCL_DEBUG_STRUCTORS OR TRISYCL_TRACE_KERNEL) | if(TRISYCL_DEBUG OR TRISYCL_DEBUG_STRUCTORS OR TRISYCL_TRACE_KERNEL) | ||||||
| @ -90,7 +91,7 @@ else() | |||||||
|   set(LOG_NEEDED OFF) |   set(LOG_NEEDED OFF) | ||||||
| endif() | endif() | ||||||
| 
 | 
 | ||||||
| find_package(Threads REQUIRED) | find_dependency(Threads REQUIRED) | ||||||
| 
 | 
 | ||||||
| # Find triSYCL directory | # Find triSYCL directory | ||||||
| if (TRISYCL_INCLUDES AND TRISYCL_LIBRARIES) | if (TRISYCL_INCLUDES AND TRISYCL_LIBRARIES) | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Antonio Sanchez
						Antonio Sanchez