Commit c49413fd authored by Florent Pruvost's avatar Florent Pruvost

update morse_distrib

parent c2ed1a64
......@@ -457,7 +457,13 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
endif()
if (UNIX AND NOT WIN32)
set(LM "-lm")
# m
find_library(M_LIBRARY NAMES m)
if(M_LIBRARY)
set(LM "-lm")
else()
set(LM "")
endif()
set(BLAS_COMPILER_FLAGS "")
if (NOT BLA_VENDOR STREQUAL "Intel10_64lp_seq")
if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
......
......@@ -431,12 +431,14 @@ if(FFTW_LIBRARIES)
endif()
# MKL
if(FFTW_LOOK_FOR_MKL)
list(APPEND REQUIRED_LIBS "${CMAKE_THREAD_LIBS_INIT};-lm")
list(APPEND REQUIRED_LIBS "${CMAKE_THREAD_LIBS_INIT}")
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
list(APPEND REQUIRED_LDFLAGS "-Wl,--no-as-needed")
endif()
endif()
if(UNIX OR WIN32)
# m
find_library(M_LIBRARY NAMES m)
if(M_LIBRARY)
list(APPEND REQUIRED_LIBS "-lm")
endif()
......
......@@ -271,13 +271,6 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT HWLOC_FOUND) O
check_function_exists(hwloc_topology_init HWLOC_WORKS)
mark_as_advanced(HWLOC_WORKS)
# test headers to guess the version
check_struct_has_member( "struct hwloc_obj" parent hwloc.h HAVE_HWLOC_PARENT_MEMBER )
check_struct_has_member( "struct hwloc_cache_attr_s" size hwloc.h HAVE_HWLOC_CACHE_ATTR )
check_c_source_compiles( "#include <hwloc.h>
int main(void) { hwloc_obj_t o; o->type = HWLOC_OBJ_PU; return 0;}" HAVE_HWLOC_OBJ_PU)
check_library_exists(${HWLOC_LIBRARIES} hwloc_bitmap_free "" HAVE_HWLOC_BITMAP)
if(NOT HWLOC_WORKS)
if(NOT HWLOC_FIND_QUIETLY)
message(STATUS "Looking for hwloc : test of hwloc_topology_init with hwloc library fails")
......@@ -319,3 +312,18 @@ else()
HWLOC_LIBRARIES
HWLOC_WORKS)
endif()
if (HWLOC_FOUND)
set(HWLOC_SAVE_CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES})
list(APPEND CMAKE_REQUIRED_INCLUDES ${HWLOC_INCLUDE_DIRS})
# test headers to guess the version
check_struct_has_member( "struct hwloc_obj" parent hwloc.h HAVE_HWLOC_PARENT_MEMBER )
check_struct_has_member( "struct hwloc_cache_attr_s" size hwloc.h HAVE_HWLOC_CACHE_ATTR )
check_c_source_compiles( "#include <hwloc.h>
int main(void) { hwloc_obj_t o; o->type = HWLOC_OBJ_PU; return 0;}" HAVE_HWLOC_OBJ_PU)
check_library_exists(${HWLOC_LIBRARIES} hwloc_bitmap_free "" HAVE_HWLOC_BITMAP)
set(CMAKE_REQUIRED_INCLUDES ${HWLOC_SAVE_CMAKE_REQUIRED_INCLUDES})
endif()
......@@ -333,8 +333,14 @@ if(BLAS_FOUND)
#intel lapack
if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
if (UNIX AND NOT WIN32)
set(LM "-lm")
endif ()
# m
find_library(M_LIBRARY NAMES m)
if(M_LIBRARY)
set(LM "-lm")
else()
set(LM "")
endif()
endif()
if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
find_PACKAGE(Threads)
......
......@@ -304,15 +304,31 @@ if (LAPACK_FOUND)
endif()
# Fortran
if (CMAKE_Fortran_COMPILER MATCHES ".+gfortran.*")
list(APPEND REQUIRED_LIBS "-lgfortran")
find_library(
FORTRAN_gfortran_LIBRARY
NAMES gfortran
HINTS ${_lib_env}
)
mark_as_advanced(FORTRAN_gfortran_LIBRARY)
if (FORTRAN_gfortran_LIBRARY AND CMAKE_C_COMPILER_ID STREQUAL "GNU")
list(APPEND REQUIRED_LIBS "-lgfortran")
endif()
elseif (CMAKE_Fortran_COMPILER MATCHES ".+ifort.*")
list(APPEND REQUIRED_LIBS "-lifcore")
find_library(
FORTRAN_ifcore_LIBRARY
NAMES ifcore
HINTS ${_lib_env}
)
mark_as_advanced(FORTRAN_ifcore_LIBRARY)
if (FORTRAN_ifcore_LIBRARY)
list(APPEND REQUIRED_LIBS "-lifcore")
endif()
endif()
# m
if(UNIX OR WIN32)
find_library(M_LIBRARY NAMES m HINTS ${_lib_env})
if(M_LIBRARY)
list(APPEND REQUIRED_LIBS "-lm")
endif()
# set required libraries for link
set(CMAKE_REQUIRED_INCLUDES "${REQUIRED_INCDIRS}")
set(CMAKE_REQUIRED_LIBRARIES)
......
......@@ -206,7 +206,8 @@ if(METIS_LIBRARIES)
endif()
set(REQUIRED_LIBS "${METIS_LIBRARIES}")
# m
if(UNIX OR WIN32)
find_library(M_LIBRARY NAMES m)
if(M_LIBRARY)
list(APPEND REQUIRED_LIBS "-lm")
endif()
......
......@@ -115,6 +115,29 @@ endif()
# Dependencies detection
# ----------------------
# Add system library paths to search lib
# --------------------------------------
unset(_lib_env)
set(ENV_MUMPS_LIBDIR "$ENV{MUMPS_LIBDIR}")
if(ENV_MUMPS_LIBDIR)
list(APPEND _lib_env "${ENV_MUMPS_LIBDIR}")
elseif(ENV_MUMPS_DIR)
list(APPEND _lib_env "${ENV_MUMPS_DIR}")
list(APPEND _lib_env "${ENV_MUMPS_DIR}/lib")
else()
if(WIN32)
string(REPLACE ":" ";" _lib_env "$ENV{LIB}")
else()
if(APPLE)
string(REPLACE ":" ";" _lib_env "$ENV{DYLD_LIBRARY_PATH}")
else()
string(REPLACE ":" ";" _lib_env "$ENV{LD_LIBRARY_PATH}")
endif()
list(APPEND _lib_env "${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES}")
list(APPEND _lib_env "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}")
endif()
endif()
list(REMOVE_DUPLICATES _lib_env)
# Required dependencies
# ---------------------
......@@ -560,9 +583,25 @@ if(MUMPS_LIBRARIES)
endif()
# Fortran
if (CMAKE_Fortran_COMPILER MATCHES ".+gfortran.*")
list(APPEND REQUIRED_LIBS "-lgfortran")
find_library(
FORTRAN_gfortran_LIBRARY
NAMES gfortran
HINTS ${_lib_env}
)
mark_as_advanced(FORTRAN_gfortran_LIBRARY)
if (FORTRAN_gfortran_LIBRARY AND CMAKE_C_COMPILER_ID STREQUAL "GNU")
list(APPEND REQUIRED_LIBS "-lgfortran")
endif()
elseif (CMAKE_Fortran_COMPILER MATCHES ".+ifort.*")
list(APPEND REQUIRED_LIBS "-lifcore")
find_library(
FORTRAN_ifcore_LIBRARY
NAMES ifcore
HINTS ${_lib_env}
)
mark_as_advanced(FORTRAN_ifcore_LIBRARY)
if (FORTRAN_ifcore_LIBRARY)
list(APPEND REQUIRED_LIBS "-lifcore")
endif()
endif()
# EXTRA LIBS such that pthread, m, rt
list(APPEND REQUIRED_LIBS ${MUMPS_EXTRA_LIBRARIES})
......
......@@ -206,7 +206,8 @@ if(PARMETIS_LIBRARIES)
endif()
set(REQUIRED_LIBS "${PARMETIS_LIBRARIES}")
# m
if(UNIX OR WIN32)
find_library(M_LIBRARY NAMES m)
if(M_LIBRARY)
list(APPEND REQUIRED_LIBS "-lm")
endif()
......
This diff is collapsed.
......@@ -617,9 +617,25 @@ if(PASTIX_LIBRARIES)
endif()
# Fortran
if (CMAKE_Fortran_COMPILER MATCHES ".+gfortran.*")
list(APPEND REQUIRED_LIBS "-lgfortran")
find_library(
FORTRAN_gfortran_LIBRARY
NAMES gfortran
HINTS ${_lib_env}
)
mark_as_advanced(FORTRAN_gfortran_LIBRARY)
if (FORTRAN_gfortran_LIBRARY AND CMAKE_C_COMPILER_ID STREQUAL "GNU")
list(APPEND REQUIRED_LIBS "-lgfortran")
endif()
elseif (CMAKE_Fortran_COMPILER MATCHES ".+ifort.*")
list(APPEND REQUIRED_LIBS "-lifcore")
find_library(
FORTRAN_ifcore_LIBRARY
NAMES ifcore
HINTS ${_lib_env}
)
mark_as_advanced(FORTRAN_ifcore_LIBRARY)
if (FORTRAN_ifcore_LIBRARY)
list(APPEND REQUIRED_LIBS "-lifcore")
endif()
endif()
# EXTRA LIBS such that pthread, m, rt
list(APPEND REQUIRED_LIBS ${PASTIX_EXTRA_LIBRARIES})
......
......@@ -361,7 +361,12 @@ endif ()
#intel scalapack
if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
if (UNIX AND NOT WIN32)
set(LM "-lm")
find_library(M_LIBRARY NAMES m)
if(M_LIBRARY)
set(LM "-lm")
else()
set(LM "")
endif()
endif ()
if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
if(SCALAPACK_FIND_QUIETLY OR NOT SCALAPACK_FIND_REQUIRED)
......
......@@ -750,9 +750,25 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT STARPU_FOUND)
endif()
# Fortran
if (CMAKE_Fortran_COMPILER MATCHES ".+gfortran.*")
list(APPEND REQUIRED_LIBS "-lgfortran")
find_library(
FORTRAN_gfortran_LIBRARY
NAMES gfortran
HINTS ${_lib_env}
)
mark_as_advanced(FORTRAN_gfortran_LIBRARY)
if (FORTRAN_gfortran_LIBRARY AND CMAKE_C_COMPILER_ID STREQUAL "GNU")
list(APPEND REQUIRED_LIBS "-lgfortran")
endif()
elseif (CMAKE_Fortran_COMPILER MATCHES ".+ifort.*")
list(APPEND REQUIRED_LIBS "-lifcore")
find_library(
FORTRAN_ifcore_LIBRARY
NAMES ifcore
HINTS ${_lib_env}
)
mark_as_advanced(FORTRAN_ifcore_LIBRARY)
if (FORTRAN_ifcore_LIBRARY)
list(APPEND REQUIRED_LIBS "-lifcore")
endif()
endif()
# set required libraries for link
......
#
# Internal module for DAGuE.
# Setup the minimal environment to compile and generate .JDF files.
#
#
# This macro creates a rule for every jdf basename passed in SOURCES.
# The OUTPUTLIST contains the list of files generated by the maxro.
#
macro(jdf_rules jdf_rules_OUTPUTLIST jdf_rules_SOURCES)
foreach(jdf_rules_SOURCE ${jdf_rules_SOURCES})
# Remove .jdf if present
string(REGEX REPLACE ".jdf" "" jdf_rules_SRC ${jdf_rules_SOURCE})
string(REGEX REPLACE "^(.*/)*(.+)\\.*.*" "\\2" jdf_rules_BSRC ${jdf_rules_SRC})
set(jdf_rules_OSRC "${jdf_rules_BSRC}")
GET_PROPERTY(ADDITIONAL_DAGUEPP_CFLAGS SOURCE ${jdf_rules_SOURCE} PROPERTY ADDITIONAL_DAGUEPP_CFLAGS)
get_source_file_property(jdf_rules_IsInBinaryDir ${jdf_rules_SOURCE} IS_IN_BINARY_DIR )
# If the file is generated in a different binary dir,
# we force the dependency on the generated file
# otherwise we let cmake choose the correct file, it is so good for that.
if( jdf_rules_IsInBinaryDir )
add_custom_command(
OUTPUT ${jdf_rules_OSRC}.h ${jdf_rules_OSRC}.c
COMMAND ${daguepp_EXE} ${DAGUEPP_CFLAGS} ${ADDITIONAL_DAGUEPP_CFLAGS} -i ${jdf_rules_SRC}.jdf -o ${jdf_rules_OSRC} -f ${jdf_rules_BSRC}
MAIN_DEPENDENCY ${CMAKE_CURRENT_BINARY_DIR}/${jdf_rules_SRC}.jdf
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${jdf_rules_SRC}.jdf ${daguepp_EXE})
else( jdf_rules_IsInBinaryDir )
add_custom_command(
OUTPUT ${jdf_rules_OSRC}.h ${jdf_rules_OSRC}.c
COMMAND ${daguepp_EXE} ${DAGUEPP_CFLAGS} ${ADDITIONAL_DAGUEPP_CFLAGS} -i ${jdf_rules_SRC}.jdf -o ${jdf_rules_OSRC} -f ${jdf_rules_BSRC}
MAIN_DEPENDENCY ${jdf_rules_SRC}.jdf
DEPENDS ${jdf_rules_SRC}.jdf ${daguepp_EXE})
endif( jdf_rules_IsInBinaryDir )
list(APPEND ${jdf_rules_OUTPUTLIST} "${CMAKE_CURRENT_BINARY_DIR}/${jdf_rules_OSRC}.h;${CMAKE_CURRENT_BINARY_DIR}/${jdf_rules_OSRC}.c")
endforeach()
#
# Mark all generated files as such.
#
set_source_files_properties(${jdf_rules_OUTPUTLIST} PROPERTIES GENERATED 1)
endmacro(jdf_rules)
......@@ -310,6 +310,7 @@ subs = {
('CORE_s', 'CORE_d', 'CORE_s', 'CORE_d' ),
('cpu_gpu_s', 'cpu_gpu_d', 'cpu_gpu_c', 'cpu_gpu_z' ),
('cublasS', 'cublasD', 'cublasC', 'cublasZ' ),
('CUDA_s', 'CUDA_d', 'CUDA_c', 'CUDA_z' ),
('example_s', 'example_d', 'example_c', 'example_z' ),
('ipt_s', 'ipt_d', 'ipt_c', 'ipt_z' ),
('LAPACKE_s', 'LAPACKE_d', 'LAPACKE_c', 'LAPACKE_z' ),
......@@ -625,6 +626,10 @@ subs = {
('ssytrd', 'dsytrd', 'chetrd', 'zhetrd' ),
('ssytrf', 'dsytrf', 'chetrf', 'zhetrf' ),
# ----- Auxiliary routines with precision
('sgemerge', 'dgemerge', 'cgemerge', 'zgemerge' ),
('sparfb', 'dparfb', 'cparfb', 'zparfb' ),
# BLAS, without precision
# must be after BLAS with precision
# Ex: cublasZhemm -> cublasShemm -> cublasSsymm
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment