1 /* 2 3 Copyright (C) 2014, The University of Texas at Austin 4 5 This file is part of libflame and is available under the 3-Clause 6 BSD license, which can be found in the LICENSE file at the top-level 7 directory, or at http://opensource.org/licenses/BSD-3-Clause 8 9 */ 10 11 // --- Define Fortran name-mangling macro -------------------------------------- 12 13 // If the F77_FUNC name-mangling macro is undefined, then we we need to define 14 // it ourselves. 15 #ifndef F77_FUNC 16 17 // Case 1: F77_FUNC is undefined because we're building for Windows. 18 #ifdef FLA_ENABLE_WINDOWS_BUILD 19 20 // Check whether we need to use uppercase BLAS routine names; otherwise 21 // default to lowercase. 22 #ifdef FLA_ENABLE_UPPERCASE_BLAS 23 24 // Use uppercase routine names (no underscore). 25 #define F77_FUNC( name_lower, name_upper ) \ 26 name_upper 27 #else 28 29 // Use lowercase routine names (no underscore). 30 #define F77_FUNC( name_lower, name_upper ) \ 31 name_lower 32 #endif 33 34 // Case 2: F77_FUNC is undefined because we're in a Linux-like environment 35 // that did not define it for us. 36 #else 37 38 // Check whether we need to use uppercase BLAS routine names; otherwise 39 // default to lowercase. 40 #ifdef FLA_ENABLE_UPPERCASE_BLAS 41 42 // Use uppercase routine names (single underscore). 43 #define F77_FUNC( name_lower, name_upper ) \ 44 name_upper ## _ 45 #else 46 47 // Use lowercase routine names (single underscore). 48 #define F77_FUNC( name_lower, name_upper ) \ 49 name_lower ## _ 50 #endif 51 52 #endif // #ifdef FLA_ENABLE_WINDOWS_BUILD 53 54 #endif // #ifndef F77_FUNC 55 56