Skip to content

Commit

Permalink
update 1d-heat-equation mpi
Browse files Browse the repository at this point in the history
  • Loading branch information
eric2003 committed Nov 13, 2024
1 parent 544cec1 commit d390e6d
Show file tree
Hide file tree
Showing 1,096 changed files with 173,940 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
cmake_minimum_required(VERSION 3.30)

project( testprj )

set ( PRJ_COMPILE_FEATURES )
set ( PRJ_COMPILE_DEFINITIONS )
set ( PRJ_LIBRARIES )
set ( PRJ_INCLUDE_DIRS )

list ( APPEND PRJ_COMPILE_FEATURES cxx_std_23 )

find_package ( MPI )

message ( STATUS "MPI_FOUND=${MPI_FOUND}" )
message ( STATUS "MPI_CXX_INCLUDE_DIRS=${MPI_CXX_INCLUDE_DIRS}" )
message ( STATUS "MPI_LIBRARIES=${MPI_LIBRARIES}" )
if ( MPI_FOUND )
list ( APPEND PRJ_INCLUDE_DIRS ${MPI_CXX_INCLUDE_DIRS} )
list ( APPEND PRJ_LIBRARIES ${MPI_LIBRARIES} )
endif ()

#get_directory_property( my_import_targets DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} IMPORTED_TARGETS )
#message( STATUS "my_import_targets=${my_import_targets}" )

list ( APPEND PRJ_LIBRARIES MPI::MPI_C )

find_package(Eigen3 CONFIG REQUIRED)

message ( STATUS "EIGEN3_INCLUDE_DIR = ${EIGEN3_INCLUDE_DIR}" )

#list ( APPEND PRJ_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR} )
list ( APPEND PRJ_LIBRARIES Eigen3::Eigen )
set ( CGNS_INCLUDE_DIRS $ENV{CGNS_INC} )
set ( CGNS_LIBRARIES $ENV{CGNS_LIB_SHARED_NAME} )

if ( ${CMAKE_SYSTEM_NAME} MATCHES "Windows" )
set ( CGNS_ROOT "C:/dev/cgns/4.4.0" )
set ( CGNS_LIBNAME "cgnsdll.lib" )

set ( CGNS_INCLUDE_DIRS "${CGNS_ROOT}/include" CACHE PATH "path to CGNS headers" )
set ( CGNS_LIBRARIES "${CGNS_ROOT}/lib/${CGNS_LIBNAME}" CACHE PATH "path to CGNS library" )
endif()

list ( APPEND PRJ_LIBRARIES ${CGNS_LIBRARIES} )
list ( APPEND PRJ_INCLUDE_DIRS ${CGNS_INCLUDE_DIRS} )

if ( WIN32 )
list ( APPEND PRJ_COMPILE_DEFINITIONS USE_DLL )
endif ()

list ( APPEND PRJ_COMPILE_DEFINITIONS HX_PARALLEL )

message( STATUS "PRJ_INCLUDE_DIRS = ${PRJ_INCLUDE_DIRS}")

if ( MSVC )
set_property( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ${PROJECT_NAME} )
endif()

add_executable( ${PROJECT_NAME}
)

set( PROJECT_SOURCES
main.cpp
global.h global.cpp
CgnsGrid.h CgnsGrid.cpp
Field.h Field.cpp
LogFile.h LogFile.cpp
Parallel.h Parallel.cpp
Solver.h Solver.cpp
ZoneState.h ZoneState.cpp
)

message( STATUS "PROJECT_NAME = ${PROJECT_NAME}")
message( STATUS "PROJECT_SOURCES = ${PROJECT_SOURCES}")

target_sources( ${PROJECT_NAME}
PRIVATE
${PROJECT_SOURCES}
)

target_include_directories ( ${PROJECT_NAME}
PRIVATE
${PRJ_INCLUDE_DIRS}
)

target_link_libraries( ${PROJECT_NAME}
PRIVATE
${PRJ_LIBRARIES}
)

target_compile_features ( ${PROJECT_NAME}
PRIVATE
${PRJ_COMPILE_FEATURES}
)

target_compile_definitions ( ${PROJECT_NAME}
PRIVATE
${PRJ_COMPILE_DEFINITIONS}
)
Loading

0 comments on commit d390e6d

Please sign in to comment.