Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
hczhai committed Oct 23, 2024
2 parents 0d1e193 + 3fe91e4 commit 44ed696
Show file tree
Hide file tree
Showing 122 changed files with 2,563 additions and 257 deletions.
9 changes: 6 additions & 3 deletions .github/actions/build-wheel/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ elif [ "${PYTHON_VERSION}" = "3.11" ]; then
PY_VER=cp311-cp311
elif [ "${PYTHON_VERSION}" = "3.12" ]; then
PY_VER=cp312-cp312
elif [ "${PYTHON_VERSION}" = "3.13-dev" ]; then
PY_VER=cp313-cp313
fi

PY_EXE=/opt/python/"${PY_VER}"/bin/python3
Expand All @@ -31,12 +33,13 @@ ls -l /opt/python
/opt/python/"${PY_VER}"/bin/pip install --upgrade --no-cache-dir pip setuptools
/opt/python/"${PY_VER}"/bin/pip install --no-cache-dir mkl==2021.4 mkl-include intel-openmp numpy 'cmake>=3.19' pybind11==2.12.0
$(cat $(which auditwheel) | head -1 | awk -F'!' '{print $2}') -m pip install auditwheel==5.1.2
$(cat $(which auditwheel) | head -1 | awk -F'!' '{print $2}') -m pip install setuptools

if [ "${PARALLEL}" = "mpi" ]; then
yum install -y wget openssh-clients openssh-server
wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.6.tar.gz
tar zxf openmpi-4.1.6.tar.gz
cd openmpi-4.1.6
wget https://download.open-mpi.org/release/open-mpi/v5.0/openmpi-5.0.5.tar.gz
tar zxf openmpi-5.0.5.tar.gz
cd openmpi-5.0.5
./configure --prefix=/usr/local |& tee config.out
make -j 4 |& tee make.out
make install |& tee install.out
Expand Down
208 changes: 165 additions & 43 deletions .github/workflows/build.yml

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ OPTION(BUILD_EXE "Build executable block2" OFF)
OPTION(REUSE_OBJS "Reuse core objects" ON)
OPTION(USE_PCH "Build precompiled headers" ON)
OPTION(FORCE_LIB_ABS_PATH "Using absolute path when linking libraries" ON)
# For BUILD_CLIB, local static variables may vaiolate ODR in .so and .exe.
# For BUILD_CLIB, local static variables may violate ODR in .so and .exe.
OPTION(USE_GLOBAL_VARIABLE "Use global variable instead of local static ones" ON)
OPTION(SIMPLE_TEST "Only compile basic unit tests" OFF)

IF (NOT ${USE_DMRG})
SET(USE_BIG_SITE OFF)
Expand Down Expand Up @@ -785,7 +786,11 @@ IF (${BUILD_TEST})
FIND_PACKAGE(GTest REQUIRED)
INCLUDE_DIRECTORIES(${GTEST_INCLUDE_DIRS})

FILE(GLOB TSRCS unit_test/test_*.cpp)
IF (${SIMPLE_TEST})
FILE(GLOB TSRCS unit_test/test_wick_*.cpp unit_test/test_npdm_*.cpp unit_test/test_dmrg_*.cpp)
ELSE()
FILE(GLOB TSRCS unit_test/test_*.cpp)
ENDIF()
MESSAGE(STATUS "TSRCS = ${TSRCS}")

IF ((NOT APPLE) AND (NOT WIN32))
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ One can install ``block2`` using ``pip`` (note: for very new Python versions, th

pip install block2

* Hybrid openMP/MPI version (requiring openMPI 4.1.x)
* Hybrid openMP/MPI version (requiring openMPI 5.0.x for ``block2-mpi >= 0.5.3`` or 4.1.x for ``block2-mpi <= 0.5.2`` and ``block2-mpi <= 0.5.3rc19``)

pip install block2-mpi

* Binary format is prepared via ``pip`` for python 3.7, 3.8, 3.9, 3.10, and 3.11 with macOS (x86 and arm64, no-MPI) or Linux (no-MPI/openMPI). If these binaries have some problems, you can use the ``--no-binary`` option of ``pip`` to force building from source (for example, ``pip install block2 --no-binary block2``).
* Binary format is prepared via ``pip`` for python 3.8, 3.9, 3.10, 3.11, 3.12, and 3.13 with macOS (x86 and arm64, no-MPI), Linux (no-MPI/openMPI), or Windows (x86, no-MPI). If these binaries have some problems, you can use the ``--no-binary`` option of ``pip`` to force building from source (for example, ``pip install block2 --no-binary block2``).

* One should only install one of ``block2`` and ``block2-mpi``. ``block2-mpi`` covers all features in ``block2``, but its dependence on mpi library can sometimes be difficult to deal with. Some guidance for resolving environment problems can be found in issue [#7](https://github.com/block-hczhai/block2-preview/issues/7) and [here](https://block2.readthedocs.io/en/latest/user/installation.html#installation-with-anaconda).

Expand All @@ -59,7 +59,7 @@ One can install ``block2`` using ``pip`` (note: for very new Python versions, th
pip install block2==<version> --extra-index-url=https://block-hczhai.github.io/block2-preview/pypi/
pip install block2-mpi==<version> --extra-index-url=https://block-hczhai.github.io/block2-preview/pypi/

where ``<version>`` can be some development version number like ``0.5.3rc17`` (see https://github.com/block-hczhai/block2-preview/tags for a complete list of version numbers. The letter ``p`` is not needed). To force reinstalling an updated version, you may consider ``pip`` options ``--upgrade --force-reinstall --no-deps --no-cache-dir``.
where ``<version>`` can be some development version number like ``0.5.3rc20`` (see https://github.com/block-hczhai/block2-preview/tags for a complete list of version numbers. The letter ``p`` is not needed). To force reinstalling an updated version, you may consider ``pip`` options ``--upgrade --force-reinstall --no-deps --no-cache-dir``.

The detailed instructions on manual installation can be found [here](https://block2.readthedocs.io/en/latest/user/installation.html#manual-installation).

Expand Down
Loading

0 comments on commit 44ed696

Please sign in to comment.