torognes / swarm

A robust and fast clustering method for amplicon-based studies
GNU Affero General Public License v3.0
121 stars 23 forks source link

Compiling fails on Windows #169

Closed torognes closed 2 years ago

torognes commented 2 years ago

Compiling currently fails on Windows using the x86_64-w64-mingw32-g++ compiler due to the getline function which is a POSIX standard and not available on Windows, only on on Unix-like systems.

We previously used the fgets function but changed to getline to allow unlimited FASTA line lengths. The getline function can automatically allocate enough memory no matter the line length, but fgets requires a fixed predetermined maximum line length.

I am working on a replacement function.

torognes commented 2 years ago

I added the replacement function xgetline to util.cc, and it now compiles on Windows using the x86_64-w64-mingw32-g++ compiler. I'll test if it works well on Windows too.

torognes commented 2 years ago

Testing (on Travis) now fails with this message:

FAIL: issue 72 --- ascii character x00 is accepted if present at the end of the header

May need to adjust the function a little bit.

torognes commented 2 years ago

Rewritten using getc instead of fgets due to lack of support for NUL characters within the string.

Fixed in commit 89e06941383ec882362eb3d4ce8767b5b3f98caf.