62 filename="pykids/version.py",
63 major_version_num=MAJOR_VERSION_NUM,
64 minor_version_num=MINOR_VERSION_NUM,
65 build_info=BUILD_INFO):
67# THIS FILE IS GENERATED FROM KIDS SETUP.PY
68short_version = '%(version)s'
69version = '%(version)s'
70full_version = '%(full_version)s'
71git_revision = '%(git_revision)s'
72release = %(isrelease)s
73KIDS_library_path = r'%(path)s'
76 version = full_version
79 if os.path.exists(filename):
80 with open(filename) as f:
82 match = re.search(r"git_revision\s+=\s+(.*)", text, re.MULTILINE)
84 git_revision = ast.literal_eval(match.group(1))
86 git_revision = 'Unknown'
88 git_revision = 'Unknown'
90 git_revision = GIT_VERSION
91 version = full_version =
'%s.%s.%s' % (major_version_num, minor_version_num, build_info)
93 full_version +=
'.dev-' + git_revision[:7]
94 with open(filename,
'w')
as a:
95 a.write(cnt % {
'version': version,
96 'full_version' : full_version,
97 'git_revision' : git_revision,
98 'isrelease': str(IS_RELEASED),
99 'path': os.getenv(
'KIDS_LIB_PATH')})
102 minor_version_num=MINOR_VERSION_NUM,
103 build_info=BUILD_INFO):
104 from setuptools
import Extension
106 from pybind11.setup_helpers
import Pybind11Extension
109 from setuptools
import Extension
as Pybind11Extension
111 if platform.system() ==
"Windows" or platform.system() ==
'Darwin':
112 reportError(
"Not support now for platform %s"%platform.system())
115 setupKeywords[
"name"] =
"KIDS"
116 setupKeywords[
"version"] =
"%s.%s.%s" % (major_version_num,
119 setupKeywords[
"author"] =
"Xin He | Liu-group"
120 setupKeywords[
"license"] =
"Python Software Foundation License (BSD-like)"
121 setupKeywords[
"url"] =
"https://github.com/xshinhe/KIDS"
122 setupKeywords[
"packages"] = [
131 setupKeywords[
"data_files"] = []
132 setupKeywords[
"package_data"] = {
"pykids" : [
137 setupKeywords[
"platforms"] = [
"Linux"]
138 setupKeywords[
"description"] =
"Python wrapper for KIDS"
139 setupKeywords[
"long_description"] = \
141 KIDS (Kernel Integrated Dynamics Simulator) offers an open-source framework tailored for simulating
142 chemical and physical dynamics, with a primary focus on atomic and molecular scales in condensed matter.
143 It is designed for (classical / qauntum) dynamics simulation of small system, few-body system, reduced
144 systems, and even large many-particle (i.e. molecules & condensed matter) systems. It provides a versatile
145 platform for the development of advanced algorithms, offering ease of use and accessibility at a minimal
149 define_macros = [(
'MAJOR_VERSION', major_version_num),
150 (
'MINOR_VERSION', minor_version_num)]
154 pykids_include_path = os.getenv(
'KIDS_INCLUDE_PATH')
155 if not pykids_include_path:
156 reportError(
"Set KIDS_INCLUDE_PATH to point to the include directory for KIDS")
157 pykids_lib_path = os.getenv(
'KIDS_LIB_PATH')
158 if not pykids_lib_path:
159 reportError(
"Set KIDS_LIB_PATH to point to the lib directory for KIDS")
163 extra_compile_args=[
'-std=c++11']
165 library_dirs=[pykids_lib_path]
166 include_dirs=pykids_include_path.split(
';')
167 include_dirs.append(numpy.get_include())
168 extensionArgs = {
"name":
"pykids._kids",
169 "sources": [
"swig/KIDSSwig.cxx"],
170 "include_dirs": include_dirs,
171 "define_macros": define_macros,
172 "library_dirs": library_dirs,
173 "libraries": libraries,
174 "extra_compile_args": extra_compile_args,
175 "extra_link_args": extra_link_args}
176 extensionArgs[
"runtime_library_dirs"] = library_dirs
177 setupKeywords[
"ext_modules"] = [Extension(**extensionArgs)]
180 setupKeywords[
"ext_modules"] += [Pybind11Extension(
181 "pykids.libpykids_v2",
182 sorted(glob(
"pybind11/libpykids_v2.cpp")),
190 setupKeywords[
"ext_modules"] += cythonize(Extension(
191 "pykids.ext.examples",
193 "ext/examples/src/test.cpp",
194 "ext/examples/test.pyx",
196 include_dirs=include_dirs +[
197 "ext/examples/include",
207 for key
in sorted(iter(setupKeywords)):
208 value = setupKeywords[key]
209 outputString += key.rjust(firstTab) + str( value ).rjust(secondTab) +
"\n"