From 6621090afb8a9f20977204863e5bbb30d5d5aa5c Mon Sep 17 00:00:00 2001 From: Valentin Seitz Date: Mon, 29 Jul 2024 19:50:47 +0200 Subject: [PATCH] Enable downloaded Json --- CMakeLists.txt | 18 ++++++++++++++++ README.md | 48 +---------------------------------------- docs/source/install.rst | 8 ++++++- 3 files changed, 26 insertions(+), 48 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8105169..6d23708 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,6 +88,24 @@ endif() include(FetchContent) + +# Define the PathTOJson variable with an empty default value +set(NLOHMAN_JSON_PATH "" CACHE STRING "Path to the local nlohmann json release file") + +if(NLOHMAN_JSON_PATH) + FetchContent_Declare( + json + URL ${NLOHMAN_JSON_PATH} + ) +else() + FetchContent_Declare( + json + URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz + ) +endif() + +# FetchContent configuration + FetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz) FetchContent_MakeAvailable(json) diff --git a/README.md b/README.md index 7d11230..120ed24 100644 --- a/README.md +++ b/README.md @@ -7,50 +7,4 @@ which translates roughly into: "Una altra capa al pastís" or "Yet another layer Its main use case is to provide an interface to annotate code regions. These annotated regions then can be used with multiple backends to gain insight in application behavior. -## Bindings - -To make neSmiK easily usable, we provide Fortran, C, C++ bindings to the library. - -### CXX bindings - -```cpp -#include "nesmik/nesmik.hpp" - -int main() { - nesmik::Init("ProperlyNested","Default"); // inits the nesmik library - nesmik::RegionStart("peter"); - - nesmik::RegionStart("marie"); - - nesmik::RegionStop("marie"); - - nesmik::RegionStop("peter"); - nesmik::Finalize(); -} -``` - -### Fortran - -To enable the Fortran module to be built please add `-DBUILD_C_FORTRAN=ON` to the cmake flags. - -```fortran -program test - use nesmik_mod - call Init("ProperlyNested","Default") - call RegionStart("test") - call RegionStop("test") - call Finalize() - end program test -``` - -Please consider having a look into the documentation (which will be available soon) for further details. - -## Backends - -| Nesting | Backend | Description | -|-------------------|-------------------|----------------------------------------------------------------| -| ProperlyNested | Default | Default Backend, just prints the regions | -| NotProperlyNested | Default | Default Backend, just prints the regions | -| ProperlyNested | Extrae::TypeStack | Extrae backend using different Types for the levels of nesting | -| ProperlyNested | TALP::Tree | DLB-TALP backend printing a tree to visualize the nesting | -| NotProperlyNested | TALP | DLB-TALP backend to register the monitoring regions | +In order to use it [please check out our documentation](https://nesmik.readthedocs.io/en/latest/) diff --git a/docs/source/install.rst b/docs/source/install.rst index dc8979b..a137620 100644 --- a/docs/source/install.rst +++ b/docs/source/install.rst @@ -15,7 +15,6 @@ Requirements * The source files of nesmik e.g downloaded via a `git clone` or a release `.tar.gz` file. * CMake >= 3.27 * C++ 17 compatible compiler -* Internet connection during install (to fetch nlohmann_json automagically) Optional dependencies ====================== @@ -64,6 +63,10 @@ We try to keep the documentation up-to-date, but newer versions may contain more * - WITH_MPI - OFF - Enables MPI-awareness (If you wanna use neSmiK in an MPI program, please enable) + * - NLOHMAN_JSON_PATH + - "" + - Path to a previously downloaded `tar.xz` file. + @@ -77,5 +80,8 @@ Installation steps * by default cmake will generate a ``Makefile``, so as a next step run ``make && make install`` * In order to run the small test suite you can invoke ``ctest`` in the build folder. +.. note:: + If you want to install neSmiK on a cluster without internet access, please download a version of `nlohmann json `_ and configure with: + ``-DNLOHMAN_JSON_PATH=.tar.xz`` **Congrats!** Now you can move forward to TODO: integrate neSmiK into your `projects build system` and `start annotation code` -- GitLab