Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build_and_test_mac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
brew install gnu-time gcc@15
brew install open-mpi --build-from-source --cc=gcc-15
brew install hdf5-mpi --build-from-source --cc=gcc-15
brew install fftw eigen
brew install fftw eigen nlohmann-json
- name: Set up pixi
uses: prefix-dev/[email protected]
Expand Down
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ repos:
hooks:
- id: clang-format
args: ['--style=file']
exclude: "include/json.hpp"
types_or: [c++]
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## latest

- Include nlohmann-json via cmake [#87](https://github.com/DataAnalyticsEngineering/FANS/pull/87)
- Relaxed versions in Pixi build workflow [#86](https://github.com/DataAnalyticsEngineering/FANS/pull/86)
- Bump version in MacOS CI [#85](https://github.com/DataAnalyticsEngineering/FANS/pull/85)
- Pixi build workflow for MacOS and Linux [#82](https://github.com/DataAnalyticsEngineering/FANS/pull/82) [#84](https://github.com/DataAnalyticsEngineering/FANS/pull/84)
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ if (FANS_LIBRARY_FOR_MICRO_MANAGER)
)
FetchContent_MakeAvailable(pybind11)
endif()

find_package(nlohmann_json REQUIRED)
# ##############################################################################
# TARGETS
# ##############################################################################
Expand Down Expand Up @@ -141,7 +141,6 @@ target_include_directories(FANS_FANS PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SO
# FANS.h header that consuming projects can use
set_property(TARGET FANS_FANS PROPERTY PUBLIC_HEADER
include/general.h
include/json.hpp
include/matmodel.h
include/reader.h
include/solverCG.h
Expand Down Expand Up @@ -200,6 +199,7 @@ target_link_libraries(FANS_FANS PUBLIC ${FFTW3_LIBRARIES})
target_compile_definitions(FANS_FANS PUBLIC ${FFTW3_DEFINITIONS})

target_link_libraries(FANS_FANS PUBLIC Eigen3::Eigen)
target_link_libraries(FANS_FANS PUBLIC nlohmann_json::nlohmann_json)

target_link_libraries(FANS_main PRIVATE FANS::FANS)

Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ FANS has the following dependencies:
- HDF5 with MPI support
- Eigen3
- FFTW3 with MPI support
- nlohmann-json (for JSON input parsing)

### Installing dependencies

Expand All @@ -35,7 +36,8 @@ FANS has the following dependencies:
libopenmpi-dev \
libeigen3-dev \
libfftw3-dev \
libfftw3-mpi-dev
libfftw3-mpi-dev \
nlohmann-json3-dev
```

- On macOS, you can obtain the dependencies using `brew` and set the environment variables:
Expand All @@ -44,7 +46,7 @@ FANS has the following dependencies:
brew install gnu-time cmake gcc@15
brew install open-mpi --build-from-source --cc=gcc-15
brew install hdf5-mpi --build-from-source --cc=gcc-15
brew install fftw eigen
brew install fftw eigen nlohmann-json

export CC=gcc-15 CXX=g++-15 MPICC=mpicc MPICXX=mpicxx
```
Expand Down Expand Up @@ -77,14 +79,15 @@ Spack is a package manager designed for high-performance computing environments.
spack install hdf5 +cxx +mpi
spack install eigen
spack install fftw +mpi
spack install nlohmann-json
```

Additionally, optimized FFTW implementations can be used depending on your system's architecture, for example `amdfftw` (For AMD systems) or `cray-fftw` (For Cray systems), or `fujitsu-fftw` (For Fujitsu systems).
3. **Load Dependencies** Once dependencies are installed, load them before building:
```bash
spack load cmake mpi hdf5 eigen fftw
spack load cmake mpi hdf5 eigen fftw nlohmann-json
```
## Building
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ RUN apt-get update -qq && apt-get install -y --no-install-recommends \
libeigen3-dev \
libfftw3-dev \
libfftw3-mpi-dev \
nlohmann-json3-dev \
# Required for preCICE Micro Manager Python bindings
python3-dev \
# Clean up
Expand Down
2 changes: 1 addition & 1 deletion include/general.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
using namespace std;

// JSON
#include <json.hpp>
#include <nlohmann/json.hpp>
using nlohmann::json;
using namespace nlohmann;

Expand Down
Loading
Loading