I am trying to write a simple differental equation solver in mpi and fortran. I figured I may as well get familiar with using ATLAS/LAPACK/BLAS routines as they seem quite useful for any future numerical modeling I might do. I installed ATLAS via macports. I use gcc 4.4 (also installed via macports.)
I am mostly开发者_运维知识库 self taught, and have never used ATLAS, BLAS, LAPACK, or any "library" knowingly (I have used "include" statements or their equivalents in C++ Java and Perl--but without full understanding of how they work.)
I would just like to be able to write a code that solves Ax=b in fortran using ATLAS. I have looked for sample code, but it seems to require "pgi." After much googling I still have no idea what "pgi" is or what it does. Typing "add pgi" in terminal just told me that "add: command not found"
I use a mac 10.5.8 in case that is of any direct relevance.
I hope this is a reasonable place to ask this question.
One aspect: have to be sure to include the libraries when you link. This can be done with the compile command with the "-l" option to name the library. If the library is in an unusual directory you may also need the "-L" option to tell the linker where to find it. If you are using the macports gfortran and macports installed libraries, you will probably not need the "-L" option. Macports libraries will be in /opt/local/lib, so if you need the option: "-L/opt/local/lib". When you specify the name of the library with the "-l" option, the convention is that you leave of "lib" and the filetype, so "-latlas".
You may need a "use" statement in your Fortran source code for some libraries.
As a beginner at parallel programming, you will probably find OpenMP easier than MPI. I suggest trying things in stages -- get your sequential program working first, then think about parallel programming.
There are some examples of the use of lapack at http://people.sc.fsu.edu/~jburkardt/f_src/lapack/lapack.html. John Burkardt may have other examples of use to you.
精彩评论