With the following preprocessor directives, I am successful in compiling easel on Windows with MinGW, allowing for an (almost) native compilation of Easel on Windows. Contrary to Cygwin, MinGW lets you compile an binary that works even in the plain Windows environment, so this should be a first step towards getting Easel and HMMER on Windows.
Changes are:
Use _putenv_s instead of setenv when setenv is not available (it's only used in the tests I think).
Check for a working mmap function before compiling mmap support in esl_buffer.c, instead of relying on _POSIX_VERSION (which is defined for MinGW while MinGW has no mmap support).
Check for the fstat function before calling fstat in esl_buffer_OpenFile (once again, instead of relying on _POSIX_VERSION).
Check if the stat struct has an st_blksize (which is not the case on Windows) before using it to get the block size in esl_buffer_OpenFile
Use GetTempPathA to find the temporary folder in esl_tmpfile (it internally uses the environment variables, but this function provides consistent behaviour on Windows)
Use ctime_s instead of ctime_r when compiling for MinGW, since ctime_r is not available on Windows while ctime_s is.
Although it builds, not all tests pass at the moment, most likely due to remaining compatibility issues. The following keep failing:
buffer-utest
getopts-utest
sqio-utest
ssi-utest
degen-residues
All the miniapps are marked as crashing as well, but I can make them run fine, even in a cmd.exe shell, so I think it's more likely a test driver issue than an actual crash, although there may be some edge cases:
Hi!
With the following preprocessor directives, I am successful in compiling
easel
on Windows with MinGW, allowing for an (almost) native compilation of Easel on Windows. Contrary to Cygwin, MinGW lets you compile an binary that works even in the plain Windows environment, so this should be a first step towards getting Easel and HMMER on Windows.Changes are:
_putenv_s
instead ofsetenv
whensetenv
is not available (it's only used in the tests I think).mmap
function before compilingmmap
support inesl_buffer.c
, instead of relying on_POSIX_VERSION
(which is defined for MinGW while MinGW has nommap
support).fstat
function before callingfstat
inesl_buffer_OpenFile
(once again, instead of relying on_POSIX_VERSION
).stat
struct has anst_blksize
(which is not the case on Windows) before using it to get the block size inesl_buffer_OpenFile
GetTempPathA
to find the temporary folder inesl_tmpfile
(it internally uses the environment variables, but this function provides consistent behaviour on Windows)ctime_s
instead ofctime_r
when compiling for MinGW, sincectime_r
is not available on Windows whilectime_s
is.Although it builds, not all tests pass at the moment, most likely due to remaining compatibility issues. The following keep failing:
buffer-utest
getopts-utest
sqio-utest
ssi-utest
degen-residues
All the
miniapps
are marked as crashing as well, but I can make them run fine, even in acmd.exe
shell, so I think it's more likely a test driver issue than an actual crash, although there may be some edge cases: