diff --git a/aidge/__init__.py b/aidge/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..692513f2f994979b965b3596a0db35062e82adc9 100644 --- a/aidge/__init__.py +++ b/aidge/__init__.py @@ -0,0 +1 @@ +import aidge.aidge_core \ No newline at end of file diff --git a/setup.py b/setup.py index 0d1323d117f343369b88ba2ef156f9558545a44d..26ee4410eb6437bbaa2a2117d94bb9dbe12b062e 100644 --- a/setup.py +++ b/setup.py @@ -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, },