[CMake] CheckFortranFunctionExists for dummies

Biddiscombe, John A. biddisco at cscs.ch
Sun Dec 19 14:41:31 EST 2010


There are some examples of usage in the hdf5 1.8.5/6 cmakelists files. Google should find you a download location and if you then look in the fortran sub directory there's some examples there.

JB

-----Original Message-----
From: cmake-bounces at cmake.org [mailto:cmake-bounces at cmake.org] On Behalf Of luxInteg
Sent: 18 December 2010 03:31
To: cmake at cmake.org
Subject: [CMake] CheckFortranFunctionExists for dummies

Greetings

I want to learn to use CheckFortranFunctionExists.cmake.  I am assuming it 
works as CheckFunctionExist.cmake.

The cmake documentation gave the following description:-
-------------------------------------------------------------
CheckFortranFunctionExists: macro which checks if the Fortran function exists
 
CHECK_FORTRAN_FUNCTION_EXISTS(FUNCTION VARIABLE)
  FUNCTION - the name of the Fortran function
  VARIABLE - variable to store the result

The following variables may be set before calling this macro to modify the way 
the check is run:
  CMAKE_REQUIRED_LIBRARIES = list of libraries to link
--------------------------------------------------------------

The only example usage I have found is in FindBLAS.cmake  and therein   the 
examples are far from clear.      I   thus have not been able to find any  
straightforwad  examples of  ${FUNCTIONS} (eg XXX)  and 
{VARIABLES}  (eg -DHAVE_XXXX???  to substitute in the above ).  

I have  below the  excerpt from an  auto-tools spew which I would like to use 
as a trainer   for using  CheckFortranFunctionExists.cmake:-

-----------------------------
checking if BLAS, ATLAS or MKL is available... 
checking how to get verbose linking output from gfortran... -v
checking for Fortran 77 libraries of gfortran...  -L/usr/local/atlas/lib -
L/usr/local/numerics6/static_lib -L/usr/local/numerics6/lib -
L/usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.2 -L/usr/lib/gcc/x86_64-unknown-
linux-gnu/4.4.2/../../../../lib -L/lib/../lib -L/usr/lib/../lib -
L/usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.2/../../.. -lpthread -ldl -lcurses 
-lgfortranbegin -lgfortran -lm
checking for dummy main to link with Fortran 77 libraries... none
checking for Fortran 77 name-mangling scheme... lower case, underscore, no 
extra underscore
checking for sgemm_... no
checking for ATL_xerbla in -latlas... yes
checking for sgemm_ in -lf77blas... yes
checking for cblas_dgemm in -lcblas... yes
Atlas found
-------

checking whether LSAME is called correctly from Fortran... yes
checking whether ISAMAX is called correctly from Fortran... yes
checking whether SDOT is called correctly from Fortran... yes
checking whether DDOT is called correctly from Fortran... yes
checking whether CDOTU is called correctly from Fortran... yes
checking whether ZDOTU is called correctly from Fortran... yes
checking whether the integer size is correct... yes
------------------------

but I do not know how to   translate stuff
----------referred to for example in this line ---:
checking for Fortran 77 name-mangling scheme... lower case, underscore, no 
extra underscore 

----------or what is refered to  in  this line----- :
checking whether DDOT is called correctly from Fortran... yes





into  syntax to feed into  CHECK_FORTRAN_FUNCTION_EXISTS()


advice would be appreciated
luxInteg
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


More information about the CMake mailing list