bedtools2 icon indicating copy to clipboard operation
bedtools2 copied to clipboard

Building on Windows using MSYS2

Open mkviatkovskii opened this issue 3 years ago • 4 comments

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).

mkviatkovskii avatar Mar 19 '21 11:03 mkviatkovskii

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

arq5x avatar Mar 25 '21 14:03 arq5x

@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.

mkviatkovskii avatar Mar 26 '21 08:03 mkviatkovskii

Are there any updates on this PR?

FabrizioG2000 avatar Mar 24 '22 08:03 FabrizioG2000

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.

mkviatkovskii avatar Apr 12 '22 11:04 mkviatkovskii