Skip to content

starter text for declspec description #10770

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/developers/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ probably don't need to read this section.
building-open-mpi
terminology
source-code-tree-layout
source-code-declspec
frameworks
gnu-autotools
sphinx
Expand Down
23 changes: 23 additions & 0 deletions docs/developers/source-code-declspec.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Source code: Symbol visibility
==============================

The ``*_DECLSPEC`` macros provide a method to annotate symbols to indicate
their intended visibility when compiling dynamically shared object files
(e.g., ``libmpi.so``).

The macros are defined on a per project basis:

* Open MPI: ``OMPI_DECLSPEC``
* Open PAL: ``OPAL_DECLSPEC``
* OpenSHMEM: ``OSHMEM_DECLSPEC``

The macros expand to the appropriate compiler and platform flags for marking
whether a symbol should be explicitly made public in the target project's
library namespace. This is related to the Windows `__declspec <https://docs.microsoft.com/en-us/cpp/cpp/declspec?view=msvc-170>`_.

The ``*_DECLSPEC`` attributes are used to declare that a symbol is to be
visible outside of that library/DSO's scope. For example, ``OMPI_DECLSPEC``
is used to control what symbols are visible in the ``libmpi.so`` scope.

.. note:: This is entirely related to dynamic library compilation and does not
apply to static compilation.