igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] igraph 0.5.x visual studio 2005 'fixes'


From: Laurence Muller
Subject: Re: [igraph] igraph 0.5.x visual studio 2005 'fixes'
Date: Fri, 20 Feb 2009 13:42:37 +0100
User-agent: Thunderbird 2.0.0.19 (Windows/20081209)

Hi Tamas,

I think we're getting close :)

More fixes for igraph 0.6

(1) Fix zillion math errors
I compared 0.5 with the 0.6 branch and noticed a difference in this header file:

types.h (line 45)
Remove or comment this:
//#include <math.h>

Remove the include and it will fix the problem ;).

(2) Change in random.c (missing _finite)
Add #include <float.h>

(3) Change in random.c (missing round)
Add this after the include lines:

#ifdef WIN32
int round (double x)
{
   int i = (int) x;

   if (x >= 0.0)
   {
       return ((x-i) >= 0.5) ? (i + 1) : (i);
   }
   else
   {
       return (-x+i >= 0.5) ? (i - 1) : (i);
   }
}
#endif

(4) Change in random.c (missing isnan)
on line 612:

int R_isnancpp(double x)
{
   #ifdef WIN32
       return (_isnan(x)!=0);
   #else
       return (isnan(x)!=0);
   #endif
}

(5) Change in random.c (missing isnan)
on line 621:

#ifdef __cplusplus
   int R_isnancpp(double); /* in arithmetic.c */
   #define ISNAN(x)     R_isnancpp(x)
#else
   #ifdef WIN32
       #define ISNAN(x)     (_isnan(x)!=0)
   #else
       #define ISNAN(x)     (isnan(x)!=0)
   #endif
#endif


After these changes it will compile until the part of the lexer/parser parts
Could you please describe how I should use Bison and Flex to compile the missing *.c files?
(gml, lgl, ncol, pajek)

Kind Regards,
- Laurence



Laurence Muller wrote:
Hi Tamas,

Nice, I noticed the changes after lunch :).

In my previous mail I didn't described all changes though, so here is the full list:

(1) igraph.vcproj
Use a text editor to change this:
RelativePath=".\src\adjlist.c" to RelativePath="..\src\adjlist.c"

Just use a proper text editor and replace all ".\" entries with "..\"

(2) Fix missing files
Visual studio changes (Debug/Release mode):

C/C++ > General > Additional Include Directories
Change the current value to: ../msvc/include;../src
(Make paths relative instead of absolute)

(3) Warnings
C/C++ > Preprocessor > Preprocessor Definitions
Add: ;_CRT_SECURE_NO_WARNINGS

(4) inline issue
Proposed by Tamas:
Add this line:
#define inline __inline

at the top of heap.c

The reason why VC++ complains about them:
"The inline keyword is available only in C++. The __inline and __forceinline keywords are available in both C and C++. For compatibility with previous versions, _inline is a synonym for __inline."
Source: http://msdn.microsoft.com/en-us/library/z8y1yy88(VS.71).aspx

After these fixes there is just one error is left:
C:\Program Files\Microsoft Visual Studio 8\VC\include\math.h(103) : error C2059: syntax error : '('

Bye,
- Laurence

Tamas Nepusz wrote:
Thanks Laurence, I merged your changes upstream.
The errors related to the "inline" keyword could theoretically be resolved by:

#define inline __inline

I don't know why VC++ complains about them -- any idea?



--
------------------------------------------
Laurence Muller (M.Sc.)

Website/Blog/Portfolio:
1. http://www.multigesture.net/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]