Skip to content
Snippets Groups Projects
Commit fb5598f8 authored by Cyril Moineau's avatar Cyril Moineau
Browse files

Merge branch 'betterpip' into 'master'

[setup.py] Update setup.py to install Cmake lib in python env by default.

See merge request !11
parents 6cb11706 f4b382c3
No related branches found
No related tags found
No related merge requests found
......@@ -14,9 +14,11 @@ So far be sure to have the correct requirements to use this library
## Pip installation
You will need to install first the aidge_core library before installing aidge_cpu.
Also, make sure that the install path was set before installing aidge_core library.
Then run in your python environnement :
You will need to install first the ``aidge_core`` library before installing ``aidge_backend_cpu``.
If you have set a custom install path for the ``aidge_core`` library, make sure to use the same one here.
Then run in your python environnement :
``` bash
pip install . -v
```
......@@ -46,4 +48,4 @@ Important: this command can also be run with `make`.
To compile the CPU library with the python binding + the associated unitary tests, run
```
make cpu_with_pybind_tests
```
\ No newline at end of file
```
......@@ -62,11 +62,11 @@ class CMakeBuild(build_ext):
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
param_py = "-DPYTHON_EXECUTABLE=" + sys.executable
install_path = f"{build_temp}/install" if "AIDGE_INSTALL" not in os.environ else os.environ["AIDGE_INSTALL"]
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}'])
if not self.dry_run:
......@@ -83,11 +83,11 @@ class CMakeBuild(build_ext):
for file in files:
if file.endswith('.so') and (root != str(aidge_package.absolute())):
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
os.chdir(os.path.dirname(__file__))
shutil.copy("version.txt", str(aidge_package.absolute()))
shutil.copy("version.txt", str(aidge_package.absolute()))
if __name__ == '__main__':
......
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