我正在尝试编译这个软件包: http: //sourceforge.net/projects/snap-graph/ ?source=dlp
我在这里遇到语法错误:
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I../include -O3 -fomit-frame-pointer -malign-double -fstrict-aliasing -ffast-math -MT drive_seed_community_detection.o -MD -MP -MF .deps/drive_seed_community_detection.Tpo -c -o drive_seed_community_detection.o drive_seed_community_detection.c
drive_seed_community_detection.c: In function ‘identify_comm’:
drive_seed_community_detection.c:214:14: error: expected expression before ‘do’
make[2]: *** [drive_seed_community_detection.o] Fehler 1
make[2]: Leaving directory `/amd.home/home/s/workspace/snap-0.4/test'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/amd.home/home/s/workspace/snap-0.4'
make: *** [all] Error 2
出现错误的相关代码部分是。特别是第 214 行:queue[atomic_fetch_and_add (&k2, 1)] = w;
任何想法可能是什么问题?
/* Find and label the connected components. */
ncomm = 0;
for (attr_id_t kseed = 0; kseed < num_seeds; ++kseed) {
attr_id_t k1, k2;
const attr_id_t seedv = seeds[kseed];
if (membership[seedv] != -2) continue;
queue[0] = seedv;
membership[seedv] = seedv;
comm_root[ncomm] = seedv;
k1 = 0;
k2 = 1;
do {
const attr_id_t qkend = k2;
attr_id_t cv = 0;
OMP("omp parallel for reduction(+:cv)")
for (attr_id_t k1i = k1; k1i < qkend; ++k1i) {
const attr_id_t v = queue[k1i];
const attr_id_t deg = xoff[v+1] - xoff[v];
cv += deg;
if (deg > comm_maxdeg[ncomm]) comm_maxdeg[ncomm] = deg;
for (attr_id_t k = xoff[v]; k < xoff[v+1]; ++k) {
const attr_id_t w = xadj[k];
attr_id_t memb;
if (membership[w] < -1) {
atomic_val_compare_and_swap (memb, &membership[w], -2, seedv);
if (memb < -1) {
//if (membership[w] < -1) {
//membership[w] = seedv;
//int loc;
//OMP("omp atomic") loc = k2++;
queue[atomic_fetch_and_add (&k2, 1)] = w;
}
}
}
}
k1 = qkend;
comm_vol[ncomm] = cv;
} while (k1 != k2);
comm_size[ncomm] = k2;
++ncomm;
}