Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Makefile library issues: gsl and lapack

  1. Aug 29, 2012 #1
    I don't have all of the info at my finger tips because I had to come to work and leave my comp at home, but here is my issue and I can post extra info if anyone has questions:

    I am working with a professor who has me running his code (C++) that links to gsl and lapack. Specifically, the code itself has a file that is the interface between the fortran lapack and the C++ code he wrote. The code also uses the gsl minimizer and another gsl function that I don't recall right now.
    I am running the big program on a school machine that I ssh into, but it is helpful to run a smaller version on my home computer. I just bought a new computer which is running Debian Wheezy (could this be part of the problem? it isn't fully stable, but development is frozen). I downloaded gsl and followed the GNU installation steps. Then I downloaded lapack, unpacked and ran make -install for both lapack and BLAS.
    In my makefile, I have

    LIBRARIES = -L/usr/lib -lgsl -lblas -llapack

    in /usr/lib the files liblapack.o.3 and libblas.o.3 (or something like that. I forget the exact file ending) exist. When I ran this on my old computer, a Mac laptop, the analogous directory was the correct one to use. However, Macintosh computers ship with veclib which takes the place of lapack, so the makefile is fairly different.

    If anyone has any advice or knows a good place to look, let me know. The professor has other things to deal with, so I think this is my problem.

    PS the lapack and gsl sites have tons of excellent information, but it all assumes that you are not a moron... and has therefore not been helpful to me
  2. jcsd
  3. Aug 29, 2012 #2
    Not that I am going to be able to help; but I thought I'd warn you that your post is not that clear...can you go ahead and ,clearly and explicitly, ask a separate question or two? and don't ask double-barreled questions, either.
  4. Aug 29, 2012 #3
    If I had a specific question, a quick google search pretty much always finds the answer since it seems that linux users post everything that happens. The amount of information that I would need to post to ask a specific question would be rude. I'm sure that I'm linking to the wrong library or I'm missing something, but if I knew which part to ask the question about, I wouldn't have the question. I'm really just hoping for some resources, and if nobody has any, I'll figure it out eventually.

    I don't think that this is a double barreled question since gsl uses lapack and blas. In fact, the problem may be that I did not have CBLAS installed, which I'm working on.
  5. Aug 30, 2012 #4


    User Avatar
    Science Advisor

    It sounds like you're on the right track. So what happens when you try to compile it? If you get specific error messages, post these and we'll try to help you figure it out. I usually find that when I am installing a large piece of software, I am in for a few hours of work getting all of the libraries installed and all of the compiler directives right.
  6. Aug 30, 2012 #5
    I did not accused you of asking double-barreled question, just warn you to be careful not to do it when you ask a question; in fact, you did not have a single question in your original post, nor the second...hence, my request for at least one.

    As far as amount of info, it is the other way around...the amount of information needed if you had a specific question would actually be pretty minimal.

    Nevertheless, it looks like we may be going somewhere...

    In you second post you say that your are linking to the wrong library...

    So, do you have any error messages when you link?
    Or, do you have any error messages when you run after what might seem a succesfull link?
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook