File: rules

package info (click to toggle)
nwchem 7.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 1,134,820 kB
  • sloc: fortran: 4,903,090; ansic: 67,501; f90: 19,555; python: 17,912; java: 12,311; sh: 12,023; cpp: 9,896; perl: 6,123; csh: 4,345; makefile: 1,856; sed: 246; awk: 115; exp: 111; pascal: 76
file content (102 lines) | stat: -rwxr-xr-x 3,045 bytes parent folder | download
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/usr/bin/make -f
# -*- makefile -*-

#export DH_VERBOSE=1

DEB_HOST_ARCH_BITS := $(shell dpkg-architecture -qDEB_HOST_ARCH_BITS)
DEB_HOST_ARCH      := $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_HOST_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

ifneq (,$(filter checkall,$(DEB_BUILD_OPTIONS)))
export RUN_ALL_TESTS ="yes"
endif

include /usr/share/mpi-default-dev/debian_defaults

ifeq ($(DEB_HOST_ARCH_BITS),64)
export NWCHEM_TARGET=LINUX64
export USE_64TO32="yes"
else
export NWCHEM_TARGET=LINUX
endif
export BLAS_SIZE=4
export BLAS_LIB="-lblas"
export LAPACK_LIB="-llapack"
export USE_SCALAPACK="yes"
export SCALAPACK_SIZE=4
export SCALAPACK=-lscalapack-$(ARCH_DEFAULT_MPI_IMPL)
ifeq ($(DEB_HOST_ARCH),armhf)
export GCC49_ARM_BROKEN="yes"
endif
export NWCHEM_TOP=${CURDIR}
export NWCHEM_MODULES="pnnl"
export NWCHEM_LONG_PATHS="y"
export EXTERNAL_GA_PATH=/usr
export PYTHONVERSION=$(shell pyversions -dv)
export PYTHONHOME=$(shell python-config --prefix)
export LIBDIR=${NWCHEM_TOP}/lib/${NWCHEM_TARGET}
export LARGE_FILES=TRUE
export FC=gfortran
export USE_MPI="y"
export USE_MPIF="y"
export USE_MPIF4="y"
ifeq ($(ARCH_DEFAULT_MPI_IMPL),mpich)
export LIBMPI=-lmpi -lmpif77
else
export LIBMPI=$(shell pkg-config mpi-fort --libs)
endif
export MPI_LIB=/usr/lib
export MPI_INCLUDE=/usr/include/${DEB_HOST_MULTIARCH}/mpi
ifneq (,$(filter ccsdtq,$(DEB_BUILD_OPTIONS)))
export CCSDTQ="yes"
endif
ifneq (,$(filter ccsdtlr,$(DEB_BUILD_OPTIONS)))
export CCSDTLR="yes"
endif
export MRCC_METHODS=y
export IPCCSD=y
export EACCSD=y
export HAS_BLAS="yes"
export BLASOPT=-lblas -llapack
export BLACS=$(SCALAPACK)
export ARMCI_NETWORK=SOCKETS
export USE_ARUR="yes"

%:
	dh $@ --with autotools_dev,python3 --parallel

override_dh_auto_build-arch:
	mkdir -p $(CURDIR)/bin/${NWCHEM_TARGET}
	(cd $(CURDIR)/src && NWCHEM_TOP=$(CURDIR) make nwchem_config)
ifeq ($(DEB_HOST_ARCH_BITS),64)
	(cd $(CURDIR)/src && make 64_to_32)
	find src -name include_stamp | xargs rm -f
	find src -name dependencies | xargs rm -f
endif
	(cd $(CURDIR)/src && make)
	(cd $(CURDIR)/src/util && make)
	(cd $(CURDIR)/src && make link)
ifeq ($(DEB_HOST_ARCH_BITS),64)
	(cd $(CURDIR)/src && make 32_to_64)
endif

override_dh_auto_clean:
	dh_testdir
	-(cd $(CURDIR)/src && make realclean)
	-(cd $(CURDIR)/doc && make realclean)
	rm -rf $(CURDIR)/bin $(CURDIR)/lib $(CURDIR)/src/tools/lib 
	rm -rf $(CURDIR)/QA/scratchdir $(CURDIR)/QA/testoutputs
	rm -f src/util/util_version.F src/stubs.F src/util/util_module_avail.F src/util/util_nwchem_version.F
	find $(CURDIR) -name "*.stamp" | xargs rm -f
	dh_auto_clean
	rm -f src/config/NWCHEM_CONFIG src/config/nwchem_config.h

export RUNTESTS=$(CURDIR)/QA/runtests.mpi.unix 
export NWCHEM_EXECUTABLE=${NWCHEM_TOP}/bin/${NWCHEM_TARGET}/nwchem
export NWCHEM_BASIS_LIBRARY=${NWCHEM_TOP}/src/basis/libraries/
export NWCHEM_NWPW_LIBRARY=${NWCHEM_TOP}/src/nwpw/libraryps/

override_dh_auto_test:
	dh_testdir
	-(cd $(CURDIR)/QA && if [ "$(RUN_ALL_TESTS)" = "yes" ]; then \
	   ../debian/testsuite all; else ../debian/testsuite; fi)