Skip to content
Snippets Groups Projects
Commit 36d784ae authored by Vincent Templier's avatar Vincent Templier
Browse files

Update setup.py and __init__ of aidge to include Core library

parent 95885833
No related branches found
No related tags found
No related merge requests found
import aidge.aidge_core
\ No newline at end of file
......@@ -54,45 +54,43 @@ class CMakeBuild(build_ext):
if not build_temp.exists():
build_temp.mkdir(parents=True, exist_ok=True)
install_temp = cwd / "install"
if not install_temp.exists():
install_temp.mkdir(parents=True, exist_ok=True)
build_lib = pathlib.Path(self.build_lib)
if not build_lib.exists():
build_lib.mkdir(parents=True, exist_ok=True)
os.chdir(str(build_temp))
self.spawn(["cmake",
f"-DCMAKE_INSTALL_PREFIX:PATH={install_temp}",
"-DCMAKE_BUILD_TYPE=Debug", "-DWERROR=OFF",
"-DPYBIND=ON", str(cwd)])
# Impose to use the executable of the python
# used to launch setup.py to setup PythonInterp
param_py = "-DPYTHON_EXECUTABLE=" + sys.executable
self.spawn(['cmake', str(cwd), param_py])
if not self.dry_run:
self.spawn(['make', 'all', 'install', '-j', max_jobs])
self.spawn(['make', '-j', max_jobs])
os.chdir(str(cwd))
aidge_package = build_lib / "aidge"
# Get "aidge" package
ext_lib = build_temp / "core"
ext_lib = build_temp / "aidge" / "_Core"
# Copy all shared object files from build_temp/lib to build_lib
for root, _, files in os.walk(ext_lib.absolute()):
for file in files:
if file.endswith('.so'):
currentFile=os.path.join(root, file)
shutil.copy(currentFile, str(build_lib.absolute()))
shutil.copy(currentFile, str(aidge_package.absolute()))
# Get "aidge_ref_cpp" package
ext_lib = build_temp / "module" / "backend" / "ref_cpp"
# Get "aidge cpu" package
# ext_lib = build_temp / "_CPU"
# Copy all shared object files from build_temp/lib to build_lib
for root, _, files in os.walk(ext_lib.absolute()):
for file in files:
if file.endswith('.so'):
currentFile=os.path.join(root, file)
shutil.copy(currentFile, str(build_lib.absolute()))
# # Copy all shared object files from build_temp/lib to build_lib
# for root, _, files in os.walk(ext_lib.absolute()):
# for file in files:
# if file.endswith('.so'):
# currentFile=os.path.join(root, file)
# shutil.copy(currentFile, str(aidge_package.absolute()))
if __name__ == '__main__':
......@@ -106,8 +104,8 @@ if __name__ == '__main__':
long_description="\n".join(DOCLINES[2:]),
classifiers=[c for c in CLASSIFIERS.split('\n') if c],
platforms=["Linux"],
#packages=find_packages(where="."),
ext_modules=[CMakeExtension('_core')],
packages=find_packages(where="."),
ext_modules=[CMakeExtension('Aidge')],
cmdclass={
'build_ext': CMakeBuild,
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment