Permalink
Browse files

Replace calls to deprecated LAPACK subroutines (#1314)

* Wrap call deprecated DGEGS to call DGGES

* Wrap deprecated DTZRQF to call DTZRZF

* Wrap deprecated DGEGV to call DGGEV

* Wrap deprecated DGELSX to call DGELSY

* Wrap deprecated DGEQPF to call DGEQP3

* Add C wrappers for DGGSVD3 and DGGSVP3

* Add Doxygen docstrings for DGGSVD3 and DGGSVP3

* Wrap deprecated DGGSDV to call DGGSVD3

* Wrap deprecated DGGSVP to call DGGSVP3

* Add PSI_DEPRECATED macro

This macro can be used to deprecated functions
and variables and alert the user at compile-time.

* Check for availability of DGGSV{D,P}3

* Always use DGGSV{D,P}3 on Windows
  • Loading branch information...
robertodr authored and andysim committed Nov 3, 2018
1 parent 8e5d7bf commit 69cdc873bbba6fce3a9cd45a4f8459e315d6c770
View
@@ -155,4 +155,24 @@
#define PSI_API PSI_HELPER_SO_EXPORT
#define PSI_LOCAL PSI_HELPER_SO_LOCAL
// Use in the header file as follows:
// PSI_DEPRECATED("extremely unsafe, use 'combust' instead!!!") void explode(void);
// will produce this kind output when compiling:
// warning: 'explode' is deprecated: extremely unsafe, use 'combust' instead!!!
// The macro can similarly be used to deprecate variables.
// The implementation uses the standard attribute if C++14 available, falling back
// to compiler extensions if C++11 is used.
#if __cplusplus >= 201402L
#define PSI_DEPRECATED(msg) [[deprecated(msg)]]
#else
#if defined(__GNUC__) || defined(__clang__)
#define PSI_DEPRECATED(msg) __attribute__((deprecated(msg)))
#elif defined(_MSC_VER)
#define PSI_DEPRECATED(msg) __declspec(deprecated(msg))
#else
#pragma message("WARNING: You need to implement PSI_DEPRECATED for this compiler")
#define PSI_DEPRECATED
#endif
#endif
#endif
@@ -23,4 +23,25 @@ set(sources_list lapack_intfc.cc
david.cc
)
add_definitions("-DFC_SYMBOL=${FC_SYMBOL}")
if(WIN32)
set(_has_dggsvd3 TRUE)
set(_has_dggsvp3 TRUE)
else()
include(CheckFortranFunctionExists)
set(CMAKE_REQUIRED_LIBRARIES tgt::lapack)
# Check whether DGGSVD3 is available
check_fortran_function_exists(DGGSVD3 _has_dggsvd3)
# Check whether DGGSVP3 is available
check_fortran_function_exists(DGGSVP3 _has_dggsvp3)
unset(CMAKE_REQUIRED_LIBRARIES)
endif()
psi4_add_module(lib qt sources_list psio ciomr mints)
target_compile_definitions(qt
PRIVATE
$<$<BOOL:${_has_dggsvd3}>:LAPACK_HAS_DGGSVD3>
$<$<BOOL:${_has_dggsvp3}>:LAPACK_HAS_DGGSVP3>
)
unset(_has_dggsvd3)
unset(_has_dggsvp3)
Oops, something went wrong.

0 comments on commit 69cdc87

Please sign in to comment.