Results 1 to 5 of 5

Thread: Linking LAPACK and Fortran

  1. #1
    Join Date
    Feb 2014
    Beans
    6

    Linking LAPACK and Fortran

    I am running 12.04 on a 64-bit machine and I am trying to compile a Fortran 90 program. I installed the LAPACK files through Synaptic but when I try to compile the program I am told "Fatal Error Can't find module file 'lapack.mod' for reading at (1): No such file or directory.

    My original attempts include:
    gfortran test.f90 -L/usr/lib/lapack -liblapack.a

    The file locations are correct. I'm just happy to take whatever information you can offer.

  2. #2
    Join Date
    Apr 2012
    Beans
    7,256

    Re: Linking LAPACK and Fortran

    DISCLAIMER: I don't really use fortran - I just have a perverse interest in this kind of thing

    I don't think your error is related to linking the lapack library (at least not directly) - it's telling you that the test executable needs a local module called lapack.mod. Where did you get the test.f90 file from? is there also a lapack.f90 file? if so you would need to compile that as well, either as a separate step or something like

    Code:
    gfortran lapack.f90 test.f90 -llapack
    See for example --> http://www.cs.mtu.edu/~shene/COURSES...mod-files.html

  3. #3
    Join Date
    Feb 2014
    Beans
    6

    Re: Linking LAPACK and Fortran

    Upon downloading from Synaptic there is no lapack.f90 file. the test.f90 is just my own piece of code.

    I typed "whereis lapack.mod" and my output was the same as the directory I was using before so I'm a little baffled.

  4. #4
    Join Date
    Apr 2012
    Beans
    7,256

    Re: Linking LAPACK and Fortran

    I'm confused - do you mean there *is* a lapack.mod file in your current directory? or in the /usr/lib/lapack directory? I can't find a reference to such a file in any of the system packages

  5. #5
    Join Date
    Feb 2014
    Beans
    6

    Re: Linking LAPACK and Fortran

    I meant in the /usr/lib/lapack directory. Didn't mean to be so ambiguous.Screenshot from 2014-05-23 12:36:54.png

Tags for this Thread

Bookmarks

Posting Permissions

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