From 5d496986cd100000aa780e19b6748a600e2ddc47 Mon Sep 17 00:00:00 2001 From: Han Lu <11597940+ErbB4@users.noreply.github.com> Date: Thu, 1 Aug 2024 16:35:25 +0200 Subject: [PATCH] Update build_install.rst --- doc/install/build_install.rst | 106 ++++++++++++++-------------------- 1 file changed, 42 insertions(+), 64 deletions(-) diff --git a/doc/install/build_install.rst b/doc/install/build_install.rst index 3ed4a15d2d..cd6850df3b 100644 --- a/doc/install/build_install.rst +++ b/doc/install/build_install.rst @@ -969,71 +969,49 @@ If you hope to install Arbor from source in a virtual environment in order not t .. code-block:: bash -#create a virtual environment - -conda create --name arbor_test -conda activate arbor_test - - -#go to the folder and clone the Arbor source package from GitHub - -cd ~/miniconda3/envs/arbor_test/ -mkdir src -cd src -git clone https://github.com/arbor-sim/arbor.git --recurse-submodules - - -#install python and numpy in this environment - -conda install python=3.12.2 -conda install numpy - - -#start the build - -cd arbor -mkdir build -cd build - -cmake .. -GNinja -DCMAKE_CXX_COMPILER=$(which g++) -DCMAKE_C_COMPILER=$(which gcc) -DARB_WITH_PYTHON=ON -DARB_VECTORIZE=ON -DPython3_EXECUTABLE=$(which python3) -DARB_USE_BUNDLED_LIBS=ON - - -#activate ninja to install - -ninja -sudo ninja install - - -#correct the path to the site packages and the libc files -#first request the right Python site package path - -python -c 'import numpy; print(numpy.__path__)' - -#load the right path to the one used for installing - -cp -r ~/miniconda3/envs/arbor_test/src/arbor/build/python/arbor -Replace with the path you get in the previous operation before ‘/numpy’ - -#redirect the libc files such that the miniconda environment can access it - -ln -sf /lib/x86_64-linux-gnu/libstdc++.so.6 ~/miniconda3/envs/arbor_test/bin/../lib/libstdc++.so.6 - - -#go to any working directory to try if you successfully installed arbor, by starting python and importing arbor. - -One thing to add here could be testing for the version, i.e. - -python -c 'import arbor; print(arbor.__version__)' - -should work without errors and print something like 0.91-dev. - + #create a virtual environment + conda create --name arbor_test + conda activate arbor_test + + #go to the folder and clone the Arbor source package from GitHub + cd ~/miniconda3/envs/arbor_test/ + mkdir src + cd src + git clone https://github.com/arbor-sim/arbor.git --recurse-submodules + + #install python and numpy in this environment + conda install python=3.12.2 + conda install numpy + + #start the build + cd arbor + mkdir build + cd build + cmake .. -GNinja -DCMAKE_CXX_COMPILER=$(which g++) -DCMAKE_C_COMPILER=$(which gcc) -DARB_WITH_PYTHON=ON -DARB_VECTORIZE=ON -DPython3_EXECUTABLE=$(which python3) -DARB_USE_BUNDLED_LIBS=ON + + #activate ninja to install + ninja + sudo ninja install + + #correct the path to the site packages and the libc files + #first request the right Python site package path + python -c 'import numpy; print(numpy.__path__)' -python -import arbor + #load the right path to the one used for installing + #replace with the path you get in the previous operation before ‘/numpy’ + cp -r ~/miniconda3/envs/arbor_test/src/arbor/build/python/arbor + + #redirect the libc files such that the miniconda environment can access it + ln -sf /lib/x86_64-linux-gnu/libstdc++.so.6 ~/miniconda3/envs/arbor_test/bin/../lib/libstdc++.so.6 + + #go to any working directory to try if you successfully installed arbor, by starting python and importing arbor. + #one thing to add here could be testing for the version, i.e., + python -c 'import arbor; print(arbor.__version__)' + #should work without errors and print something like 0.91-dev. -#then deactivate the environment if no more actions are planned. In the future, always first activate the virtual environment with and then use arbor in this environment with: -conda activate arbor_test -python ->>>import arbor + #then deactivate the environment if no more actions are planned. In the future, always first activate the virtual environment with and then use arbor in this environment with: + conda activate arbor_test + python + >>>import arbor