git: 167249824748 - 2026Q3 - cad/tochnog: fix build

From: Thierry Thomas <thierry_at_FreeBSD.org>
Date: Wed, 15 Jul 2026 20:46:34 UTC
The branch 2026Q3 has been updated by thierry:

URL: https://cgit.FreeBSD.org/ports/commit/?id=167249824748ed30ff27437d65e6ccc37a8db1cd

commit 167249824748ed30ff27437d65e6ccc37a8db1cd
Author:     Thierry Thomas <thierry@FreeBSD.org>
AuthorDate: 2026-07-14 20:14:34 +0000
Commit:     Thierry Thomas <thierry@FreeBSD.org>
CommitDate: 2026-07-15 20:45:32 +0000

    cad/tochnog: fix build
    
    Don’t try to use f2c for compilation, just link with it.
    
    Since I’m here, remove the ATLAS option and switch to openBLAS.
    
    (cherry picked from commit 0e9d10974c9e6d0ff44c5e7e8031026e212468a4)
---
 cad/tochnog/Makefile                | 30 +++++++++++-------------------
 cad/tochnog/files/patch-makefile    | 31 ++++++++++++++++---------------
 cad/tochnog/files/patch-sysposix.cc |  4 ++--
 cad/tochnog/files/patch-tn.cc       | 13 ++++++-------
 cad/tochnog/files/patch-tnsuplu.h   |  4 ++--
 cad/tochnog/files/patch-tochnog.h   | 20 ++++++++++++++------
 6 files changed, 51 insertions(+), 51 deletions(-)

diff --git a/cad/tochnog/Makefile b/cad/tochnog/Makefile
index 217becaff5e9..6180902e1a61 100644
--- a/cad/tochnog/Makefile
+++ b/cad/tochnog/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	tochnog
 PORTVERSION=	20140100
-PORTREVISION=	14
+PORTREVISION=	15
 CATEGORIES=	cad
 MASTER_SITES=	SF/${PORTNAME}/Tochnog%20Latest%20January%202014
 DISTFILES=	Sources${EXTRACT_SUFX} gid${EXTRACT_SUFX} \
@@ -13,15 +13,15 @@ WWW=		https://tochnog.sourceforge.net/
 
 LICENSE=	GPLv2
 
-BUILD_DEPENDS=	${LOCALBASE}/lib/libf2c.a:lang/f2c
+LIB_DEPENDS=	libf2c.so:lang/f2c
 
-OPTIONS_DEFINE=	ATLAS EXAMPLES
-ATLAS_DESC=	Use ATLAS instead of BLAS/LAPACK
+USES=		blaslapack:openblas fortran zip dos2unix
+DOS2UNIX_FILES=	time.cc time.h tnlapack.h tnsuplu.h
+
+OPTIONS_DEFINE=	EXAMPLES
 
 WRKSRC=		${WRKDIR}/Sources/Tochnog-Latest-jan-2014
 MAKEFILE=	makefile
-USES=		fortran zip dos2unix
-DOS2UNIX_FILES=	time.cc time.h tnlapack.h tnsuplu.h
 
 # You can set GIDDIR to share/gid to install the scripts to be used
 # with the cad/linux-gid port, otherwise they can be linked to the data
@@ -31,23 +31,14 @@ GIDDIR?=	share/${PORTNAME}
 PLIST_SUB+=	GIDDIR=${GIDDIR}
 GID_PTYPES=	${PREFIX}/${GIDDIR}/problemtypes
 
-.include <bsd.port.options.mk>
-
-.if ${PORT_OPTIONS:MATLAS}
-LIB_DEPENDS+=	libatlas.so:math/atlas
-BLAS_LIBS=	-lf77blas
-.else
-LIB_DEPENDS+=	libblas.so:math/blas	\
-		liblapack.so:math/lapack
-BLAS_LIBS=	-llapack -lblas
-.endif
-
 ALL_TARGET=	freebsd_old
 LIB_DEPENDS+=	libsuperlu.so:math/superlu
 SUPERLU=	superlu
 
+.include <bsd.port.options.mk>
+
 .if ${OPSYS} == FreeBSD
-CPPFLAGS+=  -Dregister=
+CPPFLAGS+=	-Dregister=
 .endif
 
 post-extract:
@@ -61,7 +52,7 @@ pre-configure:
 .endfor
 	${REINPLACE_CMD} -e 's,%%LOCALBASE%%,${LOCALBASE},g ; \
 	s,%%SUPERLU%%,${SUPERLU},g ; \
-	s,%%BLAS_LIBS%%,-L${LOCALBASE}/lib ${BLAS_LIBS},g' \
+	s,%%BLAS_LIBS%%,-L${LOCALBASE}/lib ${BLASLIB},g' \
 	${WRKSRC}/makefile
 	${REINPLACE_CMD} -e 's,SUPERLU_USE 0,SUPERLU_USE 1,' \
 	${WRKSRC}/tnsuplu.h
@@ -80,6 +71,7 @@ do-install:
 	  ${STAGEDIR}${GID_PTYPES}/tochnog.gid
 	${INSTALL_SCRIPT} ${WRKDIR}/Sources/gid/tochnog.gid/tochnog.ba*	\
 	  ${STAGEDIR}${GID_PTYPES}/tochnog.gid
+
 do-install-EXAMPLES-on:
 	${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
 	${RM} ${WRKDIR}/Sources/test/*.orig
diff --git a/cad/tochnog/files/patch-makefile b/cad/tochnog/files/patch-makefile
index 1fc76d36e2c7..b144547bb6d4 100644
--- a/cad/tochnog/files/patch-makefile
+++ b/cad/tochnog/files/patch-makefile
@@ -1,16 +1,16 @@
---- makefile.orig	2014-01-05 15:35:37.000000000 +0100
-+++ makefile	2014-03-09 22:07:32.000000000 +0100
+--- makefile.orig	2014-01-05 14:35:37 UTC
++++ makefile
 @@ -5,7 +5,8 @@
  #***********  fortran 2 c *******************
  # Set F2C (for unix -lf2c and for MS windows if using Visual C++ to f2c.lib)
  
 -F2C= -lf2c 
 +F2C= -lf2c -L%%LOCALBASE%%/lib
-+F2C_INCLUDE= -I%%LOCALBASE%%/include
++F2C_INCLUDE= # -I%%LOCALBASE%%/include
  #  ***********  hypoplasticity ****************
  # For hypoplasticity:
  #    install f2c on your computer (also see F2C above)
-@@ -30,11 +31,11 @@
+@@ -30,11 +31,11 @@ VCPP=
  SYS_FILE=sysother
  BCPP=-P
  VCPP=
@@ -26,7 +26,7 @@
  LINK_FLAGS_AFTER=
  
  #  ***********  SUPERLU library *******************
-@@ -49,6 +50,9 @@
+@@ -49,6 +50,9 @@ LINK_FLAGS_AFTER=
  #      SUPERLU_INCLUDE=-I/Users/fdolorenzo/Downloads/petsc-3.4.2/arch-darwin-c-debug/include
  #      3. For SuperLU_MT be sure to compile a multi threaded version
  #      of Tochnog (sparc_parallel, alpha_parallel, linux, etc.
@@ -36,7 +36,7 @@
  
  #  ***********  PetSc library *******************
  # Do NOT link together with the SUPERLU library
-@@ -80,7 +84,7 @@
+@@ -80,7 +84,7 @@ ALL_LIB=  $(LAPACK_LIB)  $(BLAS_LIB) $(F2C) -lm $(PETS
  ALL_LIB=  $(LAPACK_LIB)  $(BLAS_LIB) $(F2C) -lm $(PETSC_LIB) $(SUPERLU_LIB)
  
  #  ***********  default platform  *******************
@@ -45,7 +45,7 @@
  
  # single and multi-processor windows; borland c++ compiler
  # set SYS_FILE above to syswin32 for multi-processor
-@@ -130,17 +134,22 @@
+@@ -130,18 +134,23 @@ darwin-intel: 
  	"LINK_FLAGS_AFTER=-g -v -dynamic -undefined dynamic_lookup  $(ALL_LIB) $(PROFILE) -dynamic -lpthread -o tochnog"
  
  # single processor linux; gnu gcc compiler
@@ -64,7 +64,7 @@
  	"LINK_FLAGS_BEFORE=" \
 -	"LINK_FLAGS_AFTER= $(PROFILE) $(ALL_LIB) -static -lm -o tochnog"
 +	"LINK_FLAGS_AFTER= $(PROFILE) $(ALL_LIB) ${LDFLAGS} -pthread -lm -o tochnog"
-+
+ 
 +# Multithreaded FreeBSD
 +freebsd_parallel:
 +	${MAKE} tochnog \
@@ -73,10 +73,11 @@
 +	"COMPILER_FLAGS= -c ${CFLAGS} ${CPPFLAGS} -D_REENTRANT $(ALL_INCLUDE)" \
 +	"LINK_FLAGS_BEFORE=" \
 +	"LINK_FLAGS_AFTER= $(PROFILE) $(ALL_LIB) ${LDFLAGS} -lpthread -lm -o tochnog"
- 
++
  # multi processor linux; gnu gcc compiler
  linux: 
-@@ -289,7 +298,7 @@
+ 	make tochnog \
+@@ -289,7 +298,7 @@ tochnog: adjust.$(OBJ) area.$(OBJ) \
  	renumber.$(OBJ) repeat.$(OBJ) restart.$(OBJ) \
  	slide.$(OBJ) \
  	so.$(OBJ) so_bicg.$(OBJ) \
@@ -85,7 +86,7 @@
  	spring.$(OBJ) stress.$(OBJ) \
  	$(SYS_FILE).$(OBJ) tendon.$(OBJ) time.$(OBJ) tn.$(OBJ) \
  	top.$(OBJ) truss.$(OBJ) \
-@@ -401,7 +410,7 @@
+@@ -401,7 +410,7 @@ $(HYPO_OBJ): $(HYPO_SRC)
  	$(COMPILER_CPP) $(COMPILER_FLAGS) $(BCPP) $(VCPP)hyperela.$(SRC_CPP)
  
  $(HYPO_OBJ): $(HYPO_SRC)
@@ -94,13 +95,13 @@
  
  hypoplas.$(OBJ): hypoplas.$(SRC_CPP) tochnog.h
  	$(COMPILER_CPP) $(COMPILER_FLAGS) $(BCPP) $(VCPP)hypoplas.$(SRC_CPP)
-@@ -565,6 +574,9 @@
+@@ -564,6 +573,9 @@ so_bicg.$(OBJ): so_bicg.$(SRC_CPP) tochnog.h
+ 
  #so_petsc.$(OBJ): so_petsc.$(SRC_C) tochnog.h
  #	$(COMPILER_C) $(COMPILER_FLAGS) so_petsc.$(SRC_C)
- 
++
 +so_suplu.$(OBJ): so_suplu.$(SRC_C) tochnog.h
 +	$(COMPILER_C) $(COMPILER_FLAGS) so_suplu.$(SRC_C)
-+
+ 
  split.$(OBJ): split.$(SRC_CPP) tochnog.h
  	$(COMPILER_CPP) $(COMPILER_FLAGS) $(BCPP) $(VCPP)split.$(SRC_CPP)
- 
diff --git a/cad/tochnog/files/patch-sysposix.cc b/cad/tochnog/files/patch-sysposix.cc
index 50bbc73408da..201ecba952f0 100644
--- a/cad/tochnog/files/patch-sysposix.cc
+++ b/cad/tochnog/files/patch-sysposix.cc
@@ -1,4 +1,4 @@
---- sysposix.cc.orig
+--- sysposix.cc.orig	2004-02-25 20:46:52 UTC
 +++ sysposix.cc
 @@ -20,20 +20,20 @@
  #include "tochnog.h"
@@ -24,7 +24,7 @@
  }
  
  void parallel_sys_next_of_loop( long int next_of_loop[], long int max_loop,
-@@ -96,5 +96,5 @@
+@@ -96,5 +96,5 @@ void parallel_sys_unlock( void )
  void parallel_sys_unlock( void )
  
  {
diff --git a/cad/tochnog/files/patch-tn.cc b/cad/tochnog/files/patch-tn.cc
index 197f3bb9acfa..23b5e692c74b 100644
--- a/cad/tochnog/files/patch-tn.cc
+++ b/cad/tochnog/files/patch-tn.cc
@@ -1,5 +1,5 @@
---- tn.cc.orig	2013-08-16 01:47:35.000000000 +0200
-+++ tn.cc	2014-03-09 17:57:23.000000000 +0100
+--- tn.cc.orig	2013-08-15 23:47:35 UTC
++++ tn.cc
 @@ -33,6 +33,40 @@
    int PetscFinalize(void);
  #endif
@@ -41,19 +41,19 @@
  int main( int argc, char* argv[] )
  
  {
-@@ -40,37 +74,107 @@
+@@ -40,37 +74,107 @@ int main( int argc, char* argv[] )
    Time CPU;
    CPU.firsttime=CPU.taketime();
  
 -  long int i=0, l=0, any_point=0;
 +  extern char *optarg;
 +  extern int optind, opterr, optopt;
-+
+ 
 +  int opt_index, option, error_count = 0;
 +  bool print_usage = false, print_version = false;
 +
 +  size_t i=0, l=0, s_len=0, any_point=0;
- 
++
      // initialise static variables
    initialize();
  
@@ -155,7 +155,7 @@
 -    pri( "or:    tochnog file.dat > file.out" );
 -    exit(TN_EXIT_STATUS);
 -  }
--#endif
+ #endif
 -
 -    // append .dat to input file name
 -  l = strlen( data_file );
@@ -169,7 +169,6 @@
 -    // empty the tn.dvd file at the start of calculation
 -  ofstream outdvd( "tn.dvd" );
 -  outdvd.close();
-+#endif
  
      // read input file
    input();
diff --git a/cad/tochnog/files/patch-tnsuplu.h b/cad/tochnog/files/patch-tnsuplu.h
index 6bd5f7d8f7d8..be3ddce11a27 100644
--- a/cad/tochnog/files/patch-tnsuplu.h
+++ b/cad/tochnog/files/patch-tnsuplu.h
@@ -1,5 +1,5 @@
---- tnsuplu.h.orig	Sun Aug 19 12:31:52 2001
-+++ tnsuplu.h	Fri Feb  3 15:55:13 2006
+--- tnsuplu.h.orig	2026-07-14 18:15:00 UTC
++++ tnsuplu.h
 @@ -2,6 +2,12 @@
  #define SUPERLU_USE 0
  #define SUPERLU_MT_USE 0
diff --git a/cad/tochnog/files/patch-tochnog.h b/cad/tochnog/files/patch-tochnog.h
index aafa9a787cfe..53299c52bd48 100644
--- a/cad/tochnog/files/patch-tochnog.h
+++ b/cad/tochnog/files/patch-tochnog.h
@@ -1,11 +1,19 @@
---- tochnog.h.orig	2013-10-12 05:33:16.000000000 +0200
-+++ tochnog.h	2014-03-09 18:16:04.000000000 +0100
-@@ -58,6 +58,8 @@
+--- tochnog.h.orig	2013-10-12 03:33:16 UTC
++++ tochnog.h
+@@ -37,7 +37,6 @@
+ #include "tnhypo.h"
+ #include "matrix.h"
+ #include "time.h"
+-#include "f2c.h"
+ 
+ using namespace std;
+  
+@@ -57,6 +56,8 @@ enum {
+   VERSION_EXTRUDE,      // mesh for extrude
    MVERSION              // maximum number of versions, this must be the last item
  }; 
- 
-+#define TOCHNOG_VERSION "Latest-jan-2014"
 +
++#define TOCHNOG_VERSION "Latest-jan-2014"
+ 
    // constants
  #define MCHAR 100  // maximum length of names
- #define MDIM 3 // maximum number of space dimensions