Skip to content

Commit

Permalink
Update build_install.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
ErbB4 authored Aug 1, 2024
1 parent 9f1dd8a commit 5d49698
Showing 1 changed file with 42 additions and 64 deletions.
106 changes: 42 additions & 64 deletions doc/install/build_install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <site-packages>
Replace <site-packages> 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 <site-packages> with the path you get in the previous operation before ‘/numpy’
cp -r ~/miniconda3/envs/arbor_test/src/arbor/build/python/arbor <site-packages>
#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

0 comments on commit 5d49698

Please sign in to comment.