Closed atzberg closed 5 years ago
@wfspotz @trilinos/pytrilinos
This was addressed in Pull Request #3564.
Check the file
<TRILINOS_SRC>/packages/PyTrilinos/src/CMakeLists.txt
Somewhere around line 370 is a
SWIG_ADD_MODULE(${PyTrilinos_TARGET_NAME}
command. The last line of that command should read
"${MODULE_NAME}")
If it reads
"__init__")
then you have an outdated version.
Thanks. I did the pull (master branch) and checked the CMakeLists.txt as above, so I have the latest codes. I also tried for the (develop branch). When in each case I did the latest git pull, I now get the following compilation error. I give below my config script. I tried this both with and without including the line "-D Teuchos_ENABLE_LONG_LONG_INT:BOOL=ON" I read on-line something about the (develop branch) might being way to compile, which I am also giving that a try, but the error so far has persisted in each case. Any hints would be helpful in getting this to compile. Thanks!
The compilation error is:
[ 98%] Building CXX object packages/PyTrilinos/src/CMakeFiles/PyTrilinos_Domi.dir/DomiPYTHON_wrap.cpp.o
/Sandia_Trilinos/build_PyTrilinos/packages/PyTrilinos/src/DomiPYTHON_wrap.cpp: In function ‘Teuchos::RCP<const Tpetra::Map<int, long long int> > Domi_MDMap_getTpetraMap(Domi::MDMap*, bool)’:
/Sandia_Trilinos/build_PyTrilinos/packages/PyTrilinos/src/DomiPYTHON_wrap.cpp:4981:27: error: ‘class Domi::MDMap’ has no member named ‘getTpetraMap’
return self->template getTpetraMap< int,
^
/Sandia_Trilinos/build_PyTrilinos/packages/PyTrilinos/src/DomiPYTHON_wrap.cpp:4981:41: error: expected primary-expression before ‘int’
return self->template getTpetraMap< int,
^
/Sandia_Trilinos/build_PyTrilinos/packages/PyTrilinos/src/DomiPYTHON_wrap.cpp:4981:41: error: expected ‘;’ before ‘int’
/Sandia_Trilinos/build_PyTrilinos/packages/PyTrilinos/src/DomiPYTHON_wrap.cpp:4981:44: error: expected unqualified-id before ‘,’ token
return self->template getTpetraMap< int,
^
/Sandia_Trilinos/build_PyTrilinos/packages/PyTrilinos/src/DomiPYTHON_wrap.cpp:4982:41: error: expected unqualified-id before ‘long’
long long,
^
/Sandia_Trilinos/build_PyTrilinos/packages/PyTrilinos/src/DomiPYTHON_wrap.cpp: In function ‘Teuchos::RCP<const Tpetra::Map<int, long long int> > Domi_MDMap_getTpetraAxisMap(Domi::MDMap*, int, bool)’:
/Sandia_Trilinos/build_PyTrilinos/packages/PyTrilinos/src/DomiPYTHON_wrap.cpp:4986:27: error: ‘class Domi::MDMap’ has no member named ‘getTpetraAxisMap’
return self->template getTpetraAxisMap< int,
^
/Sandia_Trilinos/build_PyTrilinos/packages/PyTrilinos/src/DomiPYTHON_wrap.cpp:4986:45: error: expected primary-expression before ‘int’
return self->template getTpetraAxisMap< int,
^
/Sandia_Trilinos/build_PyTrilinos/packages/PyTrilinos/src/DomiPYTHON_wrap.cpp:4986:45: error: expected ‘;’ before ‘int’
/Sandia_Trilinos/build_PyTrilinos/packages/PyTrilinos/src/DomiPYTHON_wrap.cpp:4986:48: error: expected unqualified-id before ‘,’ token
return self->template getTpetraAxisMap< int,
^
/Sandia_Trilinos/build_PyTrilinos/packages/PyTrilinos/src/DomiPYTHON_wrap.cpp:4987:45: error: expected unqualified-id before ‘long’
long long,
^
packages/PyTrilinos/src/CMakeFiles/PyTrilinos_Domi.dir/build.make:69: recipe for target 'packages/PyTrilinos/src/CMakeFiles/PyTrilinos_Domi.dir/DomiPYTHON_wrap.cpp.o' failed
make[2]: *** [packages/PyTrilinos/src/CMakeFiles/PyTrilinos_Domi.dir/DomiPYTHON_wrap.cpp.o] Error 1
CMakeFiles/Makefile2:18542: recipe for target 'packages/PyTrilinos/src/CMakeFiles/PyTrilinos_Domi.dir/all' failed
make[1]: *** [packages/PyTrilinos/src/CMakeFiles/PyTrilinos_Domi.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2
================
confg script
================
#!/bin/bash
#SRC_DIR=$HOME/Trilinos
SRC_DIR=$HOME/Sandia_Trilinos
BUILD_DIR=$SRC_DIR/build
INSTALL_DIR=$SRC_DIR/install/install_PyTrilinos
#BOOST_DIR=$BOOST_ROOT
#HDF_DIR=$HDF5_ROOT
#NETCDF_DIR=$NETCDF_ROOT
#VTK_DIR=/usr/lib/vtk-5.10
#CC=gcc
#CMAKE_C_COMPILER=/usr/bin/mpicc
CC=/usr/bin/mpicc
CMAKE_C_COMPILER=/usr/bin/mpicc
#echo "WARNING: PJA: I turned off the MueLu tests, check ON/OFF settings carefully."
# remove Cmake files for fresh compilation
rm -rf CMakeCache.txt CMakeFiles
cmake \
-D CMAKE_INSTALL_PREFIX:PATH=$INSTALL_DIR \
-D CMAKE_BUILD_TYPE:STRING=RELEASE \
-D MPI_BASE_DIR:FILEPATH=/usr/lib/openmpi \
-D CMAKE_C_COMPILER:FILEPATH=/usr/bin/mpicc \
-D CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/mpicxx \
-D CMAKE_Fortran_COMPILER:FILEPATH=/usr/bin/mpifort \
\
-D BLAS_LIBRARY_NAMES:STRING="blas;gfortran" \
-D BLAS_LIBRARY_DIRS='/usr/local/lib;/usr/lib/gcc/x86_64-linux-gnu/5' \
-D LAPACK_LIBRARY_NAMES:STRING="lapack;lapacke;gfortran" \
-D LAPACK_LIBRARY_DIRS='/usr/local/lib;/usr/lib/gcc/x86_64-linux-gnu/5' \
\
-D TPL_ENABLE_MPI:BOOL=ON \
-D Trilinos_ENABLE_OpenMP:BOOL=ON \
-D TPL_ENABLE_Pthread:BOOL=OFF \
\
-D Teuchos_ENABLE_LONG_LONG_INT:BOOL=ON \
\
-D Trilinos_ENABLE_PyTrilinos:BOOL=ON \
-D BUILD_SHARED_LIBS:BOOL=ON \
-D Trilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=ON \
-D Trilinos_ENABLE_Teuchos:BOOL=ON \
-D PYTHON_EXECUTABLE:FILEPATH=/home/userName/anaconda3/envs/py27-pyTrilinos/bin/python \
$SRC_DIR
Because of #3456, I have been testing recent fixes to PyTrilinos with Tpetra disabled. If this build is to support PyTrilinos only, disabling Tpetra is not a big deal, because the wrappers are not yet comprehensive. If the build is to support C++ developers as well, then this is an issue.
Thanks. We ideally want to use in python TPetra so we can have interface
for prototyping, experimentation, testing ideas, etc... If I understand
correctly in your fix the PyTrilinos will still work with TPetra
interface? It just would not allow for C++ linking? Can you give detail
of what you had in mind for config script to do that?
For instance, I have set
-D Trilinos_ENABLE_Tpetra:BOOL=OFF \
but this now means that we have
"-- Setting PyTrilinos_ENABLE_Tpetra=OFF because PyTrilinos has an optional library dependence on disabled package Tpetra
"
I guess this means we lose Tpetra interface in Python in that case. Perhaps you meant we just fore-go TPetra to get PyTrilinos compiled in near-term. I'd really like to have TPetra in python for prototyping, etc...
Thanks again for all of your help.
Best,
Paul
On Mon, Oct 22, 2018, 6:36 AM Bill Spotz notifications@github.com wrote:
Because of #3456 https://github.com/trilinos/Trilinos/issues/3456, I have been testing recent fixes to PyTrilinos with Tpetra disabled. If this build is to support PyTrilinos only, disabling Tpetra is not a big deal, because the wrappers are not yet comprehensive. If the build is to support C++ developers as well, then this is an issue.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/trilinos/Trilinos/issues/3687#issuecomment-431837876, or mute the thread https://github.com/notifications/unsubscribe-auth/AIJ5ZjI5YidnqI2GmBJafYg7tCgSv1zKks5uncnxgaJpZM4XyFhY .
I did mean setting Trilinos_ENABLE_Tpetra:BOOL=OFF
(or you could get away with PyTrilinos_ENABLE_Tpetra:BOOL=OFF
).
PyTrilinos.Tpetra
is still experimental. Enough is wrapped so that you can construct MultiVector
s, but not yet matrices. The templating adds work when you are developing the wrappers. Also, the "second generation" packages such as Amesos2, Belos, Ifpack2, MueLu, etc., that use Tpetra are not yet wrapped. There are clever converters in place so that you can use Tpetra vectors with packages and classes that were only intended to work with Epetra, but that seems limiting for your purposes.
Thanks. However, even with both flags to turn things off, I still get related compilation error:
[ 95%] Building CXX object packages/PyTrilinos/src/CMakeFiles/PyTrilinos_Teuchos_RCP.dir/Teuchos.RCPPYTHON_wrap.cpp.o In file included from /home/atzberg/research/collaboration_Sandia_Trilinos_atz/build_PyTrilinos/packages/PyTrilinos/src/Teuchos.RCPPYTHON_wrap.cpp:3412:0: /home/atzberg/research/collaboration_Sandia_Trilinos_atz/packages/PyTrilinos/src/PyTrilinos_Tpetra_Headers.hpp:48:33: fatal error: Tpetra_ConfigDefs.hpp: No such file or directory compilation terminated. packages/PyTrilinos/src/CMakeFiles/PyTrilinos_Teuchos_RCP.dir/build.make:73: recipe for target 'packages/PyTrilinos/src/CMakeFiles/PyTrilinos_Teuchos_RCP.dir/Teuchos.RCPPYTHON_wrap.cpp.o' failed make[2]: [packages/PyTrilinos/src/CMakeFiles/PyTrilinos_Teuchos_RCP.dir/Teuchos.RCPPYTHON_wrap.cpp.o] Error 1 CMakeFiles/Makefile2:14061: recipe for target 'packages/PyTrilinos/src/CMakeFiles/PyTrilinos_Teuchos_RCP.dir/all' failed make[1]: [packages/PyTrilinos/src/CMakeFiles/PyTrilinos_Teuchos_RCP.dir/all] Error 2 Makefile:162: recipe for target 'all' failed make: *** [all] Error 2
Thanks for your help!
-- Paul
On Mon, Oct 22, 2018 at 1:49 PM Bill Spotz notifications@github.com wrote:
I did mean setting Trilinos_ENABLE_Tpetra:BOOL=OFF (or you could get away with PyTrilinos_ENABLE_Tpetra:BOOL=OFF).
PyTrilinos.Tpetra is still experimental. Enough is wrapped so that you can construct MultiVectors, but not yet matrices. The templating adds work when you are developing the wrappers. Also, the "second generation" packages such as Amesos2, Belos, Ifpack2, MueLu, etc., that use Tpetra are not yet wrapped. There are clever converters in place so that you can use Tpetra vectors with packages and classes that were only intended to work with Epetra, but that seems limiting for your purposes.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/trilinos/Trilinos/issues/3687#issuecomment-431979921, or mute the thread https://github.com/notifications/unsubscribe-auth/AIJ5Zp7itW-fTY0MdstraBRHi-STjcgHks5uni9cgaJpZM4XyFhY .
@atzberg This build logic hinges on SWIG interface file Teuchos.RCP.i
, which is a generated file. As such, it doesn't get it's dependencies queried during configuration like most standard source files, and when you change the configuration as you did, it can become out of date. I would recommend a recursive delete of directory <TRILINOS_BUILD>/packages/PyTrilinos
, and then reconfiguring and building.
Thanks for the heads up on that. I deleted the build directory. The full build and "make install" now works.
Thanks everyone for all of your help on this.
Best, Paul