diff --git a/recipes/ff/allow-longer-paths-for-ffopen.patch b/recipes/ff/allow-longer-paths-for-ffopen.patch new file mode 100644 index 0000000000000..7a574f42eba70 --- /dev/null +++ b/recipes/ff/allow-longer-paths-for-ffopen.patch @@ -0,0 +1,28 @@ +From 441ea0fffb6d4af12b15545f72e159c84256fa53 Mon Sep 17 00:00:00 2001 +From: Matthew Feickert +Date: Mon, 23 Dec 2024 00:08:17 -0700 +Subject: [PATCH] fix: Allow for longer paths for ffopen (#8) + +* The ffopen subroutine path and fullname variables need to have enough + characters to hold longer paths that can come up, such as the $PREFIX + variable in conda-build builds, so extend the length to 512 (2^9) characters. +--- + src/ff/ffinit.f | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/ff/ffinit.f b/src/ff/ffinit.f +index 463bd3b..7602e3c 100644 +--- a/src/ff/ffinit.f ++++ b/src/ff/ffinit.f +@@ -756,7 +756,7 @@ + character*(*) name + * + logical lopen +- character*128 path,fullname ++ character*512 path,fullname + * + include 'ff.h' + * +-- +2.47.1 + diff --git a/recipes/ff/meta.yaml b/recipes/ff/meta.yaml new file mode 100644 index 0000000000000..b0facabb5584c --- /dev/null +++ b/recipes/ff/meta.yaml @@ -0,0 +1,86 @@ +{% set name = "ff" %} +{% set version = "2.0.0" %} + +package: + name: {{ name }} + version: {{ version }} + +source: + url: https://github.com/hep-packaging-coordination/ff/archive/v{{ version }}.tar.gz + sha256: 2329b3ca147825b660e07dac45ed85d397a1bea2f6b886518eb4d09900da5503 + patches: + # Can be removed after the patched QCDLoop version is merged in v2.0.1. + - update-makefile.patch + # c.f. https://github.com/hep-packaging-coordination/ff/pull/8 + - allow-longer-paths-for-ffopen.patch + +build: + number: 0 + +outputs: + - name: {{ name }}-static + + build: + skip: true # [win or (osx and x86)] + script: + # FIXME: Patch out custom paths + # Note: Need the space at the end of '$PREFIX/share/ff/ ' so that + # + # fullname = path(1:index(path,' ')-1)//names + # + # in src/ff/ffinit.f can have a space to split on. + # This is a bug and should get fixed by using better logic for fullname. + - sed -i "s|/user/gj/lib/|$PREFIX/share/ff/ |g" src/ff/ffinit.f + - sed -i "s|/usr/local/ff/|$PREFIX/share/ff/ |g" src/ff/ffinit.f + + - cd src/ff + - make install FC=$FC FFLAGS="$FFLAGS -std=legacy -ffixed-line-length-none" DEST=$PREFIX/lib --jobs="${CPU_COUNT}" + - mkdir -p $PREFIX/include/ff + - mv *.h $PREFIX/include/ff + - mkdir -p $PREFIX/share/ff + - mv *.dat $PREFIX/share/ff/ + + requirements: + build: + - {{ stdlib('c') }} + - {{ compiler('fortran') }} + - make + - libtool + - sed + + test: + source_files: + - src/ff/npointes.f + requires: + - {{ compiler('fortran') }} + commands: + - test -f $PREFIX/lib/libff.a + - test -f $PREFIX/include/ff/aa.h + - test -f $PREFIX/include/ff/ff.h + - test -f $PREFIX/include/ff/ffs.h + - test -f $PREFIX/share/ff/fferr.dat + - test -f $PREFIX/share/ff/ffperm5.dat + - test -f $PREFIX/share/ff/ffwarn.dat + + - $FC ./src/ff/npointes.f -o npointes $FFLAGS -I$PREFIX/include/ff $LDFLAGS -lff + - ./npointes + +about: + home: https://github.com/hep-packaging-coordination/ff + summary: 'FF: a package to evaluate one-loop integrals' + description: | + FF is a package to evaluate one-loop integrals written by G. J. + van Oldenborgh, NIKHEF-H, Amsterdam. For the the algorithms used see + preprint NIKHEF-H 89/17, 'New Algorithms for One-loop Integrals', by + G.J. van Oldenborgh and J.A.M. Vermaseren, published in Zeitschrift + fuer Physik C46(1990)425. + [DOI: 10.1007/BF01621031](https://doi.org/10.1007/BF01621031) + license: MIT + license_family: MIT + license_file: LICENSE + dev_url: https://github.com/hep-packaging-coordination/ff + +extra: + feedstock-name: ff + recipe-maintainers: + - matthewfeickert diff --git a/recipes/ff/update-makefile.patch b/recipes/ff/update-makefile.patch new file mode 100644 index 0000000000000..54551f5d3f60c --- /dev/null +++ b/recipes/ff/update-makefile.patch @@ -0,0 +1,43 @@ +From 712ef3c8c1632a538526ece64be05a3763516b34 Mon Sep 17 00:00:00 2001 +From: Matthew Feickert +Date: Mon, 16 Dec 2024 22:30:45 -0700 +Subject: [PATCH] fix: Update the Makefile to avoid hardcoded f77 + +* Apply the Makefile patches from QCDLoop v1.981's vendored version of FF. + - c.f. https://qcdloop.fnal.gov/ +--- + src/ff/Makefile | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/src/ff/Makefile b/src/ff/Makefile +index f47b45e..6869326 100644 +--- a/src/ff/Makefile ++++ b/src/ff/Makefile +@@ -1,4 +1,5 @@ +-FFLAGS = ++FC = gfortran ++FFLAGS = -std=legacy + + LFLAGS = $(FFLAGS) + +@@ -7,7 +8,7 @@ DEST = /usr/local/lib + HDRS = aa.h \ + ff.h + +-LIBRARY = ff.a ++LIBRARY = libff.a + + MAKEFILE = Makefile + +@@ -162,7 +163,7 @@ test: npointes + diff -w npointes.out npointes.sun + + npointes: npointes.o $(LIBRARY) +- f77 $(LFLAGS) -o npointes npointes.o $(LIBRARY) ++ $(FC) $(LFLAGS) -o npointes npointes.o $(LIBRARY) + + $(LIBRARY): $(OBJS) $(AAOBJS) + ar cru $(LIBRARY) $(OBJS) $(AAOBJS) +-- +2.47.1 +