# IT4Innovations # LK 2024 easyblock = 'CMakeMake' name = 'libxc' version = '4.3.4' homepage = 'http://www.tddft.org/programs/octopus/wiki/index.php/Libxc' description = """Libxc is a library of exchange-correlation functionals for density-functional theory. The aim is to provide a portable, well tested and reliable set of exchange and correlation functionals.""" toolchain = {'name': 'foss', 'version': '2023b'} source_urls = ['http://www.tddft.org/programs/libxc/down.php?file=4.3.4/'] sources = ['libxc-4.3.4.tar.gz'] checksums = [ 'a8ee37ddc5079339854bd313272856c9d41a27802472ee9ae44b58ee9a298337', '60e479b0c56df11c6cfdff8bdf4964bc2c7b36d19740b6b2a468b4f3c55af9cc' ] patches = [ #'libxc-%(version)s_rename-F03.patch', 'libxc-%(version)s.patch' ] builddependencies = [ ('CMake', '3.27.6'), ('Perl', '5.38.0'), ] separate_build_dir = True # rename *.F03 source file since Intel Fortran local_compiler doesn't like that extension # also requires patch file to rename file in CMakeLists.txt and src/Makefile.in preconfigopts = "mv ../libxc-%(version)s/src/libxc_master.F03 ../libxc-%(version)s/src/libxc_master_F03.F90 && " local_common_configopts = "-DENABLE_FORTRAN=ON -DENABLE_FORTRAN03=ON -DENABLE_XHOST=OFF" # perform iterative build to get both static and shared libraries configopts = [ local_common_configopts + ' -DBUILD_SHARED_LIBS=OFF', local_common_configopts + ' -DBUILD_SHARED_LIBS=ON', ] parallel = 1 runtest = 'test' sanity_check_paths = { 'files': ['bin/xc-info', 'bin/xc-threshold'] + ['lib/libxc%s.%s' % (x, y) for x in ['', 'f03', 'f90'] for y in ['a', SHLIB_EXT]], 'dirs': ['include', 'lib/pkgconfig', 'share/cmake/Libxc'], } moduleclass = 'chem'