Skip to content

Installation Examples

Jonathan R. Madsen edited this page Apr 24, 2021 · 7 revisions

Python setup.py Installation

Many of the CMake arguments are available via --enable-{PACKAGE} and --disable-{PACKAGE}, e.g. --enable-mpi, --disable-tools.

git clone https://github.com/NERSC/timemory.git
cd timemory
python -m pip install -r requirements.txt
python setup.py install <ARGS> -- <CMAKE_ARGS>
python setup.py install --help
python setup.py install --enable-gotcha --enable-mpi -- -DTIMEMORY_BUILD_TOOLS=OFF

PyPi Installation

python -m pip install scikit-build
python -m pip install -vvv timemory
# usually easiest to specify the install options using {..} shell expansion
python -m pip install -vvv --no-deps timemory --install-option=--enable-{gotcha,mpi,caliper}

The pip --install-option flag will pass these options to all packages so it is important to use --no-deps to avoid errors about the dependencies not supporting these install options

Local Pip Installation

PyPi usually only has the latest release. If you want to install the develop version, clone the repo and do a local pip install.

git clone https://github.com/NERSC/timemory.git
cd timemory
python -m pip install -r requirements.txt
python -m pip install --no-build-isolation --user -vvv .
python -m pip install --no-build-isolation --user -vvv . --install-option=--enable-{cuda,gotcha,mpi}

The --no-build-isolation option is required in order to import the scikit-build (i.e. skbuild) module

Spack Installation

spack info timemory
spack spec timemory
spack install timemory@develop%gcc@8.3.0 +mpi +cuda +cupti cuda_arch=volta

Ubuntu Installation

APT installation (requires sudo)

apt-get install build-essential 
apt-get install mpich libmpich-dev
apt-get install google-perftools libgoogle-perftools-dev
apt-get install libpapi-dev papi-tools

Python Installation via Conda

The conda package manager is generally recommended for Python vs. apt. Conda will provide additional packages and allows for better control over versioning

wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
bash miniconda.sh -b -p ${HOME}/miniconda
export PATH="${HOME}/miniconda/bin:${PATH}"
echo 'export PATH="${HOME}/miniconda/bin:${PATH}"' >> ${HOME}/.bashrc
conda create -c defaults -c conda-forge -n timemory python=3.7 pyctest scikit-build cmake numpy matplotlib pillow pip cython

Activating Conda Environment

$ source activate
(base) $ conda activate timemory
(timemory) $ which python
/home/.../miniconda/envs/timemory/bin/python

MPI4Py

Installing MPI4Py via pip will build the Python bindings against the system MPI version installed in the APT section. This is generally recommended over the pre-built mpi4py provided by conda.

(timemory) $ pip install mpi4py

Installing timemory

(timemory) $ git clone https://github.com/NERSC/timemory.git 
(timemory) $ cd timemory
(timemory) $ python setup.py install --enable-c --enable-tools --enable-mpi --enable-papi --enable-gotcha --enable-gperftools

All the options used above are available by passing --help to python setup.py install:

(timemory) $ python setup.py install --help
usage: setup.py [-h] [--enable-c] [--disable-c] [--enable-tools]
                [--disable-tools] [--enable-mpi] [--disable-mpi]
                [--enable-nccl] [--disable-nccl] [--enable-upcxx]
                [--disable-upcxx] [--enable-cuda] [--disable-cuda]
                [--enable-cupti] [--disable-cupti] [--enable-papi]
                [--disable-papi] [--enable-arch] [--disable-arch]
                [--enable-ompt] [--disable-ompt] [--enable-gotcha]
                [--disable-gotcha] [--enable-kokkos] [--disable-kokkos]
                [--enable-dyninst] [--disable-dyninst] [--enable-tau]
                [--disable-tau] [--enable-caliper] [--disable-caliper]
                [--enable-likwid] [--disable-likwid] [--enable-gperftools]
                [--disable-gperftools] [--enable-vtune] [--disable-vtune]
                [--enable-pybind-install] [--disable-pybind-install]
                [--enable-build-testing] [--disable-build-testing]
                [--cxx-standard {14,17,20}]

optional arguments:
  -h, --help            Print help
  --enable-c            Explicitly enable TIMEMORY_BUILD_C build
  --disable-c           Explicitly disable TIMEMORY_BUILD_C build
  --enable-tools        Explicitly enable TIMEMORY_BUILD_TOOLS build
  --disable-tools       Explicitly disable TIMEMORY_BUILD_TOOLS build
  --enable-mpi          Explicitly enable TIMEMORY_USE_MPI build
  --disable-mpi         Explicitly disable TIMEMORY_USE_MPI build
  --enable-nccl         Explicitly enable TIMEMORY_USE_NCCL build
  --disable-nccl        Explicitly disable TIMEMORY_USE_NCCL build
  --enable-upcxx        Explicitly enable TIMEMORY_USE_UPCXX build
  --disable-upcxx       Explicitly disable TIMEMORY_USE_UPCXX build
  --enable-cuda         Explicitly enable TIMEMORY_USE_CUDA build
  --disable-cuda        Explicitly disable TIMEMORY_USE_CUDA build
  --enable-cupti        Explicitly enable TIMEMORY_USE_CUPTI build
  --disable-cupti       Explicitly disable TIMEMORY_USE_CUPTI build
  --enable-papi         Explicitly enable TIMEMORY_USE_PAPI build
  --disable-papi        Explicitly disable TIMEMORY_USE_PAPI build
  --enable-arch         Explicitly enable TIMEMORY_USE_ARCH build
  --disable-arch        Explicitly disable TIMEMORY_USE_ARCH build
  --enable-ompt         Explicitly enable TIMEMORY_USE_OMPT build
  --disable-ompt        Explicitly disable TIMEMORY_USE_OMPT build
  --enable-gotcha       Explicitly enable TIMEMORY_USE_GOTCHA build
  --disable-gotcha      Explicitly disable TIMEMORY_USE_GOTCHA build
  --enable-kokkos       Explicitly enable TIMEMORY_BUILD_KOKKOS_TOOLS build
  --disable-kokkos      Explicitly disable TIMEMORY_BUILD_KOKKOS_TOOLS build
  --enable-dyninst      Explicitly enable TIMEMORY_BUILD_DYNINST_TOOLS build
  --disable-dyninst     Explicitly disable TIMEMORY_BUILD_DYNINST_TOOLS build
  --enable-tau          Explicitly enable TIMEMORY_USE_TAU build
  --disable-tau         Explicitly disable TIMEMORY_USE_TAU build
  --enable-caliper      Explicitly enable TIMEMORY_USE_CALIPER build
  --disable-caliper     Explicitly disable TIMEMORY_USE_CALIPER build
  --enable-likwid       Explicitly enable TIMEMORY_USE_LIKWID build
  --disable-likwid      Explicitly disable TIMEMORY_USE_LIKWID build
  --enable-gperftools   Explicitly enable TIMEMORY_USE_GPERFTOOLS build
  --disable-gperftools  Explicitly disable TIMEMORY_USE_GPERFTOOLS build
  --enable-vtune        Explicitly enable TIMEMORY_USE_VTUNE build
  --disable-vtune       Explicitly disable TIMEMORY_USE_VTUNE build
  --enable-pybind-install
                        Explicitly enable PYBIND11_INSTALL build
  --disable-pybind-install
                        Explicitly disable PYBIND11_INSTALL build
  --enable-build-testing
                        Explicitly enable TIMEMORY_BUILD_TESTING build
  --disable-build-testing
                        Explicitly disable TIMEMORY_BUILD_TESTING build
  --cxx-standard {14,17,20}
                        Set C++ language standard
CMake arguments: -DPYTHON_EXECUTABLE=/home/jrmadsen/devel/c++/spack/opt/spack/linux-ubuntu18.04-broadwell/gcc-9.3.0/python-3.7.7-tg5iie7fd7z3rn54gthtl4wts72mvhs5/bin/python -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON -DTIMEMORY_USE_PYTHON=ON -DTIMEMORY_BUILD_PYTHON=ON -DTIMEMORY_BUILD_TOOLS:BOOL=ON -DTIMEMORY_USE_GOTCHA:BOOL=ON -DCMAKE_CXX_STANDARD=14
Common commands: (see '--help-commands' for more)

  setup.py build      will build the package underneath 'build/'
  setup.py install    will install the package

Global options:
  --verbose (-v)  run verbosely (default)
  --quiet (-q)    run quietly (turns verbosity off)
  --dry-run (-n)  don't actually do anything
  --help (-h)     show detailed help message
  --no-user-cfg   ignore pydistutils.cfg in your home directory
  --hide-listing  do not display list of files being included in the
                  distribution
  --force-cmake   always run CMake
  --skip-cmake    do not run CMake

Options for 'build' command:
  --build-base (-b)  base directory for build library
  --build-purelib    build directory for platform-neutral distributions
  --build-platlib    build directory for platform-specific distributions
  --build-lib        build directory for all distribution (defaults to either
                     build-purelib or build-platlib
  --build-scripts    build directory for scripts
  --build-temp (-t)  temporary build directory
  --plat-name (-p)   platform name to build for, if supported (default: linux-
                     x86_64)
  --compiler (-c)    specify the compiler type
  --parallel (-j)    number of parallel build jobs
  --debug (-g)       compile extensions and libraries with debugging
                     information
  --force (-f)       forcibly build everything (ignore file timestamps)
  --executable (-e)  specify final destination interpreter path (build.py)
  --help-compiler    list available compilers

usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help