for better windows compatibility
This commit is contained in:
parent
b97620afed
commit
0a3ebdc916
7
Makefile
7
Makefile
|
|
@ -30,8 +30,8 @@ minimap2-lite:example.o libminimap2.a
|
||||||
libminimap2.a:$(OBJS)
|
libminimap2.a:$(OBJS)
|
||||||
$(AR) -csru $@ $(OBJS)
|
$(AR) -csru $@ $(OBJS)
|
||||||
|
|
||||||
sdust:sdust.c kalloc.o kalloc.h kdq.h kvec.h kseq.h sdust.h
|
sdust:sdust.c getopt.o kalloc.o kalloc.h kdq.h kvec.h kseq.h sdust.h
|
||||||
$(CC) -D_SDUST_MAIN $(CFLAGS) $< kalloc.o -o $@ -lz
|
$(CC) -D_SDUST_MAIN $(CFLAGS) $< getopt.o kalloc.o -o $@ -lz
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -fr gmon.out *.o a.out $(PROG) $(PROG_EXTRA) *~ *.a *.dSYM session*
|
rm -fr gmon.out *.o a.out $(PROG) $(PROG_EXTRA) *~ *.a *.dSYM session*
|
||||||
|
|
@ -46,6 +46,7 @@ bseq.o: bseq.h kseq.h
|
||||||
chain.o: minimap.h mmpriv.h bseq.h kalloc.h
|
chain.o: minimap.h mmpriv.h bseq.h kalloc.h
|
||||||
example.o: minimap.h kseq.h
|
example.o: minimap.h kseq.h
|
||||||
format.o: kalloc.h mmpriv.h minimap.h bseq.h
|
format.o: kalloc.h mmpriv.h minimap.h bseq.h
|
||||||
|
getopt.o: getopt.h
|
||||||
hit.o: mmpriv.h minimap.h bseq.h kalloc.h
|
hit.o: mmpriv.h minimap.h bseq.h kalloc.h
|
||||||
index.o: kthread.h bseq.h minimap.h mmpriv.h kvec.h kalloc.h khash.h
|
index.o: kthread.h bseq.h minimap.h mmpriv.h kvec.h kalloc.h khash.h
|
||||||
kalloc.o: kalloc.h
|
kalloc.o: kalloc.h
|
||||||
|
|
@ -53,7 +54,7 @@ ksw2_extd2_sse.o: ksw2.h kalloc.h
|
||||||
ksw2_exts2_sse.o: ksw2.h kalloc.h
|
ksw2_exts2_sse.o: ksw2.h kalloc.h
|
||||||
ksw2_extz2_sse.o: ksw2.h kalloc.h
|
ksw2_extz2_sse.o: ksw2.h kalloc.h
|
||||||
ksw2_ll_sse.o: ksw2.h kalloc.h
|
ksw2_ll_sse.o: ksw2.h kalloc.h
|
||||||
main.o: bseq.h minimap.h mmpriv.h
|
main.o: bseq.h minimap.h mmpriv.h getopt.h
|
||||||
map.o: kthread.h kvec.h kalloc.h sdust.h mmpriv.h minimap.h bseq.h
|
map.o: kthread.h kvec.h kalloc.h sdust.h mmpriv.h minimap.h bseq.h
|
||||||
misc.o: minimap.h ksort.h
|
misc.o: minimap.h ksort.h
|
||||||
sdust.o: kalloc.h kdq.h kvec.h sdust.h
|
sdust.o: kalloc.h kdq.h kvec.h sdust.h
|
||||||
|
|
|
||||||
4
index.c
4
index.c
|
|
@ -1,7 +1,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#ifdef WIN32
|
#if defined(WIN32) || defined(_WIN32)
|
||||||
#include <io.h>
|
#include <io.h> // for open(2)
|
||||||
#else
|
#else
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#if defined(WIN32) || defined(_WIN32)
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#define alloca _alloca
|
#define alloca _alloca
|
||||||
#define __sync_fetch_and_add(ptr, addend) _InterlockedExchangeAdd((void*)ptr, addend)
|
#define __sync_fetch_and_add(ptr, addend) _InterlockedExchangeAdd((void*)ptr, addend)
|
||||||
|
|
|
||||||
14
main.c
14
main.c
|
|
@ -1,12 +1,6 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#ifdef WIN32
|
|
||||||
#include <time.h>
|
|
||||||
#else
|
|
||||||
#include <sys/resource.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#endif
|
|
||||||
#include "bseq.h"
|
#include "bseq.h"
|
||||||
#include "minimap.h"
|
#include "minimap.h"
|
||||||
#include "mmpriv.h"
|
#include "mmpriv.h"
|
||||||
|
|
@ -14,15 +8,19 @@
|
||||||
|
|
||||||
#define MM_VERSION "2.1-r316-dirty"
|
#define MM_VERSION "2.1-r316-dirty"
|
||||||
|
|
||||||
|
#ifdef __linux__
|
||||||
|
#include <sys/resource.h>
|
||||||
|
#include <sys/time.h>
|
||||||
void liftrlimit()
|
void liftrlimit()
|
||||||
{
|
{
|
||||||
#ifdef __linux__
|
|
||||||
struct rlimit r;
|
struct rlimit r;
|
||||||
getrlimit(RLIMIT_AS, &r);
|
getrlimit(RLIMIT_AS, &r);
|
||||||
r.rlim_cur = r.rlim_max;
|
r.rlim_cur = r.rlim_max;
|
||||||
setrlimit(RLIMIT_AS, &r);
|
setrlimit(RLIMIT_AS, &r);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
void liftrlimit() {}
|
||||||
|
#endif
|
||||||
|
|
||||||
static struct option long_options[] = {
|
static struct option long_options[] = {
|
||||||
{ "bucket-bits", required_argument, 0, 0 },
|
{ "bucket-bits", required_argument, 0, 0 },
|
||||||
|
|
|
||||||
2
misc.c
2
misc.c
|
|
@ -96,7 +96,7 @@ double cputime()
|
||||||
getrusage(RUSAGE_SELF, &r);
|
getrusage(RUSAGE_SELF, &r);
|
||||||
return r.ru_utime.tv_sec + r.ru_stime.tv_sec + 1e-6 * (r.ru_utime.tv_usec + r.ru_stime.tv_usec);
|
return r.ru_utime.tv_sec + r.ru_stime.tv_sec + 1e-6 * (r.ru_utime.tv_usec + r.ru_stime.tv_usec);
|
||||||
}
|
}
|
||||||
#endif /* WIN32 */
|
#endif /* WIN32 || _WIN32 */
|
||||||
|
|
||||||
double realtime()
|
double realtime()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
2
sdust.c
2
sdust.c
|
|
@ -176,7 +176,7 @@ uint64_t *sdust(void *km, const uint8_t *seq, int l_seq, int T, int W, int *n)
|
||||||
#ifdef _SDUST_MAIN
|
#ifdef _SDUST_MAIN
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include "getopt.h"
|
||||||
#include "kseq.h"
|
#include "kseq.h"
|
||||||
KSEQ_INIT(gzFile, gzread)
|
KSEQ_INIT(gzFile, gzread)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue