Skip to content

Commit d3694ca

Browse files
committed
updated int_am to use "new" component names
1 parent e886334 commit d3694ca

File tree

1 file changed

+13
-20
lines changed

1 file changed

+13
-20
lines changed

cmake/modules/int_am.cmake

+13-20
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,19 @@ if (_ntokens GREATER 1)
2323
set(_max_am 0)
2424
math(EXPR _max_deriv "${_ntokens} - 1")
2525
foreach(_d RANGE 0 ${_max_deriv})
26-
list(GET WITH_MAX_AM ${_d} _candidate0_d${_d})
27-
if (${_candidate0_d${_d}} GREATER _max_am)
28-
set(_max_am ${_candidate0_d${_d}})
26+
list(GET WITH_MAX_AM ${_d} _max_am_default_d${_d})
27+
if (${_max_am_default_d${_d}} GREATER _max_am)
28+
set(_max_am ${_max_am_default_d${_d}})
2929
endif()
3030
endforeach()
3131

3232
list(JOIN WITH_MAX_AM "," _sam)
3333
set(LIBINT_MAX_AM_LIST ${_sam})
3434
set(LIBINT_MAX_AM ${_max_am}) # only overall LIBINT, not specific integrals classes, sets both MAX_AM & MAX_AM_LIST
35+
set(_max_LIBINT_MAX_AM ${LIBINT_MAX_AM})
3536
else()
3637
set(_given_max_am_list FALSE)
37-
set(_candidate0_d0 ${WITH_MAX_AM})
38+
set(_max_am_default ${WITH_MAX_AM})
3839

3940
set(LIBINT_MAX_AM_LIST "")
4041
set(LIBINT_MAX_AM ${WITH_MAX_AM})
@@ -81,6 +82,7 @@ if (_ntokens GREATER 1)
8182
else()
8283
set(LIBINT_OPT_AM_LIST "")
8384
message(STATUS "WITH_OPT_AM=${WITH_OPT_AM}")
85+
message(STATUS "_max_LIBINT_MAX_AM=${_max_LIBINT_MAX_AM}")
8486
if (WITH_OPT_AM EQUAL -1)
8587
math(EXPR LIBINT_OPT_AM "${_max_LIBINT_MAX_AM}/2 + 1")
8688
#math(EXPR LIBINT_OPT_AM "${_max_LIBINT_MAX_AM}/2 + ${_max_LIBINT_MAX_AM}%2")
@@ -100,7 +102,6 @@ message(STATUS "LIBINT_OPT_AM_LIST=${LIBINT_OPT_AM_LIST} LIBINT_OPT_AM=${LIBINT_
100102
macro(process_integrals_class class)
101103
if (ENABLE_${class} GREATER_EQUAL 0)
102104
set(INCLUDE_${class} ${ENABLE_${class}})
103-
set(_candidate0_${class}_d${INCLUDE_${class}} ${_candidate0_d${INCLUDE_${class}}})
104105
set(LIBINT_SUPPORTS_${class} yes)
105106
set(LIBINT_${class}_DERIV ${INCLUDE_${class}})
106107
message(STATUS "Enabling integrals class ${class} to derivative ${INCLUDE_${class}}")
@@ -116,7 +117,7 @@ macro(process_integrals_class class)
116117
if (_ntokens GREATER 1)
117118
math(EXPR _max_deriv "${_ntokens} - 1")
118119
foreach(_d RANGE 0 ${_max_deriv})
119-
list(GET WITH_${class}_MAX_AM _d _candidate_${class}_d${_d})
120+
list(GET WITH_${class}_MAX_AM _d _max_am_${class}_d${_d})
120121
endforeach()
121122

122123
list(JOIN WITH_${class}_MAX_AM "," _sam)
@@ -126,21 +127,13 @@ macro(process_integrals_class class)
126127
set(${class}_MAX_AM_LIST "")
127128
if (WITH_${class}_MAX_AM EQUAL -1)
128129

129-
set(_candidate_${class}_E ${_candidate0_${class}_E})
130-
if (${INCLUDE_${class}} GREATER_EQUAL 1)
131-
if (${_candidate0_${class}_G} EQUAL -1)
132-
set(_candidate_${class}_G ${_candidate0_${class}_E})
130+
foreach(_d RANGE 0 ${INCLUDE_${class}})
131+
if (DEFINED _max_am_default_d${_d})
132+
set(_candidate_max_am_${class}_d${_d} ${_max_am_default_d${_d}})
133133
else()
134-
set(_candidate_${class}_G ${_candidate0_${class}_G})
134+
set(_candidate_max_am_${class}_d${_d} ${_max_am_default})
135135
endif()
136-
endif()
137-
if (${INCLUDE_${class}} GREATER_EQUAL 2)
138-
if (${_candidate0_${class}_H} EQUAL -1)
139-
set(_candidate_${class}_H ${_candidate0_${class}_E})
140-
else()
141-
set(_candidate_${class}_H ${_candidate0_${class}_H})
142-
endif()
143-
endif()
136+
endforeach()
144137

145138
if (${INCLUDE_${class}} GREATER_EQUAL 0)
146139
set(${class}_MAX_AM ${LIBINT_MAX_AM})
@@ -211,7 +204,7 @@ foreach(_cls ERI2;ERI3;ERI4)
211204
set(_lbl "${_lbl}_")
212205

213206
foreach (_deriv RANGE 0 ${INCLUDE_${_cls}})
214-
foreach(_l RANGE 0 ${_candidate_${_cls}_d${_deriv}})
207+
foreach(_l RANGE 0 ${_max_am_${_cls}_d${_deriv}})
215208
list(APPEND Libint2_ERI_COMPONENTS "${_lbl}_d${_deriv}_l${_l}")
216209
endforeach()
217210
endforeach()

0 commit comments

Comments
 (0)