summaryrefslogtreecommitdiff
blob: cafc0f1971c83f972fbc554fd7b565ccfbca0009 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
diff --git a/configure.ac b/configure.ac
index 68453ef..3ecfd21 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,13 +28,11 @@ AC_CHECK_FUNCS([floor memset clock pow sqrt strchr strdup strtol strtoul])
 dnl 1) threads options
 
 dnl abc) : with-threads option
-AC_ARG_WITH(
-	threads,
-	[  --with-threads          compile with all threads],
-	[threads="yes"],
-	[threads="no"])
+AC_ARG_ENABLE(
+	[threads],
+	AS_HELP_STRING([--enable-threads], [compile with all threads]))
 
-if test "$threads" = "yes"; then
+AS_IF([test "x$enable_threads" = "xyes"], [
   AC_MSG_RESULT(detected cpu parameter: threads);
  
   dnl pthread library here ? (UNIX system)
@@ -46,167 +44,25 @@ if test "$threads" = "yes"; then
     AC_MSG_RESULT(yes)
     AC_DEFINE([HAVE_PTHREAD],[1],[pthread available on the computer])
        CFLAGS=" $CFLAGS -DTHREAD_ASSEMBLE_ALIGN -DTHREAD_FORWARD_REVERSE -DTHREAD_QUERY_CHUNK "
-       LDFLAGS="$LDFLAGS -lpthread"
+       LIBS="$LIBS -lpthread"
   else
     AC_MSG_RESULT(no : disabling \"--with-threads\" parameter)
   fi
-
-else
-   if test -s /proc/cpuinfo; then
-      AC_MSG_CHECKING(for multi-processor)
-      dnl Multithread advice
-      if test `grep -c '^processor' /proc/cpuinfo` -gt 2; then
-         AC_MSG_RESULT(yes) 
-         AC_MSG_RESULT(- try \"configure --with-threads\")
-      else
-         AC_MSG_RESULT(no)
-      fi;
-   fi;
-fi
-
-
-
-
-
-dnl a) : with-thread-fr option
-AC_ARG_WITH(
-	thread-fr,
-	[  --with-thread-fr        compile with two separate threads for Forward and Reverse sequence],
-	[thread_forward_reverse="yes"],
-	[thread_forward_reverse="no"])
-
-if test "$thread_forward_reverse" = "yes"; then
-  AC_MSG_RESULT(detected cpu parameter: thread-fr);
- 
-  dnl pthread library here ? (UNIX system)
-  AC_MSG_CHECKING(for pthread lib)
-  AC_CHECK_LIB(pthread, pthread_create,
-	[have_pthread="yes"],
-	[have_pthread="no"])
-  if test "$have_pthread" = "yes"; then
-    AC_MSG_RESULT(yes)
-    AC_DEFINE([HAVE_PTHREAD],[1],[pthread available on the computer])
-       CFLAGS=" $CFLAGS -DTHREAD_FORWARD_REVERSE "
-       LDFLAGS="$LDFLAGS -lpthread"  
-  else
-    AC_MSG_RESULT(no : disabling \"--with-thread-fr\" parameter)
-  fi
-
-else
-   if test -s /proc/cpuinfo; then
-      AC_MSG_CHECKING(for multi-processor)
-      dnl Multithread advice
-      if test `grep -c '^processor' /proc/cpuinfo` -gt 1; then
-         AC_MSG_RESULT(yes) 
-         AC_MSG_RESULT(- try \"configure --with-thread-fr\")
-      else
-         AC_MSG_RESULT(no)
-      fi;
-   fi;
-fi
-
-
-
-
-
-dnl b) : with-thread-aa option
-AC_ARG_WITH(
-	thread-aa,
-	[  --with-thread-aa        compile with two separate threads for Assemble and Align steps],
-	[thread_assemble_align="yes"],
-	[thread_assemble_align="no"])
-
-if test "$thread_assemble_align" = "yes"; then
-  AC_MSG_RESULT(detected cpu parameter: thread-aa);
- 
-  dnl pthread library here ? (UNIX system)
-  AC_MSG_CHECKING(for pthread lib)
-  AC_CHECK_LIB(pthread, pthread_create,
-	[have_pthread="yes"],
-	[have_pthread="no"])
-  if test "$have_pthread" = "yes"; then
-    AC_MSG_RESULT(yes)
-    AC_DEFINE([HAVE_PTHREAD],[1],[pthread available on the computer])
-       CFLAGS=" $CFLAGS -DTHREAD_ASSEMBLE_ALIGN "
-       LDFLAGS="$LDFLAGS -lpthread"  
-  else
-    AC_MSG_RESULT(no : disabling \"--with-thread-aa\" parameter)
-  fi
-
-else
-   if test -s /proc/cpuinfo; then
-      AC_MSG_CHECKING(for multi-processor)
-      dnl Multithread advice
-      if test `grep -c '^processor' /proc/cpuinfo` -gt 1; then
-         AC_MSG_RESULT(yes) 
-         AC_MSG_RESULT(- try \"configure --with-thread-aa\")
-      else
-         AC_MSG_RESULT(no)
-      fi;
-   fi;
-fi
-
-
-dnl c) : with-thread-qc option
-AC_ARG_WITH(
-	thread-qc,
-	[  --with-thread-qc        compile with threads for the query chunks],
-	[thread_query_chunk="yes"],
-	[thread_query_chunk="no"])
-
-if test "$thread_query_chunk" = "yes"; then
-  AC_MSG_RESULT(detected cpu parameter: thread-qc);
- 
-  dnl pthread library here ? (UNIX system)
-  AC_MSG_CHECKING(for pthread lib)
-  AC_CHECK_LIB(pthread, pthread_create,
-	[have_pthread="yes"],
-	[have_pthread="no"])
-  if test "$have_pthread" = "yes"; then
-    AC_MSG_RESULT(yes)
-    AC_DEFINE([HAVE_PTHREAD],[1],[pthread available on the computer])
-       CFLAGS=" $CFLAGS -DTHREAD_QUERY_CHUNK "
-       LDFLAGS="$LDFLAGS -lpthread"  
-  else
-    AC_MSG_RESULT(no : disabling \"--with-thread-qc\" parameter)
-  fi
-
-else
-   if test -s /proc/cpuinfo; then
-      AC_MSG_CHECKING(for multi-processor)
-      dnl Multithread advice
-      if test `grep -c '^processor' /proc/cpuinfo` -gt 1; then
-         AC_MSG_RESULT(yes) 
-         AC_MSG_RESULT(- try \"configure --with-thread-qc\")
-      else
-         AC_MSG_RESULT(no)
-      fi;
-   fi;
-fi
-
-
-
+])
 
 dnl 2) : low-memory option
-AC_ARG_WITH(
-	low-memory,
-	[  --with-low-memory       use less memory, but can miss some repeats],
-	[low_memory="yes"],
-	[low_memory="no"])
+AC_ARG_ENABLE(
+	[lowmemory],
+	AS_HELP_STRING([--enable-lowmemory], [use less memory, but can miss some repeats]))
 
-if test "$low_memory" = "yes"; then
+AS_IF([test "x$enable_lowmemory" = "xyes"], [
    AC_MSG_RESULT(detected memory parameter: low memory);
    CFLAGS=" $CFLAGS -DLOW_MEMORY "
-else
-   AC_MSG_RESULT(detected memory parameter : plain memory) 
-fi
-
-
-CFLAGS="$CFLAGS -O3 -Wall -ansi -pedantic -funroll-loops -pipe -fomit-frame-pointer "
-LDFLAGS="$LDFLAGS -lm"
+])
 
 AC_SUBST(CFLAGS)
 AC_SUBST(LDFLAGS)
+
 AM_WITH_DMALLOC
 AM_INIT_AUTOMAKE
 AC_CONFIG_FILES([Makefile
diff --git a/src/Makefile.am b/src/Makefile.am
index e456f94..ff8400a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -6,3 +6,5 @@
 bin_PROGRAMS = yass
 yass_SOURCES = align.c assemble.c avl.c display.c global_var.c hash.c kword.c list.c main.c prdyn.c proba.c red_black.c regroup.c threads.c tuple.c util.c \
                align.h assemble.h avl.h display.h global_var.h hash.h kword.h list.h        prdyn.h proba.h red_black.h regroup.h threads.h tuple.h util.h
+yass_LDADD = -lm
+# yass_LDADD = -lm $(LIBS)