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

error if using Enzyme with gcc/g++ #1883

Merged
merged 4 commits into from
May 15, 2024
Merged
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
20 changes: 20 additions & 0 deletions enzyme/cmake/EnzymeConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# - Config file for the Enzyme package

get_property(languages GLOBAL PROPERTY ENABLED_LANGUAGES)

if("C" IN_LIST languages)
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
message("project languages: ${languages}")
message(WARNING "C compiler ID equals ${CMAKE_C_COMPILER_ID}\n"
"C compiler: ${CMAKE_C_COMPILER}\n"
"Using Enzyme without an LLVM based C compiler.")
endif()
endif()

if("CXX" IN_LIST languages)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
message("project languages: ${languages}")
message(WARNING "C++ compiler equals ${CMAKE_CXX_COMPILER_ID}\n"
"C++ compiler: ${CMAKE_CXX_COMPILER}\n"
"Using Enzyme without an LLVM based C++ compiler.")
endif()
endif()

# Compute paths
get_filename_component(Enzyme_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(Enzyme_LLVM_VERSION_MAJOR "@CONF_LLVM_VERSION_MAJOR@")
Expand Down
20 changes: 20 additions & 0 deletions enzyme/cmake/EnzymeConfigVersion.cmake.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
set(PACKAGE_VERSION "@ENZYME_VERSION@")

get_property(languages GLOBAL PROPERTY ENABLED_LANGUAGES)

if("C" IN_LIST languages)
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
message("project languages: ${languages}")
message(WARNING "C compiler ID equals ${CMAKE_C_COMPILER_ID}\n"
"C compiler: ${CMAKE_C_COMPILER}\n"
"Using Enzyme without an LLVM based C compiler.")
endif()
endif()

if("CXX" IN_LIST languages)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
message("project languages: ${languages}")
message(WARNING "C++ compiler equals ${CMAKE_CXX_COMPILER_ID}\n"
"C++ compiler: ${CMAKE_CXX_COMPILER}\n"
"Using Enzyme without an LLVM based C++ compiler.")
endif()
endif()

# Check whether the requested PACKAGE_FIND_VERSION is compatible
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
set(PACKAGE_VERSION_COMPATIBLE FALSE)
Expand Down
Loading