Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amesos2: Build error when compiling with SuperLU 5.2.1 #4833

Closed
Filipe-Cumaru opened this issue Apr 8, 2019 · 19 comments
Closed

Amesos2: Build error when compiling with SuperLU 5.2.1 #4833

Filipe-Cumaru opened this issue Apr 8, 2019 · 19 comments
Labels
CLOSED_DUE_TO_INACTIVITY Issue or PR has been closed by the GitHub Actions bot due to inactivity. impacting: configure or build The issue is primarily related to configuring or building MARKED_FOR_CLOSURE Issue or PR is marked for auto-closure by the GitHub Actions bot. pkg: Amesos2

Comments

@Filipe-Cumaru
Copy link

@trilinos/Amesos
@trilinos/Amesos2

Expectations

Amesos2 works with SuperLU and SuperLU-dist 5.

Current Behavior

I've got some compilation errors when trying to build Amesos2 with SuperLU support. Some of those are shown above. I've put the full list of errors in the attached file to avoid flooding this report.
amesos_compilation_errors.txt

/home/facsa/Downloads/Trilinos-master/packages/amesos2/src/Amesos2_Superludist_FunctionMap.hpp:378:37: error: invalid conversion from ‘SLUD::int_t {aka int}’ to ‘SLUD::D::LUstruct_t*’ [-fpermissive]
       SLUD::D::LUstructInit(m, n, lu);
                                     ^
In file included from /home/facsa/Downloads/Trilinos-master/packages/amesos2/src/Amesos2_Superludist_TypeMap.hpp:87:0,
                 from /home/facsa/Downloads/Trilinos-master/packages/amesos2/src/Amesos2_Superludist_FunctionMap.hpp:63,
                 from /home/facsa/Downloads/Trilinos-master/packages/amesos2/src/Amesos2_Superludist_decl.hpp:58,
                 from /home/facsa/Downloads/Trilinos-master/packages/amesos2/src/Amesos2_Superludist.hpp:47,
                 from /home/facsa/Downloads/Trilinos-master/packages/amesos2/src/Amesos2_Factory.hpp:108,
                 from /home/facsa/Downloads/Trilinos-master/packages/amesos2/src/Amesos2_Details_LinearSolverFactory_def.hpp:52,
                 from /home/facsa/Downloads/Trilinos-master/packages/amesos2/src/Amesos2_Details_LinearSolverFactory.hpp:49,
                 from /home/facsa/Downloads/Trilinos-master/packages/amesos2/src/Amesos2_Details_registerLinearSolverFactory.cpp:45:
/usr/include/superlu-dist/superlu_ddefs.h:262:13: note: declared here
 extern void LUstructInit(const int_t, LUstruct_t *);
             ^~~~~~~~~~~~
In file included from /home/facsa/Downloads/Trilinos-master/packages/amesos2/src/Amesos2_Superlu_decl.hpp:58:0,
                 from /home/facsa/Downloads/Trilinos-master/packages/amesos2/src/Amesos2_Superlu.hpp:47,
                 from /home/facsa/Downloads/Trilinos-master/packages/amesos2/src/Amesos2_Factory.hpp:124,
                 from /home/facsa/Downloads/Trilinos-master/packages/amesos2/src/Amesos2_Details_LinearSolverFactory_def.hpp:52,
                 from /home/facsa/Downloads/Trilinos-master/packages/amesos2/src/Amesos2_Details_LinearSolverFactory.hpp:49,
                 from /home/facsa/Downloads/Trilinos-master/packages/amesos2/src/Amesos2_Details_registerLinearSolverFactory.cpp:45:
/home/facsa/Downloads/Trilinos-master/packages/amesos2/src/Amesos2_Superlu_FunctionMap.hpp: At global scope:
/home/facsa/Downloads/Trilinos-master/packages/amesos2/src/Amesos2_Superlu_FunctionMap.hpp:108:19: error: variable or field ‘sgssvx’ declared void
       sgssvx(SLU::superlu_options_t *, SLU::SuperMatrix *, int *, int *, int *,
                   ^~~~~~~~~~~~~~~~~
/home/facsa/Downloads/Trilinos-master/packages/amesos2/src/Amesos2_Superlu_FunctionMap.hpp:108:19: error: ‘superlu_options_t’ is not a member of ‘SLU’
/home/facsa/Downloads/Trilinos-master/packages/amesos2/src/Amesos2_Superlu_FunctionMap.hpp:108:38: error: expected primary-expression before ‘,’ token
       sgssvx(SLU::superlu_options_t *, SLU::SuperMatrix *, int *, int *, int *,
                                      ^
/home/facsa/Downloads/Trilinos-master/packages/amesos2/src/Amesos2_Superlu_FunctionMap.hpp:115:19: error: ‘mem_usage_t’ is not a member of ‘SLU’
              SLU::mem_usage_t *, SLU::SuperLUStat_t *, int *);
                   ^~~~~~~~~~~
/home/facsa/Downloads/Trilinos-master/packages/amesos2/src/Amesos2_Superlu_FunctionMap.hpp:115:32: error: expected primary-expression before ‘,’ token
              SLU::mem_usage_t *, SLU::SuperLUStat_t *, int *);
                                ^
/home/facsa/Downloads/Trilinos-master/packages/amesos2/src/Amesos2_Superlu_FunctionMap.hpp:115:39: error: ‘SuperLUStat_t’ is not a member of ‘SLU’
              SLU::mem_usage_t *, SLU::SuperLUStat_t *, int *);
                                       ^~~~~~~~~~~~~
/home/facsa/Downloads/Trilinos-master/packages/amesos2/src/Amesos2_Superlu_FunctionMap.hpp:459:15: error: ‘sgssvx’ is not a member of ‘SLU::S’
       SLU::S::sgssvx(options, A, perm_c, perm_r, etree, equed, R, C, L, U, work,
               ^~~~~~

Steps to Reproduce

I've configured Trilinos using cmake with the following options:

cmake \
    -D CMAKE_INSTALL_PREFIX:PATH=/home/facsa/Trilinos-SuperLU \
    \
    -D MPI_BASE_DIR:PATH=/usr \
    \
    -D CMAKE_BUILD_TYPE:STRING=DEBUG \
    -D CMAKE_Fortran_COMPILER:FILEPATH=/usr/bin/mpif90 \
    -D CMAKE_CXX_FLAGS:STRING="-std=c++11 -O3" \
    -D BUILD_SHARED_LIBS:BOOL=ON \
    -D Trilinos_WARNINGS_AS_ERRORS_FLAGS:STRING="" \
    -D PYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 \
    \
    -D Trilinos_ENABLE_CXX11=ON \
    -D Trilinos_CXX11_FLAGS="-std=c++11" \
    -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF \
    -D Trilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=OFF \
    -D Trilinos_ENABLE_ALL_FORWARD_DEP_PACKAGES:BOOL=OFF \
    -D Trilinos_ENABLE_Teuchos:BOOL=ON \
    -D Trilinos_ENABLE_Epetra:BOOL=ON \
    -D Trilinos_ENABLE_EpetraExt:BOOL=ON \
    -D Trilinos_ENABLE_AztecOO:BOOL=ON \
    -D Trilinos_ENABLE_Amesos2:BOOL=ON \
    -D Trilinos_ENABLE_ML:BOOL=ON \
    -D Trilinos_ENABLE_PyTrilinos:BOOL=OFF \
    \
    -D Trilinos_ENABLE_EXAMPLES:BOOL=OFF \
    -D Trilinos_ENABLE_TESTS:BOOL=OFF \
    \
    -D TPL_ENABLE_MATLAB:BOOL=OFF \
    -D TPL_ENABLE_Matio:BOOL=OFF \
    -D TPL_ENABLE_MPI:BOOL=ON \
    -D TPL_ENABLE_BLAS:BOOL=ON \
    -D TPL_ENABLE_LAPACK:BOOL=ON \
    -D TPL_ENABLE_QT:BOOL=OFF \
    -D TPL_ENABLE_X11:BOOL=OFF \
    -D TPL_ENABLE_SuperLU:BOOL=ON \
    -D TPL_SuperLU_LIBRARIES:PATH=/usr/lib/x86_64-linux-gnu \
    -D TPL_SuperLU_INCLUDE_DIRS:PATH=/usr/include/superlu \
    -D TPL_ENABLE_SuperLUDist:BOOL=ON \
    -D TPL_SuperLUDist_INCLUDE_DIRS:PATH=/usr/include/superlu-dist \
    -D TPL_SuperLUDist_LIBRARIES:PATH=/usr/lib/x86_64-linux-gnu \
    -D TPL_ENABLE_ParMETIS:BOOL=ON \
    \
    -D CMAKE_VERBOSE_MAKEFILE:BOOL=OFF \
    -D Trilinos_VERBOSE_CONFIGURE:BOOL=OFF \
    ..

and then tried to build with make. I've tried to build master branch and the latest release. Both failed with the same errors.

Your Environment

I'm trying to build Trilinos on Ubuntu 18.04 (Bionic Beaver). The SuperLU libraries were installed using apt-get install libsuperlu-dev libsuperlu-dist-dev.

@ndellingwood
Copy link
Contributor

@Filipe-Cumaru I'm guessing when cmake is run it isn't properly picking up the version of SuperLUDist which would set a macro needed for your version. Try adding this to your CMake line and hopefully it gets you past this.

-DHAVE_SUPERLUDIST_LUSTRUCTINIT_2ARG:BOOL=ON \

@Filipe-Cumaru
Copy link
Author

@ndellingwood Added the line and still got the same errors.

@ndellingwood
Copy link
Contributor

@Filipe-Cumaru just to check, did you blow away your previous build and CMakeCache and CMakeFiles?

@Filipe-Cumaru
Copy link
Author

Yes, I did.

@jhux2 jhux2 added impacting: configure or build The issue is primarily related to configuring or building pkg: Amesos2 labels Apr 9, 2019
@jhux2
Copy link
Member

jhux2 commented Apr 9, 2019

@trilinos/amesos2

@srajama1
Copy link
Contributor

srajama1 commented Apr 9, 2019

@ndellingwood gave you the right suggestion. It appears something is messed up in our configure. Do you have your configure o/p ? I am looking for lines that say SuperLU.

@Filipe-Cumaru
Copy link
Author

Those are the lines from the configure output about SuperLU.

-- Final kokkos settings variable:
--   env;KOKKOS_CMAKE=yes;KOKKOS_SRC_PATH=/home/facsa/Downloads/Trilinos-master/packages/kokkos;KOKKOS_PATH=/home/facsa/Downloads/Trilinos-master/packages/kokkos;KOKKOS_INSTALL_PATH=/home/facsa/Trilinos-SuperLU;KOKKOS_ARCH=None;KOKKOS_DEVICES=Serial;KOKKOS_DEBUG=yes;KOKKOS_OPTIONS=disable_dualview_modify_check
# ...
-- Performing Test HAVE_SUPERLUDIST_ENUM_NAMESPACE
-- Performing Test HAVE_SUPERLUDIST_ENUM_NAMESPACE - Success
-- Performing Test Trilinos_ENABLE_SuperLU5_API
-- Performing Test Trilinos_ENABLE_SuperLU5_API - Failed

@ndellingwood
Copy link
Contributor

@Filipe-Cumaru since the configure test is not properly picking up the SuperLU5 API, you may need to override some additional settings through the CMAKE_CXX_FLAGS. Try adding this to your configure:

-D CMAKE_CXX_FLAGS:STRING="-O3 -DHAVE_AMESOS2_SUPERLU5_API"
(you shouldn't need to specify the c++11 standard)

And if you are using Amesos or Ifpack2 you will need to add these options as well:
-DHAVE_AMESOS_SUPERLU5_API
-DHAVE_IFPACK2_SUPERLU5_API

@srajama1
Copy link
Contributor

srajama1 commented Apr 9, 2019

That last line is the problem. CMake is not able to compile a small program with SuperLU 5 (which is what we do test if SuperLU 5 is there). It could be because of various reasons - missing headers, libraries, wrong path etc. The suggestion above by @ndellingwood to force Amesos2 to believe that SuperLU 5 exists will help you make progress, but I think you might see where the original problem is. My current guess we are not able to find the library to link to.

@Filipe-Cumaru
Copy link
Author

Filipe-Cumaru commented Apr 9, 2019

@ndellingwood @srajama1 I noticed I didn't add the full path for SuperLU libraries in the CMake configure options. So I replaced these lines:

-D TPL_SuperLU_INCLUDE_DIRS:PATH=/usr/include/superlu \
-D TPL_SuperLUDist_LIBRARIES:PATH=/usr/lib/x86_64-linux-gnu \

with those:

-D TPL_SuperLU_LIBRARIES:PATH=/usr/lib/x86_64-linux-gnu/libsuperlu.so \
-D TPL_SuperLUDist_LIBRARIES:PATH=/usr/lib/x86_64-linux-gnu/libsuperlu_dist.so \

and now all tests pass (I also had to add -D ML_ENABLE_SuperLU:BOOL=OFF so that ML was properly configured). However, I still ran into the same issues when trying to build.

@srajama1
Copy link
Contributor

srajama1 commented Apr 9, 2019

Hmm ... what do you mean now all tests pass, but still running into same issues when building ? The configure doesn't have the error, but the build has. That might be due to stale CMake info from previous configure. Did you start fresh ? If not I suggest that ..

@Filipe-Cumaru
Copy link
Author

Hmm ... what do you mean now all tests pass, but still running into same issues when building ?

The Trilinos_ENABLE_SuperLU5_API test is now passing not the post-build tests.

The configure doesn't have the error, but the build has.

Before I changed those lines, I kept getting the warnings above. I didn't notice it could be an issue with the libraries paths until you mentioned it.

-- Configuring done
WARNING: Target "ml" requests linking to directory "/usr/lib/x86_64-linux-gnu".  Targets may link only to libraries.  CMake is dropping the item.
WARNING: Target "ml" requests linking to directory "/usr/lib/x86_64-linux-gnu".  Targets may link only to libraries.  CMake is dropping the item.
WARNING: Target "amesos2" requests linking to directory "/usr/lib/x86_64-linux-gnu".  Targets may link only to libraries.  CMake is dropping the item.
WARNING: Target "amesos2" requests linking to directory "/usr/lib/x86_64-linux-gnu".  Targets may link only to libraries.  CMake is dropping the item.
WARNING: Target "amesos2" requests linking to directory "/usr/lib/x86_64-linux-gnu".  Targets may link only to libraries.  CMake is dropping the item.
WARNING: Target "amesos2" requests linking to directory "/usr/lib/x86_64-linux-gnu".  Targets may link only to libraries.  CMake is dropping the item.

Did you start fresh ? If not I suggest that ..

Yes. I'm creating a directory for building the application and then deleting it before trying to build again.

@srajama1
Copy link
Contributor

srajama1 commented Apr 9, 2019

What is the build error now ? Same as the one in the top of this issue with LUStructInit ?

@Filipe-Cumaru
Copy link
Author

This is the full list of compilation errors after I add the the fixes you suggested to me. The issue with LUStructInit seems to be gone.

@srajama1
Copy link
Contributor

Now it looks like something has changed in SuperLU headers. We tested on 5.0 and you are using 5.2.1. I really wish they don't break backward compatibility in minor versions, but they have done it in the past. Is there a way you can use 5.0 ?

@Filipe-Cumaru
Copy link
Author

I'll try to install a previous version of SuperLU and then build Trilinos again.

@Filipe-Cumaru
Copy link
Author

Sorry for the delay. Since the SuperLU libraries prior to 5.2 are no longer available in the Ubuntu 18 repository, I tried to build and install it from source, but I wasn't able to do it. Hence, I can't tell whether there were any changes to the headers.

@github-actions
Copy link

This issue has had no activity for 365 days and is marked for closure. It will be closed after an additional 30 days of inactivity.
If you would like to keep this issue open please add a comment and/or remove the MARKED_FOR_CLOSURE label.
If this issue should be kept open even with no activity beyond the time limits you can add the label DO_NOT_AUTOCLOSE.
If it is ok for this issue to be closed, feel free to go ahead and close it. Please do not add any comments or change any labels or otherwise touch this issue unless your intention is to reset the inactivity counter for an additional year.

@github-actions github-actions bot added the MARKED_FOR_CLOSURE Issue or PR is marked for auto-closure by the GitHub Actions bot. label Aug 18, 2021
@github-actions
Copy link

This issue was closed due to inactivity for 395 days.

@github-actions github-actions bot added the CLOSED_DUE_TO_INACTIVITY Issue or PR has been closed by the GitHub Actions bot due to inactivity. label Sep 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLOSED_DUE_TO_INACTIVITY Issue or PR has been closed by the GitHub Actions bot due to inactivity. impacting: configure or build The issue is primarily related to configuring or building MARKED_FOR_CLOSURE Issue or PR is marked for auto-closure by the GitHub Actions bot. pkg: Amesos2
Projects
None yet
Development

No branches or pull requests

4 participants