Find the answer to your Linux question:
Results 1 to 4 of 4
Behold, WindowsDude is back! I have problems linking stuff. I have this single library dpotrf that I want to use. I declare it like this: Code: extern void dpotrf_(char*, int*, ...
  1. #1
    Just Joined! WindowsDude's Avatar
    Join Date
    May 2010
    Location
    Wintopia
    Posts
    12

    How to link

    Behold, WindowsDude is back!

    I have problems linking stuff. I have this single library dpotrf that I want to use. I declare it like this:

    Code:
    extern void dpotrf_(char*, int*, double**, int*, int*);
    And call it somewhere in main:
    Code:
    dpotrf_(&uplow, &order, A, &size, &info);
    The problem is that I have to link it somehow. It is a .f file, and last time I worked with it it seems like I compiled it into a .o file using ifort I guess. So I have the .o file already.

    I think I can include it like this, but I have no idea because the syntax isn't intuitive:
    icc -std=c99 -03 main.c dpotrf.o

    Ok great, I get different errors, now it seems like this library requires other libraries. Consequently I do like this:

    icc -std=c99 -O3 main.c dpotrf.o lsame.o xerbla.o ilaenv.o dsyrk.o dpotf2.o dgemm.o dtrsm.o ddot.o dgemv.o dscal.o

    But I still get complaints
    xerbla.o: In function `xerbla_':
    xerbla.f:(.text+0x45): undefined reference to `for_write_seq_fmt'
    xerbla.f:(.text+0x62): undefined reference to `for_write_seq_fmt_xmit'
    xerbla.f:(.text+0x7f): undefined reference to `for_stop_core'
    ilaenv.o: In function `ilaenv_':
    ilaenv.f:(.text+0x7a): undefined reference to `for_cpystr'

    How can I avoid these godforsaken errors?

    On some random site on the net I found that I should include this -L/opt/intel/Compiler/11.1/072/lib but it didn't help.

  2. #2
    Just Joined! WindowsDude's Avatar
    Join Date
    May 2010
    Location
    Wintopia
    Posts
    12
    WindowsDude unexpectedly found the answer by doing like this:

    icc -L/opt/intel/Compiler/11.1/072/lib main.c -std=c99 -O3 dpotrf.o lsame.o xerbla.o ilaenv.o dsyrk.o dpotf2.o dgemm.o dtrsm.o ddot.o dgemv.o dscal.o -L/opt/intel/Compiler -Bstatic -lifport -lifcore -Bdynamic -limf


    But the function completes in almost no time. Could be an error?

  3. #3
    Linux Newbie unlimitedscolobb's Avatar
    Join Date
    Jan 2008
    Posts
    120
    Quote Originally Posted by WindowsDude View Post
    But the function completes in almost no time. Could be an error?
    Well, if you don't get build errors or runtime errors, then you should just check what result your function yields. If it's okay, everything is okay (I hope I understood your question right.)

  4. #4
    Just Joined! WindowsDude's Avatar
    Join Date
    May 2010
    Location
    Wintopia
    Posts
    12
    Yes, unfortunately I had to do that. But I don't remember what was wrong.

    This problem should be solved now. But the terminal thing from that other thread still bothers me.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...