Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions easyconfigs/t/TreeFARMS/TreeFARMS-0.2.4-gfbf-2024a-5508f60.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
easyblock = 'PythonBundle'

name = 'TreeFARMS'
version = '0.2.4'
_commit = '5508f60'
versionsuffix = '-%s' % _commit

homepage = 'https://github.com/ubc-systopia/treeFarms'
description = """
Implementation of Trees FAst RashoMon Sets.
"""

toolchain = {'name': 'gfbf', 'version': '2024a'}

builddependencies = [
('CMake', '3.31.8'),
('scikit-build', '0.17.6'),
]

dependencies = [
('Python', '3.12.3'),
('IPython', '8.28.0'),
('SciPy-bundle', '2024.05'),
('scikit-learn', '1.5.2'),
('matplotlib', '3.9.2'),
('tqdm', '4.66.5'),
('tbb', '2021.13.0'),
('GMP', '6.3.0'),
('gmpy2', '2.2.0'),
]
_date = 'date +%d%m%Y'
_host = 'uname -s'
_buildtype = 'Release'
_buildflags = '-O3'
_localcmakesed = ' '.join([
f'BUILDDATE=$({_date})',
f'BUILDHOST=$({_host}) &&',
"sed -i -e '9s/version/%s/'" % version,
'-e "10s/builddate/$BUILDDATE/"',
'-e "11s/buildhost/$BUILDHOST/"',
"-e '12s/buildgitrev/%s/'" % _commit,
"-e '13s/buildtype/%s/'" % _buildtype,
"-e '14s/buildflags/%s/'" % _buildflags,
'setup.py',
'&& '
])

exts_defaultclass = 'PythonPackage'
exts_default_options = {
'source_urls': [PYPI_SOURCE],
'download_dep_fail': True,
'sanity_pip_check': True,
}
exts_list = [
('editables', '0.2', {
'checksums': ['6918f16225258f24ef9800c2327e14eded42ddac344e77982380749464024f35'],
}),
('timbertrek', '0.1.7', {
'checksums': ['83f558ecfb4d8b11a79525cc7846b185803a707455566e638f15dfd26de3084b'],
}),
('treefarms', version, {
'patches': [f'{name}-%(version)s_installcli.patch'],
'preinstallopts': _localcmakesed,
'postinstallcmds': ["mv %(installdir)s/lib/python%(pyshortver)s/site-packages/\\"
"%(name)s/{bin,experiments,README_PyPI.md,LICENSE} %(installdir)s"],
'sources': [{
'git_config': {
'url': 'https://github.com/%(github_account)s',
'repo_name': '%(name)s',
'commit': '%s' % _commit,
},
'filename': SOURCE_TAR_XZ,
}],
'checksums': [
{'treefarms-0.2.4.tar.xz': 'fc98ef8bee3cfee0e7338f62e8f41747bccad4294c7c978054961265d3d7aa5a'},
{'TreeFARMS-0.2.4_installcli.patch': '31a62927f5c0c47f8bc3eff3a2d23609e555ac93a8ee0519e0190dcf5f992661'},
],
}),
]

sanity_check_paths = {
'files': ['bin/%(namelower)s', f'lib/python%(pyshortver)s/site-packages/%(namelower)s/libgosdt.abi3.{SHLIB_EXT}'],
'dirs': ['experiments', 'lib/python%(pyshortver)s/site-packages'],
}
sanity_check_commands = [
"%(namelower)s ",
"python -c 'import %(namelower)s'",
"cd %(installdir)s; python lib/python%(pyshortver)s/site-packages/%(namelower)s/example.py",
]

modextrapaths = {'PYTHONPATH': 'lib/python%(pyshortver)s/site-packages'}

moduleclass = 'dataset'
44 changes: 44 additions & 0 deletions easyconfigs/t/TreeFARMS/TreeFARMS-0.2.4_installcli.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d272cc3..1d22d1e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,6 +26,8 @@ else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -DDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
+ add_compile_definitions(_VERSION_="${_VERSION_}" BUILD_HOST="${BUILD_HOST}" BUILD_DATE="${BUILD_DATE}" BUILD_GIT_REV="${BUILD_GIT_REV}")
+ add_definitions("${BUILDFLAGS}")
endif()

#
@@ -77,6 +79,11 @@ find_package(Threads REQUIRED)
target_link_libraries(${TARGET_CLI} PRIVATE Threads::Threads)
target_link_libraries(${TARGET_TESTS} PRIVATE Threads::Threads)

+install(TARGETS ${TARGET_CLI} RUNTIME DESTINATION bin)
+#install(TARGETS ${TARGET_TESTS} RUNTIME DESTINATION bin)
+install(DIRECTORY ${CMAKE_SOURCE_DIR}/experiments/ DESTINATION experiments)
+install(FILES README_PyPI.md LICENSE DESTINATION .)
+
# Target: TREEFARMS Python Module
if (SKBUILD)
message(STATUS "TREEFARMS is built using scikit-build. Will build the Python module.")
diff --git a/setup.py b/setup.py
index 09e61d5..1dc55a3 100644
--- a/setup.py
+++ b/setup.py
@@ -6,7 +6,13 @@ import distro
from setuptools import find_packages
from skbuild import setup

-cmake_args = []
+cmake_args = ['-D_VERSION_:STRING=version',
+ '-DBUILD_DATE:STRING=builddate',
+ '-DBUILD_HOST:STRING=buildhost',
+ '-DBUILD_GIT_REV:STRING=buildgitrev',
+ '-DCMAKE_BUILD_TYPE:STRING=buildtype',
+ '-DBUILDFLAGS=buildflags',
+]

if platform.system() == "Windows" or (platform.system() == "Linux" and distro.id() == "centos"):
assert "VCPKG_INSTALLATION_ROOT" in os.environ, \