File: rules

package info (click to toggle)
cp2k 2023.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 371,760 kB
  • sloc: fortran: 950,945; python: 24,503; f90: 24,350; ansic: 21,636; sh: 12,577; cpp: 2,408; xml: 2,173; makefile: 1,444; lisp: 952; pascal: 845; perl: 492; javascript: 258; csh: 16
file content (112 lines) | stat: -rwxr-xr-x 5,533 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
103
104
105
106
107
108
109
110
111
112
#!/usr/bin/make -f
# -*- makefile -*-

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

include /usr/share/dpkg/architecture.mk

ifeq ($(DEB_BUILD_ARCH), i386)
    export FFTW3_ALIGN=-D__FFTW3_UNALIGNED
else
    export FFTW3_ALIGN=
endif

export LIB_SCALAPACK=-lscalapack-$(ARCH_DEFAULT_MPI_IMPL)
export LIB_BLACS=$(LIB_SCALAPACK)
export OMPI_MCA_orte_rsh_agent=/bin/false
export CP2K_DATA_DIR=$(CURDIR)/data

# Upstream makefile contains lots of @ which make it impossible to debug
export MAKEFLAGS += --trace

ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
  NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
  export MAKEFLAGS += -j$(NUMJOBS)
endif

PLATFORM=Linux
ARCH=`uname -m`
FORT_C_NAME=gfortran
VERSION=psmp
PYTHON=python3

%:
	dh $@ 

override_dh_auto_clean:
	cd arch && ln -fs $(PLATFORM)-generic-$(FORT_C_NAME).$(VERSION)		   \
		$(PLATFORM)-$(ARCH)-$(FORT_C_NAME).$(VERSION)
	+$(MAKE) ARCH=$(PLATFORM)-$(ARCH)-$(FORT_C_NAME)		   \
		VERSION=$(VERSION) distclean
	cd tools/manual && rm -rf CP2K_INPUT && rm -f *.html *.xml
	rm -f arch/$(PLATFORM)-$(ARCH)-$(FORT_C_NAME).*
	rm -rf LAST* TEST*
	dh_auto_clean

override_dh_auto_build:
	cd arch && ln -fs $(PLATFORM)-generic-$(FORT_C_NAME).$(VERSION)		    \
		$(PLATFORM)-$(ARCH)-$(FORT_C_NAME).$(VERSION)
	+$(MAKE) ARCH=$(PLATFORM)-$(ARCH)-$(FORT_C_NAME) 		    \
		VERSION=$(VERSION) PYTHON=$(PYTHON) all
	cd tools/manual && \
		$(CURDIR)/exe/*/cp2k.$(VERSION) --xml && \
		saxonb-xslt -o index.html -ext:on cp2k_input.xml cp2k_input.xsl

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
override_dh_auto_test:
	(cd tools/regtesting; ARCH=$(PLATFORM)-$(ARCH)-$(FORT_C_NAME) ./do_regtest \
		-config ../../debian/regtest.config                                 \
		-restrictdir ATOM/regtest-2                                         \
		-restrictdir DFTB/regtest-nonscc                                    \
		-restrictdir FARMING/regtest-1                                      \
		-restrictdir FE/regtest-2                                           \
		-restrictdir Fist/regtest-11                                        \
		-restrictdir LIBTEST                                                \
		-restrictdir MC/regtest                                             \
		-restrictdir NEB/regtest-1                                          \
		-restrictdir optimize_input/regtest-1                               \
		-restrictdir QMMM/QS/regtest-2-erf                                  \
		-restrictdir QMMM/QS/regtest-4                                      \
		-restrictdir QMMM/QS/regtest-gapw                                   \
		-restrictdir QMMM/QS/regtest-lrigpw                                 \
		-restrictdir QMMM/SE/regtest_2                                      \
		-restrictdir QMMM/DFTB/regtest                                      \
		-restrictdir QS/regtest-all-electron                                \
		-restrictdir QS/regtest-almo-eda                                    \
		-restrictdir QS/regtest-cdft-3-1                                    \
		-restrictdir QS/regtest-dm-ls-scf-4                                 \
		-restrictdir QS/regtest-double-hybrid-2                             \
		-restrictdir QS/regtest-elpa                                        \
		-restrictdir QS/regtest-epr-2                                       \
		-restrictdir QS/regtest-fftw                                        \
		-restrictdir QS/regtest-gapw-2                                      \
		-restrictdir QS/regtest-gpw-2-1                                     \
		-restrictdir QS/regtest-hfx-periodic                                \
		-restrictdir QS/regtest-hfx-stress                                  \
		-restrictdir QS/regtest-hirshfeld                                   \
		-restrictdir QS/regtest-hybrid-1                                    \
		-restrictdir QS/regtest-libxc                                       \
		-restrictdir QS/regtest-linearscaling                               \
		-restrictdir QS/regtest-lsroks                                      \
		-restrictdir QS/regtest-lvlshift                                    \
		-restrictdir QS/regtest-md-lgvregion                                \
		-restrictdir QS/regtest-mp2-1                                       \
		-restrictdir QS/regtest-mp2-grad                                    \
		-restrictdir QS/regtest-nmr-2                                       \
		-restrictdir QS/regtest-optbas                                      \
		-restrictdir QS/regtest-ot-refine-3                                 \
		-restrictdir QS/regtest-pao-3                                       \
		-restrictdir QS/regtest-polar                                       \
		-restrictdir QS/regtest-properties/resp                             \
		-restrictdir QS/regtest-ps-implicit-2-3                             \
		-restrictdir QS/regtest-ri-mp2                                      \
		-restrictdir QS/regtest-ri-rpa                                      \
		-restrictdir QS/regtest-sccs-2                                      \
		-restrictdir QS/regtest-tddfpt                                      \
		-restrictdir QS/regtest-tddfpt-force-2                              \
		-restrictdir QS/regtest-tddfpt-lri                                  \
		-restrictdir SCPTB/regtest-1                                        \
		-restrictdir SE/regtest-3-1                                         \
		-restrictdir SWARM/regtest-glbopt-1                                 \
		-restrictdir TAMC/regtest)
endif