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 FF (second attempt) #28692

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
28 changes: 28 additions & 0 deletions recipes/ff/allow-longer-paths-for-ffopen.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
From 441ea0fffb6d4af12b15545f72e159c84256fa53 Mon Sep 17 00:00:00 2001
From: Matthew Feickert <matthew.feickert@cern.ch>
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

86 changes: 86 additions & 0 deletions recipes/ff/meta.yaml
Original file line number Diff line number Diff line change
@@ -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)]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Things work for arm64 osx but not x86, so skipping x86 for the time being, but not using # [not linux] to allow for rerenders to add additional builds.

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
43 changes: 43 additions & 0 deletions recipes/ff/update-makefile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
From 712ef3c8c1632a538526ece64be05a3763516b34 Mon Sep 17 00:00:00 2001
From: Matthew Feickert <matthew.feickert@cern.ch>
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

Loading