Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 4b83ad0d authored by PRUVOST Florent's avatar PRUVOST Florent
Browse files

detect mangling using FortranCInterface and remove the ADD_ arbitrary prepocessor variable

parent efffaa5a
Branches
Tags
No related merge requests found
......@@ -59,6 +59,7 @@ else()
endif()
include(MorseInit)
include(GenPkgConfig)
include(SetFortranMangling)
#############################################
# #
......@@ -959,12 +960,6 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_SHARED_LINKER_FLAGS "-undefined dynamic_lookup")
endif()
# Add define for Fortran Mangling (should be defined somewhere else)
# ------------------------------------------------------------------
message("-- ${Blue}Add definition ADD_"
" - For Fortran mangling${ColourReset}")
set(ADD_ 1)
#------------------------------------------------------------------------------
if(CHAMELEON_SCHED_STARPU)
link_directories(${STARPU_LIBRARY_DIRS_DEP})
......
###
#
# @copyright (c) 2017 Inria. All rights reserved.
#
###
#
# @file SetFortranMangling.cmake
#
# @project MORSE
# MORSE is a software package provided by:
# Inria Bordeaux - Sud-Ouest,
# Univ. of Tennessee,
# King Abdullah Univesity of Science and Technology
# Univ. of California Berkeley,
# Univ. of Colorado Denver.
#
# @version 1.0.0
# @author Florent Pruvost
# @date 25-04-2017
#
# Detect Fortran mangling and define the proper API symbols
###
include(FortranCInterface)
## Ensure that the fortran compiler and c compiler specified are compatible
FortranCInterface_VERIFY()
FortranCInterface_HEADER(${CMAKE_CURRENT_BINARY_DIR}/include/morse_mangling.h
MACRO_NAMESPACE "MORSE_"
SYMBOLS
MORSE_INIT
MORSE_FINALIZE
MORSE_ENABLE
MORSE_DISABLE
MORSE_SET
MORSE_GET
MORSE_DEALLOC_HANDLE
MORSE_VERSION
MORSE_DESC_CREATE
MORSE_DESC_DESTROY
MORSE_LAPACK_TO_TILE
MORSE_TILE_TO_LAPACK
)
......@@ -31,11 +31,6 @@
#ifndef _MORSE_COMMON_H_
#define _MORSE_COMMON_H_
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <ctype.h>
#if defined( _WIN32 ) || defined( _WIN64 )
#include <io.h>
......@@ -81,6 +76,7 @@
* Chameleon header files
**/
#include "morse.h"
#include "morse_mangling.h"
#include "coreblas/include/coreblas.h"
#if defined(CHAMELEON_USE_CUDA) && !defined(CHAMELEON_SIMULATION)
......@@ -97,26 +93,11 @@
/** ****************************************************************************
* Determine FORTRAN names
**/
#if defined(ADD_)
#define MORSE_FNAME(lcname, UCNAME) morse_##lcname##_
#define MORSE_TILE_FNAME(lcname, UCNAME) morse_##lcname##_tile_
#define MORSE_ASYNC_FNAME(lcname, UCNAME) morse_##lcname##_tile_async_
#define MORSE_WS_FNAME(lcname, UCNAME) morse_alloc_workspace_##lcname##_
#define MORSE_WST_FNAME(lcname, UCNAME) morse_alloc_workspace_##lcname##_tile_
#elif defined(NOCHANGE)
#define MORSE_FNAME(lcname, UCNAME) morse_##lcname
#define MORSE_TILE_FNAME(lcname, UCNAME) morse_##lcname##_tile
#define MORSE_ASYNC_FNAME(lcname, UCNAME) morse_##lcname##_tile_async
#define MORSE_WS_FNAME(lcname, UCNAME) morse_alloc_workspace_##lcname
#define MORSE_WST_FNAME(lcname, UCNAME) morse_alloc_workspace_##lcname##_tile
#elif defined(UPCASE)
#define MORSE_FNAME(lcname, UCNAME) MORSE_##UCNAME
#define MORSE_TILE_FNAME(lcname, UCNAME) MORSE_##UCNAME##_TILE
#define MORSE_ASYNC_FNAME(lcname, UCNAME) MORSE_##UCNAME##_TILE_ASYNC
#define MORSE_WS_FNAME(lcname, UCNAME) MORSE_ALLOC_WORKSPACE_##UCNAME
#define MORSE_WST_FNAME(lcname, UCNAME) MORSE_ALLOC_WORKSPACE_##UCNAME##_TILE
#endif
#define MORSE_FNAME(lcname, UCNAME) MORSE_GLOBAL(morse_##lcname, MORSE_##UCNAME)
#define MORSE_TILE_FNAME(lcname, UCNAME) MORSE_GLOBAL(morse_##lcname##_tile, MORSE_##UCNAME##_TILE)
#define MORSE_ASYNC_FNAME(lcname, UCNAME) MORSE_GLOBAL(morse_##lcname##_tile_async, MORSE_##UCNAME##_TILE_ASYNC)
#define MORSE_WS_FNAME(lcname, UCNAME) MORSE_GLOBAL(morse_alloc_workspace_##lcname, MORSE_ALLOC_WORKSPACE_##UCNAME)
#define MORSE_WST_FNAME(lcname, UCNAME) MORSE_GLOBAL(morse_alloc_workspace_##lcname##_tile, MORSE_ALLOC_WORKSPACE_##UCNAME##_TILE)
/*******************************************************************************
* Global shortcuts
......
......@@ -28,9 +28,6 @@
/* inherit from public chameleon's definitions */
#include "include/chameleon_config.h"
/* For BLAS Fortran mangling */
#cmakedefine ADD_
/* StarPU functions */
#cmakedefine HAVE_STARPU_FXT_PROFILING
#cmakedefine HAVE_STARPU_IDLE_PREFETCH
......
......@@ -25,34 +25,7 @@
#include <stdlib.h>
#include "control/common.h"
#include "morse.h"
#ifdef ADD_
#define MORSE_INIT morse_init_
#define MORSE_FINALIZE morse_finalize_
#define MORSE_ENABLE morse_enable_
#define MORSE_DISABLE morse_disable_
#define MORSE_SET morse_set_
#define MORSE_GET morse_get_
#define MORSE_DEALLOC_HANDLE morse_dealloc_handle_
#define MORSE_VERSION morse_version_
#define MORSE_DESC_CREATE morse_desc_create_
#define MORSE_DESC_DESTROY morse_desc_destroy_
#define MORSE_LAPACK_TO_TILE morse_lapack_to_tile_
#define MORSE_TILE_TO_LAPACK morse_tile_to_lapack_
#elif defined (NOCHANGE)
#define MORSE_INIT morse_init
#define MORSE_FINALIZE morse_finalize
#define MORSE_ENABLE morse_enable
#define MORSE_DISABLE morse_disable
#define MORSE_SET morse_set
#define MORSE_GET morse_get
#define MORSE_DEALLOC_HANDLE morse_dealloc_handle
#define MORSE_VERSION morse_version
#define MORSE_DESC_CREATE morse_desc_create
#define MORSE_DESC_DESTROY morse_desc_destroy
#define MORSE_LAPACK_TO_TILE morse_lapack_to_tile
#define MORSE_TILE_TO_LAPACK morse_tile_to_lapack
#endif
#include "morse_mangling.h"
#ifdef __cplusplus
extern "C" {
......
......@@ -58,6 +58,7 @@ set(CHAMELEON_HDRS
morse_struct.h
morse_types.h
morse.h
morse_mangling.h
runtime.h
${CHAMELEON_HDRS_GENERATED}
)
......@@ -84,7 +85,11 @@ set(HDR_INSTALL
foreach( hdr_file ${CHAMELEON_HDRS_GENERATED} )
list(APPEND HDR_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/${hdr_file})
endforeach()
list(APPEND HDR_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/morse.h ${CMAKE_CURRENT_BINARY_DIR}/chameleon_config.h)
list(APPEND
HDR_INSTALL
${CMAKE_CURRENT_BINARY_DIR}/morse.h
${CMAKE_CURRENT_BINARY_DIR}/morse_mangling.h
${CMAKE_CURRENT_BINARY_DIR}/chameleon_config.h)
# installation
# ------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment