Fix OSX linker problems with the Fortran bindings:
- ensure to initialize the values that we use for fortran constants (even tough their *values* don't matter -- only their *addresses* do, but initializing them or not has implications for the OSX linker) - move the fortran constants to a file with functions in it, because the OSX linker sometimes does not import global variables from object files that do not have functions (I'm not even going to pretend to get all the subtle details about the OSX linker right here -- it's just "better" to have global variables in object files with functions that otherwise get pulled in during linker resolution). This commit was SVN r10908.
Этот коммит содержится в:
родитель
91f48f9a79
Коммит
0c102e6e5b
@ -9,6 +9,7 @@
|
||||
# University of Stuttgart. All rights reserved.
|
||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
# All rights reserved.
|
||||
# Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
@ -62,14 +63,13 @@ headers = \
|
||||
#
|
||||
|
||||
libmpi_f77_la_SOURCES = \
|
||||
constants_f.c \
|
||||
attr_fn_f.c \
|
||||
f90_accessors.c \
|
||||
strings.c \
|
||||
test_constants_f.c
|
||||
|
||||
#
|
||||
# libmpi_c_mpi.la is only built in some cases (see above)
|
||||
# These files are only built and added to libmpi_f77.la in certain cases.
|
||||
#
|
||||
|
||||
libmpi_f77_mpi_la_SOURCES = \
|
||||
|
@ -9,6 +9,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -40,8 +41,10 @@
|
||||
|
||||
#if defined(HAVE_LONG_DOUBLE) && OMPI_ALIGNMENT_LONG_DOUBLE == 16
|
||||
typedef struct { long double bogus[1]; } ompi_fortran_common_t;
|
||||
#define OMPI_FORTRAN_COMMON_INIT {{ 0 }}
|
||||
#else
|
||||
typedef struct { double bogus[2]; } ompi_fortran_common_t;
|
||||
#define OMPI_FORTRAN_COMMON_INIT {{ 0, 0 }}
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -1,43 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "ompi_config.h"
|
||||
|
||||
#include "ompi/mpi/f77/bindings.h"
|
||||
#include "constants.h"
|
||||
|
||||
#define INST(upper_case, lower_case, single_u, double_u) \
|
||||
ompi_fortran_common_t lower_case; \
|
||||
ompi_fortran_common_t upper_case; \
|
||||
ompi_fortran_common_t single_u; \
|
||||
ompi_fortran_common_t double_u
|
||||
|
||||
INST(MPI_FORTRAN_BOTTOM, mpi_fortran_bottom,
|
||||
mpi_fortran_bottom_, mpi_fortran_bottom__);
|
||||
INST(MPI_FORTRAN_IN_PLACE, mpi_fortran_in_place,
|
||||
mpi_fortran_in_place_, mpi_fortran_in_place__);
|
||||
INST(MPI_FORTRAN_ARGV_NULL, mpi_fortran_argv_null,
|
||||
mpi_fortran_argv_null_, mpi_fortran_argv_null__);
|
||||
INST(MPI_FORTRAN_ARGVS_NULL, mpi_fortran_argvs_null,
|
||||
mpi_fortran_argvs_null_, mpi_fortran_argvs_null__);
|
||||
INST(MPI_FORTRAN_ERRCODES_IGNORE, mpi_fortran_errcodes_ignore,
|
||||
mpi_fortran_errcodes_ignore_, mpi_fortran_errcodes_ignore__);
|
||||
INST(MPI_FORTRAN_STATUS_IGNORE, mpi_fortran_status_ignore,
|
||||
mpi_fortran_status_ignore_, mpi_fortran_status_ignore__);
|
||||
INST (MPI_FORTRAN_STATUSES_IGNORE, mpi_fortran_statuses_ignore,
|
||||
mpi_fortran_statuses_ignore_, mpi_fortran_statuses_ignore__);
|
@ -9,6 +9,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -21,6 +22,48 @@
|
||||
#include "ompi/mpi/f77/bindings.h"
|
||||
#include "ompi/mpi/f77/constants.h"
|
||||
|
||||
/**
|
||||
* This file contains two parts:
|
||||
*
|
||||
* 1. Various constants used in the Fortran bindings.
|
||||
* 2. A special, internal OMPI function used for testing constant
|
||||
* values (i.e., not an MPI API function)
|
||||
*
|
||||
* The constants in #1 are in this file because certain linkers (e.g.,
|
||||
* OSX) need to have object files with functions in them or they won't
|
||||
* pull in global variables from that file. Specifically, the
|
||||
* constants in #1 used to be in a .c file by themselves (with no
|
||||
* functions), which led to certain cases where the OSX linker
|
||||
* wouldn't "see" them because there were no functions in the
|
||||
* resulting .o file that would cause the constants to be pulled for
|
||||
* run-time/link-time resolution.
|
||||
*/
|
||||
|
||||
/* Constants for the Fortran layer. These values are referred to via
|
||||
common blocks in the Fortran equivalents. See
|
||||
ompi/mpi/f77/constants.h for a more detailed explanation. */
|
||||
|
||||
#define INST(upper_case, lower_case, single_u, double_u) \
|
||||
ompi_fortran_common_t lower_case = OMPI_FORTRAN_COMMON_INIT; \
|
||||
ompi_fortran_common_t upper_case = OMPI_FORTRAN_COMMON_INIT; \
|
||||
ompi_fortran_common_t single_u = OMPI_FORTRAN_COMMON_INIT; \
|
||||
ompi_fortran_common_t double_u = OMPI_FORTRAN_COMMON_INIT
|
||||
|
||||
INST(MPI_FORTRAN_BOTTOM, mpi_fortran_bottom,
|
||||
mpi_fortran_bottom_, mpi_fortran_bottom__);
|
||||
INST(MPI_FORTRAN_IN_PLACE, mpi_fortran_in_place,
|
||||
mpi_fortran_in_place_, mpi_fortran_in_place__);
|
||||
INST(MPI_FORTRAN_ARGV_NULL, mpi_fortran_argv_null,
|
||||
mpi_fortran_argv_null_, mpi_fortran_argv_null__);
|
||||
INST(MPI_FORTRAN_ARGVS_NULL, mpi_fortran_argvs_null,
|
||||
mpi_fortran_argvs_null_, mpi_fortran_argvs_null__);
|
||||
INST(MPI_FORTRAN_ERRCODES_IGNORE, mpi_fortran_errcodes_ignore,
|
||||
mpi_fortran_errcodes_ignore_, mpi_fortran_errcodes_ignore__);
|
||||
INST(MPI_FORTRAN_STATUS_IGNORE, mpi_fortran_status_ignore,
|
||||
mpi_fortran_status_ignore_, mpi_fortran_status_ignore__);
|
||||
INST (MPI_FORTRAN_STATUSES_IGNORE, mpi_fortran_statuses_ignore,
|
||||
mpi_fortran_statuses_ignore_, mpi_fortran_statuses_ignore__);
|
||||
|
||||
/* This is an internal test function for Open MPI; it does not have a
|
||||
profiled equivalent. */
|
||||
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user