# neSmiK # Bindings ## CXX bindings How to configure and install: 1. `cmake .. -DCMAKE_INSTALL_PREFIX= -DBUILD_C_FORTRAN=OFF` 2. `make install` ### How to use ```cpp #include "nesmik/nesmik.hpp" int main() { nesmik::init("Default"); nesmik::region_start("peter"); nesmik::region_start("marie"); nesmik::region_stop("marie"); nesmik::region_stop("peter"); nesmik::finalize(); } ``` You **must** call `nesmik::init` exactly once to init the datastructures before you can use the other functionality. Also some backends require finalization, so please make sure to also call `finalize` in the end. To add it to your code, currently just install it and use something similar to: `-I/include -L-I/lib -lnesmik` in the compiler options ## Fortran How to configure and install: 1. `cmake .. -DCMAKE_INSTALL_PREFIX= -DBUILD_C_FORTRAN=ON` 2. `make install` ### How to use ```fortran program test use nesmik_mod call init("Default") call region_start("test") call region_stop("test") call finalize() end program test ``` You **must** call `init` exactly once to init the datastructures before you can use the other functionality. Also some backends require finalization, so please make sure to also call `finalize` in the end. To add it to your code, currently just install it and use something similar to: `gfortran -I.//include .f90 -o /lib/libnesmik_f.a /lib/libnesmik.so` in the compiler of your choice. # Backends ## DLB ### Building To build the DLB backend please make sure you have `DLB_HOME` set in your enviroment or provide the installation dir of dlb with `-DDLB_DIR` To configure: `cmake .. -DENABLE_DLB=ON -DCMAKE_INSTALL_PREFIX= -DBUILD_C_FORTRAN=OFF` Please note, that you may have to add the DLB location to the library path, but as you probably preload it anyway, this shoule be fine :) ### Usage `nesmik::init("DLB")`