xref: /libCEED/rust/libceed-sys/src/lib.rs (revision f53477dea266b2ca120ffada7a193bd1f68c10f2)
1*f53477deSjeremylt // Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at
2*f53477deSjeremylt // the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights
3*f53477deSjeremylt // reserved. See files LICENSE and NOTICE for details.
4*f53477deSjeremylt //
5*f53477deSjeremylt // This file is part of CEED, a collection of benchmarks, miniapps, software
6*f53477deSjeremylt // libraries and APIs for efficient high-order finite element and spectral
7*f53477deSjeremylt // element discretizations for exascale applications. For more information and
8*f53477deSjeremylt // source code availability see http://github.com/ceed.
9*f53477deSjeremylt //
10*f53477deSjeremylt // The CEED research is supported by the Exascale Computing Project 17-SC-20-SC,
11*f53477deSjeremylt // a collaborative effort of two U.S. Department of Energy organizations (Office
12*f53477deSjeremylt // of Science and the National Nuclear Security Administration) responsible for
13*f53477deSjeremylt // the planning and preparation of a capable exascale ecosystem, including
14*f53477deSjeremylt // software, applications, hardware, advanced system engineering and early
15*f53477deSjeremylt // testbed platforms, in support of the nation's exascale computing imperative
16*f53477deSjeremylt 
17*f53477deSjeremylt //! # libCEED Rust Interface
18*f53477deSjeremylt //!
19*f53477deSjeremylt //! This is the documentation for the low level Rust bindings to the libCEED C interface.
20*f53477deSjeremylt //! See the full libCEED user manual [here](https://libceed.readthedocs.io).
21*f53477deSjeremylt //!
22*f53477deSjeremylt //! libCEED is a low-level API for for the efficient high-order discretization methods
23*f53477deSjeremylt //! developed by the ECP co-design Center for Efficient Exascale Discretizations (CEED).
24*f53477deSjeremylt //! While our focus is on high-order finite elements, the approach is mostly algebraic
25*f53477deSjeremylt //! and thus applicable to other discretizations in factored form.
26*f53477deSjeremylt //!
27*f53477deSjeremylt //! ## Usage
28*f53477deSjeremylt //!
29*f53477deSjeremylt //! To use low level libCEED bindings in a Rust package, the following `Cargo.toml`
30*f53477deSjeremylt //! can be used.
31*f53477deSjeremylt //! ```toml
32*f53477deSjeremylt //! [dependencies]
33*f53477deSjeremylt //! libceed-sys = { git = "https://github.com/CEED/libCEED", branch = "main" }
34*f53477deSjeremylt //! ```
35*f53477deSjeremylt //!
36*f53477deSjeremylt //! Supported features:
37*f53477deSjeremylt //! * `static` (default): link to static libceed.a
38*f53477deSjeremylt //! * `system`: use libceed from a system directory (otherwise, install from source)
39*f53477deSjeremylt //!
40*f53477deSjeremylt //! ## Development
41*f53477deSjeremylt //!
42*f53477deSjeremylt //! To develop libCEED, use `cargo build` in the `rust/libceed-sys` directory to
43*f53477deSjeremylt //! install a local copy and build the bindings. If you need custom flags for the
44*f53477deSjeremylt //! C project, we recommend using `make configure` to cache arguments. If you
45*f53477deSjeremylt //! disable the `static` feature, then you'll need to set `LD_LIBRARY_PATH` for
46*f53477deSjeremylt //! doctests to be able to find it. You can do this in `$CEED_DIR/lib` and set
47*f53477deSjeremylt //! `PKG_CONFIG_PATH`.
48*f53477deSjeremylt //!
49*f53477deSjeremylt //! Note: the `LD_LIBRARY_PATH` workarounds will become unnecessary if [this
50*f53477deSjeremylt //! issue](https://github.com/rust-lang/cargo/issues/1592) is resolved -- it's
51*f53477deSjeremylt //! currently closed, but the problem still exists.
52*f53477deSjeremylt 
539df49d7eSJed Brown pub mod bind_ceed {
549df49d7eSJed Brown     #![allow(non_upper_case_globals)]
559df49d7eSJed Brown     #![allow(non_camel_case_types)]
569df49d7eSJed Brown     #![allow(dead_code)]
579df49d7eSJed Brown     include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
589df49d7eSJed Brown }
59