clapack_dpotrf not found in liblapack?

Help
Reiko
2009-01-04
2013-01-09
  • Reiko
    Reiko
    2009-01-04

    Hello,

    I am having problem with accessing a function in liblapack.
    I have created a simple file "conftest.c":

    #include "/opt/local/include/clapack.h"
    int
    main ()
    {
      clapack_dpotrf (0,0,0,0,0);
      ;
      return 0;
    }

    and attempted to compile it with the command:

    cc -L/opt/local/lib -llapack -cblas -lm -o conftest conftest.c

    which gives the link error:

    Undefined symbols:
      "_clapack_dpotrf", referenced from:
          _main in ccvdjdUt.o
    ld: symbol(s) not found
    collect2: ld returned 1 exit status

    I do have a file /opt/local/lib/liblapack.a (it is a MacOSX darwinport install, atlas 3.8.2_0), and it seems to include the string _clapack_dpotrf.  Perhaps I have some other lapack that is interfering, but the only one that looks close enough is

    /usr/lib/liblapack.dylib (something that came with the original MacOSX).

    ...but this file doesn't contain the string clapack_dpotrf.  I don't know how to proceed from here.  How can I get the compiler to see where clapack_dpotrf is?  Any help is appreciated.

    Cheers,
    Reiko

     
    • Reiko
      Reiko
      2009-01-04

      I should have clarified that I also tried

      cc -o conftest conftest.c  /opt/local/lib/liblapack.a /opt/local/lib/libcblas.a

      according to the 3.8.2 errata, and this does not work either.

      Cheers,
      Reiko

       
    • Reiko
      Reiko
      2009-01-05

      Hello,

      Here is what I found:

      The darwinport installation of atlas 3.8.2_0 has a liblapack.a that doesn't seem to link to clapack_dpotrf.

      I've installed atlas 3.6.0 manually, and with the command

      cc -o conftest conftest.c /my/ATLAS3.6.0/lib/path/liblapack.a /my/ATLAS3.6.0/lib/path/libcblas.a /my/ATLAS3.6.0/lib/path/libatlas.a

      the compilation and linking went fine.  It also links with the main program that I need.

      The atlas package is for use with SCAMP, an astrometry software from Terapix, which requires polynomial fitting to remove the telescope optical distortion.  Thanks for having atlas available for the scientific community.

      Cheers,
      Reiko