WIP: Add test subdirectory; tests fail to link

pull/5/head
Damian Rouson 9 years ago
parent 37c4024bf5
commit c171e9addb

@ -610,7 +610,7 @@ add_definitions(
-DHAVE_METIS_ -DLowerUnderscore -DPtr64Bits
)
set(directory_list base prec krylov util) # TODO: add cbind
set(directory_list base prec krylov util test) # TODO: add cbind
foreach(directory ${directory_list})
add_subdirectory("${directory}")
endforeach()

@ -0,0 +1,94 @@
if (NOT MPI_C_FOUND)
find_package(MPI REQUIRED)
set(CMAKE_C_COMPILE_FLAGS ${CMAKE_C_COMPILE_FLAGS} ${MPI_C_COMPILE_FLAGS})
set(CMAKE_C_LINK_FLAGS ${CMAKE_C_LINK_FLAGS} ${MPI_C_LINK_FLAGS})
set(CMAKE_Fortran_COMPILE_FLAGS ${CMAKE_Fortran_COMPILE_FLAGS} ${MPI_Fortran_COMPILE_FLAGS})
set(CMAKE_Fortran_LINK_FLAGS ${CMAKE_Fortran_LINK_FLAGS} ${MPI_Fortran_LINK_FLAGS})
include_directories(BEFORE ${MPI_C_INCLUDE_PATH} ${MPI_Fortran_INCLUDE_PATH})
endif()
if("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "GNU")
set(gfortran_compiler true)
endif()
include(CheckIncludeFile)
CHECK_INCLUDE_FILE("alloca.h" HAVE_ALLOCA)
if(NOT HAVE_ALLOCA)
add_definitions(-DALLOCA_MISSING)
message(WARNING "Could not find <alloca.h>. Assuming functionality is provided elsewhere.")
endif()
set(old_cmake_required_includes "${CMAKE_REQUIRED_INCLUDES}")
if(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES};${MPI_C_INCLUDE_PATH})
else()
set(CMAKE_REQUIRED_INCLUDES ${MPI_C_INCLUDE_PATH})
endif()
set(old_cmake_required_flags "${CMAKE_REQUIRED_FLAGS}")
if(CMAKE_REQUIRED_FLAGS)
set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS};${MPI_C_COMPILE_FLAGS};${MPI_C_LINK_FLAGS})
else()
set(CMAKE_REQUIRED_FLAGS ${MPI_C_COMPILE_FLAGS};${MPI_C_LINK_FLAGS})
endif()
set(old_cmake_required_libraries "${CMAKE_REQUIRED_LIBRARIES}")
if(CMAKE_REQUIRED_LIBRARIES)
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES};${MPI_C_LIBRARIES})
else()
set(CMAKE_REQUIRED_LIBRARIES ${MPI_C_LIBRARIES})
endif()
set(MPI_HEADERS mpi.h)
include(CheckIncludeFiles)
CHECK_INCLUDE_FILES("mpi.h;mpi-ext.h" HAVE_MPI_EXT)
if(HAVE_MPI_EXT)
add_definitions(-DHAVE_MPI_EXT_H)
set(MPI_HEADERS ${MPI_HEADERS};mpi-ext.h)
endif()
set(CMAKE_REQUIRED_INCLUDES ${old_cmake_required_includes})
set(CMAKE_REQUIRED_FLAGS ${old_cmake_required_flags})
set(CMAKE_REQUIRED_LIBRARIES ${old_cmake_required_libraries})
#---------------------------------------------------
# Windows Intel MPI compatibility, see GH issue #435
#---------------------------------------------------
set(old_cmake_required_includes "${CMAKE_REQUIRED_INCLUDES}")
if(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES};${MPI_C_INCLUDE_PATH})
else()
set(CMAKE_REQUIRED_INCLUDES ${MPI_C_INCLUDE_PATH})
endif()
CHECK_INCLUDE_FILES("mpi.h" HAVE_MPI_H)
include(CheckSymbolExists)
CHECK_SYMBOL_EXISTS(I_MPI_VERSION "mpi.h" HAVE_Intel_MPI)
if(HAVE_Intel_MPI AND WIN32)
add_definitions(-DUSE_GCC)
endif()
set(CMAKE_REQUIRED_INCLUDES ${old_cmake_required_includes})
set(PSBLAS_SO_VERSION 0)
if(gfortran_compiler)
if(NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.0.0)
set(PSBLAS_SO_VERSION 2)
elseif(NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 6.0.0)
set(PSBLAS_SO_VERSION 1)
endif()
endif()
set(PSBLAS_MODDIR "${CMAKE_INSTALL_INCLUDEDIR}/${mod_dir_tail}")
set(MOD_DIR_FLAG "${CMAKE_Fortran_MODDIR_FLAG}")
set(MPI_LIBS "")
foreach( lib IN LISTS MPI_Fortran_LIBRARIES)
set(MPI_LIBS "${MPI_LIBS} \"${lib}\"")
endforeach()
string(STRIP "${MPI_LIBS}" MPI_LIBS)
set(directory_list fileread hello kernel pargen torture util)
if (SERIAL_MPI)
set(directory_list ${directory_list} serial)
endif()
foreach(directory ${directory_list})
add_subdirectory("${directory}")
endforeach()

@ -0,0 +1,11 @@
include_directories("${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}/${mod_dir_tail}")
add_executable(psb_cf_sample psb_cf_sample.f90 getp.f90)
add_executable(psb_df_sample psb_df_sample.f90 getp.f90)
add_executable(psb_sf_sample psb_sf_sample.f90 getp.f90)
add_executable(psb_zf_sample psb_zf_sample.f90 getp.f90)
target_link_libraries(psb_cf_sample krylov util base)
target_link_libraries(psb_df_sample krylov util base)
target_link_libraries(psb_sf_sample krylov util base)
target_link_libraries(psb_zf_sample krylov util base)

@ -0,0 +1,7 @@
include_directories("${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}/${mod_dir_tail}")
add_executable(hello hello.f90)
add_executable(pingpong pingpong.f90)
target_link_libraries(hello base)
target_link_libraries(pingpong base)

@ -0,0 +1,9 @@
include_directories("${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}/${mod_dir_tail}")
add_executable(d_file_spmv d_file_spmv.f90)
add_executable(pdgenspmv pdgenspmv.f90)
add_executable(s_file_spmv s_file_spmv.f90)
target_link_libraries(d_file_spmv util)
target_link_libraries(pdgenspmv util)
target_link_libraries(s_file_spmv util)

@ -0,0 +1,11 @@
include_directories("${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}/${mod_dir_tail}")
add_executable(psb_d_pde2d psb_d_pde2d.f90)
add_executable(psb_d_pde3d psb_d_pde3d.f90)
add_executable(psb_s_pde2d psb_s_pde2d.f90)
add_executable(psb_s_pde3d psb_s_pde3d.f90)
target_link_libraries(psb_d_pde2d krylov util)
target_link_libraries(psb_d_pde3d krylov util)
target_link_libraries(psb_s_pde2d krylov util)
target_link_libraries(psb_s_pde3d krylov util)

@ -0,0 +1,8 @@
include_directories("${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}/${mod_dir_tail}")
add_executable( d_matgen
psb_d_xyz_impl.f90
psb_d_xyz_mat_mod.f90
d_matgen.F90 # Main program
)
target_link_libraries(d_matgen base)

@ -0,0 +1,11 @@
include_directories("${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}/${mod_dir_tail}")
add_executable(fortran_interface_test
psb_c_mvsv_tester.f90
psb_d_mvsv_tester.f90
psb_mvsv_tester.f90
psb_s_mvsv_tester.f90
psbtf.f90 # Main program
psb_z_mvsv_tester.f90
)
target_link_libraries(fortran_interface_test base)

@ -0,0 +1,11 @@
include_directories("${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}/${mod_dir_tail}")
add_executable(dhb2mm dhb2mm.f90)
add_executable(dmm2hb dmm2hb.f90)
add_executable(zhb2mm zhb2mm.f90)
add_executable(zmm2hb zmm2hb.f90)
target_link_libraries(dhb2mm util)
target_link_libraries(dmm2hb util)
target_link_libraries(zhb2mm util)
target_link_libraries(zmm2hb util)
Loading…
Cancel
Save