libflame  12600
FLA_f77_name_mangling.h
Go to the documentation of this file.
00001 /*
00002    libflame
00003    An object-based infrastructure for developing high-performance
00004    dense linear algebra libraries.
00005 
00006    Copyright (C) 2011, The University of Texas
00007 
00008    libflame is free software; you can redistribute it and/or modify
00009    it under the terms of the GNU Lesser General Public License as
00010    published by the Free Software Foundation; either version 2.1 of
00011    the License, or (at your option) any later version.
00012 
00013    libflame is distributed in the hope that it will be useful, but
00014    WITHOUT ANY WARRANTY; without even the implied warranty of
00015    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00016    Lesser General Public License for more details.
00017 
00018    You should have received a copy of the GNU Lesser General Public
00019    License along with libflame; if you did not receive a copy, see
00020    http://www.gnu.org/licenses/.
00021 
00022    For more information, please contact us at flame@cs.utexas.edu or
00023    send mail to:
00024 
00025    Field G. Van Zee and/or
00026    Robert A. van de Geijn
00027    The University of Texas at Austin
00028    Department of Computer Sciences
00029    1 University Station C0500
00030    Austin TX 78712
00031 */
00032 
00033 // --- Define Fortran name-mangling macro --------------------------------------
00034 
00035 // If the F77_FUNC name-mangling macro is undefined, then we we need to define
00036 // it ourselves.
00037 #ifndef F77_FUNC
00038 
00039   // Case 1: F77_FUNC is undefined because we're building for Windows.
00040   #ifdef FLA_ENABLE_WINDOWS_BUILD
00041 
00042     // Check whether we need to use uppercase BLAS routine names; otherwise
00043     // default to lowercase.
00044     #ifdef FLA_ENABLE_UPPERCASE_BLAS
00045 
00046       // Use uppercase routine names (no underscore).
00047       #define F77_FUNC( name_lower, name_upper ) \
00048               name_upper
00049     #else
00050 
00051       // Use lowercase routine names (no underscore).
00052       #define F77_FUNC( name_lower, name_upper ) \
00053               name_lower
00054     #endif
00055 
00056   // Case 2: F77_FUNC is undefined because we're in a Linux-like environment
00057   // that did not define it for us.
00058   #else
00059 
00060     // Check whether we need to use uppercase BLAS routine names; otherwise
00061     // default to lowercase.
00062     #ifdef FLA_ENABLE_UPPERCASE_BLAS
00063 
00064       // Use uppercase routine names (single underscore).
00065       #define F77_FUNC( name_lower, name_upper ) \
00066               name_upper ## _
00067     #else
00068 
00069       // Use lowercase routine names (single underscore).
00070       #define F77_FUNC( name_lower, name_upper ) \
00071               name_lower ## _
00072     #endif
00073 
00074   #endif // #ifdef FLA_ENABLE_WINDOWS_BUILD
00075 
00076 #endif // #ifndef F77_FUNC
00077