Commit 8ada5220 authored by yuri's avatar yuri
Browse files

New port: science/jdftx: Software for joint density functional theory in chemistry

parent 2ddc49e6
......@@ -88,6 +88,7 @@
SUBDIR += hypre
SUBDIR += iboview
SUBDIR += isaac-cfd
SUBDIR += jdftx
SUBDIR += jstrack
SUBDIR += kalzium
SUBDIR += kalzium-kde4
......
# $FreeBSD$
PORTNAME= jdftx
DISTVERSIONPREFIX= v
DISTVERSION= 1.4.2-73
DISTVERSIONSUFFIX= -g73b17437
CATEGORIES= science
MAINTAINER= yuri@FreeBSD.org
COMMENT= Software for joint density functional theory in chemistry
LICENSE= GPLv3+
LICENSE_FILE= ${WRKSRC}/COPYING
LIB_DEPENDS= libblas.so:math/blas \
libcblas.so:math/cblas \
libfftw3.so:math/fftw3 \
libgsl.so:math/gsl \
liblapack.so:math/lapack
TEST_DEPENDS= bash:shells/bash
USES= cmake:outsource fortran localbase:ldflags shebangfix
SHEBANG_GLOB= *.sh
USE_GITHUB= yes
GH_ACCOUNT= shankar1729
USE_LDCONFIG= yes
TEST_TARGET= test
WRKSRC_SUBDIR= ${PORTNAME}
CMAKE_ARGS= -DLAPACK_LIBRARIES:STRING="-llapack -lblas"
OPTIONS_DEFINE= MPI LIBXC HDF5 SCALAPACK
OPTIONS_DEFAULT= MPI LIBXC
MPI_CMAKE_BOOL= EnableMPI
MPI_LIB_DEPENDS= libmpich.so:net/mpich2
LIBXC_DESC= Use LibXC for additional exchange-correlation functionals
LIBXC_CMAKE_BOOL= EnableLibXC
LIBXC_LIB_DEPENDS= libxc.so:science/libxc
HDF5_CMAKE_BOOL= EnableHDF5
HDF5_LIB_DEPENDS= libhdf5.so:science/hdf5
HDF5_BROKEN= use of undeclared identifier 'H5Pset_dxpl_mpio' # https://github.com/shankar1729/jdftx/issues/37
SCALAPACK_DESC= Enable ScaLAPACK support
SCALAPACK_CMAKE_BOOL= EnableScaLAPACK
SCALAPACK_LIB_DEPENDS= libscalapack.so:math/scalapack
do-install:
${INSTALL_PROGRAM} ${BUILD_WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
${INSTALL_PROGRAM} ${BUILD_WRKSRC}/phonon ${STAGEDIR}${PREFIX}/bin
${INSTALL_PROGRAM} ${BUILD_WRKSRC}/wannier ${STAGEDIR}${PREFIX}/bin
${INSTALL_PROGRAM} ${BUILD_WRKSRC}/libjdftx.so ${STAGEDIR}${PREFIX}/lib
@${MKDIR} ${STAGEDIR}${DATADIR}/pseudopotentials
.for pp in GBRV-2017 GBRV SG15-pulay SG15
cd ${STAGEDIR}${DATADIR}/pseudopotentials && ${TAR} xzf ${WRKSRC}/pseudopotentials/${pp}.tgz
.endfor
.include <bsd.port.mk>
TIMESTAMP = 1535759151
SHA256 (shankar1729-jdftx-v1.4.2-73-g73b17437_GH0.tar.gz) = 77651051c09796ded793fb781022d9b3aca43a31f9bcfb999c646e4ef13017c9
SIZE (shankar1729-jdftx-v1.4.2-73-g73b17437_GH0.tar.gz) = 56831467
--- CMakeLists.txt.orig 2018-08-24 15:03:02 UTC
+++ CMakeLists.txt
@@ -97,7 +97,7 @@ if(EnableMPI)
add_definitions("-DMPI_ENABLED")
endif()
-option(EnableLibXC "Use LibXC to provide additional exchange-correlation functionals")
+option(EnableLibXC "Use LibXC to provide additional exchange-correlation functionals" OFF)
if(EnableLibXC)
find_package(LIBXC REQUIRED)
include_directories(${LIBXC_INCLUDE_DIR})
@@ -223,7 +223,7 @@ endif()
#Library with all the functionality:
FILE(GLOB jdftxlibSources core/*.cpp fluid/*.cpp electronic/*.cpp commands/*.cpp)
add_library(jdftxlib ${LINK_TYPE} ${jdftxlibSources})
-target_link_libraries(jdftxlib ${EXTERNAL_LIBS})
+target_link_libraries(jdftxlib ${EXTERNAL_LIBS} -lexecinfo) # execinfo only for libxc?
set_target_properties(jdftxlib PROPERTIES OUTPUT_NAME "jdftx")
set_JDFTx_flags(jdftxlib OFF)
@@ -232,6 +232,16 @@ set_JDFTx_flags(jdftxlib OFF)
option(EnableCUDA "Enable NVIDIA GPU support using CUDA" OFF)
option(EnableCuSolver "Whether to use cuSolver GPU LAPACK (Requires CUDA >= 9)" OFF)
+include(CheckFunctionExists)
+CHECK_FUNCTION_EXISTS(sincos HAVE_SINCOS_FUNCTION)
+
+if(NOT HAVE_SINCOS_FUNCTION)
+ MESSAGE("Do not have function sincos")
+ add_definitions("-DMISSING_SINCOS_FUNCTION")
+else()
+ MESSAGE("Found function sincos")
+endif()
+
if(EnableCUDA)
find_package(CUDA REQUIRED)
set(CUDA_ARCH "compute_35" CACHE STRING "CUDA virtual architecture to compile for")
--- core/scalar.h.orig 2018-08-24 15:03:02 UTC
+++ core/scalar.h
@@ -54,7 +54,7 @@ template<class T> T ceildiv(T num, T den
//! Return largest multiple of den smaller than num, templated over int types
template<class T> T floorMultiple(T num, T den) { return (num/den)*den; }
-#ifdef __APPLE__
+#ifdef MISSING_SINCOS_FUNCTION
#ifndef __in_a_cu_file__
inline void sincos(double x, double* s, double* c)
{ *s = sin(x);
JDFTx is a software package for quantum chemistry computations.
JDFTx supports all the standard functionality present in any electronic DFT
software. It supports several semilocal, meta-GGA and EXX-hybrid
exchange-correlation functions, with additional options available by linking to
LibXC [18]. DFT+U [5] is available for treating localized electrons. Pair
potential dispersion corrections [10] are available for including van der Waals
interactions. JDFTx supports several formats of norm-conserving and ultrasoft
pseudopotentials and comes pre-installed with an opens-ource library for each.
With truncated Coulomb interactions [27], JDFTx enables accurate calculations
of systems of any dimensionality from 0 to 3: molecules, wires, slabs/2D
materials and bulk.
WWW: http://jdftx.org/
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment