Skip to content

Commit

Permalink
science/openmx: Re-add port: Nanoscale material simulations using den…
Browse files Browse the repository at this point in the history
…sity functional theories (DFT)

It isn't unfetchable.
  • Loading branch information
yurivict committed Aug 15, 2021
1 parent 8aa5711 commit 54e006a
Show file tree
Hide file tree
Showing 16 changed files with 604 additions and 1 deletion.
1 change: 0 additions & 1 deletion MOVED
Expand Up @@ -14746,7 +14746,6 @@ russian/p5-cyrillic||2020-05-05|Has expired: Broken for more than 6 months
russian/tidyup-mail||2020-05-05|Has expired: Broken for more than 6 months
science/atom||2020-05-05|Has expired: Broken for more than 6 months
science/esys-particle||2020-05-05|Has expired: Broken for more than 6 months
science/openmx||2020-05-05|Has expired: Broken for more than 6 months
science/p5-Geo-ReadGRIB||2020-05-05|Has expired: Broken for more than 6 months
science/py-tensorflow-estimator||2020-05-05|Has expired: Broken for more than 6 months
security/firewalk||2020-05-05|Has expired: Broken for more than 6 months
Expand Down
1 change: 1 addition & 0 deletions science/Makefile
Expand Up @@ -174,6 +174,7 @@
SUBDIR += openbabel
SUBDIR += openkim
SUBDIR += openkim-models
SUBDIR += openmx
SUBDIR += opensim-core
SUBDIR += opensph
SUBDIR += opsin
Expand Down
74 changes: 74 additions & 0 deletions science/openmx/Makefile
@@ -0,0 +1,74 @@
# $FreeBSD$

PORTNAME= openmx
DISTVERSION= 3.8.5 # the 18June12 patch upgrades 3.8 -> 3.8.5
PORTREVISION= 7
CATEGORIES= science
MASTER_SITES= http://www.openmx-square.org/ \
http://www.openmx-square.org/bugfixed/18June12/: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}
EXTRACT_ONLY= ${PORTNAME}${DISTVERSION:R}${EXTRACT_SUFX}

MAINTAINER= yuri@FreeBSD.org
COMMENT= Nanoscale material simulations using density functional theories (DFT)

LICENSE= GPLv2

BROKEN_i386= undefined reference to `__atomic_load', see bug#229605 and https://reviews.llvm.org/D42154
LIB_DEPENDS= libblas.so:math/blas \
libfftw3.so:math/fftw3 \
liblapack.so:math/lapack \
libmpich.so:net/mpich
USES= dos2unix fortran gmake localbase:ldflags
USE_CXXSTD= c++11
DOS2UNIX_FILES= openmx_common.h
MAKEFILE= makefile
WRKSRC= ${WRKDIR}/${PORTNAME}${DISTVERSION:R}
CFLAGS+= -Dkcomp -fcommon
LDFLAGS+= ${LOCALBASE}/lib/gcc${GCC_DEFAULT}/libgcc_s.so ${LOCALBASE}/lib/libmpifort.so
FFLAGS+= -fallow-argument-mismatch
WRKSRC_SUBDIR= source
MAKE_ENV= MPICH_CC=${CC}
MAKE_ARGS+= CFLAGS="${CFLAGS}" FFLAGS="${FFLAGS}" LDFLAGS="${LDFLAGS}" GCC_LIB=${LOCALBASE}/lib/gcc${GCC_DEFAULT}/libgfortran.so
BINARY_ALIAS= gcc=${CXX} gcc7=${CXX}
UTIL_PROGS= DosMain jx analysis_example esp polB bandgnu13 bin2txt cube2xsf intensity_map md2axsf
PLIST_FILES= bin/${PORTNAME} ${UTIL_PROGS:C/^/bin\//}
OPTIONS_DEFINE_amd64= SIMD
OPTIONS_DEFINE_i386= SIMD
OPTIONS_DEFAULT_amd64= SIMD
OPTIONS_DEFAULT_i386= SIMD
SIMD_CFLAGS= -msse -msse2 -mfpmath=sse
SIMD_CFLAGS_OFF= -Dnosse
CFLAGS+= ${ARCH:S/amd64//:S/i386//:S/${ARCH}/-Dnosse/}
pre-patch: # overlay files before patching
@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
post-install:
.for u in ${UTIL_PROGS}
${INSTALL_PROGRAM} ${WRKSRC}/${u} ${STAGEDIR}${PREFIX}/bin
.endfor
cd ${WRKSRC}/.. && ${COPYTREE_SHARE} DFT_DATA13 ${STAGEDIR}${DATADIR}
# autoplist for potentials: about 500 files in DATADIR
@cd ${STAGEDIR}${PREFIX} && \
${FIND} ${DATADIR:S/^${PREFIX}\///} -type f >> ${TMPPLIST}
.include <bsd.port.mk>
5 changes: 5 additions & 0 deletions science/openmx/distinfo
@@ -0,0 +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
15 changes: 15 additions & 0 deletions science/openmx/files/patch-Band__DFT__Col.c
@@ -0,0 +1,15 @@
--- 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);
15 changes: 15 additions & 0 deletions science/openmx/files/patch-Band__DFT__NonCol.c
@@ -0,0 +1,15 @@
--- 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);
46 changes: 46 additions & 0 deletions science/openmx/files/patch-Cluster__DFT.c
@@ -0,0 +1,46 @@
--- 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 */

23 changes: 23 additions & 0 deletions science/openmx/files/patch-Cluster__DFT__ON2.c
@@ -0,0 +1,23 @@
--- Cluster_DFT_ON2.c.orig 2016-03-27 06:53:28 UTC
+++ Cluster_DFT_ON2.c
@@ -10,6 +10,7 @@

***********************************************************************/

+#include <complex.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -1275,9 +1276,9 @@ static void OND_Solver(
MPI_Request *request_send;
MPI_Request *request_recv;

- 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);

al.r = 1.0;
al.i = 0.0;
11 changes: 11 additions & 0 deletions science/openmx/files/patch-Input__std.c
@@ -0,0 +1,11 @@
--- Input_std.c.orig 2018-09-12 02:18:32 UTC
+++ Input_std.c
@@ -85,7 +85,7 @@ void Input_std(char *file)

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_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 */

0 comments on commit 54e006a

Please sign in to comment.