Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FANS to conda-forge #28099

Merged
merged 13 commits into from
Dec 12, 2024
25 changes: 25 additions & 0 deletions recipes/fans/fix_gitignore_ms.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From 393a0c622bcef196bbe1c0cc81fe8c15b9b152c4 Mon Sep 17 00:00:00 2001
From: Claudius Haag <[email protected]>
Date: Thu, 28 Nov 2024 11:04:56 +0100
Subject: [PATCH] Fix gitignore for sphere32 inclusion + needed for copying
when doing test for conda-forge packaging

---
.gitignore | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index 2bc948f..c713336 100644
--- a/.gitignore
+++ b/.gitignore
@@ -198,7 +198,7 @@ test/input_files/**/*.json
**/scratch/

# Test microstructure files
-!sphere.h5
+!sphere32.h5

# Test input files
!test_LinearElastic.json
--
2.34.1
76 changes: 76 additions & 0 deletions recipes/fans/recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
context:
version: "0.3.0"

package:
name: fans
version: ${{ version }}

source:
url: https://github.com/DataAnalyticsEngineering/FANS/archive/refs/tags/v${{ version }}.tar.gz
sha256: 1573478d9acd27a9cfc126a4167ce3951ec26e9896bf19577b44cbc4bdc48b88
patches:
- fix_gitignore_ms.patch # modify so gitignore does not include the sphere32.h5 file

build:
number: 0
skip:
- win
- osx
script:
- if: linux
then:
- rm -rf build
- mkdir build
- cd build
- cmake .. $CMAKE_ARGS -DCMAKE_C_COMPILER=$PREFIX/bin/mpicc -DCMAKE_CXX_COMPILER=$PREFIX/bin/mpicxx
- cmake --build . -j
- cmake --install .

requirements:
build:
- ${{ compiler('c') }}
- ${{ compiler('cxx') }}
- ${{ stdlib('c') }}
- cmake
- make
- ninja
host:
- hdf5 * mpi_openmpi*
- fftw * mpi_openmpi*
- openmpi-mpicxx
- eigen

tests:
- package_contents:
bin:
- FANS
- script:
- JSON_FILE="$PREFIX/etc/conda/test-files/$PKG_NAME/0/test/input_files/test_LinearElastic.json"
- MODIFIED_JSON_FILE="$PREFIX/etc/conda/test-files/$PKG_NAME/0/test/input_files/test_LinearElastic_mod.json"
- NEW_MS_FILENAME="$PREFIX/etc/conda/test-files/$PKG_NAME/0/test/microstructures/sphere32.h5"
# Use jq to create a modified copy of the JSON file
- jq --arg new_filename "$NEW_MS_FILENAME" '.ms_filename = $new_filename' "$JSON_FILE" > "$MODIFIED_JSON_FILE"
# Run tests
- mpiexec -n 2 FANS "$MODIFIED_JSON_FILE" "$PREFIX/etc/conda/test-files/$PKG_NAME/0//test/test_results.h5"
requirements:
run:
- jq
files:
source:
- test/

about:
homepage: https://github.com/DataAnalyticsEngineering/FANS
summary: "FANS: an open-source, efficient, and parallel FFT-based homogenization solver designed to solve microscale multiphysics problems."
description: |
Fourier Accelerated Nodal Solvers (FANS) is an FFT-based homogenization solver designed to handle microscale multiphysics problems.
This repository contains a C++ implementation of FANS, built using CMake and MPI for parallel computations.
license: LGPL-3.0-only
license_family: LGPL
license_file: LICENSE

extra:
recipe-maintainers:
- sanathkeshav
- claudiushaag
- EMMAOpenSource
Loading