Skip to content
Snippets Groups Projects
Unverified Commit ff5d2352 authored by Han Lu's avatar Han Lu Committed by GitHub
Browse files

Update build_install.rst (#2379)

<!-- Please make sure your PR follows our [contribution
guidelines](https://github.com/arbor-sim/arbor/tree/master/doc/contrib)
and agree to the terms outlined in the [PR
procedure](https://github.com/arbor-sim/arbor/tree/master/doc/contrib/pr.rst).
-->
parent 9f1dd8a1
No related branches found
No related tags found
No related merge requests found
...@@ -969,71 +969,49 @@ If you hope to install Arbor from source in a virtual environment in order not t ...@@ -969,71 +969,49 @@ If you hope to install Arbor from source in a virtual environment in order not t
.. code-block:: bash .. code-block:: bash
#create a virtual environment #create a virtual environment
conda create --name arbor_test
conda create --name arbor_test conda activate arbor_test
conda activate arbor_test
#go to the folder and clone the Arbor source package from GitHub
cd ~/miniconda3/envs/arbor_test/
#go to the folder and clone the Arbor source package from GitHub mkdir src
cd src
cd ~/miniconda3/envs/arbor_test/ git clone https://github.com/arbor-sim/arbor.git --recurse-submodules
mkdir src
cd src #install python and numpy in this environment
git clone https://github.com/arbor-sim/arbor.git --recurse-submodules conda install python=3.12.2
conda install numpy
#install python and numpy in this environment #start the build
cd arbor
conda install python=3.12.2 mkdir build
conda install numpy 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
#start the build #activate ninja to install
ninja
cd arbor sudo ninja install
mkdir build
cd build #correct the path to the site packages and the libc files
#first request the right Python site package path
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 python -c 'import numpy; print(numpy.__path__)'
#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.
python #load the right path to the one used for installing
import arbor #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 #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:
python conda activate arbor_test
>>>import arbor python
>>>import arbor
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment