aboutsummaryrefslogtreecommitdiffstats
path: root/science/nwchem/Makefile
blob: 215f04a5a125c80d1503f4a86aace8636c45cffe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# $FreeBSD$

PORTNAME=   nwchem
PORTVERSION=    6.8.1.20181107
CATEGORIES= science

MAINTAINER= yuri@FreeBSD.org
COMMENT=    High-performance computational chemistry software

LICENSE=    ECL20
LICENSE_NAME=   Educational Community License (ECL) 2.0
LICENSE_FILE=   ${WRKSRC}/../LICENSE.TXT
LICENSE_PERMS=  dist-mirror dist-sell pkg-mirror pkg-sell auto-accept

BUILD_DEPENDS=  bash:shells/bash
LIB_DEPENDS=    libblas.so:math/blas \
        libga.so:devel/ga \
        libmpich.so:net/mpich

USES=       fortran gmake ${ARCH_64BIT:S/^$/perl5/:S/64//} shebangfix
SHEBANG_FILES=  ../contrib/distro-tools/build_* ../contrib/add_*
SHEBANG_GLOB=   *.sh
USE_GITHUB= yes
GH_ACCOUNT= nwchemgit
GH_TAGNAME= master-oct22_2018-21-gd3913ef8b
USE_PERL5=  build

MAKEFILE=   GNUmakefile
ARCH_64BIT= ${ARCH:C/.*64.*/64/:S/${ARCH}//}
MAKE_ENV=   NWCHEM_TOP=${WRKSRC}/.. NWCHEM_MODULES=all NWCHEM_LONG_PATHS=Y NWCHEM_TARGET=LINUX${ARCH_64BIT} USE_MPI=Y USE_INTERNALBLAS=Y EXTERNAL_GA_PATH=${LOCALBASE} \
        BLAS_SIZE=4 USE_64TO32=y

SUB_FILES=  nwchemrc

WRKSRC_SUBDIR=  src

BINARY_ALIAS=   gcc=${CC} gfortran=gfortran${GCC_DEFAULT}

post-extract:
    @${RM} ${WRKSRC}/atomscf/src.orig

post-patch:
    @${REINPLACE_CMD} 's|nwchrc="/etc/nwchemrc"|nwchrc="${PREFIX}/etc/nwchemrc"|' ${WRKSRC}/util/util_nwchemrc.F

pre-build:
    @cd ${WRKSRC} && \
        ${SETENV} ${MAKE_ENV} ${MAKE_CMD} nwchem_config && \
        ${SETENV} ${MAKE_ENV} ${MAKE_CMD} 64_to_32

do-install:
    ${INSTALL_DATA} ${WRKDIR}/nwchemrc ${STAGEDIR}${PREFIX}/etc/nwchemrc
    ${INSTALL_PROGRAM} ${WRKSRC}/../bin/LINUX${ARCH_64BIT}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
    cd ${WRKSRC}/basis && ${COPYTREE_SHARE} libraries ${STAGEDIR}${DATADIR}
    cd ${WRKSRC} && ${COPYTREE_SHARE} data ${STAGEDIR}${DATADIR}
    @${MKDIR} ${STAGEDIR}${DATADIR}/libraryps
.for d in development_psps HGH_LDA library1 library2 ofpw_default paw_default pspw_default pspw_new pspw_old Spin_Orbit TETER TM
    cd ${WRKSRC}/nwpw/libraryps && ${COPYTREE_SHARE} ${d} ${STAGEDIR}${DATADIR}/libraryps/
.endfor

.include <bsd.port.mk>