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 packaging BNG with Anaconda #191

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

alubbock
Copy link

@alubbock alubbock commented Dec 3, 2017

This PR introduces a set of changes needed to put BNG in an Anaconda package on Windows. The Anaconda build system uses either the Microsoft VS compiler (there's too much posix dependency in BNG, so this seems like a lot of work) or the msys2 environment, which is what I went with.

Itemized changes:

  • Muparser is moved to the Network3/src/muparser directory, rather than compiled separately. This was necessary because the muparser build scripts wouldn't easily support msys2. The upside is that this speeds up the build time, as there's not a separate configure/make etc. for muparser.
  • Replace the posix-specific CPU timing code with a cross-platform version in cputime.cpp, which works natively on Windows and posix using a bunch of ifdefs
  • Update CVODE's config.guess and config.sub, which identify the build platform. They weren't updated since 2005, so they couldn't identify msys2. I updated them as described here and included them in a new cvode-2.6.0.tar.gz.
  • Change bng2/Network3/src/util/mathutils/random.c to use the cross platform rand() and srand(), rather than the posix-specific random() and srandom().
  • Change bng2\Perl2\BNGModel.pm to search for batch files when looking for external executables on Windows (in addition to .exes). Anaconda uses .bat files in place of symbolic links on Windows.

The result of all this is a simple unified build system. To build, clone my Anaconda recipes repo, change to the bionetgen directory, and type conda-build .. Works on Windows, Linux, and Mac.

To try the BNG build using these changes (together with NFsim and PySB builds), see my anaconda page for the packages and installation instructions.

@jrfaeder
Copy link
Contributor

Hi Alex,

Sorry about the delay in addressing this. We resolved the build problems on Travis but there is a problem remaining on Appveyor with the Windows build that we would like you to address if possible before we do the merge.

Thanks,

Jim

@alubbock
Copy link
Author

Hi Jim,

I think the Appveyor build issues stem from the fact I was using Anaconda/msys2 rather than Cygwin for Windows builds (see e.g. msys2 vs cygwin if you're not familiar with msys2).

I rebased my PR against BNG's latest master and updated appveyor.yml with this msys2 configuration. Unfortunately it's not building at the moment due to the private FTP you're using for fetching NFsim and Atomizer, which doesn't work with my fork. Hopefully it should work or be close to working on Appveyor now with access to that FTP server.

Let me know if anything else comes up.

Cheers,
Alex

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.

2 participants