[xcrysden] problem compiling and executing xcrysden

rafael rlarrosa at uma.es
Wed Mar 7 15:39:29 CET 2012


Hello,

We have been compiling xcrysden from xc-1.5.24-src-all.tar.gz using several compilers, at the end we selected gcc 4.4.2 for compiling it on a x86-64 with SLES (SuSE Linux Enterprise Server) 10.2

We have needed to change the source to make it compile, with those changes:

In C/shank_Hinv.c add:

#define M_PI 3.14159265358979323846

In C/shankland.h and C/shank_util.c the compiler gives errors on those functions :
extern void print_complex_vector(FILE *stream, const char *name, size_t m, fftw_complex *mat);

extern void print_complex_matrix(FILE *stream, const char *name, size_t m, size_t n, fftw_complex *mat);

shank_util.c: In function ‘print_complex_vector’:
shank_util.c:124: error: subscripted value is neither array nor pointer
shank_util.c:124: error: subscripted value is neither array nor pointer
shank_util.c: In function ‘print_complex_matrix’:
shank_util.c:164: error: subscripted value is neither array nor pointer
shank_util.c:164: error: subscripted value is neither array nor pointer

So I modified them putting an extra asterisk :

extern void print_complex_vector(FILE *stream, const char *name, size_t m, fftw_complex **mat);
...
extern void print_complex_matrix(FILE *stream, const char *name, size_t m, size_t n, fftw_complex **mat);




After those changes it compiles, but when executing it gives a segmentation fault:

TCL_LIBRARY=/export/home_users/home/soft/xcrysden/originals/XCrySDen-1.5.24-src-all/external/lib/tcl8.5
XCRYSDEN_TOPDIR=/export/home_users/home/soft/xcrysden/originals/XCrySDen-1.5.24-src-all
XCRYSDEN_SCRATCH=/export/home_users/home/soft/xcrysden/xcrys_tmp

Running on platform : unix
  Operating system : Linux
Package Ppmtompeg: /usr/bin/ppmtompeg
Package Xwd: /usr/X11R6/bin/xwd
Executing: /export/home_users/home/soft/xcrysden/originals/XCrySDen-1.5.24-src-all/bin/ftnunit
/export/home_users/home/soft/xcrysden/originals/XCrySDen-1.5.24-src-all/xcrysden: line 227: 30136 Segmentation fault      ${XCRYSDEN_TOPDIR}/bin/xcrys ${XCRYSDEN_TOPDIR}/Tcl/xcInit.tcl $USE -- $XCRYSDEN_TOPDIR $XCRYSDEN_SCRATCH "$@" >/dev/null



I have debugged (-d)  it and it shows:

Executing: /export/home_users/home/soft/xcrysden/originals/XCrySDen-1.5.24-src-all/bin/ftnunit

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 47700007662880 (LWP 29800)]
0xffffffffffffffff in ?? ()
(gdb) bt
#0  0xffffffffffffffff in ?? ()
#1  0x000000000043df17 in LoadLights ()
#2  0x00000000004440f6 in XC_SetGLparamCmd ()
#3  0x00002b620408dc8f in TclInvokeStringCommand () from /export/home_users/home/soft/xcrysden/originals/XCrySDen-1.5.24-src-all/external/lib/libtcl8.5.so
#4  0x00002b620408f131 in TclEvalObjvInternal () from /export/home_users/home/soft/xcrysden/originals/XCrySDen-1.5.24-src-all/external/lib/libtcl8.5.so
#5  0x00002b62040d8659 in TclExecuteByteCode () from /export/home_users/home/soft/xcrysden/originals/XCrySDen-1.5.24-src-all/external/lib/libtcl8.5.so
#6  0x00002b6204117e1b in TclObjInterpProcCore () from /export/home_users/home/soft/xcrysden/originals/XCrySDen-1.5.24-src-all/external/lib/libtcl8.5.so
#7  0x00002b620408f131 in TclEvalObjvInternal () from /export/home_users/home/soft/xcrysden/originals/XCrySDen-1.5.24-src-all/external/lib/libtcl8.5.so
#8  0x00002b620408f879 in TclEvalEx () from /export/home_users/home/soft/xcrysden/originals/XCrySDen-1.5.24-src-all/external/lib/libtcl8.5.so
#9  0x00002b620408ffc6 in Tcl_EvalEx () from /export/home_users/home/soft/xcrysden/originals/XCrySDen-1.5.24-src-all/external/lib/libtcl8.5.so
#10 0x00002b62040904fd in TclEvalObjEx () from /export/home_users/home/soft/xcrysden/originals/XCrySDen-1.5.24-src-all/external/lib/libtcl8.5.so
#11 0x00002b620409af21 in Tcl_EvalObjCmd () from /export/home_users/home/soft/xcrysden/originals/XCrySDen-1.5.24-src-all/external/lib/libtcl8.5.so
#12 0x00002b620408f131 in TclEvalObjvInternal () from /export/home_users/home/soft/xcrysden/originals/XCrySDen-1.5.24-src-all/external/lib/libtcl8.5.so
#13 0x00002b620408f879 in TclEvalEx () from /export/home_users/home/soft/xcrysden/originals/XCrySDen-1.5.24-src-all/external/lib/libtcl8.5.so
#14 0x00002b620408ffc6 in Tcl_EvalEx () from /export/home_users/home/soft/xcrysden/originals/XCrySDen-1.5.24-src-all/external/lib/libtcl8.5.so
#15 0x00002b62040fae91 in Tcl_FSEvalFileEx () from /export/home_users/home/soft/xcrysden/originals/XCrySDen-1.5.24-src-all/external/lib/libtcl8.5.so
#16 0x00002b6203e6d67c in Tk_MainEx () from /export/home_users/home/soft/xcrysden/originals/XCrySDen-1.5.24-src-all/external/lib/libtk8.5.so
#17 0x000000000040d3ef in main ()


I have put a strace before the executable and the last that it shows is:

stat("/export/home_users/home/soft/xcrysden/originals/XCrySDen-1.5.24-src-all/Tcl/menu.tcl", {st_mode=S_IFREG|0644, st_size=67758, ...}) = 0
open("/export/home_users/home/soft/xcrysden/originals/XCrySDen-1.5.24-src-all/Tcl/menu.tcl", O_RDONLY) = 5
fcntl(5, F_SETFD, FD_CLOEXEC)           = 0
ioctl(5, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fff1255cc90) = -1 ENOTTY (Inappropriate ioctl for device)
read(5, "################################"..., 4096) = 4096
read(5, "--------------------------------"..., 4096) = 4096
read(5, "tem(BINDIR)/fhi_inpini2ftn34 \\\n\t"..., 4096) = 4096
read(5, "Files}  {.xyz} }\n\t\t\t  } -initial"..., 4096) = 4096
read(5, "{ $file != \"\" } {\n\t\tg98Cube $fil"..., 4096) = 4096
read(5, "$mdis1 add radiobutton \\\n\t    -l"..., 4096) = 4096
read(5, "nd . <W> SetWignerSeitzInit\n\n   "..., 4096) = 4096
read(5, "ultiSlab change]\n\n\n    #--------"..., 4096) = 4096
read(5, "{\n\tset dir $system(PWD)\n    } el"..., 4096) = 4096
read(5, "tr $file $can}] } {\n\tErrorDialog"..., 4096) = 4096
brk(0xadd000)                           = 0xadd000
brk(0xad3000)                           = 0xad3000
read(5, "== \"cell\"} { \n\tset MODE2 $geng(M"..., 4096) = 4096
read(5, "  10004\n    set mody(R_OUTLINEWI"..., 4096) = 4096
read(5, "_FOG)                  30\n    se"..., 4096) = 4096
read(5, "  \n    }\n    return\n}\n\n\n\f\nproc M"..., 4096) = 4096
read(5, "l(green) * 255)] ]\n    set cellc"..., 4096) = 4096
read(5, "save structure\" \\\n\t\twarning 1 No"..., 4096) = 4096
read(5, "    set top .perspective\n    if "..., 4096) = 2222
read(5, "", 4096)                       = 0
close(5)                                = 0
brk(0xaf4000)                           = 0xaf4000
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++


Executing with -T it shows:

...
Package Xwd: /usr/X11R6/bin/xwd
determine_movie_encoders ; level == 1
FtnName ; level == 1
xcCatchExecReturn /export/home_users/home/soft/xcrysden/originals/XCrySDen-1.5.24-src-all/bin/ftnunit ; level == 2
destroyWelcome ; level == 3
xcDebug -stderr {{Executing: /export/home_users/home/soft/xcrysden/originals/XCrySDen-1.5.24-src-all/bin/ftnunit}} ; level == 3
Executing: /export/home_users/home/soft/xcrysden/originals/XCrySDen-1.5.24-src-all/bin/ftnunit
GetGengM3Arg ANGS none ; level == 2
ModConst ; level == 2
/export/home_users/home/soft/xcrysden/originals/XCrySDen-1.5.24-src-all/xcrysden: line 227: 30155 Segmentation fault      ${XCRYSDEN_TOPDIR}/bin/xcrys ${XCRYSDEN_TOPDIR}/Tcl/xcInit.tcl $USE -- $XCRYSDEN_TOPDIR $XCRYSDEN_SCRATCH "$@" >/dev/null


If you need more information I can provide it.

Does someone have any tips to make it work ?

Thanks,

Rafael



More information about the XCrySDen mailing list