Commit b7edc32f authored by Kirill Terekhov's avatar Kirill Terekhov

CMake installation scripts

Tested automatic inmost with parmetis+zoltan+trilinos libraries linkage
with external CMake project through find_package(inmost). Removed
external dependency on io.hpp. Removed unnecessary link_directories
calls from scripts in examples.
parent 3ba8f44a
......@@ -185,6 +185,7 @@ if(USE_AUTODIFF_OPENCL)
if(OPENCL_FOUND)
set(USE_AUTODIFF_OPENCL ON)
include_directories(${OPENCL_INCLUDE_DIRS})
link_directories(${PETSC_LIBRARY_DIRS})
else()
set(USE_AUTODIFF_OPENCL OFF)
message("OpenCL not found")
......@@ -243,7 +244,7 @@ export(TARGETS inmost FILE inmost-targets.cmake)
export(PACKAGE inmost)
set(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}")
configure_file(inmost-config.cmake.in "${PROJECT_BINARY_DIR}/inmost-config.cmake" @ONLY)
set(CONF_INCLUDE_DIRS "\${INMOST_DIR}/include")
set(CONF_INCLUDE_DIRS "\${inmost_DIR}/include")
configure_file(inmost-config.cmake.in "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/inmost-config.cmake" @ONLY)
configure_file(inmost-config-version.cmake.in "${PROJECT_BINARY_DIR}/inmost-config-version.cmake" @ONLY)
......@@ -270,4 +271,4 @@ install(TARGETS inmost EXPORT inmost-targets
PUBLIC_HEADER DESTINATION include)
install(EXPORT inmost-targets DESTINATION "lib/CMake")
install(EXPORT inmost-targets DESTINATION ".")
......@@ -28,8 +28,6 @@ if(OPENGL_FOUND)
endif()
if(USE_SOLVER_TRILINOS)
message("linking DrawMatrix with Trilinos")
link_directories(${Trilinos_LIBRARY_DIRS})
link_directories(${Trilinos_TPL_LIBRARY_DIRS})
target_link_libraries(DrawMatrix ${Trilinos_LIBRARIES} ${Trilinos_TPL_LIBRARIES})
endif()
endif()
......
......@@ -12,13 +12,10 @@ if(USE_SOLVER)
endif()
if(USE_SOLVER_PETSC)
message("linking FVDiscr with PETSc")
link_directories(${PETSC_LIBRARY_DIRS})
target_link_libraries(FVDiscr ${PETSC_LIBRARIES})
endif()
if(USE_SOLVER_TRILINOS)
message("linking FVDiscr with Trilinos")
link_directories(${Trilinos_LIBRARY_DIRS})
link_directories(${Trilinos_TPL_LIBRARY_DIRS})
target_link_libraries(FVDiscr ${Trilinos_LIBRARIES} ${Trilinos_TPL_LIBRARIES})
endif()
endif()
......
......@@ -20,13 +20,10 @@ if(USE_SOLVER)
endif()
if(USE_SOLVER_PETSC)
message("linking MatSolve with PETSc")
link_directories(${PETSC_LIBRARY_DIRS})
target_link_libraries(MatSolve ${PETSC_LIBRARIES})
endif()
if(USE_SOLVER_TRILINOS)
message("linking MatSolve with Trilinos")
link_directories(${Trilinos_LIBRARY_DIRS})
link_directories(${Trilinos_TPL_LIBRARY_DIRS})
target_link_libraries(MatSolve ${Trilinos_LIBRARIES} ${Trilinos_TPL_LIBRARIES})
endif()
endif()
......
......@@ -11,13 +11,10 @@ if(USE_SOLVER_ANI)
endif()
if(USE_SOLVER_PETSC)
message("linking Solver with PETSc")
link_directories(${PETSC_LIBRARY_DIRS})
target_link_libraries(Solver ${PETSC_LIBRARIES})
endif()
if(USE_SOLVER_TRILINOS)
message("linking Solver with Trilinos")
link_directories(${Trilinos_LIBRARY_DIRS})
link_directories(${Trilinos_TPL_LIBRARY_DIRS})
target_link_libraries(Solver ${Trilinos_LIBRARIES} ${Trilinos_TPL_LIBRARIES})
endif()
if(USE_PARTITIONER)
......
......@@ -6,22 +6,22 @@
# INMOST_COMPILE_FLAGS - flags to set to compiler (generally inherited from MPI)
# Compute paths
get_filename_component(INMOST_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(inmost_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(INMOST_INCLUDE_DIRS "@CONF_INCLUDE_DIRS@")
if(NOT TARGET inmost AND NOT INMOST_BINARY_DIR)
include("${INMOST_DIR}/inmost-targets.cmake")
include("${inmost_DIR}/inmost-targets.cmake")
endif()
set(INMOST_LIBRARY_DIRS "${INMOST_DIR}/lib")
set(INMOST_LIBRARY_DIRS "${inmost_DIR}/lib")
set(INMOST_LIBRARIES inmost)
set(USE_MPI,@USE_MPI@)
set(USE_PARTITIONER_ZOLTAN,@USE_PARTITIONER_ZOLTAN@)
set(USE_PARTITIONER_PARMETIS,@USE_PARTITIONER_PARMETIS@)
set(USE_SOLVER_TRILINOS,@USE_SOLVER_TRILINOS@)
set(USE_SOLVER_PETSC,@USE_SOLVER_PETSC@)
set(USE_MPI @USE_MPI@)
set(USE_PARTITIONER_ZOLTAN @USE_PARTITIONER_ZOLTAN@)
set(USE_PARTITIONER_PARMETIS @USE_PARTITIONER_PARMETIS@)
set(USE_SOLVER_TRILINOS @USE_SOLVER_TRILINOS@)
set(USE_SOLVER_PETSC @USE_SOLVER_PETSC@)
if( USE_MPI )
list(APPEND INMOST_INCLUDE_DIRS "@MPI_INCLUDE_PATH@")
......
......@@ -212,7 +212,7 @@ namespace INMOST
}
#include "container.hpp"
#include "io.hpp"
//#include "io.hpp"
#endif //INMOST_COMMON_INCLUDED
......@@ -2529,9 +2529,6 @@ namespace INMOST
};
private:
std::vector< std::pair<std::string, std::string> > file_options;
//implemented in io.hpp
io_converter<INMOST_DATA_INTEGER_TYPE,INMOST_DATA_REAL_TYPE> iconv;
io_converter<INMOST_DATA_ENUM_TYPE ,INMOST_DATA_REAL_TYPE> uconv;
public:
/// Current availible file options:
/// "VTK_GRID_DIMS" - set "2" for two-dimensional vtk grids, "3" for three-dimensional vtk grids
......
......@@ -9,7 +9,7 @@
#include <sstream>
#include <stdlib.h>
#include <stdio.h>
#include "io.hpp"
//vtk states
......@@ -2867,6 +2867,8 @@ read_elem_num_link:
}
else if(LFile.find(".pmf") != std::string::npos) //this is inner parallel/platform mesh format
{
io_converter<INMOST_DATA_INTEGER_TYPE,INMOST_DATA_REAL_TYPE> iconv;
io_converter<INMOST_DATA_ENUM_TYPE ,INMOST_DATA_REAL_TYPE> uconv;
REPORT_STR("start load pmf");
dynarray<INMOST_DATA_ENUM_TYPE,128> myprocs;
std::stringstream in(std::ios::in | std::ios::out | std::ios::binary);
......@@ -4211,6 +4213,8 @@ safe_output:
}
else if(LFile.find(".pmf") != std::string::npos) //this is inner parallel/platform mesh format
{
io_converter<INMOST_DATA_INTEGER_TYPE,INMOST_DATA_REAL_TYPE> iconv;
io_converter<INMOST_DATA_ENUM_TYPE ,INMOST_DATA_REAL_TYPE> uconv;
INMOST_DATA_ENUM_TYPE nlow,nhigh, lid;
char wetype;
//~ if( m_state == Mesh::Serial ) SetCommunicator(INMOST_MPI_COMM_WORLD);
......
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