diff --git a/science/fasthenry/Makefile b/science/fasthenry/Makefile index 348d94ffe0b2..80607152dfb5 100644 --- a/science/fasthenry/Makefile +++ b/science/fasthenry/Makefile @@ -1,45 +1,50 @@ PORTNAME= fasthenry DISTVERSION= 3.0wr-031424 +PORTREVISION= 1 CATEGORIES= science cad MASTER_SITES= http://www.wrcad.com/ftp/pub/ MAINTAINER= ports@FreeBSD.org COMMENT= Multipole-accelerated inductance analysis program WWW= https://www.rle.mit.edu/cpg/research_codes.htm LICENSE= MIT -USES= gmake -USE_GCC= yes +USES= gmake HAS_CONFIGURE= yes CONFIGURE_SCRIPT= config +CONFIGURE_ARGS= freebsd # Fix build with clang11 CFLAGS+= -fcommon # Use malloc CFLAGS+= -DNO_SBRK -BINARY_ALIAS= gcc=gcc${GCC_DEFAULT} make=gmake +BINARY_ALIAS= make=gmake -WRKSRC= ${WRKDIR}/fasthenry-3.0wr +WRKSRC= ${WRKDIR}/fasthenry-3.0wr OPTIONS_DEFINE= DOCS EXAMPLES +post-patch: + @${REINPLACE_CMD} -Ee '/CFLAGS =/{s/=/+=/;}' \ + ${WRKSRC}/src/sparse/Makefile + do-install: ${INSTALL_PROGRAM} ${WRKSRC}/bin/fasthenry ${STAGEDIR}${PREFIX}/bin/ ${INSTALL_PROGRAM} ${WRKSRC}/bin/zbuf ${STAGEDIR}${PREFIX}/bin do-install-DOCS-on: @${MKDIR} ${STAGEDIR}${DOCSDIR} ${CAT} ${WRKSRC}/README ${WRKSRC}/README.mit > ${STAGEDIR}${DOCSDIR}/readme ${INSTALL_DATA} ${WRKSRC}/doc/nonuniform_manual.pdf ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${WRKSRC}/doc/fasthenry_manual.pdf ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${WRKSRC}/doc/ms_thesis.pdf ${STAGEDIR}${DOCSDIR} ${GZIP_CMD} ${STAGEDIR}${DOCSDIR}/* do-install-EXAMPLES-on: @${MKDIR} ${STAGEDIR}${EXAMPLESDIR} @cd ${WRKSRC}/examples/ && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR} .include diff --git a/science/fasthenry/files/patch-src__mk_syscfg__mk_freebsd.inc b/science/fasthenry/files/patch-src__mk_syscfg__mk_freebsd.inc new file mode 100644 index 000000000000..4cda88f7ccd5 --- /dev/null +++ b/science/fasthenry/files/patch-src__mk_syscfg__mk_freebsd.inc @@ -0,0 +1,37 @@ +--- /dev/null 2026-04-04 21:53:35.827546000 +0000 ++++ src/mk_syscfg/mk_freebsd.inc 2026-04-04 21:52:38.905644000 +0000 +@@ -0,0 +1,34 @@ ++# These CFLAGS should be fine for anything that is reasonably recent ++# except for MinGW. ++ ++# Check AVX (parallel math support), for x86_64 only. We're going to ++# assume the compiler is gcc compatible, you'll need to comment this ++# if a non-compatible compiler is used. Allow AVX if the gcc version ++# is 4.8 or later. This should also work for macOS clang on Intel ++# Macs. ++ ++ARCH := $(shell uname -m) ++ ++ifeq ($(ARCH),amd64) ++ HAVX = 1 ++endif ++ ++# If you build with AVX enabled, and run on a system that does not ++# have AVX, the program will crash. If is not likely that you would ++# want to run fasthenry on such a machine as it is probably slow, but ++# to force build without AVX comment the next three lines below. ++# There seems to be no way to accommodate the presence/absence of AVX ++# at run-time nicely. ++ ++ifeq "$(HAVX)" "1" ++ MAVX = -mavx -DWITH_AVX ++endif ++ ++CFLAGS += -O3 -DFOUR $(MAVX) ++ ++# For debugging. ++#CFLAGS = -O -g -DFOUR $(MAVX) ++ ++# For profiling. ++#CFLAGS = -pg -g -DFOUR $(MAVX) ++