1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2024-11-03 20:54:07 +01:00

Install trexio in OCaml if it is not on the system

This commit is contained in:
Anthony Scemama 2023-06-21 14:46:02 +02:00
parent d011447f6f
commit 701690e415
2 changed files with 67 additions and 0 deletions

25
ocaml/trexio/compile-lib.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/sh
PREFIX=$1
PKGCONFIG_COMMAND="pkg-config --libs --cflags trexio"
INSTALLED="no"
# Try with system defaults
if cc test.c >/dev/null 2>&1 ; then
exit
fi
# Try with pkg-config
if eval $PKGCONFIG_COMMAND >/dev/null 2>&1; then
exit
fi
# Compile C library
cd vendor
tar -zxf trexio-*.tar.gz
cd trexio-*
./configure --prefix=${PREFIX}
$(MAKE) install && \
rm -rf trexio-*/

42
ocaml/trexio/trexio.opam Normal file
View File

@ -0,0 +1,42 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
version: "2.3.0"
synopsis: "Binding for the TREXIO Input/Output library"
description:
"TREXIO is a file format and library for storing wave functions and integrals for quantum chemistry."
maintainer: ["Anthony Scemama <scemama@irsamc.ups-tlse.fr>"]
authors: [
"Anthony Scemama <scemama@irsamc.ups-tlse.fr>"
"Evgeny Posenitskiy <posenitskiy@irsamc.ups-tlse.fr>"
]
license: "BSD-3-Clause"
tags: ["Quantum chemistry" "Library"]
homepage: "https://github.com/trex-coe/trexio_ocaml"
doc: "https://trex-coe.github.io/trexio/"
bug-reports: "https://github.com/trex-coe/trexio_ocaml/issues"
depends: [
"dune" {>= "3.1"}
"dune-configurator" {build}
"conf-pkg-config" {build}
"odoc" {with-doc}
]
build: [
["dune" "subst"] {dev}
["./compile-lib.sh" "%{prefix}%" "build"]
[
"dune"
"build"
"-p"
name
"-j"
jobs
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
]
install: [
["./compile-lib.sh" "%{prefix}%" "install"]
["dune" "install"]
]
dev-repo: "git+https://github.com/trex-coe/trexio_ocaml.git"