Skip to content

Commit

Permalink
setup.py: CCache Env Control
Browse files Browse the repository at this point in the history
Add control to `setup.py` for `pyAMReX_CCACHE`.
  • Loading branch information
ax3l committed Feb 26, 2024
1 parent 0cbf4b0 commit 10e5a7d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ If you are using the pip-driven install, selected [AMReX CMake options](https://
| `PYBIND11_INTERNAL` | **ON**/OFF | Needs a pre-installed pybind11 library if set to `OFF` |
| `CMAKE_BUILD_PARALLEL_LEVEL` | 2 | Number of parallel build threads |
| `PYAMREX_LIBDIR` | *None* | If set, search for pre-built a pyAMReX library |
| `PYAMREX_CCACHE` | **ON**/OFF | Search and use CCache to speed up rebuilds |
| `PYAMREX_IPO` | **ON**/OFF | Compile with interprocedural/link optimization (IPO/LTO) |
| `PYINSTALLOPTIONS` | *None* | Additional options for ``pip install``, e.g., ``-v --user`` |

Expand All @@ -187,6 +188,7 @@ Furthermore, pyAMReX adds a few selected CMake build options:
| CMake Option | Default & Values | Description |
|------------------------------|--------------------------------------------|---------------------------------------------------------------|
| `AMReX_SPACEDIM` | **3**, use `"1;2;3"` for all | Dimension(s) of AMReX as a ``;``-separated list |
| `pyAMReX_CCACHE` | **ON**/OFF | Search and use CCache to speed up rebuilds |
| `pyAMReX_IPO` | **ON**/OFF | Compile with interprocedural/link optimization (IPO/LTO) |
| `pyAMReX_INSTALL` | **ON**/OFF | Enable install targets for pyAMReX |
| `pyAMReX_amrex_src` | *None* | Absolute path to AMReX source directory (preferred if set) |
Expand Down
2 changes: 1 addition & 1 deletion docs/source/install/cmake.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ CMake Option Default & Values Des
``AMReX_PRECISION`` SINGLE/**DOUBLE** Precision of AMReX Real type
``AMReX_SPACEDIM`` ``3`` Dimension(s) of AMReX as a ``;``-separated list
``AMReX_BUILD_SHARED_LIBS`` ON/**OFF** Build AMReX library as shared (required for app extensions)
``pyAMReX_IPO`` **ON**/OFF Compile with interprocedural/link optimization (IPO/LTO)
``pyAMReX_INSTALL`` **ON**/OFF Enable install targets for pyAMReX
``PYINSTALLOPTIONS`` *None* Additional options for ``pip install``, e.g., ``-v --user``
``Python_EXECUTABLE`` (newest found) Path to Python executable
Expand All @@ -109,6 +108,7 @@ CMake Option Default & Values Des
============================= ============================================== ===========================================================
``BUILD_SHARED_LIBS`` ON/**OFF** Build shared libraries for dependencies
``pyAMReX_CCACHE`` **ON**/OFF Search and use CCache to speed up rebuilds.
``pyAMReX_IPO`` **ON**/OFF Compile with interprocedural/link optimization (IPO/LTO)
``pyAMReX_amrex_src`` *None* Path to AMReX source directory (preferred if set)
``pyAMReX_amrex_repo`` ``https://github.com/AMReX-Codes/amrex.git`` Repository URI to pull and build AMReX from
``pyAMReX_amrex_branch`` *we set and maintain a compatible commit* Repository branch for ``pyAMReX_amrex_repo``
Expand Down
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def build_extension(self, ext):
"-DAMReX_MPI:BOOL=" + AMReX_MPI,
"-DAMReX_PRECISION=" + AMReX_PRECISION,
#'-DAMReX_PARTICLES_PRECISION=' + AMReX_PARTICLES_PRECISION,
"-DpyAMReX_CCACHE=" + PYAMREX_CCACHE,
"-DpyAMReX_IPO=" + PYAMREX_IPO,
## dependency control (developers & package managers)
"-DpyAMReX_amrex_internal=" + AMReX_internal,
Expand Down Expand Up @@ -157,6 +158,7 @@ def build_extension(self, ext):
# Pick up existing AMReX libraries or...
PYAMREX_libdir = os.environ.get("PYAMREX_LIBDIR")

PYAMREX_CCACHE = os.environ.get("PYAMREX_CCACHE", "ON")
PYAMREX_IPO = os.environ.get("PYAMREX_IPO", "ON")

# ... build AMReX libraries with CMake
Expand Down Expand Up @@ -259,6 +261,7 @@ def build_extension(self, ext):
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
(
"License :: OSI Approved :: BSD License"
), # TODO: use real SPDX: BSD-3-Clause-LBNL
Expand Down

0 comments on commit 10e5a7d

Please sign in to comment.