[CMake] FindLAPACK/FindBLAS require Fortran compiler. Why?

Alin M Elena alinm.elena at googlemail.com
Tue Jul 7 04:46:25 EDT 2009


Hi Marcel,

There are two reasons for that.
1. The way in which FindBlas and Lapack are working. They check that actually 
you can link against this libs, by writing a small Fortran call program. 
2. They are for Fortran use projects. Calling fortran functions from C/C++, in 
a portable way, is not as simple as it looks.

As the modules do a little bit more than just finding some names, we decided 
some time ago that is better to keep Fortran versions FindBlas/Lapack and in 
future if necessary to add C versions.

As a note, if you are interested in mixing C/C++/Fortran I will recommend you 
the iso_c_binding module, from Fortran 2003 standard as a portable, standard 
way of doing it.

regards,

Alin

-- 
 ______________________________________________________________________
 "If the Universities will not study useless subjects, who will?"
                             G. F. FitzGerald, Nature, 45/46, 392 (1892)
 ______________________________________________________________________
 Mr  Alin M ELENA
 Irish Centre for High-End Computing -- www.ichec.ie
 The Design Tower, Trinity Technology & Enterprise Campus
 Grand Canal Quay,  Dublin 2, Ireland
 Tel:   +353 (0) 1 5241608 ext 29
 Fax: +353 (0) 1 7645845
 http://alin.elenaworld.net
 alin.elena at ichec.ie
 alinm.elena at gmail.com
 ______________________________________________________________________
On Tuesday 07 July 2009 09:31:57 cmake-request at cmake.org wrote:
> Message: 5
> Date: Tue, 07 Jul 2009 10:11:21 +0200
> From: "Marcel Loose" <loose at astron.nl>
> Subject: [CMake] FindLAPACK/FindBLAS require Fortran compiler. Why?
> To: <cmake at cmake.org>
> Message-ID: <4A531F4902000020000062F6 at server7.nfra.nl>
> Content-Type: text/plain; charset=US-ASCII
>
> Hi all,
>
> I noticed that FindLAPACK and FindBLAS require that you enable Fortran
> as language, which causes CMake to check for a working Fortran
> compiler.
> IMHO, you only need the fortran runtime libraries, cause you're only
> linking against the Lapack/Blas libraries. Most Linux distro's have
> separate packages for compiler and runtime libraries.
>
> Is there a good reason for FindLAPACK and FindBLAS to require a working
> Fortran compiler?
>
> Best regards,
> Marcel Loose.


More information about the CMake mailing list