From f3c3312995753e35b67887f505312c9ef11e734d Mon Sep 17 00:00:00 2001 From: Vincent Rouvreau Date: Mon, 16 May 2022 16:43:12 +0200 Subject: Add instructions to compile gudhi in a conda env --- .github/how_to_compile_gudhi_in_a_conda_env.md | 97 ++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 .github/how_to_compile_gudhi_in_a_conda_env.md diff --git a/.github/how_to_compile_gudhi_in_a_conda_env.md b/.github/how_to_compile_gudhi_in_a_conda_env.md new file mode 100644 index 00000000..3691b75e --- /dev/null +++ b/.github/how_to_compile_gudhi_in_a_conda_env.md @@ -0,0 +1,97 @@ +# Install a conda development environment to compile GUDHI + +## Install miniconda + +Download the [installer](https://docs.conda.io/en/latest/miniconda.html) required by your system and follow the [instructions](https://conda.io/projects/conda/en/latest/user-guide/install/index.html). + +## Create a dedicated environment + +```bash +conda install -c conda-forge mamba # installation with mamba is faster +conda create --name gudhi +conda activate gudhi +mamba install -c conda-forge python cmake doxygen eigen cgal-cpp +``` + +Some of the requirements are in the gudhi repository (please refer to +[how to use github to contribute to gudhi](how_to_use_github_to_contribute_to_gudhi.md)). +In the gudhi repository - let's call it `/workdir/gudhi` i.e. - once submodules are initialised: + +```bash +pip install -r ext/gudhi-deploy/build-requirements.txt +pip install -r ext/gudhi-deploy/test-requirements.txt # pytorch can be painful to install - not mandatory +``` + +## Compilation + +In order to compile all c++ utilities, examples, benchmarks, unitary tests, and python module: +```bash +cd /workdir/gudhi +rm -rf build +mkdir build +cd build +# To build all even examples and benchmarks +cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DWITH_GUDHI_EXAMPLE=ON -DWITH_GUDHI_BENCHMARK=ON .. +``` + +### Specific python compilation + +In order to compile only python module +```bash +cd /workdir/gudhi +rm -rf build +mkdir build +cd build +# To build all even examples and benchmarks +cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$CONDA_PREFIX .. +cd src/python +# To build python module in parallel +python setup.py build_ext -j 16 --inplace +# to clean the build +# python setup.py clean --all +``` + +In order to use freshly compiled gudhi python module: +```bash +PYTHONPATH=/workdir/gudhi/build/src/python python # or ipython, jupyter, ... +``` + +### Specific C++ documentation generation + +```bash +cd /workdir/gudhi +rm -rf build +mkdir build +cd build +# python OFF to prevent python modules search makes cmake faster +cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DWITH_GUDHI_PYTHON=OFF -DUSER_VERSION_DIR=version .. +make user_version; +cd version +mkdir build +cd build +# python OFF to prevent python modules search makes cmake faster +cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DWITH_GUDHI_PYTHON=OFF .. +make doxygen 2>&1 | tee dox.log +grep warning dox.log # Warnings can be lost with parallel doxygen +firefox html/index.html # [optional] To display the c++ documentation. Anything else than firefox can be used. +``` + +### Specific python documentation generation + +```bash +cd /workdir/gudhi +rm -rf build +mkdir build +cd build +# python OFF to prevent python modules search makes cmake faster - it is the next one in user version that matters +cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DWITH_GUDHI_PYTHON=OFF -DUSER_VERSION_DIR=version .. +make user_version; +cd version +mkdir build +cd build +cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$CONDA_PREFIX .. +cd python +# To build python module in parallel +python setup.py build_ext -j 16 --inplace +firefox sphinx/index.html # [optional] To display the python documentation. Anything else than firefox can be used. +``` \ No newline at end of file -- cgit v1.2.3 From 7941d119872fbd6bc91dca744111b1320f268150 Mon Sep 17 00:00:00 2001 From: Vincent Rouvreau Date: Mon, 23 May 2022 11:57:31 +0200 Subject: doc review: comment on remove build directory --- .github/how_to_compile_gudhi_in_a_conda_env.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/how_to_compile_gudhi_in_a_conda_env.md b/.github/how_to_compile_gudhi_in_a_conda_env.md index 3691b75e..3870381b 100644 --- a/.github/how_to_compile_gudhi_in_a_conda_env.md +++ b/.github/how_to_compile_gudhi_in_a_conda_env.md @@ -27,8 +27,7 @@ pip install -r ext/gudhi-deploy/test-requirements.txt # pytorch can be painful In order to compile all c++ utilities, examples, benchmarks, unitary tests, and python module: ```bash cd /workdir/gudhi -rm -rf build -mkdir build +rm -rf build; mkdir build # /!\ any existing build folder will be removed cd build # To build all even examples and benchmarks cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DWITH_GUDHI_EXAMPLE=ON -DWITH_GUDHI_BENCHMARK=ON .. @@ -39,8 +38,7 @@ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DWITH_GUDHI_ In order to compile only python module ```bash cd /workdir/gudhi -rm -rf build -mkdir build +rm -rf build; mkdir build # /!\ any existing build folder will be removed cd build # To build all even examples and benchmarks cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$CONDA_PREFIX .. @@ -60,8 +58,7 @@ PYTHONPATH=/workdir/gudhi/build/src/python python # or ipython, jupyter, ... ```bash cd /workdir/gudhi -rm -rf build -mkdir build +rm -rf build; mkdir build # /!\ any existing build folder will be removed cd build # python OFF to prevent python modules search makes cmake faster cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DWITH_GUDHI_PYTHON=OFF -DUSER_VERSION_DIR=version .. @@ -80,8 +77,7 @@ firefox html/index.html # [optional] To display the c++ documentation. Anything ```bash cd /workdir/gudhi -rm -rf build -mkdir build +rm -rf build; mkdir build # /!\ any existing build folder will be removed cd build # python OFF to prevent python modules search makes cmake faster - it is the next one in user version that matters cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DWITH_GUDHI_PYTHON=OFF -DUSER_VERSION_DIR=version .. -- cgit v1.2.3 From 953cbffc67c2f6e26f10ca3a4538ef56b933dcc3 Mon Sep 17 00:00:00 2001 From: Vincent Rouvreau Date: Mon, 23 May 2022 12:01:04 +0200 Subject: doc review: comment on number of CPU for python module --- .github/how_to_compile_gudhi_in_a_conda_env.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/how_to_compile_gudhi_in_a_conda_env.md b/.github/how_to_compile_gudhi_in_a_conda_env.md index 3870381b..533d0fd2 100644 --- a/.github/how_to_compile_gudhi_in_a_conda_env.md +++ b/.github/how_to_compile_gudhi_in_a_conda_env.md @@ -44,7 +44,7 @@ cd build cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$CONDA_PREFIX .. cd src/python # To build python module in parallel -python setup.py build_ext -j 16 --inplace +python setup.py build_ext -j 16 --inplace # 16 is the number of CPUthat are used to compile the python module. Can be any other value. # to clean the build # python setup.py clean --all ``` @@ -88,6 +88,6 @@ cd build cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$CONDA_PREFIX .. cd python # To build python module in parallel -python setup.py build_ext -j 16 --inplace +python setup.py build_ext -j 16 --inplace # 16 is the number of CPUthat are used to compile the python module. Can be any other value. firefox sphinx/index.html # [optional] To display the python documentation. Anything else than firefox can be used. ``` \ No newline at end of file -- cgit v1.2.3 From b440e2b6e61bd81dac8f887a7cdac55e7daa2940 Mon Sep 17 00:00:00 2001 From: Vincent Rouvreau Date: Mon, 23 May 2022 12:13:01 +0200 Subject: doc review: remove wrong comment --- .github/how_to_compile_gudhi_in_a_conda_env.md | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/how_to_compile_gudhi_in_a_conda_env.md b/.github/how_to_compile_gudhi_in_a_conda_env.md index 533d0fd2..0d677c1f 100644 --- a/.github/how_to_compile_gudhi_in_a_conda_env.md +++ b/.github/how_to_compile_gudhi_in_a_conda_env.md @@ -40,7 +40,6 @@ In order to compile only python module cd /workdir/gudhi rm -rf build; mkdir build # /!\ any existing build folder will be removed cd build -# To build all even examples and benchmarks cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$CONDA_PREFIX .. cd src/python # To build python module in parallel -- cgit v1.2.3 From d792eaf38ac91453a9a214285716d162b8eb74e2 Mon Sep 17 00:00:00 2001 From: Vincent Rouvreau <10407034+VincentRouvreau@users.noreply.github.com> Date: Thu, 9 Jun 2022 08:55:24 +0200 Subject: [skip ci] code review: Update .github/how_to_compile_gudhi_in_a_conda_env.md Co-authored-by: Hind-M <70631848+Hind-M@users.noreply.github.com> --- .github/how_to_compile_gudhi_in_a_conda_env.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/how_to_compile_gudhi_in_a_conda_env.md b/.github/how_to_compile_gudhi_in_a_conda_env.md index 0d677c1f..bc75cc60 100644 --- a/.github/how_to_compile_gudhi_in_a_conda_env.md +++ b/.github/how_to_compile_gudhi_in_a_conda_env.md @@ -78,7 +78,7 @@ firefox html/index.html # [optional] To display the c++ documentation. Anything cd /workdir/gudhi rm -rf build; mkdir build # /!\ any existing build folder will be removed cd build -# python OFF to prevent python modules search makes cmake faster - it is the next one in user version that matters +# python OFF to prevent python modules search makes cmake faster - it is the next cmake call in user version that matters cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DWITH_GUDHI_PYTHON=OFF -DUSER_VERSION_DIR=version .. make user_version; cd version -- cgit v1.2.3 From 88f2ec40c0e879010dfb562054b99bd253787922 Mon Sep 17 00:00:00 2001 From: Vincent Rouvreau <10407034+VincentRouvreau@users.noreply.github.com> Date: Thu, 9 Jun 2022 08:56:38 +0200 Subject: [skip ci] doc review: Update .github/how_to_compile_gudhi_in_a_conda_env.md Co-authored-by: Hind-M <70631848+Hind-M@users.noreply.github.com> --- .github/how_to_compile_gudhi_in_a_conda_env.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/how_to_compile_gudhi_in_a_conda_env.md b/.github/how_to_compile_gudhi_in_a_conda_env.md index bc75cc60..4bd4e828 100644 --- a/.github/how_to_compile_gudhi_in_a_conda_env.md +++ b/.github/how_to_compile_gudhi_in_a_conda_env.md @@ -43,7 +43,7 @@ cd build cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$CONDA_PREFIX .. cd src/python # To build python module in parallel -python setup.py build_ext -j 16 --inplace # 16 is the number of CPUthat are used to compile the python module. Can be any other value. +python setup.py build_ext -j 16 --inplace # 16 is the number of CPU that are used to compile the python module. Can be any other value. # to clean the build # python setup.py clean --all ``` -- cgit v1.2.3 From 09a412d9c444666889c335fef592753df49125d3 Mon Sep 17 00:00:00 2001 From: Vincent Rouvreau <10407034+VincentRouvreau@users.noreply.github.com> Date: Thu, 9 Jun 2022 08:57:03 +0200 Subject: [skip ci] doc review: Update .github/how_to_compile_gudhi_in_a_conda_env.md Co-authored-by: Hind-M <70631848+Hind-M@users.noreply.github.com> --- .github/how_to_compile_gudhi_in_a_conda_env.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/how_to_compile_gudhi_in_a_conda_env.md b/.github/how_to_compile_gudhi_in_a_conda_env.md index 4bd4e828..d55f53f1 100644 --- a/.github/how_to_compile_gudhi_in_a_conda_env.md +++ b/.github/how_to_compile_gudhi_in_a_conda_env.md @@ -87,6 +87,6 @@ cd build cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$CONDA_PREFIX .. cd python # To build python module in parallel -python setup.py build_ext -j 16 --inplace # 16 is the number of CPUthat are used to compile the python module. Can be any other value. +python setup.py build_ext -j 16 --inplace # 16 is the number of CPU that are used to compile the python module. Can be any other value. firefox sphinx/index.html # [optional] To display the python documentation. Anything else than firefox can be used. ``` \ No newline at end of file -- cgit v1.2.3 From 5839625a253fbb54b40205da1a3e2811b29a1be2 Mon Sep 17 00:00:00 2001 From: Vincent Rouvreau Date: Thu, 9 Jun 2022 09:06:21 +0200 Subject: [skip ci] doc review: rename the repository gudhi-devel, precise how to clone and init submodules --- .github/how_to_compile_gudhi_in_a_conda_env.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/how_to_compile_gudhi_in_a_conda_env.md b/.github/how_to_compile_gudhi_in_a_conda_env.md index d55f53f1..fc9b37a8 100644 --- a/.github/how_to_compile_gudhi_in_a_conda_env.md +++ b/.github/how_to_compile_gudhi_in_a_conda_env.md @@ -15,7 +15,8 @@ mamba install -c conda-forge python cmake doxygen eigen cgal-cpp Some of the requirements are in the gudhi repository (please refer to [how to use github to contribute to gudhi](how_to_use_github_to_contribute_to_gudhi.md)). -In the gudhi repository - let's call it `/workdir/gudhi` i.e. - once submodules are initialised: +Once the gudhi-devel repository is cloned on your machine (`git clone...`) - let's call it `/workdir/gudhi-devel` i.e. - +and once the submodules are initialised (`git submodule update --init`): ```bash pip install -r ext/gudhi-deploy/build-requirements.txt @@ -26,7 +27,7 @@ pip install -r ext/gudhi-deploy/test-requirements.txt # pytorch can be painful In order to compile all c++ utilities, examples, benchmarks, unitary tests, and python module: ```bash -cd /workdir/gudhi +cd /workdir/gudhi-devel rm -rf build; mkdir build # /!\ any existing build folder will be removed cd build # To build all even examples and benchmarks @@ -37,7 +38,7 @@ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DWITH_GUDHI_ In order to compile only python module ```bash -cd /workdir/gudhi +cd /workdir/gudhi-devel rm -rf build; mkdir build # /!\ any existing build folder will be removed cd build cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$CONDA_PREFIX .. @@ -50,13 +51,13 @@ python setup.py build_ext -j 16 --inplace # 16 is the number of CPU that are us In order to use freshly compiled gudhi python module: ```bash -PYTHONPATH=/workdir/gudhi/build/src/python python # or ipython, jupyter, ... +PYTHONPATH=/workdir/gudhi-devel/build/src/python python # or ipython, jupyter, ... ``` ### Specific C++ documentation generation ```bash -cd /workdir/gudhi +cd /workdir/gudhi-devel rm -rf build; mkdir build # /!\ any existing build folder will be removed cd build # python OFF to prevent python modules search makes cmake faster @@ -75,7 +76,7 @@ firefox html/index.html # [optional] To display the c++ documentation. Anything ### Specific python documentation generation ```bash -cd /workdir/gudhi +cd /workdir/gudhi-devel rm -rf build; mkdir build # /!\ any existing build folder will be removed cd build # python OFF to prevent python modules search makes cmake faster - it is the next cmake call in user version that matters -- cgit v1.2.3 From 88573b11c3cb7b65fc0f716054d7258e73d9beaf Mon Sep 17 00:00:00 2001 From: Vincent Rouvreau Date: Thu, 9 Jun 2022 10:11:11 +0200 Subject: [skip ci] doc review: rename the repository gudhi-devel --- .github/how_to_compile_gudhi_in_a_conda_env.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/how_to_compile_gudhi_in_a_conda_env.md b/.github/how_to_compile_gudhi_in_a_conda_env.md index fc9b37a8..4acfca2e 100644 --- a/.github/how_to_compile_gudhi_in_a_conda_env.md +++ b/.github/how_to_compile_gudhi_in_a_conda_env.md @@ -13,7 +13,7 @@ conda activate gudhi mamba install -c conda-forge python cmake doxygen eigen cgal-cpp ``` -Some of the requirements are in the gudhi repository (please refer to +Some of the requirements are in the gudhi-devel repository (please refer to [how to use github to contribute to gudhi](how_to_use_github_to_contribute_to_gudhi.md)). Once the gudhi-devel repository is cloned on your machine (`git clone...`) - let's call it `/workdir/gudhi-devel` i.e. - and once the submodules are initialised (`git submodule update --init`): -- cgit v1.2.3