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

Windows build and NeuroML2 support #485

Closed
wants to merge 60 commits into from

Conversation

subhacom
Copy link
Collaborator

@subhacom subhacom commented Sep 3, 2024

This branch has a set of major overhauls:

  1. neuroml2 support improved:
    • Implemented support for voltage and [Ca2+] dependent channel (HHChannel2D)
    • Fast vectorized computation of gate table expressions using numpy.
  2. Switch build system to meson and ninja: this is much cleaner than cmake
  3. Native Windows/MSVC build: the meson build now works for building pymoose natively on Windows using the free Visual Studio Command-line Build Tools on conda/mamba/micromamba. (fixes Building issues #479 )
  4. Fix HHChannel class hierarchy. (fixes Attribute values do not persist on MS Windows  #483 )

subhacom added 30 commits May 20, 2024 22:57
In setup.py and CMakeLists.txt for build

- Added switches for compiler flags for Windows/MSVC

- Removed possible override of version in CMakeLists.txt: setup.py
  should be the only source of version info

- Archive format set to zip for windows

- Using module name moose instead of _moose, the underscore is added
  as PREFIX

- Platform dependent shared lib file name extension

- Removed platform name CMAKE from cmake file

- Updated setup.py to allow release build on windows

In C++ code

- Switched all new style logical opeartors (and, or, not)to C
  style (&&, ||, !) - these are not recognized by MSVC compiler

- Added windows port of getopt in external

- Removed SocketStreamer conditionally for Win32 build.
  Win32 does not have socket library. TODO: look at ports.

- CylBase uses a constant PI which does not exist in win32 standard
  library. Replaced it with cmath's M_PI. Hope they are the same.

- Corrected cnpy function for checking numpy file header

- Minor correction on printf formatting to avoid warning for size_t
build updates for windows

- Undefine _DEBUG macro for release builds

Added build instructions for windows
- setup.py: use `cmake --build` for all systems
- switch filename suffix pyd back to dll for windows
- setup.py for two passes of cmake - first to create config, second to
run build tool
- pybind11/CMakeLists.txt - going back to no prefix, directly put
`_moose` for target. Reverted pyd suffix to dll on windows
- Updated guide to windows build
- Updated meson.build files to build on Ubuntu with gcc
- Added instructions for Ubuntu build
- Updated instructions for Windows build
- Fixed minor issue with loading kkit file
- Removed function filepath_exists to check existence of a
file: now this is done portably with the `access` (unix) or
`_access` (win) function call.
- Fixed the calculation of gate parameters for HH-type channels with
non-standard formula
- String formatting switched to f-strings
- Refactored functions for updating gates/creating HHChannels
- Added some function docstrings
- The switch between Ca dependent and voltage dependent gates put
inside for loop instead of having one loop under each condition.
- array_eval_component() reimplements neuroml expression evaluation
                         using numpy vectorization. This adds
			 dependency on pint for unit handling.
- Numerous other fixes and cleanups.
This commit puts together several bug fixes and cleanups.

Meson-based build functional now.
- Windows MSVC Build works.
- Tested on WSL-Ubuntu as well
- Removed cmake build files (CMakeLists.txt)

HHChannel class hierarchy
- Original version of HHChannel was using the diamond of death
multiple inheritance. While linux/gcc was forgiving of this, on
Windows MSVC this was producing strange errors issue#483.
- Turns out this design was not essential and single inheritance along
the line ChanBase->ChanCommon->HHChannelBase->HHChannel sufficed.

pybind11 based pymoose

This code was quite dirty with static member functions under __Finfo__
which had no relations with the class. Reorganized the code here.
@subhacom subhacom closed this Nov 10, 2024
@subhacom
Copy link
Collaborator Author

All these changes have been squashed into a single pull request from the master branch of the fork

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Attribute values do not persist on MS Windows Building issues
1 participant