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

CEpetra_LAPACK: "no matching function for call to Epetra_LAPACK::GGSVD" with HAVE_EPETRA_LAPACK_GSSVD3 #2448

Closed
edmondac opened this issue Mar 23, 2018 · 8 comments
Labels
CLOSED_DUE_TO_INACTIVITY Issue or PR has been closed by the GitHub Actions bot due to inactivity. MARKED_FOR_CLOSURE Issue or PR is marked for auto-closure by the GitHub Actions bot. pkg: Epetra

Comments

@edmondac
Copy link

edmondac commented Mar 23, 2018

I'm trying to build Trilinos but get the following error:

 <PATH>/trilinos-12.12.1-Source/packages/CTrilinos/src/epetra/CEpetra_LAPACK.cpp: In function ‘void Epetra_LAPACK_GGSVD_double(CT_Epetra_LAPACK_ID_t, char, char, char, i    nt, int, int, int*, int*, double*, int, double*, int, double*, double*, double*, int, double*, int, double*, int, double*, int*, int*)’:
  <PATH>/trilinos-12.12.1-Source/packages/CTrilinos/src/epetra/CEpetra_LAPACK.cpp:612:76: error: no matching function for call to ‘Epetra_LAPACK::GGSVD(const char&, const     char&, const char&, const int&, const int&, const int&, int*&, int*&, double*&, const int&, double*&, const int&, double*&, double*&, double*&, const int&, double*&, const int&, double*&, const int&, double*&, int*&, int*&) const’
          LDA, B, LDB, ALPHA, BETA, U, LDU, V, LDV, Q, LDQ, WORK, IWORK, INFO);
                                                                             ^
 In file included from <PATH>/trilinos-12.12.1-Source/packages/CTrilinos/src/epetra/CEpetra_LAPACK_Cpp.hpp:52:0,
                  from <PATH>/trilinos-12.12.1-Source/packages/CTrilinos/src/epetra/CEpetra_LAPACK.cpp:50:
 <PATH>/trilinos-12.12.1-Source/packages/epetra/src/Epetra_LAPACK.h:279:8: note: candidate: void Epetra_LAPACK::GGSVD(char, char, char, int, int, int, int*, int*, double    *, int, double*, int, double*, double*, double*, int, double*, int, double*, int, double*, int, int*, int*) const
    void GGSVD(const char JOBU, const char JOBV, const char JOBQ, const int M, const int N, const int P, int * K, int * L,  double* A,  const int LDA,  double* B,  const int LDB,
         ^~~~~
 <PATH>/trilinos-12.12.1-Source/packages/epetra/src/Epetra_LAPACK.h:279:8: note:   candidate expects 24 arguments, 23 provided
 <PATH>/trilinos-12.12.1-Source/packages/epetra/src/Epetra_LAPACK.h:286:8: note: candidate: void Epetra_LAPACK::GGSVD(char, char, char, int, int, int, int*, int*, float*    , int, float*, int, float*, float*, float*, int, float*, int, float*, int, float*, int, int*, int*) const
    void GGSVD(const char JOBU, const char JOBV, const char JOBQ, const int M, const int N, const int P, int * K, int * L,  float* A,  const int LDA,  float* B,  const int LDB,
         ^~~~~
 <PATH>/trilinos-12.12.1-Source/packages/epetra/src/Epetra_LAPACK.h:286:8: note:   candidate expects 24 arguments, 23 provided
 <PATH>/trilinos-12.12.1-Source/packages/CTrilinos/src/epetra/CEpetra_LAPACK.cpp: In function ‘void Epetra_LAPACK_GGSVD_float(CT_Epetra_LAPACK_ID_t, char, char, char, in    t, int, int, int*, int*, float*, int, float*, int, float*, float*, float*, int, float*, int, float*, int, float*, int*, int*)’:
 <PATH>/trilinos-12.12.1-Source/packages/CTrilinos/src/epetra/CEpetra_LAPACK.cpp:624:76: error: no matching function for call to ‘Epetra_LAPACK::GGSVD(const char&, const     char&, const char&, const int&, const int&, const int&, int*&, int*&, float*&, const int&, float*&, const int&, float*&, float*&, float*&, const int&, float*&, const int&, float*&, const int&, float*&, int*&, int*&) const’
          LDA, B, LDB, ALPHA, BETA, U, LDU, V, LDV, Q, LDQ, WORK, IWORK, INFO);
                                                                             ^
 In file included from <PATH>/trilinos-12.12.1-Source/packages/CTrilinos/src/epetra/CEpetra_LAPACK_Cpp.hpp:52:0,
                  from <PATH>/trilinos-12.12.1-Source/packages/CTrilinos/src/epetra/CEpetra_LAPACK.cpp:50:
 <PATH>/trilinos-12.12.1-Source/packages/epetra/src/Epetra_LAPACK.h:279:8: note: candidate: void Epetra_LAPACK::GGSVD(char, char, char, int, int, int, int*, int*, double    *, int, double*, int, double*, double*, double*, int, double*, int, double*, int, double*, int, int*, int*) const
    void GGSVD(const char JOBU, const char JOBV, const char JOBQ, const int M, const int N, const int P, int * K, int * L,  double* A,  const int LDA,  double* B,  const int LDB,
         ^~~~~
 <PATH>/trilinos-12.12.1-Source/packages/epetra/src/Epetra_LAPACK.h:279:8: note:   candidate expects 24 arguments, 23 provided
 <PATH>/trilinos-12.12.1-Source/packages/epetra/src/Epetra_LAPACK.h:286:8: note: candidate: void Epetra_LAPACK::GGSVD(char, char, char, int, int, int, int*, int*, float*    , int, float*, int, float*, float*, float*, int, float*, int, float*, int, float*, int, int*, int*) const
    void GGSVD(const char JOBU, const char JOBV, const char JOBQ, const int M, const int N, const int P, int * K, int * L,  float* A,  const int LDA,  float* B,  const int LDB,
         ^~~~~
 <PATH>/trilinos-12.12.1-Source/packages/epetra/src/Epetra_LAPACK.h:286:8: note:   candidate expects 24 arguments, 23 provided

The problem seems to stem from packages/epetra/src/Epetra_LAPACK.cpp having been changed to add an extra argument for GSSVD3 but packages/CTrilinos/src/epetra/CEpetra_LAPACK.cpp not so:

packages/CTrilinos/src/epetra/CEpetra_LAPACK.cpp:

 603 void Epetra_LAPACK_GGSVD_double ( 
 604   CT_Epetra_LAPACK_ID_t selfID, const char JOBU, const char JOBV, 
 605   const char JOBQ, const int M, const int N, const int P, int * K, 
 606   int * L, double * A, const int LDA, double * B, const int LDB, 
 607   double * ALPHA, double * BETA, double * U, const int LDU, 
 608   double * V, const int LDV, double * Q, const int LDQ, 
 609   double * WORK, int * IWORK, int * INFO )
 610 {
 611     CEpetra::getConstLAPACK(selfID)->GGSVD(JOBU, JOBV, JOBQ, M, N, P, K, L, A, 
 612         LDA, B, LDB, ALPHA, BETA, U, LDU, V, LDV, Q, LDQ, WORK, IWORK, INFO);
 613 }
 614 
 615 void Epetra_LAPACK_GGSVD_float ( 
 616   CT_Epetra_LAPACK_ID_t selfID, const char JOBU, const char JOBV, 
 617   const char JOBQ, const int M, const int N, const int P, int * K, 
 618   int * L, float * A, const int LDA, float * B, const int LDB, 
 619   float * ALPHA, float * BETA, float * U, const int LDU, float * V, 
 620   const int LDV, float * Q, const int LDQ, float * WORK, 
 621   int * IWORK, int * INFO )
 622 {
 623     CEpetra::getConstLAPACK(selfID)->GGSVD(JOBU, JOBV, JOBQ, M, N, P, K, L, A, 
 624         LDA, B, LDB, ALPHA, BETA, U, LDU, V, LDV, Q, LDQ, WORK, IWORK, INFO);
 625 }

packages/epetra/src/Epetra_LAPACK.cpp

363 //=============================================================================
364 void Epetra_LAPACK::GGSVD(const char JOBU, const char JOBV, const char JOBQ, const int M, const int N, const int P, int * K, int * L,
365               double* A,  const int LDA,  double* B,  const int LDB,
366                           double* ALPHA,  double* BETA,  double* U,  const int LDU, double* V, const int LDV, double* Q, const int LDQ, double* WORK,
367           #ifdef HAVE_EPETRA_LAPACK_GSSVD3
368                           const int LWORK,
369           #endif
370                           int* IWORK, int* INFO) const {
371   DGGSVD_F77(CHAR_MACRO(JOBU), CHAR_MACRO(JOBV), CHAR_MACRO(JOBQ), &M, &N, &P, K, L,  A,  &LDA,  B,  &LDB,
372             ALPHA,  BETA,  U,  &LDU, V, &LDV, Q, &LDQ, WORK,
373           #ifdef HAVE_EPETRA_LAPACK_GSSVD3
374             &LWORK,
375           #endif
376             IWORK, INFO);
377 }
378 
379 //=============================================================================
380 void Epetra_LAPACK::GGSVD(const char JOBU, const char JOBV, const char JOBQ, const int M, const int N, const int P, int * K, int * L,
381               float* A,  const int LDA,  float* B,  const int LDB,
382                           float* ALPHA,  float* BETA,  float* U,  const int LDU, float* V, const int LDV, float* Q, const int LDQ, float* WORK,
383           #ifdef HAVE_EPETRA_LAPACK_GSSVD3
384                           const int LWORK,
385           #endif
386                           int* IWORK, int* INFO) const {
387   SGGSVD_F77(CHAR_MACRO(JOBU), CHAR_MACRO(JOBV), CHAR_MACRO(JOBQ), &M, &N, &P, K, L,  A,  &LDA,  B,  &LDB,
388             ALPHA,  BETA,  U,  &LDU, V, &LDV, Q, &LDQ, WORK,
389           #ifdef HAVE_EPETRA_LAPACK_GSSVD3
390             &LWORK,
391           #endif
392             IWORK, INFO);
393 }

I've got a patch that builds on my system, but it wouldn't work in the opposite situation as the header doesn't use an ifdef.

@edmondac
Copy link
Author

The patch is:

--- packages/CTrilinos/test/epetra/CEpetra_LAPACK_UnitTests.cpp.orig	2018-03-23 14:54:03.279789763 +0000
+++ packages/CTrilinos/test/epetra/CEpetra_LAPACK_UnitTests.cpp	2018-03-23 14:59:08.612644045 +0000
@@ -486,6 +486,9 @@
   int * L, double * A, const int LDA, double * B, const int LDB, 
   double * ALPHA, double * BETA, double * U, const int LDU, 
   double * V, const int LDV, double * Q, const int LDQ, 
+  #ifdef HAVE_EPETRA_LAPACK_GSSVD3
+    const int LWORK,
+  #endif
   double * WORK, int * IWORK, int * INFO );
  **********************************************************************/
 
@@ -496,6 +499,9 @@
   int * L, float * A, const int LDA, float * B, const int LDB, 
   float * ALPHA, float * BETA, float * U, const int LDU, float * V, 
   const int LDV, float * Q, const int LDQ, float * WORK, 
+  #ifdef HAVE_EPETRA_LAPACK_GSSVD3
+    const int LWORK,
+  #endif
   int * IWORK, int * INFO );
  **********************************************************************/
 
--- packages/CTrilinos/src/epetra/CEpetra_LAPACK.cpp.orig	2018-03-23 14:54:32.390877459 +0000
+++ packages/CTrilinos/src/epetra/CEpetra_LAPACK.cpp	2018-03-23 15:27:06.835668066 +0000
@@ -605,11 +605,14 @@
   const char JOBQ, const int M, const int N, const int P, int * K, 
   int * L, double * A, const int LDA, double * B, const int LDB, 
   double * ALPHA, double * BETA, double * U, const int LDU, 
-  double * V, const int LDV, double * Q, const int LDQ, 
-  double * WORK, int * IWORK, int * INFO )
+  double * V, const int LDV, double * Q, const int LDQ, double * WORK, 
+  #ifdef HAVE_EPETRA_LAPACK_GSSVD3
+    const int LWORK,
+  #endif
+  int * IWORK, int * INFO )
 {
     CEpetra::getConstLAPACK(selfID)->GGSVD(JOBU, JOBV, JOBQ, M, N, P, K, L, A, 
-        LDA, B, LDB, ALPHA, BETA, U, LDU, V, LDV, Q, LDQ, WORK, IWORK, INFO);
+        LDA, B, LDB, ALPHA, BETA, U, LDU, V, LDV, Q, LDQ, WORK, LWORK, IWORK, INFO);
 }
 
 void Epetra_LAPACK_GGSVD_float ( 
@@ -618,10 +621,13 @@
   int * L, float * A, const int LDA, float * B, const int LDB, 
   float * ALPHA, float * BETA, float * U, const int LDU, float * V, 
   const int LDV, float * Q, const int LDQ, float * WORK, 
+  #ifdef HAVE_EPETRA_LAPACK_GSSVD3
+    const int LWORK,
+  #endif
   int * IWORK, int * INFO )
 {
     CEpetra::getConstLAPACK(selfID)->GGSVD(JOBU, JOBV, JOBQ, M, N, P, K, L, A, 
-        LDA, B, LDB, ALPHA, BETA, U, LDU, V, LDV, Q, LDQ, WORK, IWORK, INFO);
+        LDA, B, LDB, ALPHA, BETA, U, LDU, V, LDV, Q, LDQ, WORK, LWORK, IWORK, INFO);
 }
 
 void Epetra_LAPACK_GEEV_double ( 
--- packages/CTrilinos/src/epetra/CEpetra_LAPACK.h.orig	2018-03-23 14:55:50.453108788 +0000
+++ packages/CTrilinos/src/epetra/CEpetra_LAPACK.h	2018-03-23 15:27:13.059687296 +0000
@@ -564,8 +564,8 @@
   const char JOBQ, const int M, const int N, const int P, int * K, 
   int * L, double * A, const int LDA, double * B, const int LDB, 
   double * ALPHA, double * BETA, double * U, const int LDU, 
-  double * V, const int LDV, double * Q, const int LDQ, 
-  double * WORK, int * IWORK, int * INFO );
+  double * V, const int LDV, double * Q, const int LDQ, double * WORK, 
+  const int LWORK, int * IWORK, int * INFO );
 
 /*! @brief Wrapper for 
    void Epetra_LAPACK::GGSVD(const char JOBU, const char JOBV, const char JOBQ, const int M, const int N, const int P, int * K, int * L, float* A, const int LDA, float* B, const int LDB, float* ALPHA, float* BETA, float* U, const int LDU, float* V, const int LDV, float* Q, const int LDQ, float* WORK, int* IWORK, int* INFO) const
@@ -576,7 +576,7 @@
   int * L, float * A, const int LDA, float * B, const int LDB, 
   float * ALPHA, float * BETA, float * U, const int LDU, float * V, 
   const int LDV, float * Q, const int LDQ, float * WORK, 
-  int * IWORK, int * INFO );
+  const int LWORK, int * IWORK, int * INFO );
 
 /*! @brief Wrapper for 
    void Epetra_LAPACK::GEEV(const char JOBVL, const char JOBVR, const int N, double* A, const int LDA, double* WR, double* WI, double* VL, const int LDVL, double* VR, const int LDVR, double* WORK, const int LWORK, int* INFO) const

But I'd like confirmation that this is ok, and someone to make a more generic fix!

@mhoemmen
Copy link
Contributor

@edmondac Thanks for the patch! Would you feel comfortable submitting this as a pull request against Trilinos' develop branch? We have automatic testing for pull requests.

@edmondac
Copy link
Author

Hi @mhoemmen - sure I'll make a pull request. I just have to sort out the #ifdef in the header file, since it will need one I think.

@mhoemmen
Copy link
Contributor

@edmondac I'm not quite sure I understand what you mean by the #ifdef -- are you worried about supporting both versions of the LAPACK function?

@edmondac
Copy link
Author

edmondac commented Mar 31, 2018

@mhoemmen - this will sound like a silly question... What's the correct procedure for a pull request from the CTrilinos repo? Should I have created this issue in there? The files I needed to change were all in that repo...

@edmondac
Copy link
Author

I've created a PR: trilinos/CTrilinos#1

@github-actions
Copy link

github-actions bot commented Jun 5, 2021

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 Jun 5, 2021
@github-actions
Copy link

github-actions bot commented Jul 7, 2021

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 Jul 7, 2021
@github-actions github-actions bot closed this as completed Jul 7, 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. MARKED_FOR_CLOSURE Issue or PR is marked for auto-closure by the GitHub Actions bot. pkg: Epetra
Projects
None yet
Development

No branches or pull requests

2 participants