The current version of tacg (4.1.0) does not support the current version of gcc and fails to compile with the error you observe
However you can build if you apply a set of patches contributed by Charles Plessy to enable builds with gcc 4: http://sourceforge.net/p/tacg/patches/1/
wget http://downloads.sourceforge.net/project/tacg/tacg/tacg-4.1/tacg-4.1.0-src.tar.bz2
tar zjf tacg-4.1.0-src.tar.bz2
cd tacg-4.1.0-src
wget http://sourceforge.net/p/tacg/patches/_discuss/thread/55725c46/3160/attachment/to-build-with-gcc4.patch
patch -p1 < to-build-with-gcc4.patch
./configure
make
You can then test that the build works with something like:
export TACGLIB=`pwd`/Data
./tacg -S -f1 -n3 -o1 -T 1,3 -C0 -c -L -F0 -D1 -w60 < ~/test/data/sequence/nuc_embl_L12345.tfa
In this case the input data file is EMBL:L12345.
On a Ubuntu 12.04 LTS the program generates the expected restriction map of the sequence before triggering a glibc error:
*** glibc detected *** ./tacg: free(): invalid pointer: 0x00007f20a7c33560 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7eb96)[0x7f20a71bbb96]
./tacg[0x403639]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7f20a715e76d]
./tacg[0x404cbd]
You may have better luck with the version in CVS, rather than the release build (see http://sourceforge.net/p/tacg/code/?source=navbar).
For what it is worth, the last time I built a working version of tacg it was not the latest version, but instead the older 3.12. This still required a couple of changes (patch set provided below) but does not give the glibc error and accompanying segfault:
diff -Naur tacg-3.12-src/Makefile.in tacg-3.12-src_patched/Makefile.in
--- tacg-3.12-src/Makefile.in 2001-06-12 23:17:06.000000000 +0100
+++ tacg-3.12-src_patched/Makefile.in 2013-10-14 14:45:51.559741916 +0100
@@ -21,7 +21,7 @@
# Simply edit CFLAGS for your local compiler/system
#
# -O2 will work for most systems
-CFLAGS = -O3 -m486 -Wall -fPIC
+CFLAGS = -O3 -Wall -fPIC
# for gcc on intel, add -m486 to CFLAGS
# -fPIC for building Position Independent Code for dynamic lib
diff -Naur tacg-3.12-src/SeqFuncs.c tacg-3.12-src_patched/SeqFuncs.c
--- tacg-3.12-src/SeqFuncs.c 2001-08-20 23:20:21.000000000 +0100
+++ tacg-3.12-src_patched/SeqFuncs.c 2013-10-14 14:44:01.003739835 +0100
@@ -91,7 +91,7 @@
should have been functionized long ago */
void LinearMap(long seq_len, int basesPerLine, int NumREs, char *sequence, int max_okline,
- char Codons[][][], int codon_Table) {
+ char Codons[MAX_ORGS][N_CODONS][7], int codon_Table) {
/* Declarations */
int i, d, k, mm=0, rc, n_letters=0, Xn=0, okline, HTML, spacer, spacermod, nocuts, stanzaspace,
@@ -173,13 +173,13 @@
/*write the correct numbering in Left margin */
if (F.NumStart < 1 && (((block_Cnt-1)*basesPerLine) + 1 + F.NumStart) == 0) {numstart++; tripclick++;}
- sprintf((char *)s, "%7d",(((block_Cnt-1)*basesPerLine) + 1 + numstart)); /* numstart is just a + offset */
+ sprintf((char *)s, "%7ld",(((block_Cnt-1)*basesPerLine) + 1 + numstart)); /* numstart is just a + offset */
memcpy(&O_txt[O_SEQ_LINE][0], s, 7);
/* and in the right margin - combine with the above bit? */
if (F.NumStart < 0 && (tripclick || (((block_Cnt)*basesPerLine + numstart)) > 0)) {
if (!tripclick) {tripclick++; numstart++;}
}
- sprintf((char *)s, "%7d",(((block_Cnt)*basesPerLine + numstart)));
+ sprintf((char *)s, "%7ld",(((block_Cnt)*basesPerLine + numstart)));
memcpy(&O_txt[O_SEQ_LINE][O_LMARG+basesPerLine], s, 7);
/* and drop in the sequence directly after it. */
diff -Naur tacg-3.12-src/tacg.h tacg-3.12-src_patched/tacg.h
--- tacg-3.12-src/tacg.h 2001-09-07 00:57:45.000000000 +0100
+++ tacg-3.12-src_patched/tacg.h 2013-10-14 14:42:06.471737678 +0100
@@ -591,7 +591,7 @@
/* fmax/imax return the float/int max of 2 values (mainly to save space) - it's another
1 liner, but should be used relatively infrequently */
-float fmax(float v1, float v2);
+/* float fmax(float v1, float v2); */
int imax(int v1, int v2);
/* BitArray() is a 1st pass approx to doing interesting things with bit strings
@@ -740,7 +740,7 @@
and functional enough to makeinto its own fn(). It takes the DD.Dat struct
and parses the hit data out of it and composes a Linear Map out of it. */
void LinearMap(long seq_len, int basesPerLine, int NumREs, char *sequence,
- int max_okline, char Codons[][][], int codon_Table);
+ int max_okline, char Codons[MAX_ORGS][N_CODONS][7], int codon_Table);
/* Clone() goes thru RE[] and figures out which REs match the conditions of the option flag, where
--clone '#_#,#x#,#x#,#_#' (up to MAX_NUM_CLONE_RANGES). '_' indicates that the range cannot be cut;
diff -Naur tacg-3.12-src/udping.c tacg-3.12-src_patched/udping.c
--- tacg-3.12-src/udping.c 2001-08-21 03:56:49.000000000 +0100
+++ tacg-3.12-src_patched/udping.c 2013-10-14 14:38:30.059733637 +0100
@@ -54,7 +54,7 @@
extern uid_t getuid();
extern int socket();
-extern int sendto();
+/* extern int sendto(); */
extern int close();
int iamhere(char *progname)