[CMake] Extension proposal: CheckFortranFuinctionExists.cmake

Hauke Heibel heibel at cs.tum.edu
Thu Jun 26 03:56:27 EDT 2008


Ok, now that we have collected a list of problems/facts, I have the 
feeling that
we need to step back and make a wishlist... There is no way in writing an
all-purpose version scripts since there exist contradictory paradigms.

I will start by the list of problems/facts:
* BLAS and CBLAS do have different interfaces
* LAPACK and CLAPACK do have different interfaces
* Fortran underscoring issues

What I do not regard as a problem:
* Missing interface headers / proxies (up to the developer)
* Memory layout (row vs. column major, actually it's part of the interface)
* The case when a C/C++ developer wants to use a Fotran compiled library.
  It is sometimes required (e.g. for CBLAS) and the devloper better has 
some
  good unit tests at hand to do the final error checking...


And now to my wishlist:
1) FindBLAS.cmake:
------------------
a) Should work without a Fortran compiler (CBLAS requires BLAS)
b) Support for f2c'ed versions (afaik, requires additional dependencies)
c) Optimized alternatives should get higher priority in the search than
   non-optimized ones
d) Should figure out and store the used underscoring convention
   (I am absolutely not sure about this one...)

2) FindCBLAS.cmake:
-------------------
a) Well, we need it (I already told Alan, that I am willing to write it)
b) Should be able to use FindBLAS.cmake (Legacy BLAS is required by CBLAS),
   even without a Fotran compiler being present...

2) FindCBLAS.cmake:
-------------------
Things I assume to be true from the script's point of view
* A sane system, i.e. not 10 different versions of BLAS & Co.
  The script will simply return the first one it stumbles upon
* BLAS and commercial alternatives may though coexist.
  The script might return at first optimized versions and then
  non-optimized ones.

Actually, the Fortran underscoring remains an issue, since there exist two
possible solutions (that is also the main reason, why we cannot have a 
general
purpose script).

a) We try to figure out the underscoring convention from within the script
   since some libraries that require BLAS offer the possibility to set 
the used
   convention via pre-processor defines.

b) We let the developer tell the script the desired convention via a 
variable.

In my opinion the latter solution is as valid as the first one since the
developer is actually writing the CMake script, so he should know which
convention he wants to have. From a CMake-script implementation point of 
view
the latter solution is simmpler to implement but requires the user to pass a
parameter to FindBLAS.cmake.
This first method has the advantage that in case of a library supporting
dynamic underscoring convention configuration via pre-processor defines,
people could use one and the same library with one or the other convention.

Before starting we need to be sure that we know exactly what we want,
especially regarding the underscoring issue.

So let's go for the next round... :)

- Hauke

-- 
Tim Hauke Heibel
Computer Aided Medical Procedures (CAMP)
fon: +49 89 289 19427
fax: +49 89 289 17059



More information about the CMake mailing list