Skip to content

Commit

Permalink
Merge branch 'develop' into publish-gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
atztogo committed Nov 26, 2024
2 parents 389ba8e + 74e8122 commit 1106bbd
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repos:
exclude: ^example/AlN-LDA/

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.4
rev: v0.8.0
hooks:
- id: ruff
args: [ "--fix", "--show-fixes" ]
Expand Down
70 changes: 44 additions & 26 deletions doc/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ See an example at {ref}`install_an_example`. In the standard output, flags and
libraries found by cmake are shown. Please carefully check if those
configurations are expected ones or not.

(install_without_lapacke)=
### Building without linking LAPACKE

**Experimental**
Expand Down Expand Up @@ -118,7 +119,14 @@ wrong python libraries can be imported.
For x86-64 system:

```bash
% conda install numpy scipy h5py pyyaml matplotlib-base c-compiler cxx-compiler "libblas=*=*mkl" spglib mkl-include cmake
% conda install numpy scipy h5py pyyaml matplotlib-base c-compiler cxx-compiler cmake spglib
```

Unless {ref}`install_without_lapacke`, the following packages will be
necessary to compile phono3py:

```bash
% conda install "libblas=*=*mkl" mkl-include
```

A libblas library can be chosen among `[openblas, mkl, blis, netlib]`. If
Expand All @@ -128,20 +136,21 @@ wrong python libraries can be imported.
% conda install "libblas=*=*openblas"
```

For macOS ARM64 system, currently only openblas can be chosen:
For macOS ARM64 system:

```bash
% conda install numpy scipy h5py pyyaml matplotlib-base c-compiler cxx-compiler spglib cmake openblas
% conda install numpy scipy h5py pyyaml matplotlib-base c-compiler cxx-compiler spglib cmake
```

Note that using hdf5 files on NFS mounted file system, you may have to disable
file locking by setting
Unless {ref}`install_without_lapacke`, the following package will be
necessary to compile phono3py:

```bash
export HDF5_USE_FILE_LOCKING=FALSE
% conda install openblas
```

Install the latest phonopy and phono3py from github sources:
The latest phonopy and phono3py are obtained from github, and they are
compiled and installed by:

```bash
% mkdir dev
Expand All @@ -154,28 +163,37 @@ wrong python libraries can be imported.
% pip install . -vvv
```

The editable install (`pip install -e`) may not work depending on the
computer environment. The conda packages dependency can often change and this
recipe may not work properly. So if you find this instruction doesn't work,
it is very appreciated if letting us know it in the phonopy mailing list.
## Dependent libraries

### OpenMP

#### GCC on Ubuntu

With system provided gcc, `libgomp1` may be necessary to enable OpenMP
multithreading support. This library is probably installed already in your
system. If you don't have it and you use Ubuntu linux, it is installed by:

```bash
% sudo apt-get install libgomp1
```

(install_lapacke)=
## Installation of LAPACKE
### LAPACKE

LAPACK library is used in a few parts of the code to diagonalize matrices.
LAPACK*E* is the C-wrapper of LAPACK and LAPACK relies on BLAS. Both
single-thread or multithread BLAS can be used in phono3py. In the following,
multiple different ways of installation of LAPACKE are explained.

### OpenBLAS provided by conda
#### OpenBLAS provided by conda

The installation of LAPACKE is easy by conda. It is:

```bash
% conda install -c conda-forge openblas
```

### Netlib LAPACKE provided by Ubuntu package manager (with single-thread BLAS)
#### Netlib LAPACKE provided by Ubuntu package manager (with single-thread BLAS)

LAPACKE (http://www.netlib.org/lapack/lapacke.html) can be installed from the
Ubuntu package manager (`liblapacke` and `liblapacke-dev`):
Expand All @@ -184,7 +202,17 @@ Ubuntu package manager (`liblapacke` and `liblapacke-dev`):
% sudo apt-get install liblapack-dev liblapacke-dev
```

(install_openmp)=
## Using HDF5 files on NFS mounted file system

If you are using HDF5 files on an NFS-mounted file system, you might need to
disable file locking. This can be done by setting the following environment
variable:

```bash
export HDF5_USE_FILE_LOCKING=FALSE
```

<!-- (install_openmp)=
## Multithreading and its controlling by C macro
Phono3py uses multithreading concurrency in two ways. One is that written in the
Expand All @@ -201,17 +229,7 @@ be deactivated at the compilation time. This is achieved by setting the C macro
`MULTITHREADED_BLAS`, which can be written in `CMakeLists.txt`. Deactivating the
multithreading of BLAS using the environment variables is not recommended
because it is also used in the non-nested parts of the code and these
multithreadings are unnecessary to be deactivated.

### OpenMP library of gcc

With system provided gcc, `libgomp1` may be necessary to enable OpenMP
multithreading support. This library is probably installed already in your
system. If you don't have it and you use Ubuntu linux, it is installed by:

```bash
% sudo apt-get install libgomp1
```
multithreadings are unnecessary to be deactivated. -->

## Trouble shooting

Expand Down

0 comments on commit 1106bbd

Please sign in to comment.