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

Replace #define complex by optional typedef #148

Merged
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
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ option(enable_doc "Add target 'doc' to build Doxygen documentation" OFF)
option(enable_examples "Build examples" ON)
option(enable_fortran "Build Fortran interface" ${enable_fortran_xSDK})
option(enable_tests "Build tests" ON)
option(enable_compatibility_complex "Provide typdef 'complex' for compatibility with older SuperLU version" OFF)

include(CTest)
include(GNUInstallDirs)
Expand Down Expand Up @@ -100,6 +101,11 @@ endif()
set(SUPERLU_VERSION "${PROJECT_VERSION}")
set(SUPERLU_REV "${PROJECT_REV}")

if(enable_compatibility_complex)
add_compile_definitions(SUPERLU_TYPEDEF_COMPLEX)
endif()


#-- BLAS
option(TPL_ENABLE_INTERNAL_BLASLIB "Build the CBLAS library" ${enable_internal_blaslib})
option(TPL_BLAS_LIBRARIES "List of absolute paths to blas libraries [].")
Expand Down
6 changes: 5 additions & 1 deletion SRC/slu_scomplex.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ at the top-level directory.

typedef struct { float r, i; } singlecomplex;

#define complex singlecomplex // backward compatibility
#if defined(SUPERLU_TYPEDEF_COMPLEX) || DOXYGEN
//! \brief backward compatibility with older versions of SuperLU
//! Add -D enable_compatibility_complex=ON to your CMake call
typedef singlecomplex complex;
#endif

/* Macro definitions */

Expand Down
Loading