@trilinos/shylu fails to compile with Tpetra_ENABLE_DEPRECATED_CODE:BOOL=OFF
The file packages/shylu/shylu_dd/bddc/test/SparseSolverTest.cpp fails to compile:
In file included from /home/tjfulle/Developer/repos/github.com/tjfulle/Trilinos/develop/packages/shylu/shylu_dd/bddc/src/shylu_SolverFactoryBDDC.hpp:82:0,
from /home/tjfulle/Developer/repos/github.com/tjfulle/Trilinos/develop/packages/shylu/shylu_dd/bddc/test/SparseSolverTest.cpp:47:
/home/tjfulle/Developer/repos/github.com/tjfulle/Trilinos/develop/packages/shylu/shylu_dd/bddc/src/shylu_SolverMueLu.hpp: In member function ‘int bddc::SolverMueLu<SX>::Initialize()’:
/home/tjfulle/Developer/repos/github.com/tjfulle/Trilinos/develop/packages/shylu/shylu_dd/bddc/src/shylu_SolverMueLu.hpp:125:64: error: no matching function for call to ‘Tpetra::CrsMatrix<double, int, int, Kokkos::Compat::KokkosDeviceWrapperNode<Kokkos::Serial> >::CrsMatrix(Teuchos::RCP<const Tpetra::Map<int, int, Kokkos::Compat::KokkosDeviceWrapperNode<Kokkos::Serial> > >&, Teuchos::RCP<const Tpetra::Map<int, int, Kokkos::Compat::KokkosDeviceWrapperNode<Kokkos::Serial> > >&, Teuchos::ArrayRCP<long unsigned int>&)’
RCP<CrsMatrix> A = rcp( new CrsMatrix(rowMap, rowMap, count) );
^
In file included from packages/tpetra/core/src/Tpetra_CrsMatrix.hpp:1:0,
from /home/tjfulle/Developer/repos/github.com/tjfulle/Trilinos/develop/packages/shylu/shylu_dd/bddc/src/shylu_SolverMueLu.hpp:53,
from /home/tjfulle/Developer/repos/github.com/tjfulle/Trilinos/develop/packages/shylu/shylu_dd/bddc/src/shylu_SolverFactoryBDDC.hpp:82,
from /home/tjfulle/Developer/repos/github.com/tjfulle/Trilinos/develop/packages/shylu/shylu_dd/bddc/test/SparseSolverTest.cpp:47:
My configure script (source the sems gcc/7.3.0 environment script in cmake/std/sems)
#!/bin/sh
rm -rf CMake*
/projects/sems/install/rhel6-x86_64/sems/utility/cmake/3.12.2/bin/cmake \
-G "Ninja" \
-D Trilinos_ENABLE_Tpetra:BOOL=ON \
-D Tpetra_INST_INT_INT:BOOL=ON \
-D Trilinos_CONFIGURE_OPTIONS_FILE:FILEPATH=$TRILINOS_DIR/cmake/std/PullRequestLinuxCommonTestingSettings.cmake \
-DTpetra_ENABLE_DEPRECATED_CODE:BOOL=OFF \
-DXpetra_ENABLE_DEPRECATED_CODE:BOOL=OFF \
-D Trilinos_ENABLE_STK:BOOL=OFF \
$TRILINOS_DIR
Potential fix: replace use of ArrayRCP with Array in packages/shylu/shylu_dd/bddc/src/shylu_SolverMueLu.hpp. I have a branch with this fix, as well as some others for #5536
It also works if you make the ArrayRCP into an ArrayView by putting parentheses after it.
@mhoemmen - Doh, I didn't know that worked for ArrayRCP! The ArrayRCP is only used locally to fill the matrix, so I replaced it with Array and when calling the matrix constructor called the Array's operator() (as you suggest). I can switch it back to ArrayRCP if that is preferred over Array
@tjfulle Either way is good; thanks! ArrayRCP is only worth using if people create uninitialized data (Array is like std::vector, in that its constructor initializes all elements).