Diff gromacs-2021.7-r1 with a gromacs-2022.5-r1

/usr/portage/sci-chemistry/gromacs/gromacs-2022.5-r1.ebuild 2023-10-09 14:52:35.036368490 +0300
22 22
	inherit git-r3
23 23
else
24 24
	SRC_URI="
25
		https://ftp.gromacs.org/gromacs/${PN}-${PV/_/-}.tar.gz
26
		doc? ( https://ftp.gromacs.org/manual/manual-${PV/_/-}.pdf )
27
		test? ( https://ftp.gromacs.org/regressiontests/regressiontests-${PV/_/-}.tar.gz )"
28
	KEYWORDS="amd64 ~arm ~x86 ~amd64-linux ~x86-linux ~x64-macos"
25
		https://ftp.gromacs.org/gromacs/${P}.tar.gz
26
		doc? ( https://ftp.gromacs.org/manual/manual-${PV}.pdf )
27
		test? ( https://ftp.gromacs.org/regressiontests/regressiontests-${PV}.tar.gz )"
28
	# since 2022 arm support was dropped (but not arm64)
29
	KEYWORDS="~amd64 -arm ~arm64 ~x86 ~amd64-linux ~x86-linux ~x64-macos"
29 30
fi
30 31

  
31 32
ACCE_IUSE="cpu_flags_x86_sse2 cpu_flags_x86_sse4_1 cpu_flags_x86_fma4 cpu_flags_x86_avx cpu_flags_x86_avx2 cpu_flags_x86_avx512f cpu_flags_arm_neon"
......
38 39
#        base,    vmd plugins, fftpack from numpy,  blas/lapck from netlib,        memtestG80 library,  mpi_thread lib
39 40
LICENSE="LGPL-2.1 UoI-NCSA !mkl? ( !fftw? ( BSD ) !blas? ( BSD ) !lapack? ( BSD ) ) cuda? ( LGPL-3 ) threads? ( BSD )"
40 41
SLOT="0/${PV}"
41
IUSE="X blas cuda +custom-cflags +doc build-manual double-precision +fftw +gmxapi +gmxapi-legacy +hwloc lapack +lmfit mkl mpi +offensive opencl openmp +python +single-precision test +threads +tng ${ACCE_IUSE}"
42
IUSE="blas clang clang-cuda cuda  +custom-cflags +doc build-manual double-precision +fftw +gmxapi +gmxapi-legacy +hwloc lapack mkl mpi +offensive opencl openmp +python +single-precision test +threads +tng ${ACCE_IUSE}"
42 43

  
43 44
CDEPEND="
44
	X? (
45
		x11-libs/libX11
46
		x11-libs/libSM
47
		x11-libs/libICE
48
		)
49 45
	blas? ( virtual/blas )
50
	cuda? ( >=dev-util/nvidia-cuda-toolkit-6.5.14:=[profiler] )
46
	cuda? ( >=dev-util/nvidia-cuda-toolkit-11:=[profiler] )
51 47
	opencl? ( virtual/opencl )
52 48
	fftw? ( sci-libs/fftw:3.0= )
53 49
	hwloc? ( sys-apps/hwloc:= )
54 50
	lapack? ( virtual/lapack )
55
	lmfit? ( sci-libs/lmfit:= )
56 51
	mkl? ( sci-libs/mkl )
57
	mpi? ( virtual/mpi )
52
	mpi? ( virtual/mpi[cxx] )
53
	sci-libs/lmfit:=
54
	>=dev-cpp/muParser-2.3:=
58 55
	${PYTHON_DEPS}
59 56
	"
60 57
BDEPEND="${CDEPEND}
61 58
	virtual/pkgconfig
59
	clang? ( >=sys-devel/clang-6:* )
62 60
	build-manual? (
63 61
		app-doc/doxygen
64 62
		$(python_gen_cond_dep '
......
70 68
		dev-texlive/texlive-latexextra
71 69
		media-gfx/imagemagick
72 70
	)"
73
RDEPEND="${CDEPEND}"
71
RDEPEND="${CDEPEND}
72
	<sci-chemistry/dssp-4"
74 73

  
75 74
REQUIRED_USE="
76 75
	|| ( single-precision double-precision )
......
78 77
	cuda? ( single-precision )
79 78
	opencl? ( single-precision )
80 79
	cuda? ( !opencl )
80
	clang-cuda? ( clang cuda )
81 81
	mkl? ( !blas !fftw !lapack )
82 82
	${PYTHON_REQUIRED_USE}"
83 83

  
......
85 85

  
86 86
RESTRICT="!test? ( test )"
87 87

  
88
PATCHES=(
89
	"${FILESDIR}/${PN}-2021-musl-stdint.patch"
90
	"${FILESDIR}/${PN}-2021-cuda-detection.patch"
91
)
92

  
93 88
if [[ ${PV} != *9999 ]]; then
94 89
	S="${WORKDIR}/${PN}-${PV/_/-}"
95 90
fi
......
123 118

  
124 119
	xdg_environment_reset #591952
125 120

  
121
	# we can use clang as default
122
	if use clang && ! tc-is-clang ; then
123
		export CC=${CHOST}-clang
124
		export CXX=${CHOST}-clang++
125
	else
126
		tc-export CXX CC
127
	fi
128
	# clang-cuda need to filter mfpmath
129
	if use clang-cuda ; then
130
		filter-mfpmath sse
131
		filter-mfpmath i386
132
	fi
133

  
126 134
	cmake_src_prepare
127 135

  
128 136
	use cuda && cuda_src_prepare
......
203 211
		fft_opts=( -DGMX_FFT_LIBRARY=fftpack )
204 212
	fi
205 213

  
206
	if use lmfit; then
207
		local lmfit_opts=( -DGMX_USE_LMFIT=EXTERNAL )
208
	else
209
		local lmfit_opts=( -DGMX_USE_LMFIT=INTERNAL )
210
	fi
211

  
212 214
	mycmakeargs_pre+=(
213 215
		"${fft_opts[@]}"
214 216
		"${lmfit_opts[@]}"
215
		-DGMX_X11=$(usex X)
217
		-DGMX_USE_LMFIT=EXTERNAL
218
		-DGMX_USE_MUPARSER=EXTERNAL
216 219
		-DGMX_EXTERNAL_BLAS=$(usex blas)
217 220
		-DGMX_EXTERNAL_LAPACK=$(usex lapack)
218 221
		-DGMX_OPENMP=$(usex openmp)
......
223 226
		-DGMX_DEFAULT_SUFFIX=off
224 227
		-DGMX_SIMD="$acce"
225 228
		-DGMX_VMD_PLUGIN_PATH="${EPREFIX}/usr/$(get_libdir)/vmd/plugins/*/molfile/"
229
		-DGMX_DSSP_PROGRAM_PATH="${EPREFIX}/usr/bin/dssp"
226 230
		-DBUILD_TESTING=$(usex test)
227 231
		-DGMX_BUILD_UNITTESTS=$(usex test)
228 232
		-DPYTHON_EXECUTABLE="${EPREFIX}/usr/bin/${EPYTHON}"
......
239 243
		[[ ${x} = "double" ]] && p="-DGMX_DOUBLE=ON" || p="-DGMX_DOUBLE=OFF"
240 244
		local gpu=( "-DGMX_GPU=OFF" )
241 245
		[[ ${x} = "float" ]] && use cuda && gpu=( "-DGMX_GPU=CUDA" )
246
		[[ ${x} = "float" ]] && use clang-cuda && gpu=( "-DGMX_GPU=CUDA" "-DGMX_CLANG_CUDA=ON" )
242 247
		use opencl && gpu=( "-DGMX_GPU=OPENCL" )
243 248
		local mycmakeargs=(
244 249
			${mycmakeargs_pre[@]} ${p}
245
			-DGMX_MPI=OFF
250
			-DGMX_MPI=$(usex mpi)
246 251
			-DGMX_THREAD_MPI=$(usex threads)
247 252
			-DGMXAPI=$(usex gmxapi)
248 253
			-DGMX_INSTALL_LEGACY_API=$(usex gmxapi-legacy)
......
255 260
		BUILD_DIR="${WORKDIR}/${P}_${x}" cmake_src_configure
256 261
		[[ ${CHOST} != *-darwin* ]] || \
257 262
		  sed -i '/SET(CMAKE_INSTALL_NAME_DIR/s/^/#/' "${WORKDIR}/${P}_${x}/gentoo_rules.cmake" || die
258
		use mpi || continue
259
		einfo "Configuring for ${x} precision with mpi"
260
		local mycmakeargs=(
261
			${mycmakeargs_pre[@]} ${p}
262
			-DGMX_THREAD_MPI=OFF
263
			-DGMX_MPI=ON
264
			-DGMX_OPENMM=OFF
265
			-DGMXAPI=OFF
266
			"${opencl[@]}"
267
			"${cuda[@]}"
268
			-DGMX_BUILD_MDRUN_ONLY=ON
269
			-DBUILD_SHARED_LIBS=OFF
270
			-DGMX_BUILD_MANUAL=OFF
271
			-DGMX_BINARY_SUFFIX="_mpi${suffix}"
272
			-DGMX_LIBS_SUFFIX="_mpi${suffix}"
273
			)
274
		BUILD_DIR="${WORKDIR}/${P}_${x}_mpi" CC="mpicc" cmake_src_configure
275
		[[ ${CHOST} != *-darwin* ]] || \
276
		  sed -i '/SET(CMAKE_INSTALL_NAME_DIR/s/^/#/' "${WORKDIR}/${P}_${x}_mpi/gentoo_rules.cmake" || die
277 263
	done
278 264
}
279 265

  
......
293 279
			BUILD_DIR="${WORKDIR}/${P}_${x}"\
294 280
				cmake_src_compile manual
295 281
		fi
296
		use mpi || continue
297
		einfo "Compiling for ${x} precision with mpi"
298
		BUILD_DIR="${WORKDIR}/${P}_${x}_mpi"\
299
			cmake_src_compile
300 282
	done
301 283
}
302 284

  
......
324 306
				newdoc "${DISTDIR}/manual-${PV}.pdf" "${PN}-manual-${PV}.pdf"
325 307
			fi
326 308
		fi
327

  
328
		use mpi || continue
329
		BUILD_DIR="${WORKDIR}/${P}_${x}_mpi" \
330
			cmake_src_install
331 309
	done
332 310

  
333 311
	if use tng; then
Thank you!