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

Support for building NEURON on windows under Azure CI with installer #572

Merged
merged 25 commits into from
Oct 23, 2020

Conversation

pramodk
Copy link
Member

@pramodk pramodk commented May 31, 2020

  • setup azure CI pipeline with windows server 2019
  • build installer with python 2.7, 3.5, 3.6, 3.7, 3.8
  • use Microsoft MPI for parallel build
  • test installer with system provided 2.7
  • disable documentation in NSIS script as it causes issue with NSIS v 3.05
  • create various scripts so that they can be used for local installation as well as CI
  • fix issue with finding ms-mpi in non-standard installation
  • add build timeouts in all Azure jobs
  • cleanup of mingw_files/vcenv.sh
  • upload installer to separate GitHub repo : https://github.com/neuronsimulator/installers
    - [ ] minimise hardcoded paths in the CI scripts by using top level env variables
    - [ ] add README about how to use CI scripts for local development setup on windows See Add README about how to use CI scripts for local development setup on windows #788

Later edit:

We will open separate tickets for testing installer and adding a developer README. At this stage, the pipeline can be used as Windows CI for every PR.

@pramodk pramodk added wip CI Continuous Integration windows labels May 31, 2020
@pramodk pramodk requested a review from nrnhines May 31, 2020 23:46
@pramodk
Copy link
Member Author

pramodk commented May 31, 2020

By the way, the scripts under ci folder are put together so that one can use those same scripts to setup development/build environment and install NEURON from source. Only missing part is Visual Studio but I will cover that tomorrow.

@pramodk pramodk requested review from adamjhn and ramcdougal June 1, 2020 00:02
@pramodk
Copy link
Member Author

pramodk commented Jun 1, 2020

CI fails with unrelated error on OS X:

+ /Users/runner/runners/2.169.1/work/1/s/nrn_test_venv_37/bin/python -c 'import neuron; from neuron import h; s = h.Section(); s.insert('\''cacum'\''); quit()'
Warning: no DISPLAY environment variable.
--No graphics will be displayed.
dlopen failed - 
dlopen(x86_64/.libs/libnrnmech.so, 2): no suitable image found.  Did find:
	file system relative paths not allowed in hardened programs
Traceback (most recent call last):
  File "<string>", line 1, in <module>

This is because of new restrictive Python distributions on OSX. I created #574.

@pramodk pramodk force-pushed the pramodk/windows-ci branch 4 times, most recently from beeb589 to 43c09ee Compare June 1, 2020 18:43
@pramodk
Copy link
Member Author

pramodk commented Jun 2, 2020

@nrnhines : slide 27 of this pdf says,

you might first need to copy all the dlls cp c:/nrn/bin/*.dll c:/nrn/lib/python/neuron

Is that still applicable? If so, that should be addressed?

By the way, this PR is ready for first review except README.

@nrnhines
Copy link
Member

nrnhines commented Jun 2, 2020

slide 27 of this pdf says,

This was also mentioned in #319 with the comment

Here is a big hint relevant to the 'dll dependency' quote above. When I copy all c:/nrn/bin/*.dll into the neuron module, 'import neuron' works.

This is resolved by the use of os.add_dll_directory in pull request #565

setup.py Outdated
@@ -272,7 +272,7 @@ def setup_package():
rxd_params = extension_common_params.copy()
rxd_params['libraries'].append("rxdmath")
rxd_params.update(dict(
extra_compile_args=["-O0"], # cython files take too long to compile with O3
extra_compile_args=["-O2"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should simply remove this flag so that other configurations may change this, like env vars

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be tackled here : #518

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I am reverting.

Copy link
Member

@nrnhines nrnhines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the organization where the builder can do this on their own machine. This is filled with idioms that work around surprising problems. I wonder if comments about these would be helpful.

@@ -85,6 +85,8 @@ copy() {
copy mingw64/bin '
as.exe
ld.exe
zlib1.dll
libzstd.dll
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should make sure that the changes from pull request #563 where we now automatically determinge needed dlls take precedence over this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simply removed those, since cp_dlls is doing the job.

  - setup azure CI pipelines with windows server 2019
  - build installer with python 2.7, 3.5, 3.6, 3.7, 3.8
  - use Microsoft MPI for parallel support
  - installer is also tested with system provided 2.7
  - todo
  - todo
  - todo

Installer is (temporarily) being uploaded to : https://github.com/neuronsimulator/installers
@alexsavulescu alexsavulescu force-pushed the pramodk/windows-ci branch 2 times, most recently from 1a5cd2a to ebd4377 Compare October 22, 2020 08:54
@alexsavulescu alexsavulescu marked this pull request as ready for review October 22, 2020 11:48
src/mswin/nrnsetupmingw.nsi.in Show resolved Hide resolved
packaging/python/test_wheels.sh Outdated Show resolved Hide resolved
@alexsavulescu
Copy link
Member

This PR is ready for review. Testing the installer doesn't work (see ci/azure-win-installer-upload.yml) and will be resolved in a separate ticket. Also a developer README will be added at a later step.

@pramodk
Copy link
Member Author

pramodk commented Oct 22, 2020

I will review this tonight.

Copy link
Member Author

@pramodk pramodk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added minor comments / questions. Apart from those, it's ready for merge.

NOTE: While merging, we should squash commit messages into meaningful summary.

src/nrnpython/nrnpy_hoc.cpp Outdated Show resolved Hide resolved
src/mswin/nrnsetupmingw.nsi.in Show resolved Hide resolved
share/lib/python/neuron/rxd/rxd.py Outdated Show resolved Hide resolved
share/lib/python/neuron/rxd/rxd.py Outdated Show resolved Hide resolved
setup.py Outdated
@@ -272,7 +272,7 @@ def setup_package():
rxd_params = extension_common_params.copy()
rxd_params['libraries'].append("rxdmath")
rxd_params.update(dict(
extra_compile_args=["-O0"], # cython files take too long to compile with O3
extra_compile_args=["-O2"],
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I am reverting.

packaging/python/test_wheels.sh Outdated Show resolved Hide resolved
@pramodk
Copy link
Member Author

pramodk commented Oct 22, 2020

@nrnhines : when you will merge this, here is commit message you can use after squashing all commits:

Support for building windows under Azure CI with installer
  - setup azure CI pipelines with windows server 2019
  - build installer with python 2.7, 3.5, 3.6, 3.7, 3.8
  - use Microsoft MPI for parallel support
  - installer is (temporarily) being uploaded to : https://github.com/neuronsimulator/installers
  - Add test for nrnivmodl on windows
  - Reorder tests
  - Specify timeoutInMinutes for all platforms
  - Run ctest after building on Windows
  - dl_info and dladdr not defined on windows
  - installer testing is currently disabled on windows due to silent instalaltion bug

@pramodk
Copy link
Member Author

pramodk commented Oct 23, 2020

@nrnhines @alexsavulescu : should we merge this then? (I put commit message here).

@alexsavulescu
Copy link
Member

alexsavulescu commented Oct 23, 2020

OK for me, @adamjhn clarified rxd commit. So green light to merge on my part

@nrnhines nrnhines merged commit 4963240 into master Oct 23, 2020
@nrnhines nrnhines deleted the pramodk/windows-ci branch October 23, 2020 18:35
@alexsavulescu alexsavulescu linked an issue Oct 30, 2020 that may be closed by this pull request
olupton pushed a commit that referenced this pull request Dec 7, 2022
One of the feature of github ci is the capability to split jobs.
This way job are smaller and more readable.
Split build and test from build documentation and publish.

Fix live-debug following neuron simulator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration windows wip
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make windows silent installer work on Azure CI
5 participants