git: 47a5a87c5798 - main - science/openmx: update 3.8.5 → 3.9.9

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Mon, 17 Jun 2024 01:21:00 UTC
The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=47a5a87c5798153dd0ce45312567ee0813746ab9

commit 47a5a87c5798153dd0ce45312567ee0813746ab9
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2024-06-16 23:13:52 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2024-06-17 01:20:36 +0000

    science/openmx: update 3.8.5 → 3.9.9
---
 science/openmx/Makefile                        | 26 +++++----
 science/openmx/distinfo                        | 10 ++--
 science/openmx/files/patch-Band__DFT__Col.c    | 15 ------
 science/openmx/files/patch-Band__DFT__NonCol.c | 15 ------
 science/openmx/files/patch-Cluster__DFT.c      | 46 ----------------
 science/openmx/files/patch-Input__std.c        | 10 ++--
 science/openmx/files/patch-Poisson.c           | 22 ++++----
 science/openmx/files/patch-Poisson__ESM.c      | 24 ---------
 science/openmx/files/patch-bandgnu13.c         |  6 +--
 science/openmx/files/patch-makefile            | 75 +++++++++++++++-----------
 science/openmx/files/patch-openmx__common.h    | 11 ++++
 science/openmx/files/patch-tran__variables.h   | 10 ----
 12 files changed, 94 insertions(+), 176 deletions(-)

diff --git a/science/openmx/Makefile b/science/openmx/Makefile
index 297bbc26ba97..dd23335b19b2 100644
--- a/science/openmx/Makefile
+++ b/science/openmx/Makefile
@@ -1,9 +1,8 @@
 PORTNAME=	openmx
-DISTVERSION=	3.8.5 # the 18June12 patch upgrades 3.8 -> 3.8.5
-PORTREVISION=	10
+DISTVERSION=	3.9.9 # the 18June12 patch upgrades 3.9 -> 3.9.9
 CATEGORIES=	science
-MASTER_SITES=	http://www.openmx-square.org/ \
-		http://www.openmx-square.org/bugfixed/18June12/:patch
+MASTER_SITES=	https://www.openmx-square.org/ \
+		https://www.openmx-square.org/bugfixed/21Oct17/:patch
 DISTFILES=	${PORTNAME}${DISTVERSION:R}${EXTRACT_SUFX} \
 		patch${DISTVERSION}${EXTRACT_SUFX}:patch # this patch isn't a patch, but a set of file updates
 DIST_SUBDIR=	${PORTNAME}
@@ -11,16 +10,18 @@ EXTRACT_ONLY=	${PORTNAME}${DISTVERSION:R}${EXTRACT_SUFX}
 
 MAINTAINER=	yuri@FreeBSD.org
 COMMENT=	Nanoscale material simulations using density functional theories (DFT)
-WWW=		http://www.openmx-square.org/
+WWW=		https://www.openmx-square.org/
 
 LICENSE=	GPLv2
 
 BROKEN_i386=	undefined reference to `__atomic_load', see bug#229605 and https://reviews.llvm.org/D42154
 
 LIB_DEPENDS=	libblas.so:math/blas \
+		libcblas.so:math/cblas \
 		libfftw3.so:math/fftw3 \
 		liblapack.so:math/lapack \
-		libmpich.so:net/mpich
+		libmpich.so:net/mpich \
+		libscalapack.so:math/scalapack
 
 USES=		dos2unix fortran gmake localbase:ldflags
 USE_CXXSTD=	c++11
@@ -54,17 +55,22 @@ SIMD_CFLAGS=		-msse -msse2 -mfpmath=sse
 SIMD_CFLAGS_OFF=	-Dnosse
 CFLAGS+=		${ARCH:S/amd64//:S/i386//:S/${ARCH}/-Dnosse/}
 
+MAKE_JOBS_UNSAFE=	yes
+
 pre-patch: # overlay files before patching
-	@cd ${WRKSRC} && ${TAR} xzf ${DISTDIR}/${DIST_SUBDIR}/patch${DISTVERSION}${EXTRACT_SUFX}
+	@cd ${WRKSRC} && \
+		${TAR} xzf ${DISTDIR}/${DIST_SUBDIR}/patch${DISTVERSION}${EXTRACT_SUFX}
 
 post-patch:
-	@cd ${WRKSRC} && ${REINPLACE_CMD} 's|DFT_DATA_PATH|"${DATADIR}/DFT_DATA13"|' Input_std.c check_lead.c SetPara_DFT.c OutData.c OutData_Binary.c
+	@cd ${WRKSRC} && \
+		${ECHO} "const char DFT_DATA_PATH[YOUSO10] = \"${DATADIR}/DFT_DATA19\";" >> ${WRKSRC}/Input_std.c
 
-post-install:
+do-install:
+	${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
 .for u in ${UTIL_PROGS}
 	${INSTALL_PROGRAM} ${WRKSRC}/${u} ${STAGEDIR}${PREFIX}/bin
 .endfor
-	cd ${WRKSRC}/.. && ${COPYTREE_SHARE} DFT_DATA13 ${STAGEDIR}${DATADIR}
+	cd ${WRKSRC}/.. && ${COPYTREE_SHARE} DFT_DATA19 ${STAGEDIR}${DATADIR}
 	# autoplist for potentials: about 500 files in DATADIR
 	@cd ${STAGEDIR}${PREFIX} && \
 		${FIND} ${DATADIR:S/^${PREFIX}\///} -type f >> ${TMPPLIST}
diff --git a/science/openmx/distinfo b/science/openmx/distinfo
index 9794f107d104..675900e11d77 100644
--- a/science/openmx/distinfo
+++ b/science/openmx/distinfo
@@ -1,5 +1,5 @@
-TIMESTAMP = 1536713126
-SHA256 (openmx/openmx3.8.tar.gz) = 36ee10d8b1587b25a2ca1d57f110111be65c4fb4dc820e6d93e1ed2b562634a1
-SIZE (openmx/openmx3.8.tar.gz) = 143086177
-SHA256 (openmx/patch3.8.5.tar.gz) = d0fea2ce956d796a87a4bc9e9d580fb115ff2a22764650fffa78bb79a1b30468
-SIZE (openmx/patch3.8.5.tar.gz) = 316333
+TIMESTAMP = 1718573397
+SHA256 (openmx/openmx3.9.tar.gz) = 27bb56bd4d1582d33ad32108fb239b546bdd1bdffd6f5b739b4423da1ab93ae2
+SIZE (openmx/openmx3.9.tar.gz) = 166014953
+SHA256 (openmx/patch3.9.9.tar.gz) = 20cccc4e3412a814a53568f400260e90f79f0bfb7e2bed84447fe071b26edd38
+SIZE (openmx/patch3.9.9.tar.gz) = 1074993
diff --git a/science/openmx/files/patch-Band__DFT__Col.c b/science/openmx/files/patch-Band__DFT__Col.c
deleted file mode 100644
index a22e95c8e542..000000000000
--- a/science/openmx/files/patch-Band__DFT__Col.c
+++ /dev/null
@@ -1,15 +0,0 @@
---- Band_DFT_Col.c.orig	2018-08-29 06:24:38 UTC
-+++ Band_DFT_Col.c
-@@ -483,9 +483,9 @@ double Band_DFT_Col(int SCF_iter,
- 
-     /* allocation */ 
- 
--    stat_send = malloc(sizeof(MPI_Status)*numprocs2);
--    request_send = malloc(sizeof(MPI_Request)*numprocs2);
--    request_recv = malloc(sizeof(MPI_Request)*numprocs2);
-+    stat_send = (MPI_Status *)malloc(sizeof(MPI_Status)*numprocs2);
-+    request_send = (MPI_Request *)malloc(sizeof(MPI_Request)*numprocs2);
-+    request_recv = (MPI_Request *)malloc(sizeof(MPI_Request)*numprocs2);
- 
-     is1 = (int*)malloc(sizeof(int)*numprocs2);
-     ie1 = (int*)malloc(sizeof(int)*numprocs2);
diff --git a/science/openmx/files/patch-Band__DFT__NonCol.c b/science/openmx/files/patch-Band__DFT__NonCol.c
deleted file mode 100644
index dfbcc2493215..000000000000
--- a/science/openmx/files/patch-Band__DFT__NonCol.c
+++ /dev/null
@@ -1,15 +0,0 @@
---- Band_DFT_NonCol.c.orig	2018-08-29 06:26:10 UTC
-+++ Band_DFT_NonCol.c
-@@ -554,9 +554,9 @@ double Band_DFT_NonCol(int SCF_iter,
- 
-     /* allocation */ 
- 
--    stat_send = malloc(sizeof(MPI_Status)*numprocs1);
--    request_send = malloc(sizeof(MPI_Request)*numprocs1);
--    request_recv = malloc(sizeof(MPI_Request)*numprocs1);
-+    stat_send = (MPI_Status *)malloc(sizeof(MPI_Status)*numprocs1);
-+    request_send = (MPI_Request *)malloc(sizeof(MPI_Request)*numprocs1);
-+    request_recv = (MPI_Request *)malloc(sizeof(MPI_Request)*numprocs1);
- 
-     is1 = (int*)malloc(sizeof(int)*numprocs1);
-     ie1 = (int*)malloc(sizeof(int)*numprocs1);
diff --git a/science/openmx/files/patch-Cluster__DFT.c b/science/openmx/files/patch-Cluster__DFT.c
deleted file mode 100644
index cbf76c632080..000000000000
--- a/science/openmx/files/patch-Cluster__DFT.c
+++ /dev/null
@@ -1,46 +0,0 @@
---- Cluster_DFT.c.orig	2018-08-29 06:05:22 UTC
-+++ Cluster_DFT.c
-@@ -194,9 +194,9 @@ static double Cluster_collinear(
- 
-   Num_Comm_World1 = SpinP_switch + 1; 
- 
--  stat_send = malloc(sizeof(MPI_Status)*numprocs0);
--  request_send = malloc(sizeof(MPI_Request)*numprocs0);
--  request_recv = malloc(sizeof(MPI_Request)*numprocs0);
-+  stat_send = (MPI_Status *)malloc(sizeof(MPI_Status)*numprocs0);
-+  request_send = (MPI_Request *)malloc(sizeof(MPI_Request)*numprocs0);
-+  request_recv = (MPI_Request *)malloc(sizeof(MPI_Request)*numprocs0);
- 
-   /***********************************************
-       allocation of arrays for the first world 
-@@ -1541,9 +1541,9 @@ static double Cluster_non_collinear(
- 
-   /* allocation of arrays */
- 
--  stat_send = malloc(sizeof(MPI_Status)*numprocs);
--  request_send = malloc(sizeof(MPI_Request)*numprocs);
--  request_recv = malloc(sizeof(MPI_Request)*numprocs);
-+  stat_send = (MPI_Status *)malloc(sizeof(MPI_Status)*numprocs);
-+  request_send = (MPI_Request *)malloc(sizeof(MPI_Request)*numprocs);
-+  request_recv = (MPI_Request *)malloc(sizeof(MPI_Request)*numprocs);
- 
-   /****************************************************
-              calculation of the array size
-@@ -2649,7 +2649,7 @@ void Save_DOS_Col(int n, int MaxN, int *
-   MPI_Comm_size(mpi_comm_level1,&numprocs);
-   MPI_Comm_rank(mpi_comm_level1,&myid);
- 
--  request_recv = malloc(sizeof(MPI_Request)*numprocs);
-+  request_recv = (MPI_Request *)malloc(sizeof(MPI_Request)*numprocs);
- 
-   /* open file pointers */
- 
-@@ -2901,7 +2901,7 @@ void Save_DOS_NonCol(int n, int MaxN, in
-   MPI_Comm_size(mpi_comm_level1,&numprocs);
-   MPI_Comm_rank(mpi_comm_level1,&myid);
- 
--  request_recv = malloc(sizeof(MPI_Request)*numprocs);
-+  request_recv = (MPI_Request *)malloc(sizeof(MPI_Request)*numprocs);
- 
-   /* open file pointers */
- 
diff --git a/science/openmx/files/patch-Input__std.c b/science/openmx/files/patch-Input__std.c
index d8e1325a911b..a480b91c744f 100644
--- a/science/openmx/files/patch-Input__std.c
+++ b/science/openmx/files/patch-Input__std.c
@@ -1,11 +1,11 @@
---- Input_std.c.orig	2018-09-12 02:18:32 UTC
+--- Input_std.c.orig	2021-08-12 15:44:59 UTC
 +++ Input_std.c
-@@ -85,7 +85,7 @@ void Input_std(char *file)
+@@ -97,7 +97,7 @@ void Input_std(char *file)
+   sprintf(filepath,"%s/",filepath);
  
-   input_string("System.CurrrentDirectory",filepath,"./");
    input_string("System.Name",filename,"default");
--  input_string("DATA.PATH",DFT_DATA_PATH,"../DFT_DATA13");
-+  //input_string("DATA.PATH",DFT_DATA_PATH,"../DFT_DATA13");
+-  input_string("DATA.PATH",DFT_DATA_PATH,"../DFT_DATA19");
++  //input_string("DATA.PATH",DFT_DATA_PATH,"../DFT_DATA19");
    input_int("level.of.stdout", &level_stdout,1);
    input_int("level.of.fileout",&level_fileout,1);
    input_logical("memory.usage.fileout",&memoryusage_fileout,0); /* default=off */
diff --git a/science/openmx/files/patch-Poisson.c b/science/openmx/files/patch-Poisson.c
index 6705c1abff28..287fe3822aac 100644
--- a/science/openmx/files/patch-Poisson.c
+++ b/science/openmx/files/patch-Poisson.c
@@ -1,6 +1,6 @@
---- Poisson.c.orig	2018-08-29 05:58:06 UTC
+--- Poisson.c.orig	2021-08-12 13:42:04 UTC
 +++ Poisson.c
-@@ -141,8 +141,8 @@ void FFT_Poisson(double *ReRhor, double 
+@@ -209,8 +209,8 @@ void FFT_Poisson(double *ReRhor, double *ImRhor, 
      allocation of arrays:
    ****************************************************/
  
@@ -9,9 +9,9 @@
 +  in  = (fftw_complex *)fftw_malloc(sizeof(fftw_complex)*List_YOUSO[17]); 
 +  out = (fftw_complex *)fftw_malloc(sizeof(fftw_complex)*List_YOUSO[17]); 
  
-   /*------------------ FFT along the C-axis in the AB partition ------------------*/
- 
-@@ -182,10 +182,10 @@ void FFT_Poisson(double *ReRhor, double 
+   ReTmp = (double*)malloc(sizeof(double)*My_NumGridB_AB);
+   ImTmp = (double*)malloc(sizeof(double)*My_NumGridB_AB);
+@@ -260,10 +260,10 @@ void FFT_Poisson(double *ReRhor, double *ImRhor, 
    array0 = (double*)malloc(sizeof(double)*2*GP_B_AB2CA_S[NN_B_AB2CA_S]); 
    array1 = (double*)malloc(sizeof(double)*2*GP_B_AB2CA_R[NN_B_AB2CA_R]); 
  
@@ -26,7 +26,7 @@
  
    NN_S = 0;
    NN_R = 0;
-@@ -307,10 +307,10 @@ void FFT_Poisson(double *ReRhor, double 
+@@ -385,10 +385,10 @@ void FFT_Poisson(double *ReRhor, double *ImRhor, 
    array0 = (double*)malloc(sizeof(double)*2*GP_B_CA2CB_S[NN_B_CA2CB_S]); 
    array1 = (double*)malloc(sizeof(double)*2*GP_B_CA2CB_R[NN_B_CA2CB_R]); 
  
@@ -41,7 +41,7 @@
  
    NN_S = 0;
    NN_R = 0;
-@@ -503,8 +503,8 @@ void Inverse_FFT_Poisson(double *ReRhor,
+@@ -592,8 +592,8 @@ void Inverse_FFT_Poisson(double *ReRhor, double *ImRho
      fftw_complex out[List_YOUSO[17]];
    ****************************************************/
  
@@ -50,9 +50,9 @@
 +  in  = (fftw_complex *)fftw_malloc(sizeof(fftw_complex)*List_YOUSO[17]); 
 +  out = (fftw_complex *)fftw_malloc(sizeof(fftw_complex)*List_YOUSO[17]); 
  
-   /*------------------ Inverse FFT along the A-axis in the CB partition ------------------*/
- 
-@@ -544,10 +544,10 @@ void Inverse_FFT_Poisson(double *ReRhor,
+   ReTmp = (double*)malloc(sizeof(double)*My_NumGridB_CB);
+   ImTmp = (double*)malloc(sizeof(double)*My_NumGridB_CB);
+@@ -643,10 +643,10 @@ void Inverse_FFT_Poisson(double *ReRhor, double *ImRho
    array0 = (double*)malloc(sizeof(double)*2*GP_B_CA2CB_R[NN_B_CA2CB_R]); 
    array1 = (double*)malloc(sizeof(double)*2*GP_B_CA2CB_S[NN_B_CA2CB_S]); 
  
@@ -67,7 +67,7 @@
  
    NN_S = 0;
    NN_R = 0;
-@@ -669,10 +669,10 @@ void Inverse_FFT_Poisson(double *ReRhor,
+@@ -768,10 +768,10 @@ void Inverse_FFT_Poisson(double *ReRhor, double *ImRho
    array0 = (double*)malloc(sizeof(double)*2*GP_B_AB2CA_R[NN_B_AB2CA_R]); 
    array1 = (double*)malloc(sizeof(double)*2*GP_B_AB2CA_S[NN_B_AB2CA_S]); 
  
diff --git a/science/openmx/files/patch-Poisson__ESM.c b/science/openmx/files/patch-Poisson__ESM.c
deleted file mode 100644
index 19224a759e79..000000000000
--- a/science/openmx/files/patch-Poisson__ESM.c
+++ /dev/null
@@ -1,24 +0,0 @@
---- Poisson_ESM.c.orig	2018-08-29 06:03:16 UTC
-+++ Poisson_ESM.c
-@@ -71,8 +71,8 @@ double Poisson_ESM(int fft_charge_flag,
-     fftw_complex out[List_YOUSO[17]];
-   ****************************************************/
- 
--  in0  = fftw_malloc(sizeof(fftw_complex)*List_YOUSO[17]);
--  out0 = fftw_malloc(sizeof(fftw_complex)*List_YOUSO[17]);
-+  in0  = (fftw_complex *)fftw_malloc(sizeof(fftw_complex)*List_YOUSO[17]);
-+  out0 = (fftw_complex *)fftw_malloc(sizeof(fftw_complex)*List_YOUSO[17]);
- 
- 
-   if (myid==Host_ID) { 
-@@ -908,8 +908,8 @@ void One_dim_FFT(FILE *fp, 
-     fftw_complex out[List_YOUSO[17]];
-   ****************************************************/
- 
--  in  = fftw_malloc(sizeof(fftw_complex)*List_YOUSO[17]);
--  out = fftw_malloc(sizeof(fftw_complex)*List_YOUSO[17]);
-+  in  = (fftw_complex *)fftw_malloc(sizeof(fftw_complex)*List_YOUSO[17]);
-+  out = (fftw_complex *)fftw_malloc(sizeof(fftw_complex)*List_YOUSO[17]);
- 
-   p = fftw_plan_dft_1d(Ngrid1, in, out, sgn2, FFTW_ESTIMATE);
- 
diff --git a/science/openmx/files/patch-bandgnu13.c b/science/openmx/files/patch-bandgnu13.c
index 3c6172bc62e6..75177274e297 100644
--- a/science/openmx/files/patch-bandgnu13.c
+++ b/science/openmx/files/patch-bandgnu13.c
@@ -1,11 +1,11 @@
---- bandgnu13.c.orig	2018-09-11 19:33:10 UTC
+--- bandgnu13.c.orig	2019-12-02 04:59:59 UTC
 +++ bandgnu13.c
-@@ -75,7 +75,7 @@ void vk_rtv(double vk[4], double rtv[4][
+@@ -75,7 +75,7 @@ void vk_rtv(double vk[4], double rtv[4][4])
  
  #define MUNIT 2
  
 -main(int argc, char **argv)
 +int main(int argc, char **argv)
  {
-   static double Unit0[MUNIT]={27.2,1.0}; /* Hartree-> eV */
+   static double Unit0[MUNIT]={27.2113845,1.0}; /* Hartree-> eV */
    static char *Unitname0[MUNIT]={"eV","Hartree"};
diff --git a/science/openmx/files/patch-makefile b/science/openmx/files/patch-makefile
index 2a21aa3db1fe..e9cd2cbefbd5 100644
--- a/science/openmx/files/patch-makefile
+++ b/science/openmx/files/patch-makefile
@@ -1,43 +1,54 @@
---- makefile.orig	2016-04-02 12:43:42 UTC
+--- makefile.orig	2021-09-14 23:57:59 UTC
 +++ makefile
-@@ -136,15 +136,15 @@
- #
- 
- 
--CC = mpicc -O3 -xHOST -ip -no-prec-div -openmp -I/opt/intel/mkl/include/fftw
--FC = mpif90 -O3 -xHOST -ip -no-prec-div -openmp
--LIB= -L/opt/intel/mkl/lib -mkl=parallel -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lpthread -lifcore -lmpi -lmpi_f90 -lmpi_f77
-+CC = mpicc $(CFLAGS) -fopenmp
-+FC = mpif90 $(FFLAGS) -fopenmp
-+LIB= $(LDFLAGS) -lpthread -llapack -lblas -lgfortran -lfftw3 -lomp
+@@ -6,9 +6,9 @@ MKLROOT = /opt/intel/mkl
+ ###################################################################
  
+ MKLROOT = /opt/intel/mkl
+-CC = mpicc -O3 -xHOST -ip -no-prec-div -qopenmp -I/opt/intel/mkl/include/fftw
+-FC = mpif90 -O3 -xHOST -ip -no-prec-div -qopenmp
+-LIB= -L${MKLROOT}/lib/intel64 -lmkl_scalapack_lp64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lmkl_blacs_openmpi_lp64 -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -liomp5 -lpthread -lm -ldl
++CC = mpicc -fopenmp $(CFLAGS)
++FC = mpif90 -fopenmp $(FFLAGS)
++LIB= $(LDFLAGS) -lpthread -llapack -lblas -lscalapack -lgfortran -lfftw3 -lomp
  
  
+ #
+@@ -103,7 +103,7 @@ LIB= -L${MKLROOT}/lib/intel64 -lmkl_scalapack_lp64 -lm
+ #
  
  
 -CFLAGS  = -g 
 +#CFLAGS  = -g 
  
- OBJS    = openmx.o openmx_common.o Input_std.o Inputtools.o \
-           init.o LU_inverse.o ReLU_inverse.o \
-@@ -661,7 +661,7 @@ Show_DFT_DATA.o: Show_DFT_DATA.c openmx_
- 
- install: $(PROG)
- 	strip $(PROG)
--	cp $(PROG) $(DESTDIR)/$(PROG)
-+	install $(PROG) $(DESTDIR)$(PREFIX)/bin/$(PROG)
- 
- #
+ OBJS    = openmx.o openmx_common.o Input_std.o Inputtools.o init.o LU_inverse.o ReLU_inverse.o \
+           truncation.o readfile.o FT_PAO.o FT_NLP.o FT_ProExpn_VNA.o FT_VNA.o FT_ProductPAO.o \
+@@ -216,7 +216,7 @@ all: $(PROG) $(UTIL)
  #
-@@ -889,9 +889,9 @@ TRAN_CDen_Main.o: TRAN_CDen_Main.c openm
- 
- elpa1.o: elpa1.f90 
- 	$(FC) -c elpa1.f90
--solve_evp_real.o: solve_evp_real.f90 
-+solve_evp_real.o: solve_evp_real.f90 elpa1.o
- 	$(FC) -c solve_evp_real.f90 
--solve_evp_complex.o: solve_evp_complex.f90 
-+solve_evp_complex.o: solve_evp_complex.f90 elpa1.o
- 	$(FC) -c solve_evp_complex.f90
- 
  
+ all: $(PROG) $(UTIL)
+-	cp $(PROG) $(UTIL) $(DESTDIR)/
++	#install -s $(PROG) $(DESTDIR)$(PREFIX)/bin/$(PROG)
+ 
+ openmx.o: openmx.c openmx_common.h tran_variables.h tran_prototypes.h 
+ 	$(CC) -c openmx.c
+@@ -989,9 +989,9 @@ elpa_utilities.o: $(LIBELPADIR)/elpa_utilities.F90
+ 	$(FC) -c $(LIBELPADIR)/mod_precision.F90
+ elpa_utilities.o: $(LIBELPADIR)/elpa_utilities.F90
+ 	$(FC) -c $(LIBELPADIR)/elpa_utilities.F90
+-elpa1_compute_real.o: $(LIBELPADIR)/elpa1_compute_real.F90
++elpa1_compute_real.o: $(LIBELPADIR)/elpa1_compute_real.F90 elpa_utilities.o
+ 	$(FC) -c $(LIBELPADIR)/elpa1_compute_real.F90
+-elpa1_compute_complex.o: $(LIBELPADIR)/elpa1_compute_complex.F90
++elpa1_compute_complex.o: $(LIBELPADIR)/elpa1_compute_complex.F90 elpa_utilities.o mod_compute_hh_trafo_complex.o
+ 	$(FC) -c $(LIBELPADIR)/elpa1_compute_complex.F90
+ aligned_mem.o: $(LIBELPADIR)/aligned_mem.F90
+ 	$(FC) -c $(LIBELPADIR)/aligned_mem.F90
+@@ -1015,7 +1015,7 @@ mod_compute_hh_trafo_complex.o: $(LIBELPADIR)/mod_comp
+ 	$(FC) -c $(LIBELPADIR)/mod_compute_hh_trafo_real.F90
+ mod_compute_hh_trafo_complex.o: $(LIBELPADIR)/mod_compute_hh_trafo_complex.F90
+ 	$(FC) -c $(LIBELPADIR)/mod_compute_hh_trafo_complex.F90
+-elpa2_compute_real.o: $(LIBELPADIR)/elpa2_compute_real.F90
++elpa2_compute_real.o: $(LIBELPADIR)/elpa2_compute_real.F90 elpa1.o elpa_utilities.o
+ 	$(FC) -c $(LIBELPADIR)/elpa2_compute_real.F90
+ elpa2_compute_complex.o: $(LIBELPADIR)/elpa2_compute_complex.F90
+ 	$(FC) -c $(LIBELPADIR)/elpa2_compute_complex.F90
diff --git a/science/openmx/files/patch-openmx__common.h b/science/openmx/files/patch-openmx__common.h
new file mode 100644
index 000000000000..8457c5ccc82c
--- /dev/null
+++ b/science/openmx/files/patch-openmx__common.h
@@ -0,0 +1,11 @@
+--- openmx_common.h.orig	2024-06-16 22:56:57 UTC
++++ openmx_common.h
+@@ -2656,7 +2656,7 @@ char restart_filename[YOUSO10];
+ char filename[YOUSO10],filepath[YOUSO10],command[YOUSO10];
+ char ref_diff_charge_filename[YOUSO10];
+ char restart_filename[YOUSO10];
+-char DFT_DATA_PATH[YOUSO10];
++const char DFT_DATA_PATH[YOUSO10];
+ double Oopt_NormD[10];
+ double bias_weight,Past_Utot[10],Past_Norm[10];
+ double Max_Force,GridVol,W_OrthoNorm;
diff --git a/science/openmx/files/patch-tran__variables.h b/science/openmx/files/patch-tran__variables.h
deleted file mode 100644
index 7d7d961603d6..000000000000
--- a/science/openmx/files/patch-tran__variables.h
+++ /dev/null
@@ -1,10 +0,0 @@
---- tran_variables.h.orig	2018-08-29 05:50:14 UTC
-+++ tran_variables.h
-@@ -46,7 +46,6 @@ double TRAN_Poisson_Gpara_Scaling;
- double ScaleSize_e[2];
- int SpinP_switch_e[2], atomnum_e[2], SpeciesNum_e[2], Max_FSNAN_e[2];
- int TCpyCell_e[2], Matomnum_e[2], MatomnumF_e[2], MatomnumS_e[2];
--int Latomnum,Ratomnum,Catomnum;
- int *WhatSpecies_e[2];
- int *Spe_Total_CNO_e[2];
- int *Spe_Total_NO_e[2];