Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Sep 2018 15:03:13 +0000 (UTC)
From:      Yuri Victorovich <yuri@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r478965 - in head/science: . libgridxc libgridxc/files
Message-ID:  <201809041503.w84F3DR2042335@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yuri
Date: Tue Sep  4 15:03:13 2018
New Revision: 478965
URL: https://svnweb.freebsd.org/changeset/ports/478965

Log:
  New port: science/libgridxc: Library to compute the exchange and correlation energy and potentials

Added:
  head/science/libgridxc/
  head/science/libgridxc/Makefile   (contents, props changed)
  head/science/libgridxc/distinfo   (contents, props changed)
  head/science/libgridxc/files/
  head/science/libgridxc/files/patch-build.sh   (contents, props changed)
  head/science/libgridxc/files/patch-gridxc.mk.in   (contents, props changed)
  head/science/libgridxc/files/patch-makefile   (contents, props changed)
  head/science/libgridxc/files/patch-top.gridxc.mk.in   (contents, props changed)
  head/science/libgridxc/pkg-descr   (contents, props changed)
  head/science/libgridxc/pkg-plist   (contents, props changed)
Modified:
  head/science/Makefile

Modified: head/science/Makefile
==============================================================================
--- head/science/Makefile	Tue Sep  4 14:57:27 2018	(r478964)
+++ head/science/Makefile	Tue Sep  4 15:03:13 2018	(r478965)
@@ -103,6 +103,7 @@
     SUBDIR += libefp
     SUBDIR += libgeodecomp
     SUBDIR += libghemical
+    SUBDIR += libgridxc
     SUBDIR += libint
     SUBDIR += libint2
     SUBDIR += libkml

Added: head/science/libgridxc/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/science/libgridxc/Makefile	Tue Sep  4 15:03:13 2018	(r478965)
@@ -0,0 +1,57 @@
+# $FreeBSD$
+
+PORTNAME=	libgridxc
+DISTVERSION=	0.8.0
+CATEGORIES=	science
+MASTER_SITES=	https://launchpad.net/${PORTNAME}/trunk/${DISTVERSION:R}/+download/
+
+MAINTAINER=	yuri@FreeBSD.org
+COMMENT=	Library to compute the exchange and correlation energy and potentials
+
+LICENSE=	BSD3CLAUSE
+LICENSE_FILE=	${WRKSRC}/../BSD_LICENSE
+
+USES=		fortran gmake tar:tgz
+USE_LDCONFIG=	yes
+
+MAKEFILE=	makefile
+ALL_TARGET=	default
+
+WRKSRC_SUBDIR=	src
+
+BUILD_WRKSRC=	${WRKSRC}/../build
+TMP_STAGEDIR=	${WRKDIR}/tmp_stage
+MAKE_ENV=	INSTALL_DIR=${TMP_STAGEDIR}${PREFIX} FREEBSD_LOCALBASE=${LOCALBASE}
+
+BINARY_ALIAS=	make=${GMAKE}
+
+OPTIONS_DEFINE=		MPI LIBXC
+OPTIONS_DEFAULT=	MPI LIBXC
+
+MPI_MAKE_ENV=		WITH_MPI=1
+MPI_LIB_DEPENDS=	libmpich.so:net/mpich2
+
+LIBXC_DESC=		Use libxc for exchange-correlation functionals for DFT
+LIBXC_MAKE_ENV=		WITH_LIBXC=1
+LIBXC_LIB_DEPENDS=	libxc.so:science/libxc
+
+post-patch:
+	@${MKDIR} ${BUILD_WRKSRC}
+	@${CAT} ${WRKSRC}/../extra/fortran.mk \
+		| ${SED} '\
+			s|FC_SERIAL=gfortran|&${GCC_DEFAULT}|; \
+			s|LIBXC_ROOT=/usr/local|LIBXC_ROOT=${LOCALBASE}|; \
+			s|FFLAGS= -O2|& -fPIC|' \
+		> ${BUILD_WRKSRC}/fortran.mk
+
+do-configure:
+	@cd ${BUILD_WRKSRC} && ${SETENV} ${CONFIGURE_ENV} ${SH} ../src/config.sh
+
+do-build:
+	@cd ${BUILD_WRKSRC} && ${MKDIR} ${TMP_STAGEDIR} && ${SETENV} ${MAKE_ENV} ${SH} ../src/build.sh
+
+do-install:
+	cd ${TMP_STAGEDIR} && ${COPYTREE_SHARE} . ${STAGEDIR}
+	${MKDIR} ${STAGEDIR}${PREFIX}/share/mk && ${MV} ${STAGEDIR}${PREFIX}/*.mk ${STAGEDIR}${PREFIX}/share/mk
+
+.include <bsd.port.mk>

Added: head/science/libgridxc/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/science/libgridxc/distinfo	Tue Sep  4 15:03:13 2018	(r478965)
@@ -0,0 +1,3 @@
+TIMESTAMP = 1536009612
+SHA256 (libgridxc-0.8.0.tgz) = 823002baa3e5e18eddef05b2ea55ff08cf9c311dd655dd7147df26a3f7096390
+SIZE (libgridxc-0.8.0.tgz) = 222704

Added: head/science/libgridxc/files/patch-build.sh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/science/libgridxc/files/patch-build.sh	Tue Sep  4 15:03:13 2018	(r478965)
@@ -0,0 +1,34 @@
+--- build.sh.orig	2018-02-01 10:48:08 UTC
++++ build.sh
+@@ -39,14 +39,17 @@
+ # libGridXC installations in the old style.
+ #
+ #
+-inPREFIX=${PREFIX}
++inPREFIX=${INSTALL_DIR}
+ #
+ # Build first without MPI
+ #
+-echo "==> make WITH_LIBXC=${WITH_LIBXC} WITH_MPI= PREFIX=${inPREFIX}/serial"
+-sleep 1
+-make clean
+-make WITH_LIBXC=${WITH_LIBXC} WITH_MPI= PREFIX=${inPREFIX}/serial
++if [ "${WITH_MPI}" = "" ]
++then
++  echo "==> make WITH_LIBXC=${WITH_LIBXC} WITH_MPI= PREFIX=${inPREFIX}/serial"
++  #sleep 1
++  make clean
++  make WITH_LIBXC=${WITH_LIBXC} WITH_MPI= PREFIX=${inPREFIX}/serial
++fi
+ #
+ # Install the top-level gridxc.mk
+ #
+@@ -63,7 +66,7 @@ fi
+ if [ "${WITH_MPI}" != "" ]
+ then
+    echo "==> make WITH_LIBXC=${WITH_LIBXC} WITH_MPI=1 PREFIX=${inPREFIX}/mpi"
+-   sleep 1
++   #sleep 1
+    make clean
+    make WITH_LIBXC=${WITH_LIBXC} WITH_MPI=1 PREFIX=${inPREFIX}/mpi
+ #

Added: head/science/libgridxc/files/patch-gridxc.mk.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/science/libgridxc/files/patch-gridxc.mk.in	Tue Sep  4 15:03:13 2018	(r478965)
@@ -0,0 +1,17 @@
+--- gridxc.mk.in.orig	2018-02-01 10:48:08 UTC
++++ gridxc.mk.in
+@@ -22,7 +22,7 @@ ifeq ($(GRIDXC_USES_LIBXC),1)
+    $(error you need to define LIBXC_ROOT in your arch.make)
+  endif
+  #
+- include $(GRIDXC_ROOT)/libxc.mk
++ include $(GRIDXC_ROOT)/share/mk/libxc.mk
+  #
+ else
+  # 
+@@ -31,4 +31,4 @@ else
+ endif
+ #
+ GRIDXC_INCFLAGS= -I $(GRIDXC_ROOT)/include $(LIBXC_INCFLAGS)
+-GRIDXC_LIBS=$(GRIDXC_ROOT)/lib/libGridXC.a $(LIBXC_LIBS)
++GRIDXC_LIBS=$(GRIDXC_ROOT)/lib/libGridXC.so $(LIBXC_LIBS)

Added: head/science/libgridxc/files/patch-makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/science/libgridxc/files/patch-makefile	Tue Sep  4 15:03:13 2018	(r478965)
@@ -0,0 +1,63 @@
+--- makefile.orig	2018-02-01 10:48:08 UTC
++++ makefile
+@@ -93,15 +93,20 @@ else
+   MPI_INTERFACE=
+ endif
+ 
++ifdef WITH_LIBXC
++LIBXC=$(FREEBSD_LOCALBASE)/lib/libxc.so
++endif
++
+ libmpi_f90.a: 
+ 	@(cd MPI_instr ; $(MAKE) \
+                         "VPATH=$(VPATH)/MPI_instr" )
+ 
+-libGridXC.a: $(MPI_INTERFACE) $(ALL_OBJS)
+-	$(AR) $(ARFLAGS_EXTRA) cru libGridXC.a $(ALL_OBJS) 
++libGridXC.so: $(MPI_INTERFACE) $(ALL_OBJS)
+ 	@if [ ! -z "$(MPI_INTERFACE)" ] ; then \
+-            $(AR) $(ARFLAGS_EXTRA) cru libGridXC.a MPI_instr/*.o ; fi
+-	-$(RANLIB) libGridXC.a
++	    $(CC) -shared -o libGridXC.so -Wl,-soname,libGridXC.so $(ALL_OBJS) MPI_instr/*.o $(FREEBSD_LOCALBASE)/lib/libmpich.so $(LIBXC); \
++        else \
++	    $(CC) -shared -o libGridXC.so -Wl,-soname,libGridXC.so $(ALL_OBJS) $(LIBXC); \
++        fi;
+ 
+ MODULES_TO_INSTALL=gridxc.mod gridxc_config.mod m_atomxc.mod \
+                    m_cellxc.mod xcmod.mod m_ldaxc.mod m_ggaxc.mod \
+@@ -126,23 +131,23 @@ setup_mk_file:
+  endif
+ endif
+ 
+-module: setup_mk_file libGridXC.a
++module: setup_mk_file libGridXC.so
+ 	@echo "Prefix: $(PREFIX)"
+ 	mkdir -p lib 
+ 	mkdir -p include
+ 	cp -p $(MODULES_TO_INSTALL) include/
+-	cp -p libGridXC.a lib/
++	cp -p libGridXC.so lib/
+ 	@if [ "$(PREFIX)" != "$(MAIN_OBJDIR)" ]; then \
+-          echo "mkdir -p $(GRIDXC_PREFIX)/lib" ; \
+-          mkdir -p $(GRIDXC_PREFIX)/lib ; \
+-          echo "mkdir -p $(GRIDXC_PREFIX)/include" ; \
+-          mkdir -p $(GRIDXC_PREFIX)/include ; \
+-          echo "cp -p $(MODULES_TO_INSTALL) $(GRIDXC_PREFIX)/include/" ; \
+-          cp -p $(MODULES_TO_INSTALL) $(GRIDXC_PREFIX)/include/ ; \
+-          echo "cp -p libGridXC.a $(GRIDXC_PREFIX)/lib" ; \
+-          cp -p libGridXC.a $(GRIDXC_PREFIX)/lib ; \
+-          echo "cp -p gridxc.mk libxc.mk $(GRIDXC_PREFIX)" ; \
+-          cp -p gridxc.mk libxc.mk $(GRIDXC_PREFIX) ; fi
++          echo "mkdir -p $(INSTALL_DIR)/lib" ; \
++          mkdir -p $(INSTALL_DIR)/lib ; \
++          echo "mkdir -p $(INSTALL_DIR)/include" ; \
++          mkdir -p $(INSTALL_DIR)/include ; \
++          echo "cp -p $(MODULES_TO_INSTALL) $(INSTALL_DIR)/include/" ; \
++          cp -p $(MODULES_TO_INSTALL) $(INSTALL_DIR)/include/ ; \
++          echo "cp -p libGridXC.so $(INSTALL_DIR)/lib" ; \
++          cp -p libGridXC.so $(INSTALL_DIR)/lib ; \
++          echo "cp -p gridxc.mk libxc.mk $(INSTALL_DIR)" ; \
++          cp -p gridxc.mk libxc.mk $(INSTALL_DIR) ; fi
+ 
+ clean:
+ 	rm -f *.o *.*d *.a gridxc.mk

Added: head/science/libgridxc/files/patch-top.gridxc.mk.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/science/libgridxc/files/patch-top.gridxc.mk.in	Tue Sep  4 15:03:13 2018	(r478965)
@@ -0,0 +1,33 @@
+--- top.gridxc.mk.in.orig	2018-02-01 10:48:08 UTC
++++ top.gridxc.mk.in
+@@ -13,8 +13,8 @@ GRIDXC_USES_MPI=0
+ #
+ ifeq ($(GRIDXC_USES_MPI),1)
+   $(info GRIDXC includes MPI support)
+-  GRIDXC_MPI_INCFLAGS= -I $(GRIDXC_ROOT)/mpi/include $(LIBXC_INCFLAGS)
+-  GRIDXC_MPI_LIBS=$(GRIDXC_ROOT)/mpi/lib/libGridXC.a $(LIBXC_LIBS)
++  GRIDXC_MPI_INCFLAGS= -I $(GRIDXC_ROOT)/include $(LIBXC_INCFLAGS)
++  GRIDXC_MPI_LIBS=$(GRIDXC_ROOT)/lib/libGridXC.so $(LIBXC_LIBS)
+ endif
+ #
+ ifeq ($(GRIDXC_USES_LIBXC),1)
+@@ -24,7 +24,7 @@ ifeq ($(GRIDXC_USES_LIBXC),1)
+    $(error you need to define LIBXC_ROOT in your arch.make)
+  endif
+  #
+- include $(GRIDXC_ROOT)/libxc.mk
++ include $(GRIDXC_ROOT)/share/mk/libxc.mk
+  #
+ else
+  # 
+@@ -32,8 +32,8 @@ else
+  LIBXC_LIBS=
+ endif
+ #
+-GRIDXC_SERIAL_INCFLAGS= -I $(GRIDXC_ROOT)/serial/include $(LIBXC_INCFLAGS)
+-GRIDXC_SERIAL_LIBS=$(GRIDXC_ROOT)/serial/lib/libGridXC.a $(LIBXC_LIBS)
++GRIDXC_SERIAL_INCFLAGS= -I $(GRIDXC_ROOT)/include $(LIBXC_INCFLAGS)
++GRIDXC_SERIAL_LIBS=$(GRIDXC_ROOT)/lib/libGridXC.so $(LIBXC_LIBS)
+ #
+ ifdef WITH_MPI
+  ifneq ($(GRIDXC_USES_MPI),1)

Added: head/science/libgridxc/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/science/libgridxc/pkg-descr	Tue Sep  4 15:03:13 2018	(r478965)
@@ -0,0 +1,7 @@
+A library to compute the exchange and correlation energy and potential in
+spherical (i.e. an atom) or periodic systems. It is based on SiestaXC.
+
+The project is based on the SiestaXC code, and eventually will produce a package
+to be included in the Electronic Structure Library.
+
+WWW: https://launchpad.net/libgridxc

Added: head/science/libgridxc/pkg-plist
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/science/libgridxc/pkg-plist	Tue Sep  4 15:03:13 2018	(r478965)
@@ -0,0 +1,13 @@
+include/debugxc.mod
+include/gridxc.mod
+include/gridxc_config.mod
+include/m_atomxc.mod
+include/m_cellxc.mod
+include/m_fft_gpfa.mod
+include/m_ggaxc.mod
+include/m_ldaxc.mod
+include/mesh3d.mod
+include/xcmod.mod
+lib/libGridXC.so
+share/mk/gridxc.mk
+share/mk/libxc.mk



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201809041503.w84F3DR2042335>