From a5bd70e9129f6718fd89d45b6cc61608d9e67159 Mon Sep 17 00:00:00 2001 From: Seth R Johnson Date: Thu, 10 Feb 2022 21:46:09 -0500 Subject: [PATCH 1/3] Update documentation --- doc/install.rst | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/doc/install.rst b/doc/install.rst index 5cfa4f53..d942dd03 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -21,6 +21,21 @@ ability to rebuild ForTrilinos wrappers. (Note that SWIG is always optional; the version here simply denotes the version used to generate the included wrappers.) +The version scheme is based on semantic versioning: +- Major version numbers with Trilinos and minor versions of SWIG-Fortran (since + it's still not officially upstreamed) can result in major version number + changes for ForTrilinos. + +- New features in Trilinos, and new support by ForTrilinos, can result in minor + version number changes. Features removed by a minor version change in + Trilinos may also result in a minor version change. + +- Minor changes to the SWIG-Fortran implementation (which don't affect the + interface in the .F90 files) result in a patch version. + +Essentially, the versioning will be driven by what the Fortran-only users see +in the committed version of the generated wrappers. + .. _version_table: .. table:: Version compatibility table for ForTrilinos. @@ -28,7 +43,7 @@ wrappers.) =========== ============== ====================== ForTrilinos Trilinos SWIG =========== ============== ====================== - 2.0.1 13.0:13.1 4.1.0+fortran + 2.0.1 13.0:13.1 4.1.0-dev1+fortran 2.0.0 13.0:13.1 4.0.2+fortran 2.0.0-dev3 12.18.1 4.0.2+fortran 2.0.0-dev2 12.18.1 4.0.0+fortran+15e6ed59 @@ -40,30 +55,29 @@ In :ref:`the version table above `, the ``+fortran`` suffix for SWIG indicates `the SWIG-Fortran fork `. ``+sha`` refers to a specific Git commit that comes after the given version. -The versioning scheme is based on `SemVer 2.0`_: - -- Major version numbers with Trilinos and minor versions of SWIG-Fortran can - result in major version number changes for ForTrilinos. -- New features in Trilinos, and new support by ForTrilinos, can result in minor - version number changes. -- Minor changes to the SWIG-Fortran implementation (which don't affect the - interface in the .F90 files) result in a patch version. - Basically, the versioning will be driven by what the Fortran-only users see in the committed version of the generated wrappers. The original implementation of the ForTrilinos was developed prior to 2012. That code is no longer developed and maintained, and is available using the -``trilinos-release-12-8-1`` tag and the corresponding Trilinos 12.8.1 version. +``trilinos-release-12-8-1`` tag in the ForTrilinos repository and the +corresponding Trilinos 12.8.1 version. + +E4S +--- + +As of this writing, ForTrilinos is distributed as part of the `E4S Project +` and should be available as a +pre-built binary on a variety of user and HPC systems. Spack ----- -To install ForTrilinos version ``2.0.0`` through an existing Spack -installation (v0.16 or higher, or the ``develop`` branch): +To install ForTrilinos version ``2.0.1`` through an existing Spack +installation (v0.18 or higher, or the ``develop`` branch): .. code:: console - $ spack install fortrilinos@2.0.0 ^trilinos+nox+stratimikos + $ spack install fortrilinos Manual ------ From 8dace43e3cd0506c0d965d22111800d412bc6c61 Mon Sep 17 00:00:00 2001 From: Seth R Johnson Date: Fri, 3 Jun 2022 15:33:02 -0400 Subject: [PATCH 2/3] Update spack variants --- scripts/spack.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/spack.yaml b/scripts/spack.yaml index 277505fe..2ae3184c 100644 --- a/scripts/spack.yaml +++ b/scripts/spack.yaml @@ -4,10 +4,11 @@ spack: - ninja - openmpi - swig@4.1.0-fortran - - trilinos +amesos2 +anasazi +belos +teuchos +kokkos +ifpack2 +muelu +nox +tpetra + - trilinos@13.0.0:13.1 +amesos2 +anasazi +belos +kokkos +ifpack2 +muelu +nox +tpetra +stratimikos +mpi gotype=long_long view: true - concretization: together + concretizer: + unify: true packages: trilinos: variants: ~adios2 ~alloptpkgs ~boost ~cgns ~chaco ~complex ~debug ~dtk ~exodus From 37af6553d65adb5094b9359cac1804f040b61e77 Mon Sep 17 00:00:00 2001 From: Seth R Johnson Date: Fri, 5 Aug 2022 13:14:02 -0400 Subject: [PATCH 3/3] Regenerate with swig 4.1.0 --- .../generated/forbelosFORTRAN_wrap.cxx | 65 +++++++++------- .../generated/forerrorFORTRAN_wrap.cxx | 67 +++++++++------- .../generated/forteuchosFORTRAN_wrap.cxx | 73 ++++++++++-------- .../generated/fortpetraFORTRAN_wrap.cxx | 77 +++++++++++-------- .../generated/fortrilinos_hlFORTRAN_wrap.cxx | 65 +++++++++------- 5 files changed, 206 insertions(+), 141 deletions(-) diff --git a/src/forbelos/generated/forbelosFORTRAN_wrap.cxx b/src/forbelos/generated/forbelosFORTRAN_wrap.cxx index e475ae7b..f78f9264 100644 --- a/src/forbelos/generated/forbelosFORTRAN_wrap.cxx +++ b/src/forbelos/generated/forbelosFORTRAN_wrap.cxx @@ -21,30 +21,6 @@ #define SWIGFORTRAN #endif - -#ifdef __cplusplus -/* SwigValueWrapper is described in swig.swg */ -template class SwigValueWrapper { - struct SwigMovePointer { - T *ptr; - SwigMovePointer(T *p) : ptr(p) { } - ~SwigMovePointer() { delete ptr; } - SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } - } pointer; - SwigValueWrapper& operator=(const SwigValueWrapper& rhs); - SwigValueWrapper(const SwigValueWrapper& rhs); -public: - SwigValueWrapper() : pointer(0) { } - SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } - operator T&() const { return *pointer.ptr; } - T *operator&() { return pointer.ptr; } -}; - -template T SwigValueInit() { - return T(); -} -#endif - /* ----------------------------------------------------------------------------- * This section contains generic SWIG labels for method/variable * declarations/attributes, and other compiler dependent labels. @@ -170,6 +146,44 @@ template T SwigValueInit() { #endif +#ifdef __cplusplus +#include +/* SwigValueWrapper is described in swig.swg */ +template class SwigValueWrapper { + struct SwigSmartPointer { + T *ptr; + SwigSmartPointer(T *p) : ptr(p) { } + ~SwigSmartPointer() { delete ptr; } + SwigSmartPointer& operator=(SwigSmartPointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } + } pointer; + SwigValueWrapper& operator=(const SwigValueWrapper& rhs); + SwigValueWrapper(const SwigValueWrapper& rhs); +public: + SwigValueWrapper() : pointer(0) { } + SwigValueWrapper& operator=(const T& t) { SwigSmartPointer tmp(new T(t)); pointer = tmp; return *this; } +#if __cplusplus >=201103L + SwigValueWrapper& operator=(T&& t) { SwigSmartPointer tmp(new T(std::move(t))); pointer = tmp; return *this; } + operator T&&() const { return std::move(*pointer.ptr); } +#else + operator T&() const { return *pointer.ptr; } +#endif + T *operator&() const { return pointer.ptr; } +}; + +template T SwigValueInit() { + return T(); +} + + +#if __cplusplus >=201103L +# define SWIG_STD_MOVE(OBJ) std::move(OBJ) +#else +# define SWIG_STD_MOVE(OBJ) OBJ +#endif + +#endif + + #ifndef SWIGEXTERN # ifdef __cplusplus # define SWIGEXTERN extern @@ -197,7 +211,7 @@ SWIGEXPORT void SWIG_store_exception(const char* decl, int errcode, const char * #define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ SWIG_store_exception(DECL, CODE, MSG); RETURNNULL; -/* Errors in SWIG */ +/* SWIG Errors applicable to all language modules, values are reserved from -1 to -99 */ #define SWIG_UnknownError -1 #define SWIG_IOError -2 #define SWIG_RuntimeError -3 @@ -214,7 +228,6 @@ SWIGEXPORT void SWIG_store_exception(const char* decl, int errcode, const char * - enum SwigMemFlags { SWIG_MEM_OWN = 0x01, SWIG_MEM_RVALUE = 0x02, diff --git a/src/forerror/generated/forerrorFORTRAN_wrap.cxx b/src/forerror/generated/forerrorFORTRAN_wrap.cxx index 86b5e8ca..f2353be4 100644 --- a/src/forerror/generated/forerrorFORTRAN_wrap.cxx +++ b/src/forerror/generated/forerrorFORTRAN_wrap.cxx @@ -21,30 +21,6 @@ #define SWIGFORTRAN #endif - -#ifdef __cplusplus -/* SwigValueWrapper is described in swig.swg */ -template class SwigValueWrapper { - struct SwigMovePointer { - T *ptr; - SwigMovePointer(T *p) : ptr(p) { } - ~SwigMovePointer() { delete ptr; } - SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } - } pointer; - SwigValueWrapper& operator=(const SwigValueWrapper& rhs); - SwigValueWrapper(const SwigValueWrapper& rhs); -public: - SwigValueWrapper() : pointer(0) { } - SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } - operator T&() const { return *pointer.ptr; } - T *operator&() { return pointer.ptr; } -}; - -template T SwigValueInit() { - return T(); -} -#endif - /* ----------------------------------------------------------------------------- * This section contains generic SWIG labels for method/variable * declarations/attributes, and other compiler dependent labels. @@ -170,6 +146,44 @@ template T SwigValueInit() { #endif +#ifdef __cplusplus +#include +/* SwigValueWrapper is described in swig.swg */ +template class SwigValueWrapper { + struct SwigSmartPointer { + T *ptr; + SwigSmartPointer(T *p) : ptr(p) { } + ~SwigSmartPointer() { delete ptr; } + SwigSmartPointer& operator=(SwigSmartPointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } + } pointer; + SwigValueWrapper& operator=(const SwigValueWrapper& rhs); + SwigValueWrapper(const SwigValueWrapper& rhs); +public: + SwigValueWrapper() : pointer(0) { } + SwigValueWrapper& operator=(const T& t) { SwigSmartPointer tmp(new T(t)); pointer = tmp; return *this; } +#if __cplusplus >=201103L + SwigValueWrapper& operator=(T&& t) { SwigSmartPointer tmp(new T(std::move(t))); pointer = tmp; return *this; } + operator T&&() const { return std::move(*pointer.ptr); } +#else + operator T&() const { return *pointer.ptr; } +#endif + T *operator&() const { return pointer.ptr; } +}; + +template T SwigValueInit() { + return T(); +} + + +#if __cplusplus >=201103L +# define SWIG_STD_MOVE(OBJ) std::move(OBJ) +#else +# define SWIG_STD_MOVE(OBJ) OBJ +#endif + +#endif + + #ifndef SWIGEXTERN # ifdef __cplusplus # define SWIGEXTERN extern @@ -182,7 +196,7 @@ template T SwigValueInit() { #define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ { throw std::logic_error("In " DECL ": " MSG); } -/* Errors in SWIG */ +/* SWIG Errors applicable to all language modules, values are reserved from -1 to -99 */ #define SWIG_UnknownError -1 #define SWIG_IOError -2 #define SWIG_RuntimeError -3 @@ -199,7 +213,6 @@ template T SwigValueInit() { - #ifdef __cplusplus extern "C" { #endif @@ -289,7 +302,7 @@ SWIGEXPORT const char* fortrilinos_get_serr() { extern "C" { - +#include // Call this function before any new action SWIGEXPORT void SWIG_check_unhandled_exception_impl(const char* decl) { diff --git a/src/forteuchos/generated/forteuchosFORTRAN_wrap.cxx b/src/forteuchos/generated/forteuchosFORTRAN_wrap.cxx index 7eaa204a..4adc2cd4 100644 --- a/src/forteuchos/generated/forteuchosFORTRAN_wrap.cxx +++ b/src/forteuchos/generated/forteuchosFORTRAN_wrap.cxx @@ -21,30 +21,6 @@ #define SWIGFORTRAN #endif - -#ifdef __cplusplus -/* SwigValueWrapper is described in swig.swg */ -template class SwigValueWrapper { - struct SwigMovePointer { - T *ptr; - SwigMovePointer(T *p) : ptr(p) { } - ~SwigMovePointer() { delete ptr; } - SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } - } pointer; - SwigValueWrapper& operator=(const SwigValueWrapper& rhs); - SwigValueWrapper(const SwigValueWrapper& rhs); -public: - SwigValueWrapper() : pointer(0) { } - SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } - operator T&() const { return *pointer.ptr; } - T *operator&() { return pointer.ptr; } -}; - -template T SwigValueInit() { - return T(); -} -#endif - /* ----------------------------------------------------------------------------- * This section contains generic SWIG labels for method/variable * declarations/attributes, and other compiler dependent labels. @@ -170,6 +146,44 @@ template T SwigValueInit() { #endif +#ifdef __cplusplus +#include +/* SwigValueWrapper is described in swig.swg */ +template class SwigValueWrapper { + struct SwigSmartPointer { + T *ptr; + SwigSmartPointer(T *p) : ptr(p) { } + ~SwigSmartPointer() { delete ptr; } + SwigSmartPointer& operator=(SwigSmartPointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } + } pointer; + SwigValueWrapper& operator=(const SwigValueWrapper& rhs); + SwigValueWrapper(const SwigValueWrapper& rhs); +public: + SwigValueWrapper() : pointer(0) { } + SwigValueWrapper& operator=(const T& t) { SwigSmartPointer tmp(new T(t)); pointer = tmp; return *this; } +#if __cplusplus >=201103L + SwigValueWrapper& operator=(T&& t) { SwigSmartPointer tmp(new T(std::move(t))); pointer = tmp; return *this; } + operator T&&() const { return std::move(*pointer.ptr); } +#else + operator T&() const { return *pointer.ptr; } +#endif + T *operator&() const { return pointer.ptr; } +}; + +template T SwigValueInit() { + return T(); +} + + +#if __cplusplus >=201103L +# define SWIG_STD_MOVE(OBJ) std::move(OBJ) +#else +# define SWIG_STD_MOVE(OBJ) OBJ +#endif + +#endif + + #ifndef SWIGEXTERN # ifdef __cplusplus # define SWIGEXTERN extern @@ -197,7 +211,7 @@ SWIGEXPORT void SWIG_store_exception(const char* decl, int errcode, const char * #define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ SWIG_store_exception(DECL, CODE, MSG); RETURNNULL; -/* Errors in SWIG */ +/* SWIG Errors applicable to all language modules, values are reserved from -1 to -99 */ #define SWIG_UnknownError -1 #define SWIG_IOError -2 #define SWIG_RuntimeError -3 @@ -214,7 +228,6 @@ SWIGEXPORT void SWIG_store_exception(const char* decl, int errcode, const char * - enum SwigMemFlags { SWIG_MEM_OWN = 0x01, SWIG_MEM_RVALUE = 0x02, @@ -615,7 +628,7 @@ SWIGEXPORT void _wrap_TeuchosArrayInt_assign(SwigClassWrapper *farg1, SwigArrayW try { // Attempt the wrapped function call - Teuchos_Array_Sl_int_Sg__assign__SWIG(arg1,(int const *)arg2,arg3); + Teuchos_Array_Sl_int_Sg__assign__SWIG(arg1,(int const *)arg2,SWIG_STD_MOVE(arg3)); } catch (const std::range_error& e) { @@ -742,7 +755,7 @@ SWIGEXPORT void _wrap_TeuchosArrayDbl_assign(SwigClassWrapper *farg1, SwigArrayW try { // Attempt the wrapped function call - Teuchos_Array_Sl_double_Sg__assign__SWIG(arg1,(double const *)arg2,arg3); + Teuchos_Array_Sl_double_Sg__assign__SWIG(arg1,(double const *)arg2,SWIG_STD_MOVE(arg3)); } catch (const std::range_error& e) { @@ -869,7 +882,7 @@ SWIGEXPORT void _wrap_TeuchosArrayLongLong_assign(SwigClassWrapper *farg1, SwigA try { // Attempt the wrapped function call - Teuchos_Array_Sl_long_SS_long_Sg__assign__SWIG(arg1,(long long const *)arg2,arg3); + Teuchos_Array_Sl_long_SS_long_Sg__assign__SWIG(arg1,(long long const *)arg2,SWIG_STD_MOVE(arg3)); } catch (const std::range_error& e) { @@ -1064,7 +1077,7 @@ SWIGEXPORT SwigClassWrapper _wrap_new_TeuchosComm__SWIG_0(int const *farg1) { try { // Attempt the wrapped function call - result = (Teuchos::Comm< int > *)new_Teuchos_Comm_Sl_int_Sg___SWIG_0(arg1); + result = (Teuchos::Comm< int > *)new_Teuchos_Comm_Sl_int_Sg___SWIG_0(SWIG_STD_MOVE(arg1)); } catch (const std::range_error& e) { diff --git a/src/fortpetra/generated/fortpetraFORTRAN_wrap.cxx b/src/fortpetra/generated/fortpetraFORTRAN_wrap.cxx index ab3a58ff..f9c3efe4 100644 --- a/src/fortpetra/generated/fortpetraFORTRAN_wrap.cxx +++ b/src/fortpetra/generated/fortpetraFORTRAN_wrap.cxx @@ -21,30 +21,6 @@ #define SWIGFORTRAN #endif - -#ifdef __cplusplus -/* SwigValueWrapper is described in swig.swg */ -template class SwigValueWrapper { - struct SwigMovePointer { - T *ptr; - SwigMovePointer(T *p) : ptr(p) { } - ~SwigMovePointer() { delete ptr; } - SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } - } pointer; - SwigValueWrapper& operator=(const SwigValueWrapper& rhs); - SwigValueWrapper(const SwigValueWrapper& rhs); -public: - SwigValueWrapper() : pointer(0) { } - SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } - operator T&() const { return *pointer.ptr; } - T *operator&() { return pointer.ptr; } -}; - -template T SwigValueInit() { - return T(); -} -#endif - /* ----------------------------------------------------------------------------- * This section contains generic SWIG labels for method/variable * declarations/attributes, and other compiler dependent labels. @@ -170,6 +146,44 @@ template T SwigValueInit() { #endif +#ifdef __cplusplus +#include +/* SwigValueWrapper is described in swig.swg */ +template class SwigValueWrapper { + struct SwigSmartPointer { + T *ptr; + SwigSmartPointer(T *p) : ptr(p) { } + ~SwigSmartPointer() { delete ptr; } + SwigSmartPointer& operator=(SwigSmartPointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } + } pointer; + SwigValueWrapper& operator=(const SwigValueWrapper& rhs); + SwigValueWrapper(const SwigValueWrapper& rhs); +public: + SwigValueWrapper() : pointer(0) { } + SwigValueWrapper& operator=(const T& t) { SwigSmartPointer tmp(new T(t)); pointer = tmp; return *this; } +#if __cplusplus >=201103L + SwigValueWrapper& operator=(T&& t) { SwigSmartPointer tmp(new T(std::move(t))); pointer = tmp; return *this; } + operator T&&() const { return std::move(*pointer.ptr); } +#else + operator T&() const { return *pointer.ptr; } +#endif + T *operator&() const { return pointer.ptr; } +}; + +template T SwigValueInit() { + return T(); +} + + +#if __cplusplus >=201103L +# define SWIG_STD_MOVE(OBJ) std::move(OBJ) +#else +# define SWIG_STD_MOVE(OBJ) OBJ +#endif + +#endif + + #ifndef SWIGEXTERN # ifdef __cplusplus # define SWIGEXTERN extern @@ -197,7 +211,7 @@ SWIGEXPORT void SWIG_store_exception(const char* decl, int errcode, const char * #define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ SWIG_store_exception(DECL, CODE, MSG); RETURNNULL; -/* Errors in SWIG */ +/* SWIG Errors applicable to all language modules, values are reserved from -1 to -99 */ #define SWIG_UnknownError -1 #define SWIG_IOError -2 #define SWIG_RuntimeError -3 @@ -214,7 +228,6 @@ SWIGEXPORT void SWIG_store_exception(const char* decl, int errcode, const char * - enum SwigMemFlags { SWIG_MEM_OWN = 0x01, SWIG_MEM_RVALUE = 0x02, @@ -8884,7 +8897,7 @@ SWIGEXPORT void _wrap_TpetraCrsGraph_getNodeRowPtrs(SwigClassWrapper *farg1, Swi try { // Attempt the wrapped function call - Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg__getNodeRowPtrs__SWIG((Tpetra::CrsGraph< int,long long,ForTrilinos::DefaultNodeType > const *)arg1,arg2); + Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg__getNodeRowPtrs__SWIG((Tpetra::CrsGraph< int,long long,ForTrilinos::DefaultNodeType > const *)arg1,SWIG_STD_MOVE(arg2)); } catch (const std::range_error& e) { @@ -8918,7 +8931,7 @@ SWIGEXPORT void _wrap_TpetraCrsGraph_getNodePackedIndices(SwigClassWrapper *farg try { // Attempt the wrapped function call - Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg__getNodePackedIndices__SWIG((Tpetra::CrsGraph< int,long long,ForTrilinos::DefaultNodeType > const *)arg1,arg2); + Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg__getNodePackedIndices__SWIG((Tpetra::CrsGraph< int,long long,ForTrilinos::DefaultNodeType > const *)arg1,SWIG_STD_MOVE(arg2)); } catch (const std::range_error& e) { @@ -12899,7 +12912,7 @@ SWIGEXPORT void _wrap_TpetraCrsMatrix_getAllValues(SwigClassWrapper *farg1, Swig try { // Attempt the wrapped function call - Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__getAllValues__SWIG((Tpetra::CrsMatrix< double,int,long long,ForTrilinos::DefaultNodeType > const *)arg1,arg2,arg3,arg4); + Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__getAllValues__SWIG((Tpetra::CrsMatrix< double,int,long long,ForTrilinos::DefaultNodeType > const *)arg1,SWIG_STD_MOVE(arg2),SWIG_STD_MOVE(arg3),SWIG_STD_MOVE(arg4)); } catch (const std::range_error& e) { @@ -12944,7 +12957,7 @@ SWIGEXPORT SwigClassWrapper _wrap_operator_to_matrix(SwigClassWrapper const *far try { // Attempt the wrapped function call - result = ForTrilinos::SWIGTEMPLATEDISAMBIGUATOR operator_to_matrix< SC,LO,GO,NO >(arg1); + result = ForTrilinos::SWIGTEMPLATEDISAMBIGUATOR operator_to_matrix< SC,LO,GO,NO >(SWIG_STD_MOVE(arg1)); } catch (const std::range_error& e) { @@ -12979,7 +12992,7 @@ SWIGEXPORT SwigClassWrapper _wrap_matrix_to_operator(SwigClassWrapper const *far try { // Attempt the wrapped function call - result = ForTrilinos::SWIGTEMPLATEDISAMBIGUATOR matrix_to_operator< SC,LO,GO,NO >(arg1); + result = ForTrilinos::SWIGTEMPLATEDISAMBIGUATOR matrix_to_operator< SC,LO,GO,NO >(SWIG_STD_MOVE(arg1)); } catch (const std::range_error& e) { @@ -14066,7 +14079,7 @@ SWIGEXPORT void _wrap_TpetraMatrixMatrixAdd__SWIG_1(SwigClassWrapper *farg1, int try { // Attempt the wrapped function call - Tpetra::MatrixMatrix::SWIGTEMPLATEDISAMBIGUATOR Add< SC,LO,GO,NO >((Tpetra::CrsMatrix< double,int,long long,ForTrilinos::DefaultNodeType > const &)*arg1,arg2,arg3,(Tpetra::CrsMatrix< double,int,long long,ForTrilinos::DefaultNodeType > const &)*arg4,arg5,arg6,arg7); + Tpetra::MatrixMatrix::SWIGTEMPLATEDISAMBIGUATOR Add< SC,LO,GO,NO >((Tpetra::CrsMatrix< double,int,long long,ForTrilinos::DefaultNodeType > const &)*arg1,arg2,arg3,(Tpetra::CrsMatrix< double,int,long long,ForTrilinos::DefaultNodeType > const &)*arg4,arg5,arg6,SWIG_STD_MOVE(arg7)); } catch (const std::range_error& e) { diff --git a/src/fortrilinos_hl/generated/fortrilinos_hlFORTRAN_wrap.cxx b/src/fortrilinos_hl/generated/fortrilinos_hlFORTRAN_wrap.cxx index 4991601d..81d036bf 100644 --- a/src/fortrilinos_hl/generated/fortrilinos_hlFORTRAN_wrap.cxx +++ b/src/fortrilinos_hl/generated/fortrilinos_hlFORTRAN_wrap.cxx @@ -21,30 +21,6 @@ #define SWIGFORTRAN #endif - -#ifdef __cplusplus -/* SwigValueWrapper is described in swig.swg */ -template class SwigValueWrapper { - struct SwigMovePointer { - T *ptr; - SwigMovePointer(T *p) : ptr(p) { } - ~SwigMovePointer() { delete ptr; } - SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } - } pointer; - SwigValueWrapper& operator=(const SwigValueWrapper& rhs); - SwigValueWrapper(const SwigValueWrapper& rhs); -public: - SwigValueWrapper() : pointer(0) { } - SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } - operator T&() const { return *pointer.ptr; } - T *operator&() { return pointer.ptr; } -}; - -template T SwigValueInit() { - return T(); -} -#endif - /* ----------------------------------------------------------------------------- * This section contains generic SWIG labels for method/variable * declarations/attributes, and other compiler dependent labels. @@ -170,6 +146,44 @@ template T SwigValueInit() { #endif +#ifdef __cplusplus +#include +/* SwigValueWrapper is described in swig.swg */ +template class SwigValueWrapper { + struct SwigSmartPointer { + T *ptr; + SwigSmartPointer(T *p) : ptr(p) { } + ~SwigSmartPointer() { delete ptr; } + SwigSmartPointer& operator=(SwigSmartPointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } + } pointer; + SwigValueWrapper& operator=(const SwigValueWrapper& rhs); + SwigValueWrapper(const SwigValueWrapper& rhs); +public: + SwigValueWrapper() : pointer(0) { } + SwigValueWrapper& operator=(const T& t) { SwigSmartPointer tmp(new T(t)); pointer = tmp; return *this; } +#if __cplusplus >=201103L + SwigValueWrapper& operator=(T&& t) { SwigSmartPointer tmp(new T(std::move(t))); pointer = tmp; return *this; } + operator T&&() const { return std::move(*pointer.ptr); } +#else + operator T&() const { return *pointer.ptr; } +#endif + T *operator&() const { return pointer.ptr; } +}; + +template T SwigValueInit() { + return T(); +} + + +#if __cplusplus >=201103L +# define SWIG_STD_MOVE(OBJ) std::move(OBJ) +#else +# define SWIG_STD_MOVE(OBJ) OBJ +#endif + +#endif + + #ifndef SWIGEXTERN # ifdef __cplusplus # define SWIGEXTERN extern @@ -197,7 +211,7 @@ SWIGEXPORT void SWIG_store_exception(const char* decl, int errcode, const char * #define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ SWIG_store_exception(DECL, CODE, MSG); RETURNNULL; -/* Errors in SWIG */ +/* SWIG Errors applicable to all language modules, values are reserved from -1 to -99 */ #define SWIG_UnknownError -1 #define SWIG_IOError -2 #define SWIG_RuntimeError -3 @@ -214,7 +228,6 @@ SWIGEXPORT void SWIG_store_exception(const char* decl, int errcode, const char * - enum SwigMemFlags { SWIG_MEM_OWN = 0x01, SWIG_MEM_RVALUE = 0x02,