Skip to content

Commit

Permalink
Merge branch 'master' into debug_flags
Browse files Browse the repository at this point in the history
  • Loading branch information
scemama committed Dec 12, 2024
2 parents 751b3c9 + df0e3a8 commit d2c5dc7
Show file tree
Hide file tree
Showing 6 changed files with 210 additions and 24 deletions.
82 changes: 59 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,49 @@ which enables fast read and write operations. It is compatible with a variety
of platforms and has interfaces for the Fortran, Python, OCaml and Rust
programming languages.

Below is the list of codes that adopted TREXIO for reading and/or writing
single- and/or multi-reference wave functions:

| Software | Single-reference | Multi-reference |
| ------------------------------------------------------------------------------ | ---------------- | --------------- |
| [Quantum Package](https://github.com/QuantumPackage/qp2) | Write/Read | Write/Read |
| [PySCF](https://github.com/pyscf/pyscf) | Write/Read | Write/Read |
| [FHI-aims](https://fhi-aims.org/) | Write | --- |
| [CP2K](https://github.com/cp2k/cp2k) | Write | --- |
| [CHAMP](https://github.com/filippi-claudia/champ) | Read | Read |
| [GammCor](https://github.com/pernalk/GAMMCOR) | Read | Read |
| [ipie](https://github.com/JoonhoLee-Group/ipie) | Read | Read |
| [TurboRVB](https://github.com/sissaschool/turborvb) | Read | --- |
| [Spicy](https://gitlab.com/theoretical-chemistry-jena/quantum-chemistry/Spicy) | Read | --- |
| [QMC=Chem](https://github.com/TREX-CoE/qmcchem2) | Read | --- |
| [QMCkl](https://github.com/TREX-CoE/qmckl) | Read | --- |


* [Installation](#installation)
* [Installation using a package manager](#installation-using-a-package-manager)
* [Conda](#conda)
* [Spack](#spack)
* [Guix](#guix)
* [Debian/Ubuntu](#debianubuntu)
* [Installation from source](#installation-from-source)
* [Minimal requirements (for users):](#minimal-requirements-for-users)
* [Recommended: Installation from the release tarball](#recommended-installation-from-the-release-tarball)
* [Compilation without the HDF5 library](#compilation-without-the-hdf5-library)
* [For TREXIO developers: from the GitHub repo clone](#for-trexio-developers-from-the-github-repo-clone)
* [Using CMake instead of Autotools](#using-cmake-instead-of-autotools)
* [Installation using a package manager](#installation-using-a-package-manager)
* [Conda](#conda)
* [Spack](#spack)
* [Guix](#guix)
* [Nix](#nix)
* [Debian/Ubuntu](#debianubuntu)
* [Installation from source](#installation-from-source)
* [Minimal requirements (for users):](#minimal-requirements-for-users)
* [Recommended: Installation from the release tarball](#recommended-installation-from-the-release-tarball)
* [Compilation without the HDF5 library](#compilation-without-the-hdf5-library)
* [For TREXIO developers: from the GitHub repo clone](#for-trexio-developers-from-the-github-repo-clone)
* [Using CMake instead of Autotools](#using-cmake-instead-of-autotools)
* [Using TREXIO](#using-trexio)
* [Naming convention](#naming-convention)
* [Tutorial](#tutorial)
* [Documentation](#documentation)
* [Linking to your program](#linking-to-your-program)
* [Distributing TREXIO with your code](#distributing-trexio-with-your-code)
* [Naming convention](#naming-convention)
* [Tutorial](#tutorial)
* [Documentation](#documentation)
* [Linking to your program](#linking-to-your-program)
* [Distributing TREXIO with your code](#distributing-trexio-with-your-code)
* [APIs for other languages](#apis-for-other-languages)
* [Python](#python)
* [Rust](#rust)
* [OCaml](#ocaml)
* [Python](#python)
* [Rust](#rust)
* [OCaml](#ocaml)
* [Citation](#citation)
* [Miscellaneous](#miscellaneous)
* [Miscellaneous](#miscellaneous)


## Installation
Expand Down Expand Up @@ -82,6 +101,23 @@ It can be installed as follows:
guix package --cores=`getconf _NPROCESSORS_ONLN` --install-from-file=trexio.scm
```

#### Nix

The official releases of TREXIO `>=2.5.` can be used and installed via [Nix](https://nixos.org/).
This repository provides a [Nix Flake](https://nixos.wiki/wiki/Flakes), where [tools/nix/trexio.nix](https://github.com/TREX-CoE/trexio/blob/master/tools/nix/trexio.nix) provides the build specification.
You can inspect the flake or build the package with

```
nix flake show github:TREX-CoE/trexio
nix build github:TREX-CoE/trexio
```

TREXIO is also part of [NixPkgs](https://github.com/NixOS/nixpkgs) and can be used via that channel.

```
nix build nixpkgs#trexio
```

#### Debian/Ubuntu

The official release of TREXIO `2.2.0` is available as a Debian (`.deb`) package thanks to the [Debichem Team](https://wiki.debian.org/Debichem).
Expand Down Expand Up @@ -110,7 +146,7 @@ sudo apt-get update && sudo apt-get install libtrexio-dev
3. `cd trexio-<version>`
4. `./configure`
5. ```make -j 4 ```
6. ```make -j 4 check```
6. ```make -j $(nproc) check```
7. `sudo make install`

In environments where `sudo` access is unavailable, a common workaround for
Expand Down Expand Up @@ -155,7 +191,7 @@ Additional requirements:
3. `./autogen.sh`
4. `./configure`
5. ```make -j 4```
6. ```make -j 4 check```
6. ```make -j $(nproc) check```
7. `sudo make install`

#### Using CMake instead of Autotools
Expand All @@ -166,7 +202,7 @@ The aforementioned instructions rely on [Autotools](https://www.gnu.org/software
1. `cmake -S. -Bbuild`
2. `cd build`
3. ```make -j 4```
4. ```ctest -j 4```
4. ```ctest -j $(nproc)```
5. `sudo make install`

**Note**: on systems with no `sudo` access, one can add `-DCMAKE_INSTALL_PREFIX=build` as an argument to the `cmake` command so that `make install/uninstall` can be run without `sudo` privileges.
Expand Down
60 changes: 60 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
description = "TREX I/O library";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils }:
let overlay = import ./tools/nix/overlay.nix;
in flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ overlay ];
};
in
{
packages.default = pkgs.trexio;
}
) // {
overlays.default = overlay;
};
}
11 changes: 11 additions & 0 deletions tools/nix/overlay.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
final: prev: {
trexio = final.callPackage ./trexio.nix { };

haskell = prev.haskell // {
packageOverrides = hfinal: hprev: {
trexio-hs = hfinal.callCabal2nix "trexio" ../haskell {
inherit (final) trexio;
};
};
};
}
55 changes: 55 additions & 0 deletions tools/nix/trexio.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{ stdenv
, lib
, fetchFromGitHub
, cmake
, gfortran
, hdf5
, python3
, emacs
, swig
}:

stdenv.mkDerivation rec {
pname = "trexio";
version = "2.5.0";

src = lib.cleanSourceWith {
src = ../../.;
filter = path: type: ! (builtins.elem (builtins.baseNameOf path) [
"haskell"
"docker"
"helpers-debian"
"ocaml"
"rust"
"python"
] && type == "directory" );
};

postPatch = ''
patchShebangs tools/*
'';

nativeBuildInputs = [
cmake
gfortran
emacs
swig
python3
];

buildInputs = [
hdf5
];

outputs = [ "out" "dev" ];

doCheck = true;

meta = with lib; {
description = "File format and library for the storage of quantum chemical wave functions";
homepage = "https://trex-coe.github.io/trexio/";
downloadPage = "https://github.com/TREX-CoE/trexio";
license = licenses.bsd3;
maintainers = [ maintainers.sheepforce ];
};
}
2 changes: 1 addition & 1 deletion version_memo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ To update the version, change:
- ocaml/trexio/trexio.opam
- python/pytrexio/_version.py
- rust/trexio/Cargo.toml

- tools/nix/trexio.nix

0 comments on commit d2c5dc7

Please sign in to comment.