Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get python modules installed from 'pip list' for cmake #1025

Conversation

VincentRouvreau
Copy link
Contributor

This evolution enhances cmake, as python import can be quite slow.

git checkout master
time cmake ...
real    0m10,765s
user    0m11,097s
sys     0m14,035s
git checkout pip_list_to_find_python_module
time cmake ...
real    0m1,146s
user    0m0,888s
sys     0m0,263s

@VincentRouvreau VincentRouvreau added build The build system (CMake, etc) optimization It works, now make it faster labels Jan 30, 2024
@mglisse
Copy link
Member

mglisse commented Jan 30, 2024

Related to #580.

@VincentRouvreau
Copy link
Contributor Author

Related to #580.

Fix #580 differently from the proposal in the issue. I didn't check from which version of pip freeze was implemented

@VincentRouvreau
Copy link
Contributor Author

Should not be run on Windows (if (NOT WIN32) or if (NOT CMAKE_HOST_WIN32), to be tested on WSL)

    set(GUDHI_RUN_TIME_DEPENDENCIES "PYKEOPS;${GUDHI_RUN_TIME_DEPENDENCIES}")

@VincentRouvreau
Copy link
Contributor Author

When python dependencies are installed with conda, pip freeze:

certifi @ file:///home/conda/feedstock_root/build_artifacts/certifi_1707022139797/work/certifi
colorama @ file:///home/conda/feedstock_root/build_artifacts/colorama_1666700638685/work
contourpy @ file:///home/conda/feedstock_root/build_artifacts/contourpy_1699041467346/work
cycler @ file:///home/conda/feedstock_root/build_artifacts/cycler_1696677705766/work
Cython @ file:///home/conda/feedstock_root/build_artifacts/cython_1706274761542/work
exceptiongroup @ file:///home/conda/feedstock_root/build_artifacts/exceptiongroup_1704921103267/work
fonttools @ file:///home/conda/feedstock_root/build_artifacts/fonttools_1704979840492/work
iniconfig @ file:///home/conda/feedstock_root/build_artifacts/iniconfig_1673103042956/work
joblib @ file:///home/conda/feedstock_root/build_artifacts/joblib_1691577114857/work
kiwisolver @ file:///home/conda/feedstock_root/build_artifacts/kiwisolver_1695379925569/work
matplotlib @ file:///home/conda/feedstock_root/build_artifacts/matplotlib-suite_1700509454821/work
munkres==1.1.4
networkx @ file:///home/conda/feedstock_root/build_artifacts/networkx_1698504735452/work
numpy @ file:///home/conda/feedstock_root/build_artifacts/numpy_1707225359967/work/dist/numpy-1.26.4-cp312-cp312-linux_x86_64.whl#sha256=031b7d6b2e5e604d9e21fc21be713ebf28ce133ec872dce6de006742d5e49bab
packaging @ file:///home/conda/feedstock_root/build_artifacts/packaging_1696202382185/work
pillow @ file:///home/conda/feedstock_root/build_artifacts/pillow_1704252028018/work
pluggy @ file:///home/conda/feedstock_root/build_artifacts/pluggy_1706116770704/work
ply==3.11
POT @ file:///home/conda/feedstock_root/build_artifacts/pot_1705303604381/work
pybind11 @ file:///home/conda/feedstock_root/build_artifacts/pybind11-split_1695367016603/work
pybind11-global @ file:///home/conda/feedstock_root/build_artifacts/pybind11-split_1695367016603/work
pyparsing @ file:///home/conda/feedstock_root/build_artifacts/pyparsing_1690737849915/work
PyQt5==5.15.9
PyQt5-sip==12.12.2
pytest @ file:///home/conda/feedstock_root/build_artifacts/pytest_1706447941722/work
python-dateutil @ file:///home/conda/feedstock_root/build_artifacts/python-dateutil_1626286286081/work
scikit-learn @ file:///home/conda/feedstock_root/build_artifacts/scikit-learn_1705657310001/work
scipy @ file:///home/conda/feedstock_root/build_artifacts/scipy-split_1706041474046/work/dist/scipy-1.12.0-cp312-cp312-linux_x86_64.whl#sha256=455585fb13f602615d4e6633d9becf631347243101f5b6983e5718c2dd364888
setuptools==69.0.3
sip @ file:///home/conda/feedstock_root/build_artifacts/sip_1697300425834/work
six @ file:///home/conda/feedstock_root/build_artifacts/six_1620240208055/work
threadpoolctl @ file:///home/conda/feedstock_root/build_artifacts/threadpoolctl_1689261241048/work
toml @ file:///home/conda/feedstock_root/build_artifacts/toml_1604308577558/work
tomli @ file:///home/conda/feedstock_root/build_artifacts/tomli_1644342247877/work
tornado @ file:///home/conda/feedstock_root/build_artifacts/tornado_1695373584819/work
wheel==0.42.0

which leads to:

++ Python module networkx not found
++ Python module sphinxcontrib-bibtex not found
++ Python module pydata-sphinx-theme not found
++ Python module sphinx-paramlinks not found
++ Python module tensorflow not found
++ Python module hnswlib not found
++ Python module eagerpy not found
++ Python module pykeops not found
++ Python module torch not found
++ Python module pybind11 not found
++ Python module pot not found
++ Python module scikit-learn not found
++ Python module sphinx not found
++ Python module scipy not found
++ Python module numpy not found
++ Python module matplotlib not found
++ Python module pytest not found
++ Python module cython not found

@VincentRouvreau
Copy link
Contributor Author

Replaced by #1135

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build system (CMake, etc) optimization It works, now make it faster
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants