[mpich-discuss] MPICH2 and LAPACK

Gus Correa gus at ldeo.columbia.edu
Mon May 10 22:04:52 CDT 2010


Hi Helvio

If the LAPACK and BLAS libraries are not in
conventional directories, the linker won't find them.

Try to pass the directories where they are to the mpif90 wrapper,
something like this:

mpif90 foo.f90 -L/path/to/lapack/lib -llapack -L/path/to/blas/lib -lblas

I hope this helps,
Gus Correa
---------------------------------------------------------------------
Gustavo Correa
Lamont-Doherty Earth Observatory - Columbia University
Palisades, NY, 10964-8000 - USA
---------------------------------------------------------------------

Hélvio Vairinhos wrote:
> Thanks for the reply! I tried to compile my code using:
> 
> % mpif90 foo.f90 -llapack -lblas
> 
> but I always get the following message:
> 
> % /bin///ld: cannot find -llapack
> % /bin///ld: cannot find -lblas
> 
> My test code is very simple:
>   1. I initialize MPI,
>   2. I construct two simple 5x5 matrices,
>   3. I call the matrix multiplication routine (xGEMM),
>   4. I print the result and RANK,
>   5. I finalize MPI.
> 
> In principle this should return and print as many matrices as CPU's I 
> use to run the executable. However, mpif90 doesn't seem to allow the 
> -llapack or -lblas flags... So, since apparently I can't use the 
> libraries from the Cygwin installation, how should I proceed to be able 
> to compile LAPACK routines with mpif90?
> 
> Cheers,
> 
> -- Hélvio
> 
> 
> On 10-05-2010 23:51, Pavan Balaji wrote:
>>
>> If I understand what you are doing correctly, you don't need to 
>> recompile LAPACK -- you can continue using the single process LAPACK 
>> functions within each MPI process. As you noted, you just compile your 
>> application with mpif90 instead of gfortran; everything else stays the 
>> same. For example, you can do:
>>
>> % mpif90 foo.f -llapack -lblas
>>
>> instead of
>>
>> % gfortran foo.f -llapack -lblas
>>
>>  -- Pavan
>>
>> On 05/10/2010 05:47 PM, Hélvio Vairinhos wrote:
>>> Hi, I am new to this forum, and this is my first post.
>>>
>>> I am developing a code in Fortran 90, and I use some basic MPI 
>>> commands and LAPACK routines. I work in a Windows platform, but I use 
>>> Cygwin for development. I use the LAPACK package that comes with the 
>>> Cygwin installation, which works perfectly fine when I compile F90 
>>> codes with gfortran (the usual -llapack -lblas flags). But now I want 
>>> to parallelized my code by adding some basic MPI commands. For this 
>>> purpose, I installed MPICH2 from source, and use mpif90 to compile my 
>>> parallel codes in Cygwin; it works perfectly fine! However, I don't 
>>> know how to compile my codes when both MPI commands and LAPACK 
>>> routine calls are present.
>>>
>>> So my questions are: How can I compile LAPACK routines (not 
>>> ScaLAPACK) with mpif90? Is it possible to use the LAPACK routines 
>>> that come with the Cygwin installation?
>>>
>>> Any help is appreciated. Thanks!
>>>
>>> -- Hélvio
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> mpich-discuss mailing list
>>> mpich-discuss at mcs.anl.gov
>>> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss
>>
> _______________________________________________
> mpich-discuss mailing list
> mpich-discuss at mcs.anl.gov
> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss



More information about the mpich-discuss mailing list