1
1

* the next (and hopefullly last!) ompi_config_bottom.h fixup for Windows.

Last night's fix completely disregarded building the DSO components,
  which need to have the dllimport flag set for all the libmpi stuff, and
  need to export their component structures.  Unfortunately needed to
  add another #define to deal with the components for windows, but
  it required the least amount of work for all the non-Windows people.

This commit was SVN r5461.
Этот коммит содержится в:
Brian Barrett 2005-04-20 01:30:06 +00:00
родитель 469672a361
Коммит 8b69a532b7

Просмотреть файл

@ -27,17 +27,47 @@
#endif
/*
* OMPI_BUILDING will be true whenever ompi_config.h is included in a
* file that is "internal" to Open MPI, meaning something that is
* below the MPI layer. It will be false whenever we should provide
* the most "untampered" environment possible. The user is free to
* override this before including either mpi.h or ompi_config.h, if so
* desired.
* OMPI_BUILDING and OMPI_BUILDING_WIN_DSO define how ompi_config.h
* handles configuring all of Open MPI's "compatibility" code. Both
* constants will always be defined by the end of ompi_config.h.
*
* OMPI_BUILDING affects how much compatibility code is included by
* ompi_config.h. It will always be 1 or 0. The user can set the
* value before including either mpi.h or ompi_config.h and it will be
* respected. If ompi_config.h is included before mpi.h, it will
* default to 1. If mpi.h is included before ompi_config.h, it will
* default to 0.
*
* If OMPI_BUILDING is 1, ompi_config.h will:
* - everything that happens with OMPI_BUILDING set to 0
* - include a bunch of header files (stdint.h, stdtypes.h, etc.)
* - potentially override malloc, free, etc. for memory debugging
* - provide C bool type
* - set ompi_building code to import all OMPI interfaces (windows)
*
* If OMPI_BUILDING is 0, ompi_config.h will:
* - set configuration #defines
* - define the fortran complex types
* - set the ompi_building code to export all the interfaces
* (unless OMPI_BUILDING_WIN_DSO is set to 1) (windows)
*
* If OMPI_BUILDING_WIN_DSO is 1, ompi_config.h will:
* - configure the OMPI_DECLSPEC defines to assume we are building a
* dynamic shared object for a component on Windows. This will set
* all the import/export flags appropriately.
*
* If OMPI_BUILDING_WIN_DSO is 0 (or unset), ompi_config.h will:
* - configure the OMPI_DECLSPEC defines to assume we are not building
* a DSO component for Windows .
*/
#ifndef OMPI_BUILDING
#define OMPI_BUILDING 1
#endif
#ifndef OMPI_BUILDING_WIN_DSO
#define OMPI_BUILDING_WIN_DSO 0
#endif
/***********************************************************************
*
* code that should be in ompi_config_bottom.h regardless of build
@ -71,13 +101,24 @@ typedef struct {
#if defined(WIN32)
# if OMPI_BUILDING
# include "win32/win_compat.h"
# endif
# if OMPI_BUILDING_WIN_DSO
/* building a component - need to import libmpi and export our
struct */
# define OMPI_COMP_EXPORT __declspec(dllexport)
# define OMPI_DECLSPEC __declspec(dllimport)
# elif OMPI_BUILDING
/* building libmpi (or something in libmpi) - need to export libmpi
interface */
# define OMPI_COMP_EXPORT
# define OMPI_DECLSPEC __declspec(dllexport)
# else
/* building something using libmpi - export the libmpi interface */
# define OMPI_COMP_EXPORT
# define OMPI_DECLSPEC __declspec(dllimport)
# endif
#else
/* On Unix - get rid of the defines */
# define OMPI_COMP_EXPORT
# define OMPI_DECLSPEC
#endif