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

Building on Windows using MSYS2 #906

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

Conversation

mkviatkovskii
Copy link

Added possibility to build Bedtools on Windows using MSYS2. Required changes:

  • Modified Makefile to conditionally add -D_GNU_SOURCE -D_DEFAULT_SOURCE definitions on MSYS2.
  • Changed one of test filenames to exclude filename symbols that are unsupported on Windows (actually only \ is unsupported, so braces could be returned back if needed).
  • Added GitHub Actions CI to build and test on MSYS2.
  • Added FAQ record to document MSYS2 dependencies installation process.

I also checked that changes are not breaking build on macOS (and also prepared a branch to add macOS CI, can create a pull request if needed).

@arq5x
Copy link
Owner

arq5x commented Mar 25, 2021

Thanks for this contribution. I am unfamiliar with MSYS2. Could you elaborate on what this PR accomplishes? I apologize for my ignorance.

@mkviatkovskii
Copy link
Author

mkviatkovskii commented Mar 26, 2021

@arq5x MSYS2 is a set of tools to build, run and distribute software from Unix-like world on Windows. It provides an implementation of POSIX functions and system calls on top of Windows kernel. Also it contains a terminal with Bash shell and a package manager (lists of packages: https://github.com/msys2/MSYS2-packages, https://github.com/msys2/MINGW-packages).

For one who wishes to build Bedtools2 on Windows it looks like:

  1. Download MSYS2 environment.
  2. Run Bash shell in MSYS2 terminal.
  3. Use package manager pacman to install build dependencies: pacman -S gcc make python libbz2-devel liblzma-devel zlib-devel git diffutils
  4. Clone Bedtools and run make in it's folder (this is where the pull request is needed, since not all definitions are set).

The result is a native windows executable bedtools.exe depending only on one dynamic library msys-2.0.dll which could be distributed with bedtools.exe.
It could be also possible to add Bedtools package to MSYS2 packages to make it installable like
pacman -S bedtools.

So for people who need to use Bedtools on Windows it's the solution. I understand that you don't officially support Windows, but it just adds such possibility without breaking anything that already works.

@FabrizioG2000
Copy link

Are there any updates on this PR?

@mkviatkovskii
Copy link
Author

mkviatkovskii commented Apr 12, 2022

Are there any updates on this PR?

Probably it's question to @arq5x, but for me the request looks good. I am ready to modify it if something is wrong.

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.

3 participants