Skip to content

Commit

Permalink
Merge pull request #291 from sethrj/trilinos-13-4
Browse files Browse the repository at this point in the history
Support ForTrilinos 13.4
  • Loading branch information
sethrj committed Jan 24, 2023
2 parents 6bb7182 + 21957e8 commit 3ae3c2c
Show file tree
Hide file tree
Showing 30 changed files with 1,100 additions and 1,999 deletions.
7 changes: 4 additions & 3 deletions doc/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@ in the committed version of the generated wrappers.

.. _version_table:

.. table:: Version compatibility table for ForTrilinos.
.. table:: Guaranteed version compatibility table for ForTrilinos.

=========== ============== ======================
ForTrilinos Trilinos SWIG
=========== ============== ======================
2.2.0 13.4 4.1.1+fortran
2.1.0 13.2 4.1.0-dev1+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.1 13.0:13.2 4.1.0-dev1+fortran
2.0.0 13.0:13.2 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
2.0.0-dev1 12.17+8a82b322 4.0.0+fortran+15e6ed59
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ ENV PATH=${CMAKE_DIR}/bin:$PATH

# Install Trilinos
ENV TRILINOS_DIR=/opt/trilinos
RUN TRILINOS_VERSION=13-2-0 && \
RUN TRILINOS_VERSION=13-4-1 && \
TRILINOS_URL=https://github.com/trilinos/Trilinos/archive/refs/tags/trilinos-release-${TRILINOS_VERSION}.tar.gz && \
TRILINOS_ARCHIVE=trilinos-${TRILINOS_VERSION}.tar.gz && \
SCRATCH_DIR=/scratch && mkdir -p ${SCRATCH_DIR} && cd ${SCRATCH_DIR} && \
Expand Down
4 changes: 2 additions & 2 deletions example/PowerMethod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ program main
! numerical algorithms that use Tpetra objects to be templated on the type of
! the TpetraOperator specialization.
max_entries_per_row = 3
A = TpetraCrsMatrix(map, max_entries_per_row, TpetraStaticProfile)
A = TpetraCrsMatrix(map, max_entries_per_row)

! Fill the sparse matrix, one row at a time.
allocate(vals(3))
allocate(cols(3))
num_my_elements = int(map%getNodeNumElements(), kind=kind(num_my_elements))
num_my_elements = int(map%getLocalNumElements(), kind=kind(num_my_elements))
fill: do lcl_row = 1, num_my_elements
gbl_row = map%getGlobalElement(lcl_row)
if (gbl_row == 1) then
Expand Down
4 changes: 3 additions & 1 deletion scripts/build-yuri.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ cd $SOURCE_DIR
mkdir build 2>/dev/null || true
cd build

module purge
SPACK_VIEW=$SPACK_ROOT/var/spack/environments/fortrilinos/.spack-env/view
export CMAKE_PREFIX_PATH=$SPACK_VIEW:$CMAKE_PREFIX_PATH
export PATH=$SPACK_VIEW/bin:$PATH

cmake -G Ninja \
-DCMAKE_CXX_FLAGS:STRING=-fcolor-diagnostics \
-DCMAKE_Fortran_FLAGS:STRING=-fdiagnostics-color \
-DCMAKE_SHARED_LINKER_FLAGS:STRING=-Wl,-no_compact_unwind \
-DCMAKE_INSTALL_PREFIX:PATH=$SOURCE_DIR/install \
-DCMAKE_BUILD_TYPE:STRING=Debug \
-DBUILD_SHARED_LIBS:BOOL=ON \
Expand Down
6 changes: 3 additions & 3 deletions src/forbelos/generated/forbelos.F90
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
! This file was automatically generated by SWIG (http://www.swig.org).
! Version 4.1.0+fortran
! This file was automatically generated by SWIG (https://www.swig.org).
! Version 4.1.1+fortran
!
! Do not make changes to this file unless you know what you are doing--modify
! Do not make changes to this file unless you know what you are doing - modify
! the SWIG interface file instead.

! Copyright 2017-2020, UT-Battelle, LLC
Expand Down
110 changes: 56 additions & 54 deletions src/forbelos/generated/forbelosFORTRAN_wrap.cxx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 4.1.0+fortran
* This file was automatically generated by SWIG (https://www.swig.org).
* Version 4.1.1+fortran
*
* This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
* changes to this file unless you know what you are doing--modify the SWIG
* interface file instead.
* Do not make changes to this file unless you know what you are doing - modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */

/*
Expand All @@ -15,12 +13,6 @@
* License-Filename: LICENSE
*/



#ifndef SWIGFORTRAN
#define SWIGFORTRAN
#endif

/* -----------------------------------------------------------------------------
* This section contains generic SWIG labels for method/variable
* declarations/attributes, and other compiler dependent labels.
Expand Down Expand Up @@ -146,44 +138,6 @@
#endif


#ifdef __cplusplus
#include <utility>
/* SwigValueWrapper is described in swig.swg */
template<typename T> 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<T>& rhs);
SwigValueWrapper(const SwigValueWrapper<T>& 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 <typename T> 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
Expand Down Expand Up @@ -242,8 +196,60 @@ enum AssignmentType {
};
}



#define SWIG_VERSION 0x040101
#define SWIGFORTRAN
#define SWIGPOLICY_Belos_DefaultSolverParameters swig::ASSIGNMENT_DEFAULT

#ifdef __cplusplus
#include <utility>
/* SwigValueWrapper is described in swig.swg */
template<typename T> 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; }
void reset(T *p) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = p; }
} pointer;
SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
SwigValueWrapper(const SwigValueWrapper<T>& 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; }
static void reset(SwigValueWrapper& t, T *p) { t.pointer.reset(p); }
};

/*
* SwigValueInit() is a generic initialisation solution as the following approach:
*
* T c_result = T();
*
* doesn't compile for all types for example:
*
* unsigned int c_result = unsigned int();
*/
template <typename T> T SwigValueInit() {
return T();
}

#if __cplusplus >=201103L
# define SWIG_STD_MOVE(OBJ) std::move(OBJ)
#else
# define SWIG_STD_MOVE(OBJ) OBJ
#endif

#endif


#include <stdexcept>


Expand All @@ -256,10 +262,6 @@ enum AssignmentType {
if (!(EXPR)) { SWIG_exception_impl("$decl", SWIG_ValueError, MSG, RETURNNULL); }


#define SWIGVERSION 0x040100
#define SWIG_VERSION SWIGVERSION


#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))

Expand Down
6 changes: 3 additions & 3 deletions src/forerror/generated/forerror.F90
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
! This file was automatically generated by SWIG (http://www.swig.org).
! Version 4.1.0+fortran
! This file was automatically generated by SWIG (https://www.swig.org).
! Version 4.1.1+fortran
!
! Do not make changes to this file unless you know what you are doing--modify
! Do not make changes to this file unless you know what you are doing - modify
! the SWIG interface file instead.

! Copyright 2017-2020, UT-Battelle, LLC
Expand Down
114 changes: 58 additions & 56 deletions src/forerror/generated/forerrorFORTRAN_wrap.cxx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 4.1.0+fortran
* This file was automatically generated by SWIG (https://www.swig.org).
* Version 4.1.1+fortran
*
* This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
* changes to this file unless you know what you are doing--modify the SWIG
* interface file instead.
* Do not make changes to this file unless you know what you are doing - modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */

/*
Expand All @@ -15,12 +13,6 @@
* License-Filename: LICENSE
*/



#ifndef SWIGFORTRAN
#define SWIGFORTRAN
#endif

/* -----------------------------------------------------------------------------
* This section contains generic SWIG labels for method/variable
* declarations/attributes, and other compiler dependent labels.
Expand Down Expand Up @@ -146,44 +138,6 @@
#endif


#ifdef __cplusplus
#include <utility>
/* SwigValueWrapper is described in swig.swg */
template<typename T> 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<T>& rhs);
SwigValueWrapper(const SwigValueWrapper<T>& 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 <typename T> 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
Expand Down Expand Up @@ -228,6 +182,58 @@ SWIGEXPORT void SWIG_store_exception(const char* decl, int errcode, const char *
SWIG_store_exception(DECL, CODE, MSG); RETURNNULL;



#define SWIG_VERSION 0x040101
#define SWIGFORTRAN

#ifdef __cplusplus
#include <utility>
/* SwigValueWrapper is described in swig.swg */
template<typename T> 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; }
void reset(T *p) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = p; }
} pointer;
SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
SwigValueWrapper(const SwigValueWrapper<T>& 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; }
static void reset(SwigValueWrapper& t, T *p) { t.pointer.reset(p); }
};

/*
* SwigValueInit() is a generic initialisation solution as the following approach:
*
* T c_result = T();
*
* doesn't compile for all types for example:
*
* unsigned int c_result = unsigned int();
*/
template <typename T> T SwigValueInit() {
return T();
}

#if __cplusplus >=201103L
# define SWIG_STD_MOVE(OBJ) std::move(OBJ)
#else
# define SWIG_STD_MOVE(OBJ) OBJ
#endif

#endif


#include <stdexcept>


Expand All @@ -240,10 +246,6 @@ SWIGEXPORT void SWIG_store_exception(const char* decl, int errcode, const char *
if (!(EXPR)) { SWIG_exception_impl("$decl", SWIG_ValueError, MSG, RETURNNULL); }


#define SWIGVERSION 0x040100
#define SWIG_VERSION SWIGVERSION


#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))

Expand Down Expand Up @@ -300,10 +302,10 @@ SWIGEXPORT const char* fortrilinos_get_serr() {
#include <string>


extern "C" {

#include <cctype>

extern "C" {

// Call this function before any new action
SWIGEXPORT void SWIG_check_unhandled_exception_impl(const char* decl) {
if (fortrilinos_ierr != 0) {
Expand Down
Loading

0 comments on commit 3ae3c2c

Please sign in to comment.