Skip to content

Commit

Permalink
consolidate wheel libraries under /opt/nrnwheel
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsavulescu committed Mar 15, 2023
1 parent 23c7337 commit 5a8a813
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
docker run --rm \
-w /root/nrn \
-v $PWD:/root/nrn \
-v /opt/nrnwheel/mpt:/nrnwheel/mpt \
-v /opt/nrnwheel/mpt:/opt/nrnwheel/mpt \
-e NEURON_NIGHTLY_TAG \
-e NRN_NIGHTLY_UPLOAD \
-e NRN_RELEASE_UPLOAD \
Expand Down
8 changes: 4 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ stages:
inputs:
secureFile: 'mpt_headears.2.21.tar.gz'

# Note that mpt headers must be mounted in the docker imager under `/nrnwheel/mpt`
# Note that mpt headers must be mounted in the docker imager under `/opt/nrnwheel/mpt`
# This path is checked by `packaging/python/build_wheels.bash` when run in the image.
- script: |
sudo mkdir -p /opt/nrnwheel/mpt
sudo tar -zxf $(mpt_headersSF.secureFilePath) --directory /opt/nrnwheel/mpt
docker run --rm \
-w /root/nrn \
-v $PWD:/root/nrn \
-v /opt/nrnwheel/mpt:/nrnwheel/mpt \
-v /opt/nrnwheel/mpt:/opt/nrnwheel/mpt \
-e NEURON_NIGHTLY_TAG \
-e NRN_NIGHTLY_UPLOAD \
-e NRN_RELEASE_UPLOAD \
Expand Down Expand Up @@ -106,15 +106,15 @@ stages:
inputs:
secureFile: 'mpt_headears.2.21.tar.gz'

# Note that mpt headers must be mounted in the docker imager under `/nrnwheel/mpt`
# Note that mpt headers must be mounted in the docker imager under `/opt/nrnwheel/mpt`
# This path is checked by `packaging/python/build_wheels.bash` when run in the image.
- script: |
sudo mkdir -p /opt/nrnwheel/mpt
sudo tar -zxf $(mpt_headersSF.secureFilePath) --directory /opt/nrnwheel/mpt
docker run --rm \
-w /root/nrn \
-v $PWD:/root/nrn \
-v /opt/nrnwheel/mpt:/nrnwheel/mpt \
-v /opt/nrnwheel/mpt:/opt/nrnwheel/mpt \
-e NEURON_NIGHTLY_TAG \
-e NRN_NIGHTLY_UPLOAD \
-e NRN_RELEASE_UPLOAD \
Expand Down
4 changes: 2 additions & 2 deletions cmake/CMakeListsNrnMech.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ foreach(link_lib ${NRN_LINK_LIBS})
set(link_flag "-l${link_lib}")
set(description
"Generating link flags from name '${link_lib}', beware that this can be fragile.")
# avoid library paths from special directory /nrnwheel which used to build wheels under docker
# avoid library paths from special directory /opt/nrnwheel which used to build wheels under docker
# container
elseif("${dir_path}" MATCHES "^/nrnwheel")
elseif("${dir_path}" MATCHES "^/opt/nrnwheel")
continue()
elseif("${dir_path}" MATCHES "^(/lib|/lib64|/usr/lib|/usr/lib64)$")
# NAME_WLE not avaialble with CMake version < 3.14
Expand Down
4 changes: 2 additions & 2 deletions docs/install/python_wheels.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ The `neuronsimulator/neuron_wheel` provides out-of-the-box support for `mpich` a
For `HPE-MPT MPI`, since it's not open source, you need to acquire the headers and mount them in the docker image:

```
docker run -v $PWD/nrn:/root/nrn -w /root/nrn -v $PWD/mpt-headers/2.21/include:/nrnwheel/mpt/include -it neuronsimulator/neuron_wheel bash
docker run -v $PWD/nrn:/root/nrn -w /root/nrn -v $PWD/mpt-headers/2.21/include:/opt/nrnwheel/mpt/include -it neuronsimulator/neuron_wheel bash
```
where `$PWD/mpt-headers` is the path to the HPE-MPT MPI headers on the host machine that end up mounted at `/nrnwheel/mpt/include`.
where `$PWD/mpt-headers` is the path to the HPE-MPT MPI headers on the host machine that end up mounted at `/opt/nrnwheel/mpt/include`.
You can download the headers with:

```
Expand Down
14 changes: 7 additions & 7 deletions packaging/python/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,39 +40,39 @@ RUN rpmbuild --rebuild https://vault.centos.org/8-stream/AppStream/Source/SPacka
RUN wget http://ftpmirror.gnu.org/ncurses/ncurses-6.2.tar.gz \
&& tar -xvzf ncurses-6.2.tar.gz \
&& cd ncurses-6.2 \
&& ./configure --prefix=/nrnwheel/ncurses --without-shared CFLAGS="-fPIC" \
&& ./configure --prefix=/opt/nrnwheel/ncurses --without-shared CFLAGS="-fPIC" \
&& make -j install

RUN curl -L -o mpich-3.3.2.tar.gz http://www.mpich.org/static/downloads/3.3.2/mpich-3.3.2.tar.gz \
&& tar -xvzf mpich-3.3.2.tar.gz \
&& cd mpich-3.3.2 \
&& ./configure --disable-fortran --prefix=/nrnwheel/mpich \
&& ./configure --disable-fortran --prefix=/opt/nrnwheel/mpich \
&& make -j install

RUN curl -L -o openmpi-4.0.3.tar.gz https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.3.tar.gz \
&& tar -xvzf openmpi-4.0.3.tar.gz \
&& cd openmpi-4.0.3 \
&& ./configure --prefix=/nrnwheel/openmpi \
&& ./configure --prefix=/opt/nrnwheel/openmpi \
&& make -j install

ENV PATH /nrnwheel/openmpi/bin:$PATH
ENV PATH /opt/nrnwheel/openmpi/bin:$PATH

RUN curl -L -o MUSIC.zip https://github.com/INCF/MUSIC/archive/refs/tags/1.2.0.zip \
&& unzip MUSIC.zip \
&& mv MUSIC-* MUSIC \
&& cd MUSIC \
&& ./autogen.sh \
&& ./configure --prefix=/nrnwheel/MUSIC --with-python-sys-prefix --disable-anysource \
&& ./configure --prefix=/opt/nrnwheel/MUSIC --with-python-sys-prefix --disable-anysource \
&& make -j install

RUN curl -L -o readline-7.0.tar.gz https://ftp.gnu.org/gnu/readline/readline-7.0.tar.gz \
&& tar -xvzf readline-7.0.tar.gz \
&& cd readline-7.0 \
&& ./configure --prefix=/nrnwheel/readline --disable-shared CFLAGS="-fPIC" \
&& ./configure --prefix=/opt/nrnwheel/readline --disable-shared CFLAGS="-fPIC" \
&& make -j install

# create readline with ncurses
RUN cd /nrnwheel/readline/lib \
RUN cd /opt/nrnwheel/readline/lib \
&& ar -x libreadline.a \
&& ar -x ../../ncurses/lib/libncurses.a \
&& ar cq libreadline.a *.o \
Expand Down
6 changes: 3 additions & 3 deletions packaging/python/build_wheels.bash
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ build_wheel_linux() {
# Workaround for https://github.com/pypa/manylinux/issues/1309
git config --global --add safe.directory "*"

python setup.py build_ext --cmake-prefix="/nrnwheel/ncurses;/nrnwheel/readline;/nrnwheel/MUSIC" --cmake-defs="$CMAKE_DEFS" $setup_args bdist_wheel
python setup.py build_ext --cmake-prefix="/opt/nrnwheel/ncurses;/opt/nrnwheel/readline;/opt/nrnwheel/MUSIC" --cmake-defs="$CMAKE_DEFS" $setup_args bdist_wheel

# For CI runs we skip wheelhouse repairs
if [ "$SKIP_WHEELHOUSE_REPAIR" = true ] ; then
Expand Down Expand Up @@ -208,9 +208,9 @@ coreneuron=$3
case "$1" in

linux)
MPI_INCLUDE_HEADERS="/nrnwheel/openmpi/include;/nrnwheel/mpich/include"
MPI_INCLUDE_HEADERS="/opt/nrnwheel/openmpi/include;/opt/nrnwheel/mpich/include"
# Check for MPT headers. On Azure, we extract them from a secure file and mount them in the docker image in:
MPT_INCLUDE_PATH="/nrnwheel/mpt/include"
MPT_INCLUDE_PATH="/opt/nrnwheel/mpt/include"
if [ -d "$MPT_INCLUDE_PATH" ]; then
MPI_INCLUDE_HEADERS="${MPI_INCLUDE_HEADERS};${MPT_INCLUDE_PATH}"
fi
Expand Down
4 changes: 2 additions & 2 deletions packaging/python/test_wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ run_mpi_test () {
fi

# test MUSIC if enabled
if [[ "$has_music" == "true" ]] && [[ $mpi_name == *"OpenMPI"* || $mpi_name == *"MPICH"* ]]; then
export MUSIC_LIBDIR=/nrnwheel/MUSIC/lib
if [[ "$has_music" == "true" ]] && [[ $mpi_name == *"OpenMPI"* || $mpi_name == *"MPICHz"* ]]; then
export MUSIC_LIBDIR=/opt/nrnwheel/MUSIC/lib
$python_exe test/music_tests/runtests.py
fi

Expand Down
4 changes: 2 additions & 2 deletions test/music_tests/runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ def run(cmd):
name = musicpath + "/lib/libmusic." + suffix
if exists(name):
break
os.environ["NRN_LIBMUSIC_PATH"] = name
print("NRN_LIBMUSIC_PATH={}".format(os.getenv("NRN_LIBMUSIC_PATH")))
my_env["NRN_LIBMUSIC_PATH"] = name
print("NRN_LIBMUSIC_PATH={}".format(my_env["NRN_LIBMUSIC_PATH"]))

out2 = "numprocs=1\nRank 0: Event (0, 0.001175) detected at 0\nRank 0: Event (0, 0.013825) detected at 0\n"

Expand Down

0 comments on commit 5a8a813

Please sign in to comment.