Skip to content
Snippets Groups Projects

feat(neuron): Use default install path for Python libs

Merged Eric Müller requested to merge feat_neuron_stdpylibpath into master
1 unresolved thread

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Eric Müller added 1 commit

    added 1 commit

    • 353447a4 - feat(neuron): Use default install path for Python libs

    Compare with previous version

  • looks good, thx! the ci job failing was unrelated, the py-tvb-multiscale issue is already fixed on master.

  • Eleni Mathioulaki resolved all threads

    resolved all threads

  • Eleni Mathioulaki marked this merge request as ready

    marked this merge request as ready

  • Author Maintainer

    I think something along these lines is still needed for the +coreneuron variant installation… however, it's not yet working (${Python_SITEARCH} provides an absolute path to the underlying Python, i.e. some opt/spack/…/python3.8…-hash/lib/python3.8/site-packages/… → I read about some magic happening when the prefix is specified, but not no success yet.)

    @@ -142,7 +142,7 @@ endif()                                                                                                                                                                    
     # Install package files that were created in build (e.g. .py.in)                                                                                                                              
     install(                                                                                                                                                                                      
       DIRECTORY ${PROJECT_BINARY_DIR}/share/lib/python                                                                                                                                            
    -  DESTINATION ${NRN_LIBDIR}                                                                                                                                                                   
    +  DESTINATION ${CMAKE_INSTALL_PREFIX}/${Python_SITEARCH}                                                                                                                                      
       FILES_MATCHING                                                                                                                                                                              
       PATTERN *.py                                                                                                                                                                                
       PATTERN *.so
  • Eric Müller added 1 commit

    added 1 commit

    • fad07738 - feat(neuron): Use default install path for Python libs

    Compare with previous version

  • Author Maintainer

    Now it looks like:

    lib/libcoreneuron.so
    lib/libcorenrnmech.so
    lib/libnrniv.so
    lib/librxdmath.so
    lib/libscopmath.a
    lib/python3.8/site-packages/NEURON-8.2.3-py3.8.egg-info
    lib/python3.8/site-packages/neuron/… # lots of python files
    lib/python3.8/site-packages/neuron/hoc.cpython-38-x86_64-linux-gnu.so
    lib/python3.8/site-packages/neuron/rxd/geometry3d/graphicsPrimitives.cpython-38-x86_64-linux-gnu.so
    lib/python3.8/site-packages/neuron/rxd/geometry3d/surfaces.cpython-38-x86_64-linux-gnu.so
    lib/python3.8/site-packages/neuron/rxd/geometry3d/ctng.cpython-38-x86_64-linux-gnu.so
  • hmm.. now it's just

    -- Installing: /builds/.../neuron-8.2.3-6lzi7pc57yh7swndm2yqduxc3ukdzko3//mnt/spack_v0.19.2/spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-10.3.0/python-3.8.11-nyq5bpavmemjaumb2d2xtuichitaaptd/lib/python3.8/site-packages/python/neuron/rxd

    instead of

    -- Installing: /builds/.../neuron-8.2.3-ihk6gmbejczrdhizm7zmcdg66rr23b53/lib/python/neuron/rxd

    anyway, you're right, it's just build-time stuff.. I think the first patch was fine

    Edited by Eleni Mathioulaki
    • OK, I finally had a look at this.

      Just fixing NRN_MODULE_INSTALL_OPTIONS as you initially tried works fine: all the python modules/libraries are correctly installed in {prefix}/lib/python3.8/site-packages/neuron. There is still a {prefix}/lib/python/neuron, but it only contains a setup.py and some empty dirs:

      $ tree -pl lib/python
      lib/python
      └── [drwxr-sr-x]  neuron
          └── [drwxr-sr-x]  rxd
              └── [drwxr-sr-x]  geometry3d
                  ├── [drwxr-sr-x]  build
                  │   └── [drwxr-sr-x]  temp.linux-x86_64-3.10
                  │       └── [drwxr-sr-x]  scratch_local
                  │           └── [drwxr-sr-x]  emathiou
                  │               └── [drwxr-sr-x]  spack-stage
                  │                   └── [drwxr-sr-x]  spack-stage-neuron-8.2.3-i4b2htcob3neog3o5wd42i6pftsnphbw
                  │                       └── [drwxr-sr-x]  spack-src
                  │                           └── [drwxr-sr-x]  src
                  │                               └── [drwxr-sr-x]  nrnpython
                  ├── [drwxr-sr-x]  CMakeFiles
                  │   ├── [drwxr-sr-x]  rx3d.dir
                  │   ├── [drwxr-sr-x]  rx3dextensions_0.dir
                  │   └── [drwxr-sr-x]  rxd_cython_generated.dir
                  └── [-rw-r--r--]  setup.py
      
      16 directories, 1 file

      I think that bit is why this happens: setup.py matches *.py and the empty directories being installed are apparently a CMake thing. So I guess we could patch CMakeLists.txt to avoid that, but it's not necessary - it's just a useless extra dir.

      The longer patch just creates the same python/neuron/rxd/geometry3d dir in {prefix}//mnt/spack_v0.19.2/spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-10.3.0/python-3.8.11-nyq5bpavmemjaumb2d2xtuichitaaptd/lib/python3.8/site-packages/python/ instead: like you wrote in the comment above, ${Python_SITEARCH} is the absolute path to python - so it doesn't really work.

      So I suggest we go back to the first option. Is that OK? Am I missing sth?

    • Author Maintainer

      Yeah, sure… I didn't have time to follow up on the rel/abs-dir path magic that should somehow be possible to use — and I somehow thought that it worked for me, but whatever ;). ⇒ should I force-push to the old state?

    • yup, sure :) thx!

    • Author Maintainer

      I begged some people to review my changes (they are technically "green" now in our internal CI) → @pspilger :pray:.

    • ah you mean the install path for your packages? great, thx!!

      (the ping was mostly for this MR, for neuron, but even better :))

    • Author Maintainer

      Sorry, I was a bit too busy when reading it :grimacing: → pushing old state now, and rebasing.

      Edited by Eric Müller
    • Please register or sign in to reply
  • Eric Müller added 1 commit

    added 1 commit

    • 353447a4 - feat(neuron): Use default install path for Python libs

    Compare with previous version

  • Eric Müller added 137 commits

    added 137 commits

    Compare with previous version

  • mentioned in commit b987335a

  • Eleni Mathioulaki mentioned in merge request !621

    mentioned in merge request !621

  • Please register or sign in to reply