Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/windows ninja #300

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cmake/SUNDIALSConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ endforeach()

### ------- Create TPL imported targets

if("@ENABLE_MPI@" AND NOT TARGET MPI::MPI_C)
find_dependency(MPI)
endif()

if("@ENABLE_OPENMP@" AND NOT TARGET OpenMP::OpenMP_C)
find_dependency(OpenMP)
endif()
Expand Down
22 changes: 14 additions & 8 deletions cmake/macros/SundialsAddLibrary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -311,15 +311,21 @@ macro(sundials_add_library target)

# set the correct output name
if(sundials_add_library_OUTPUT_NAME)
set_target_properties(${_actual_target_name} PROPERTIES
OUTPUT_NAME ${sundials_add_library_OUTPUT_NAME}
CLEAN_DIRECT_OUTPUT 1
)
set(tgt_output_name ${sundials_add_library_OUTPUT_NAME})
else()
set_target_properties(${_actual_target_name} PROPERTIES
OUTPUT_NAME ${target}
CLEAN_DIRECT_OUTPUT 1
)
set(tgt_output_name ${target})
endif()

if(${_libtype} MATCHES "STATIC")
set_target_properties(${_actual_target_name} PROPERTIES
OUTPUT_NAME ${tgt_output_name}${_STATIC_LIB_SUFFIX}
CLEAN_DIRECT_OUTPUT 1
)
else()
set_target_properties(${_actual_target_name} PROPERTIES
OUTPUT_NAME ${tgt_output_name}
CLEAN_DIRECT_OUTPUT 1
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes the installed static library name to have the _static suffix e.g., libsundials_cvode_static.a rather than libsundials_cvode.a and could break user builds.

endif()

# set the library versions
Expand Down
10 changes: 2 additions & 8 deletions src/nvector/manyvector/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,6 @@ endif()
if(BUILD_NVECTOR_MPIMANYVECTOR)
install(CODE "MESSAGE(\"\nInstall NVECTOR_MPIMANYVECTOR\n\")")

if(MPI_C_COMPILER)
# use MPI wrapper as the compiler
set(CMAKE_C_COMPILER ${MPI_C_COMPILER})
else()
# add MPI_INCLUDE_PATH to include directories
include_directories(${MPI_INCLUDE_PATH})
endif()

# Create the sundials_nvecmpimanyvector library
sundials_add_library(sundials_nvecmpimanyvector
SOURCES
Expand All @@ -59,6 +51,8 @@ if(BUILD_NVECTOR_MPIMANYVECTOR)
${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_mpimanyvector.h
INCLUDE_SUBDIR
nvector
LINK_LIBRARIES
PUBLIC MPI::MPI_C
OBJECT_LIBRARIES
sundials_generic_obj
COMPILE_DEFINITIONS
Expand Down
10 changes: 2 additions & 8 deletions src/nvector/mpiplusx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@

install(CODE "MESSAGE(\"\nInstall NVECTOR_MPIPLUSX\n\")")

if(MPI_C_FOUND AND MPI_C_COMPILER)
# use MPI wrapper as the compiler
set(CMAKE_C_COMPILER ${MPI_C_COMPILER})
elseif(MPI_C_FOUND)
# add MPI_INCLUDE_PATH to include directories
include_directories(${MPI_INCLUDE_PATH})
endif()

# Create the library
sundials_add_library(sundials_nvecmpiplusx
SOURCES
Expand All @@ -32,6 +24,8 @@ sundials_add_library(sundials_nvecmpiplusx
${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_mpiplusx.h
INCLUDE_SUBDIR
nvector
LINK_LIBRARIES
PUBLIC MPI::MPI_C
OBJECT_LIBRARIES
sundials_generic_obj
sundials_nvecmpimanyvector_obj
Expand Down
2 changes: 2 additions & 0 deletions src/nvector/parallel/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ sundials_add_library(sundials_nvecparallel
${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_parallel.h
INCLUDE_SUBDIR
nvector
LINK_LIBRARIES
PUBLIC MPI::MPI_C
OBJECT_LIBRARIES
sundials_generic_obj
OUTPUT_NAME
Expand Down