[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] Installing igraph on Solaris
From: |
Tamas Nepusz |
Subject: |
Re: [igraph] Installing igraph on Solaris |
Date: |
Sun, 31 Jan 2010 20:58:37 +0000 |
> After getting rid of igraph_logbl, I can compile the library with the
> newer GCC without getting any assembly error. However, I do still get
> the linking error when using the lib. Maybe you know what might be the
> problem?
After having demangled the symbol the linker is looking for, it seems that you
are missing a function with this signature:
igraph_arpack_rssolve(int (*)(double *, double const *, long, void *), void *,
igraph_arpack_options_t *, igraph_arpack_storage_t *, igraph_vector_t *,
igraph_matrix_t *)
Actually, this function is in src/arpack.c, and I don't really understand why
did gcc mangle the symbol name. This is a plain C function, so there's no need
for name mangling as it cannot be overloaded. One thing that might help is to
add the following code snippet at the beginning of igraph_arpack.h:
#undef __BEGIN_DECLS
#undef __END_DECLS
#ifdef __cplusplus
# define __BEGIN_DECLS extern "C" {
# define __END_DECLS }
#else
# define __BEGIN_DECLS /* empty */
# define __END_DECLS /* empty */
#endif
__BEGIN_DECLS
...here comes the rest of the header file...
__END_DECLS
See, for instance, igraph_dqueue.h as an example of how to use the above
declarations. This should force g++ not to mangle the symbol names and it will
probably resolve your problem. Please keep us updated. Even better, we'd
appreciate a diff between the original igraph source tree and the one with
which you managed to compile igraph on Solaris.
> I had to change the suffixes of all files that include cs/cs.h from .c
> to .cpp such that they are compiled by g++ and not gcc because gcc was
> unable to include complex.h
Apparently this is a known bug with complex.h in Solaris:
http://trac.sagemath.org/sage_trac/ticket/7932
IIRC we don't really need complex numbers in igraph at all, so probably
#defining NCOMPLEX would help as it skips some parts from cs.h that might cause
problems. Try this:
CFLAGS=-DNCOMPLEX CXXFLAGS=-DNCOMPLEX ./configure && make
Alternatively, you might replace #include <complex.h> with this snippet in
cs/cs.h:
#include <complex.h>
#if defined(__sun__) && defined(__GNUC__)
#undef _Complex_I
#define _Complex_I 1j
#endif
> logbl is called in bliss_bignum.hh, so I cannot compile without it. I
> changed the call to logb() but maybe it would be better to provide a
> working implementation of igraph_logbl.
I will look into that. The current implementation uses inline assembler code
that does not work on your architecture but it worked so far on i386 and amd64.
--
Tamas