[MacPorts] #50311: gmt5: build fails on Mavericks: error: conflicting types for 'dsyev_'

MacPorts noreply at macports.org
Sat Mar 19 07:10:04 PDT 2016


#50311: gmt5: build fails on Mavericks: error: conflicting types for 'dsyev_'
---------------------+-----------------------
  Reporter:  mp@…    |      Owner:  florian@…
      Type:  defect  |     Status:  new
  Priority:  Normal  |  Milestone:
 Component:  ports   |    Version:  2.3.4
Resolution:          |   Keywords:
      Port:  gmt5    |
---------------------+-----------------------

Comment (by takeshi@…):

 I was able to reproduce the problem with +universal. I was able to compile
 {{{gmt_vector.c}}} without error with the source edit suggested by Mojca.
 However I was able to compile the following source using {{{dsyev_}}}
 adopted from http://www.jsces.org/Issue/Journal/pdf/nakata-0411.pdf (text
 in Japanese) with {{{clang++ -arch i386 foo.cc -framework Accelerate}}}.
 The result matches that built for x86_64. I'm confused...

 {{{
 //dsyev
 #include <iostream>
 #include <stdio.h>
 extern "C" int dsyev_(const char *jobz, const char *uplo, int *n, double
 *a, int *lda, double *w, double *work, int *lwork, int *info);
 //Matlab/Octave format
 void printmat(int N, int M, double *A, int LDA) {
   double mtmp;
   printf("[ ");
   for (int i = 0; i < N; i++) {
     printf("[ ");
     for (int j = 0; j < M; j++) {
       mtmp = A[i + j * LDA]; printf("%5.2e", mtmp);
       if (j < M - 1) printf(", ");
     } if (i < N - 1) printf("]; ");
    else printf("] ");
   } printf("]");
 }
 int main()
 {
   int n=3;
   int lwork, info;
   double *A = new double[n*n]; double *w = new double[n];
   //setting A matrix
   A[0+0*n]=1;A[0+1*n]=2;A[0+2*n]=3; A[1+0*n]=2;A[1+1*n]=5;A[1+2*n]=4;
 A[2+0*n]=3;A[2+1*n]=4;A[2+2*n]=6;
   printf("A ="); printmat(n, n, A, n); printf("\n");
   lwork = -1;
   double *work = new double[1];
   dsyev_("V", "U", &n, A, &n, w, work, &lwork, &info); lwork =
 (int)work[0];
   delete[]work;
   work = new double[std::max((int) 1, lwork)]; //get Eigenvalue
   dsyev_("V", "U", &n, A, &n, w, work, &lwork, &info); //print out some
 results.
   printf("#eigenvalues \n"); printf("w ="); printmat(n, 1, w, 1);
 printf("\n"); printf("#eigenvecs \n"); printf("U ="); printmat(n, n, A,
 n); printf("\n"); printf("#Check Matlab/Octave by:\n");
 printf("eig(A)\n");
   printf("U'*A*U\n"); delete[]work; delete[]w; delete[]A;
 }
 }}}

-- 
Ticket URL: <https://trac.macports.org/ticket/50311#comment:5>
MacPorts <https://www.macports.org/>
Ports system for OS X


More information about the macports-tickets mailing list