[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] igraph-0.4.5 gcc-4.3 build failures
From: |
Neal Becker |
Subject: |
Re: [igraph] igraph-0.4.5 gcc-4.3 build failures |
Date: |
Wed, 13 Feb 2008 14:26:47 -0500 |
User-agent: |
KMail/1.9.6 (enterprise 0.20071204.744707) |
On Wednesday 13 February 2008, Gabor Csardi wrote:
> It was fixed in both branches, at least <algorithm> was
> added, but there was no released version since the fixes.
>
> Neal, can you send a complete patch to make igraph compile
> with gcc 4.3? Off-list please, if it is big.
>
I haven't got it yet. I don't have gcc-4.3 installed on any of my machines.
I'm asking the fedora build system to do builds, and all I get is the logs.
So far I tried:
diff --git a/src/walktrap_graph.cpp b/src/walktrap_graph.cpp
--- a/src/walktrap_graph.cpp
+++ b/src/walktrap_graph.cpp
@@ -28,6 +28,9 @@
#include <iostream>
#include <fstream>
#include <sstream>
+#include <cstdlib> // exit
+#include <cstring> // strlen
+#include <algorithm> // sort
#include "walktrap_graph.h"
using namespace std;
@@ -144,7 +147,7 @@
for(int i = 0; i < G.nb_vertices; i++) {
if(G.vertices[i].degree == 0) {
cerr << "error : degree of vertex " << i << " is 0" << endl;
- exit(0);
+ std::exit(0);
}
G.vertices[i].edges = new Edge[G.vertices[i].degree + 1];
G.vertices[i].edges[0].neighbor = i;
@@ -163,7 +166,7 @@
}
for(int i = 0; i < G.nb_vertices; i++)
- sort(G.vertices[i].edges, G.vertices[i].edges+G.vertices[i].degree);
+ std::sort(G.vertices[i].edges, G.vertices[i].edges+G.vertices[i].degree);
for(int i = 0; i < G.nb_vertices; i++) { // merge multi edges
int a = 0;
@@ -186,7 +189,7 @@
if(index != 0) {
m += long(nb_vertices)*sizeof(char*);
for(int i = 0; i < nb_vertices; i++)
- m += strlen(index[i]) + 1;
+ m += std::strlen(index[i]) + 1;
}
return m;
}
But I still get:
walktrap_graph.cpp: In member function 'void Graph::convert_from_igraph(const
igraph_t*, const igraph_vector_t*)':
walktrap_graph.cpp:167: error: 'sort' was not declared in this scope
walktrap_graph.cpp: In member function 'long int Graph::memory()':
walktrap_graph.cpp:190: error: 'strlen' was not declared in this scope
make[3]: *** [libigraph_la-walktrap_graph.lo] Error 1
- [igraph] igraph-0.4.5 gcc-4.3 build failures, Neal Becker, 2008/02/13
- Re: [igraph] igraph-0.4.5 gcc-4.3 build failures, Tamas Nepusz, 2008/02/13
- Re: [igraph] igraph-0.4.5 gcc-4.3 build failures, Gabor Csardi, 2008/02/13
- Re: [igraph] igraph-0.4.5 gcc-4.3 build failures,
Neal Becker <=
- Re: [igraph] igraph-0.4.5 gcc-4.3 build failures, Neal Becker, 2008/02/13
- Re: [igraph] igraph-0.4.5 gcc-4.3 build failures, Gabor Csardi, 2008/02/14
- Re: [igraph] igraph-0.4.5 gcc-4.3 build failures, Neal Becker, 2008/02/14
- [igraph] patch for igraph-0.5 gcc-4.3, Neal Becker, 2008/02/16
- [igraph] Re: patch for igraph-0.5 gcc-4.3, Gabor Csardi, 2008/02/16