Skip to content
Snippets Groups Projects
Commit d91f9462 authored by Thibault Allenet's avatar Thibault Allenet
Browse files

Fix setup.py

parent 44fedd7d
No related branches found
No related tags found
No related merge requests found
...@@ -62,15 +62,17 @@ class CMakeBuild(build_ext): ...@@ -62,15 +62,17 @@ class CMakeBuild(build_ext):
os.chdir(str(build_temp)) os.chdir(str(build_temp))
# Impose to use the executable of the python # Impose to use the executable of the python
# used to launch setup.py to setup PythonInterp # used to launch setup.py to setup PythonInterp
param_py = "-DPYTHON_EXECUTABLE=" + sys.executable param_py = "-DPYTHON_EXECUTABLE=" + sys.executable
install_path = f"{build_temp}/install" if "AIDGE_INSTALL" not in os.environ else os.environ["AIDGE_INSTALL"]
self.spawn(['cmake', str(cwd), param_py, '-DTEST=OFF', f'-DCMAKE_INSTALL_PREFIX:PATH={install_path}']) compile_type = 'Debug'
install_path = os.path.join(sys.prefix, "lib", "libAidge") if "AIDGE_INSTALL" not in os.environ else os.environ["AIDGE_INSTALL"]
self.spawn(['cmake', str(cwd), param_py, '-DTEST=OFF', f'-DCMAKE_INSTALL_PREFIX:PATH={install_path}', f'-DCMAKE_BUILD_TYPE={compile_type}'])
if not self.dry_run: if not self.dry_run:
self.spawn(['make', 'all', 'install', '-j', max_jobs]) self.spawn(['cmake', '--build', '.', '--config', compile_type, '-j', max_jobs])
self.spawn(['cmake', '--install', '.', '--config', compile_type])
os.chdir(str(cwd)) os.chdir(str(cwd))
aidge_package = build_lib / (get_project_name()) aidge_package = build_lib / (get_project_name())
...@@ -81,9 +83,9 @@ class CMakeBuild(build_ext): ...@@ -81,9 +83,9 @@ class CMakeBuild(build_ext):
# Copy all shared object files from build_temp/lib to aidge_package # Copy all shared object files from build_temp/lib to aidge_package
for root, _, files in os.walk(build_temp.absolute()): for root, _, files in os.walk(build_temp.absolute()):
for file in files: for file in files:
if file.endswith('.so') and (root != str(aidge_package.absolute())): if (file.endswith('.so') or file.endswith('.pyd')) and (root != str(aidge_package.absolute())):
currentFile=os.path.join(root, file) currentFile=os.path.join(root, file)
shutil.copy(currentFile, str(aidge_package.absolute())) shutil.copy(currentFile, str(aidge_package.absolute()))
# Copy version.txt in aidge_package # Copy version.txt in aidge_package
os.chdir(os.path.dirname(__file__)) os.chdir(os.path.dirname(__file__))
...@@ -100,13 +102,13 @@ if __name__ == '__main__': ...@@ -100,13 +102,13 @@ if __name__ == '__main__':
long_description_content_type="text/markdown", long_description_content_type="text/markdown",
long_description="\n".join(DOCLINES[2:]), long_description="\n".join(DOCLINES[2:]),
classifiers=[c for c in CLASSIFIERS.split('\n') if c], classifiers=[c for c in CLASSIFIERS.split('\n') if c],
platforms=["Linux"],
packages=find_packages(where="."), packages=find_packages(where="."),
include_package_data=True, include_package_data=True,
ext_modules=[CMakeExtension(get_project_name())], ext_modules=[CMakeExtension(get_project_name())],
cmdclass={ cmdclass={
'build_ext': CMakeBuild, 'build_ext': CMakeBuild,
}, },
install_requires=['aidge_core','aidge_backend_cpu'],
zip_safe=False, zip_safe=False,
) )
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