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

Remove certain CLI args from setup.py #3345

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
-e SETUPTOOLS_SCM_PRETEND_VERSION \
-e NRN_BUILD_FOR_UPLOAD=1 \
'docker.io/neuronsimulator/neuron_wheel:manylinux_2_28_aarch64' \
packaging/python/build_wheels.bash linux 3<< parameters.NRN_PYTHON_VERSION_MINOR >> coreneuron
packaging/python/build_wheels.bash $(uname -s) 3<< parameters.NRN_PYTHON_VERSION_MINOR >> coreneuron

- store_artifacts:
path: ./wheelhouse
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/neuron-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ jobs:
echo CMAKE_BUILD_PARALLEL_LEVEL=3 >> $GITHUB_ENV
echo CTEST_PARALLEL_LEVEL=3 >> $GITHUB_ENV
fi
echo CI_OS_NAME=osx >> $GITHUB_ENV
echo CI_OS_NAME=$(uname -s) >> $GITHUB_ENV
shell: bash

- name: Install apt packages
Expand All @@ -152,7 +152,7 @@ jobs:
# Core https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
echo CMAKE_BUILD_PARALLEL_LEVEL=4 >> $GITHUB_ENV
echo CTEST_PARALLEL_LEVEL=4 >> $GITHUB_ENV
echo CI_OS_NAME=linux >> $GITHUB_ENV
echo CI_OS_NAME=$(uname -s) >> $GITHUB_ENV
shell: bash

- uses: actions/checkout@v4
Expand Down Expand Up @@ -430,8 +430,8 @@ jobs:
BUILD_MODE: ${{ matrix.config.build_mode }}
CCACHE_BASEDIR: ${{runner.workspace}}/nrn
CCACHE_DIR: ${{runner.workspace}}/ccache
NRN_ENABLE_PYTHON_DYNAMIC : ${{ matrix.config.python_dynamic }}
NRN_ENABLE_MUSIC: ${{ matrix.config.music }}
NRN_ENABLE_PYTHON_DYNAMIC : ${{ matrix.config.python_dynamic || 'OFF' }}
NRN_ENABLE_MUSIC: ${{ matrix.config.music || 'OFF' }}
PYTHON_MIN_NAME: "python${{ env.PY_MIN_VERSION }}"
PYTHON_MAX_NAME: "python${{ env.PY_MAX_VERSION }}"
INSTALL_DIR : ${{ runner.workspace }}/install
Expand Down
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ stages:
-e SETUPTOOLS_SCM_PRETEND_VERSION \
-e NRN_BUILD_FOR_UPLOAD=1 \
'docker.io/neuronsimulator/neuron_wheel:manylinux_2_28_x86_64' \
packaging/python/build_wheels.bash linux $(python.version) coreneuron
packaging/python/build_wheels.bash $(uname -s) $(python.version) coreneuron
displayName: 'Building ManyLinux Wheel'

- script: |
Expand Down Expand Up @@ -151,7 +151,7 @@ stages:
export NRN_BUILD_FOR_UPLOAD=1
sudo mkdir -p /opt/nrnwheel/$(uname -m)
sudo tar -zxf $(readlineSF.secureFilePath) --directory /opt/nrnwheel/$(uname -m)
packaging/python/build_wheels.bash osx $(python.version) coreneuron
packaging/python/build_wheels.bash $(uname -s) $(python.version) coreneuron
displayName: 'Build MacOS Wheel'

- template: ci/azure-wheel-test-upload.yml
Expand Down
6 changes: 3 additions & 3 deletions build_osx_wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ fi

set -e

packaging/python/build_wheels.bash osx 3.9 coreneuron &>3.9-output
packaging/python/build_wheels.bash osx 3.10 coreneuron &>3.10-output
packaging/python/build_wheels.bash osx 3.11 coreneuron &>3.11-output
packaging/python/build_wheels.bash "$(uname -s)" 3.9 coreneuron &>3.9-output
packaging/python/build_wheels.bash "$(uname -s)" 3.10 coreneuron &>3.10-output
packaging/python/build_wheels.bash "$(uname -s)" 3.11 coreneuron &>3.11-output

if [ -n $INTERACTIVE_OK ]
then
Expand Down
26 changes: 16 additions & 10 deletions docs/dev/setuptools/setuptools.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,28 @@ We use [setup.py](../../../setup.py) in two operational modes
## Creating a Development Python Package

`setup.py` can be lanched manually as well to create a dev build package, which can be tested
immediately. It supports several arguments to that the build can be tuned:
immediately. It supports several environmental variables through which the build can be tuned:

```
--disable-rx3d Disables Rx3d. Implies CMake -DNRN_ENABLE_RX3D=OFF
--disable-iv Disables IV. Implies CMake -DNRN_ENABLE_INTERVIEWS=OFF
--disable-mpi Disables MPI. Implies -DNRN_ENABLE_MPI=OFF and disabling of neuronmusic
--enable-music Enables neuronmusic
--enable-coreneuron Enables experimental CorenNeuron support
--rx3d-opt-level Sets the rx3d optimization level. Default: 0 (-O0)
--cmake-build-dir Declares one wants to use a specic NEURON build (with CMake), instead
of creating one behind the scenes. Only builds extensions and package.
NRN_ENABLE_RX3D Enables RX3D.
NRN_ENABLE_INTERVIEWS Enables IV.
NRN_ENABLE_MPI Enables MPI.
NRN_ENABLE_MUSIC Enables neuronmusic
NRN_ENABLE_CORENEURON Enables experimental CorenNeuron support
NRN_RX3D_OPT_LEVEL Sets the RX3D optimization level. Default: 0 (-O0)
```

It also supports certain command-line arguments:

```
--cmake-build-dir Declares one wants to use a specic NEURON build (with CMake), instead
of creating one behind the scenes. Only builds extensions and package.
```

A quick build for testing a change to a core component could therefore be:

```
python setup.py build --disable-rx3d --disable-iv --disable-mpi
NRN_ENABLE_RX3D=OFF NRN_ENABLE_INTERVIEWS=OFF NRN_ENABLE_MPI=OFF python setup.py build
```

---
Expand Down
8 changes: 4 additions & 4 deletions docs/install/python_wheels.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,18 +136,18 @@ Wheels are generated under `/root/nrn/wheelhouse` and also accessible in the mou

```
# Working directory is /root/nrn
bash packaging/python/build_wheels.bash linux
bash packaging/python/build_wheels.bash Linux
ls -la wheelhouse
```

You can build the wheel for a specific python version:
```
bash packaging/python/build_wheels.bash linux 39 # 39 for Python v3.9
bash packaging/python/build_wheels.bash Linux 39 # 39 for Python v3.9
```

To build wheels with CoreNEURON support you have to pass an additional argument: `coreneuron`.
```
bash packaging/python/build_wheels.bash linux 3* coreneuron
bash packaging/python/build_wheels.bash Linux 3* coreneuron
```
Where we are passing `3*` to build the wheels with `CoreNEURON` support for all python 3 versions.

Expand All @@ -158,7 +158,7 @@ As mentioned above, for macOS all dependencies have to be available on a system.

```
cd nrn
bash packaging/python/build_wheels.bash osx
bash packaging/python/build_wheels.bash Darwin
```

In some cases, setuptools-scm will see extra commits and consider your build as "dirty," resulting in filenames such as `NEURON-9.0a1.dev0+g9a96a3a4d.d20230717-cp310-cp310-macosx_11_0_arm64.whl` (which should have been `NEURON-9.0a0-cp310-cp310-macosx_11_0_arm64.whl`). If this happens, you can set an environment variable to correct this behavior:
Expand Down
Loading
Loading