1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2025-03-04 06:10:23 +01:00

Merge branch 'master' into debug_flags

This commit is contained in:
Anthony Scemama 2024-12-12 09:51:05 +01:00
commit d2c5dc7fa1
6 changed files with 210 additions and 24 deletions

View File

@ -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
@ -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).
@ -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
@ -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
@ -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.

60
flake.lock generated Normal file
View File

@ -0,0 +1,60 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1733852629,
"narHash": "sha256-lXMmrcEg1WxEdPiXpUfkxbJij0xS5acao1Jz4lnrNPY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9ad61cfc19c1f66e7d7d1ac9c71ae1b187065580",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

24
flake.nix Normal file
View File

@ -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
tools/nix/overlay.nix Normal file
View File

@ -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
tools/nix/trexio.nix Normal file
View File

@ -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 ];
};
}

View File

@ -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