Skip to content
Merged
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# LLVM included, needs to be version 16.x as newer versions have a different API
# See: https://github.com/easybuilders/easybuild-easyconfigs/issues/21960
# Author: J. Sassmannshausen (Imperial College London/UK)

easyblock = 'CMakeMake'

name = 'HOOMD-blue'
version = "4.9.1"
versionsuffix = '-llvm'

homepage = "https://bitbucket.org/glotzer/hoomd-blue"
description = """HOOMD-blue is a general-purpose particle simulation
toolkit, implementing molecular dynamics and hard particle Monte Carlo
optimized for fast execution on both GPUs and CPUs.
This version contains the LLVM environment.
"""

toolchain = {'name': 'foss', 'version': '2023a'}
toolchainopts = {'usempi': True}

github_account = 'glotzerlab'
source_urls = [GITHUB_LOWER_RELEASE]
sources = ['hoomd-%(version)s.tar.gz']
patches = ['%(name)s-%(version)s.patch']
checksums = [
{'hoomd-4.9.1.tar.gz': 'b48ff3d44fef56ddf95c64b462b5d7f670bfc7a76b47223207edd3e7438e52bd'},
{'HOOMD-blue-4.9.1.patch': '185584a621fb02a554fb2c383b0d7c8bbb7e1251298fc58529b22b8ce7212854'},
]

builddependencies = [
('CMake', '3.26.3'),
('pybind11', '2.11.1'),
]

dependencies = [
('Python', '3.11.3'),
('SciPy-bundle', '2023.07'),
('tbb', '2021.11.0'),
('Eigen', '3.4.0'),
('Cereal', '1.3.2', '', SYSTEM),
('Clang', '16.0.6', '-shared'),
]

_copts = [
'-DENABLE_GPU=OFF',
'-DENABLE_MPI=ON',
'-DBUILD_MD=ON',
'-DBUILD_METAL=OFF',
'-DENABLE_TBB=ON',
'-DBUILD_TESTING=ON',
'-DENABLE_LLVM=ON',
]

configopts = ' '.join(_copts)

postinstallcmds = [
'ln -s hoomd/include %(installdir)s/include',
]

pretestopts = "OMPI_MCA_rmaps_base_oversubscribe=1 "
runtest = 'test'

sanity_check_paths = {
'files': ['hoomd/__init__.py', 'hoomd/include/hoomd/Compute.h'],
'dirs': ['lib/cmake'],
}

sanity_check_commands = [
"python -c 'import hoomd'",
]

modextrapaths = {'PYTHONPATH': ''}

moduleclass = 'phys'
53 changes: 53 additions & 0 deletions easybuild/easyconfigs/h/HOOMD-blue/HOOMD-blue-4.9.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
Set pybind to version 2.11, deal with the script finding the right LLVM and Clang libraries.
The way it is done is spitting out a bit more information which hopefully makes any further
debugging easier.
Help from Jan André Reuter (JSC) and Davide Grassano is greatly appreciated
Author: J. Sassmannshausen (Imperial College London/UK)
diff --git a/hoomd-4.9.1.orig/CMake/hoomd/HOOMDPythonSetup.cmake b/hoomd-4.9.1/CMake/hoomd/HOOMDPythonSetup.cmake
index 780344e..7d9e544 100644
--- a/hoomd-4.9.1.orig/CMake/hoomd/HOOMDPythonSetup.cmake
+++ b/hoomd-4.9.1/CMake/hoomd/HOOMDPythonSetup.cmake
@@ -12,7 +12,7 @@ if (Python_FOUND)
endif()
endif()

-find_package(pybind11 2.12 CONFIG REQUIRED)
+find_package(pybind11 2.11 CONFIG REQUIRED)

if (pybind11_FOUND)
find_package_message(pybind11 "Found pybind11: ${pybind11_DIR} ${pybind11_INCLUDE_DIR} (version ${pybind11_VERSION})" "[${pybind11_DIR}][${pybind11_INCLUDE_DIR}]")
diff --git a/hoomd-4.9.1.orig/hoomd/hpmc/CMakeLists.txt b/hoomd-4.9.1/hoomd/hpmc/CMakeLists.txt
index 0174fb0..ae1f149 100644
--- a/hoomd-4.9.1.orig/hoomd/hpmc/CMakeLists.txt
+++ b/hoomd-4.9.1/hoomd/hpmc/CMakeLists.txt
@@ -220,16 +220,24 @@ if (BUILD_TESTING)
endif()

if (ENABLE_LLVM)
- set(PACKAGE_NAME jit)
+ find_package(LLVM REQUIRED CONFIG)
+
+ message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
+ message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
+ include_directories(${LLVM_INCLUDE_DIRS})
+ separate_arguments(LLVM_DEFINITIONS_LIST NATIVE_COMMAND ${LLVM_DEFINITIONS})
+ add_definitions(${LLVM_DEFINITIONS_LIST})
+
+ # Find the libraries that correspond to the LLVM components
+ # that we wish to use
+ llvm_map_components_to_libnames(llvm_library JITLink)
+
+ set(PACKAGE_NAME jit)

# find and configure LLVM
- find_package(LLVM REQUIRED CONFIG)
+ # find_package(LLVM REQUIRED CONFIG)

if (LLVM_FOUND)
- find_library(llvm_library LLVM
- HINTS ${LLVM_LIBRARY_DIRS}
- NO_DEFAULT_PATH)
-
find_library(clang_library clang-cpp
HINTS ${LLVM_LIBRARY_DIRS}
NO_DEFAULT_PATH)
Loading