Merge branch 'ffbidx' into 'master'

FIX: spack ffbidx python issues

See merge request germann_e/spack-psi!7
This commit is contained in:
2022-12-02 10:34:38 +00:00

View File

@ -37,25 +37,28 @@ class Ffbidx(CMakePackage, CudaPackage):
description='CMake build type',
values=('Debug', 'Release', 'RelWithDebInfo', 'MinSizeRel'))
variant("cuda", default=True, description="Build with CUDA")
variant("fast_indexer", default=True, description="Build the fast indexer" )
variant("python", default=False, description="Build python modules")
variant("fast_indexer", default=True, description="Build the fast feedback indexer library" )
variant("python", default=False, description="Build python module")
variant("simple_data_files", default=False, description="Install simple data files")
variant("simple_data_indexer", default=False, description="Build simple data indexer")
variant("simple_data_indexer", default=False, description="Build simple data reader library and indexer")
variant("test_all", default=False, description="Enable testing")
depends_on("python@3.1.5:", when='+python')
depends_on("py-numpy", when='+python')
depends_on("eigen@3.4.0:", type=('build', 'link'), when='+simple_data_indexer')
depends_on("eigen@3.4.0:", type=('build', 'link'), when='+fast_indexer')
depends_on("cmake@3.21.0:", type='build')
conflicts('cuda_arch=none', when='+fast_indexer',
msg='CUDA architecture is required when building the fast indexer!')
conflicts("~cuda", when='+fast_indexer', msg="Ffbidx requires CUDA!'")
msg='CUDA architecture is required when building the fast feedback indexer library')
conflicts("~cuda", when='+fast_indexer',
msg="The fast feedback indexer library requires CUDA'")
conflicts('+python', when='~fast_indexer',
msg='PYTHON_MODULE needs -DBUILD_FAST_INDEXER=1 as a cmake argument')
msg='Python module needs the fast feedback indexer library')
conflicts('+test_all', when='~simple_data_indexer~fast_indexer',
msg='Tests need the build of both indexers')
msg='Tests need the build of both simple data reader and fast feedback indexer library')
conflicts('+simple_data_indexer', when='~fast_indexer',
msg='Simple data indexer needs the fast feedback indexer library')
# Conflicts for compilers without C++17 support
conflicts('gcc@:6.5.0')
@ -71,8 +74,11 @@ class Ffbidx(CMakePackage, CudaPackage):
def cmake_args(self):
args = [
self.define('CMAKE_INSTALL_LIBDIR', 'lib'),
self.define_from_variant('BUILD_FAST_INDEXER', 'fast_indexer'),
self.define_from_variant('BUILD_SIMPLE_DATA_INDEXER', 'simple_data_indexer'),
self.define_from_variant('BUILD_FAST_INDEXER_STATIC', 'fast_indexer'),
self.define_from_variant('SIMPLE_DATA_INDEXER', 'simple_data_indexer'),
self.define_from_variant('REFINED_SIMPLE_DATA_INDEXER', 'simple_data_indexer'),
self.define_from_variant('BUILD_SIMPLE_DATA_READER', 'simple_data_indexer'),
self.define_from_variant('CMAKE_CUDA_ARCHITECTURES', 'cuda_arch'),
self.define_from_variant('INSTALL_SIMPLE_DATA_FILES', 'simple_data_files'),
@ -80,13 +86,19 @@ class Ffbidx(CMakePackage, CudaPackage):
self.define_from_variant('TEST_ALL', 'test_all'),
]
if 'python' in self.spec:
python_root_dir = self.spec['python'].prefix
args.append(self.define('Python3_ROOT_DIR', python_root_dir))
print(f'using python from {python_root_dir}')
return args
# Set PATHS for run time
def setup_run_environment(self, env):
env.append_path('PATH', self.prefix.bin)
env.append_path('CPATH', self.prefix.include)
env.append_path('LD_LIBRARY_PATH', self.prefix.lib64)
env.append_path('LIBRARY_PATH', self.prefix.lib64)
env.append_path('LD_LIBRARY_PATH', self.prefix.lib)
env.append_path('LIBRARY_PATH', self.prefix.lib)
env.append_path('PKG_CONFIG_PATH', self.prefix.share.ffbidx.pkgconfig)
if '+python' in self.spec:
env.append_path('PYTHONPATH', self.prefix.lib64.ffbidx)
env.append_path('PYTHONPATH', self.prefix.lib.ffbidx)