[xcrysden] Difficulty compiling Xcrysden 1.5.53

Tone Kokalj tone.kokalj at ijs.si
Fri Jun 22 11:55:02 CEST 2012


On Fri, 2012-06-15 at 18:29 -0400, Holzwarth, Natalie wrote:
> Dear Xcrysden developers,
>        In compiling the 1.5.53 version of Xcrysden I ran into the
> following error which was generated in ubuntu 10.4 and 12.04 using the
> gcc compiler.  I briefly scanned the archive and could not find
> previous instances of this problem.
> 
> 
> gcc -g -static -ansi -ffast-math -funroll-loops -DUSE_FONTS -pedantic
> -Wall   -DUSE_FONTS
> -I/home/natalie/Sharedata/Visualization/Xcrysden/xcrysden-1.5.53/external/src/tcl8.5.11/generic -I/home/natalie/Sharedata/Visualization/Xcrysden/xcrysden-1.5.53/external/src/tk8.5.11/generic -I/home/natalie/Sharedata/Visualization/Xcrysden/xcrysden-1.5.53/external/include    -c gl2ps.c
> gl2ps.c: In function ‘gl2psPutPDFText’:
> gl2ps.c:3416: error: ‘M_PI’ undeclared (first use in this function)


The problem with this M_PI is that its definition is not a C-standard,
yet for long time it used to be defined in math.h. Seems that its
definition is omitted in some new linux versions.

The fix is very easy, though: whenever you encounter this compilation
problem add the following line somewhere around the beginning of the
respective file (in your case gl2ps.c):

#define M_PI 3.14159265358979323846 

This problem will be fixed in new version of xcrysden by hardocind the
M_PI definition.

Regards, Tone
-- 
Anton Kokalj
J. Stefan Institute, Jamova 39, 1000 Ljubljana, Slovenia 
(tel: +386-1-477-3523 // fax:+386-1-477-3822)

Please, if possible, avoid sending me Word or PowerPoint attachments.
See:  http://www.gnu.org/philosophy/no-word-attachments.html



More information about the XCrySDen mailing list