DALIGNER
git clone https://github.com/thegenemyers/DALIGNER.git
cd DALIGNER
make
make 过程中有报错
error: ‘for’ loop initial declarations are only allowed in C99 mode
经过搜索, 不同版本gcc编译器,支持的标准不同,分为了C99,C99以前的标准,其实就是 C语言写法要求不同
#C99
for (int i = 0; i < n; ++i)
do_something();
#C90
int i ;
for ( i = 0; i < n; ++i)
do_something();
搜索 有关的*.c 源码文件
$grep -n "for (int" ./*
./dumpLA.c:122: { for (int i = 0; i < len; i += 2)
./dumpLA.c:126: { for (int i = 0; i < len; i += 2)
./LAa2b.c:91: { for (int i = 0; i < len; i += 2)
./LAa2b.c:96: { for (int i = 0; i < len; i += 2)
./LAb2a.c:92: for (int i = 0; i < len; i += 2)
./LAb2a.c:97: for (int i = 0; i < len; i += 2)
修改源码后 make;warning 无视之,完成
继续 安装 DAZZ_DB
git clone https://github.com/thegenemyers/DAZZ_DB.git
cd DAZZ_DB
搜索 有关的*.c 源码文件
$grep -n "for (int" ./*
./DBa2b.c:99: for (int i = 0; i < len; i++)
./DBb2a.c:99: for (int i = 0; i < len; i++)
修改,然后make,注意缩进要一样, vim 中 通过 yy复制上一行,p 粘贴,然后修改复制的哪行,就不怕缩进不对齐了
#修改前
scanf("%d %d",&mno,&len);
for (int i = 0; i < len; i++)
scanf(" %d %d",masks[mno]+2*i,masks[mno]+2*i+1);
fwrite(&mno,sizeof(int),1,stdout);
fwrite(&len,sizeof(int),1,stdout);
fwrite(masks[mno],sizeof(int),2*len,stdout);
#修改后
scanf("%d %d",&mno,&len);
int i;
for (i = 0; i < len; i++)
scanf(" %d %d",masks[mno]+2*i,masks[mno]+2*i+1);
fwrite(&mno,sizeof(int),1,stdout);
fwrite(&len,sizeof(int),1,stdout);
fwrite(masks[mno],sizeof(int),2*len,stdout);
make 后,warning 不管,完成
添加环境变量~/.bash_profile
export PATH=/software/DAZZ_DB:/software/DALIGNER:$PATH
参考:
error: ‘for’ loop initial declarations are only allowed in C99 mode
网友评论