Page 1 of 1

compiling Xboard from Xboard GIT

PostPosted: 20 Oct 2010, 11:26
by imai
I downloaded latest snapshot of Xboard/Winboard from GIT repository but failed to compile it properly. I ran autogen.sh, then configure but with make I got an error message that malloc.h is missing. See below :


make all-am
Updating ./version.texi
restore=: && backupdir=".am$$" && \
am__cwd=`pwd` && cd . && \
rm -rf $backupdir && mkdir $backupdir && \
if (/bin/sh /Users/teun/Downloads/xboard/missing --run makeinfo --version) >/dev/null 2>&1; then \
for f in xboard.info xboard.info-[0-9] xboard.info-[0-9][0-9] xboard.i[0-9] xboard.i[0-9][0-9]; do \
if test -f $f; then mv $f $backupdir; restore=mv; else :; fi; \
done; \
else :; fi && \
cd "$am__cwd"; \
if /bin/sh /Users/teun/Downloads/xboard/missing --run makeinfo -I . \
-o xboard.info xboard.texi; \
then \
rc=0; \
cd .; \
else \
rc=$?; \
cd . && \
$restore $backupdir/* `echo "./xboard.info" | sed 's|[^/]*$||'`; \
fi; \
rm -rf $backupdir; exit $rc
depbase=`echo backend.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I. -DINFODIR='"/usr/local/share/info"' -DSYSCONFDIR='"/usr/local/etc"' -MT backend.o -MD -MP -MF $depbase.Tpo -c -o backend.o backend.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo book.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I. -DINFODIR='"/usr/local/share/info"' -DSYSCONFDIR='"/usr/local/etc"' -MT book.o -MD -MP -MF $depbase.Tpo -c -o book.o book.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo childio.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I. -DINFODIR='"/usr/local/share/info"' -DSYSCONFDIR='"/usr/local/etc"' -MT childio.o -MD -MP -MF $depbase.Tpo -c -o childio.o childio.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo gamelist.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I. -DINFODIR='"/usr/local/share/info"' -DSYSCONFDIR='"/usr/local/etc"' -MT gamelist.o -MD -MP -MF $depbase.Tpo -c -o gamelist.o gamelist.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo lists.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I. -DINFODIR='"/usr/local/share/info"' -DSYSCONFDIR='"/usr/local/etc"' -MT lists.o -MD -MP -MF $depbase.Tpo -c -o lists.o lists.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo moves.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I. -DINFODIR='"/usr/local/share/info"' -DSYSCONFDIR='"/usr/local/etc"' -MT moves.o -MD -MP -MF $depbase.Tpo -c -o moves.o moves.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo parser.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I. -DINFODIR='"/usr/local/share/info"' -DSYSCONFDIR='"/usr/local/etc"' -MT parser.o -MD -MP -MF $depbase.Tpo -c -o parser.o parser.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo pgntags.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I. -DINFODIR='"/usr/local/share/info"' -DSYSCONFDIR='"/usr/local/etc"' -MT pgntags.o -MD -MP -MF $depbase.Tpo -c -o pgntags.o pgntags.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo uci.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I. -DINFODIR='"/usr/local/share/info"' -DSYSCONFDIR='"/usr/local/etc"' -MT uci.o -MD -MP -MF $depbase.Tpo -c -o uci.o uci.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo xboard.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I. -DINFODIR='"/usr/local/share/info"' -DSYSCONFDIR='"/usr/local/etc"' -MT xboard.o -MD -MP -MF $depbase.Tpo -c -o xboard.o xboard.c &&\
mv -f $depbase.Tpo $depbase.Po
In file included from xboard.c:1347:
args.h: In function ‘ParseArgs’:
args.h:999: warning: cast from pointer to integer of different size
args.h:1013: warning: cast from pointer to integer of different size
args.h: In function ‘SetDefaultsFromList’:
args.h:1109: warning: cast from pointer to integer of different size
args.h:1115: warning: cast from pointer to integer of different size
args.h:1123: warning: cast from pointer to integer of different size
args.h:1126: warning: cast from pointer to integer of different size
xboard.c: In function ‘SaveFontArg’:
xboard.c:1454: warning: cast from pointer to integer of different size
xboard.c: In function ‘SaveAttribsArg’:
xboard.c:1486: warning: cast from pointer to integer of different size
xboard.c: In function ‘SaveColor’:
xboard.c:1492: warning: cast from pointer to integer of different size
xboard.c:1493: warning: cast from pointer to integer of different size
depbase=`echo xedittags.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I. -DINFODIR='"/usr/local/share/info"' -DSYSCONFDIR='"/usr/local/etc"' -MT xedittags.o -MD -MP -MF $depbase.Tpo -c -o xedittags.o xedittags.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo engineoutput.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I. -DINFODIR='"/usr/local/share/info"' -DSYSCONFDIR='"/usr/local/etc"' -MT engineoutput.o -MD -MP -MF $depbase.Tpo -c -o engineoutput.o engineoutput.c &&\
mv -f $depbase.Tpo $depbase.Po
engineoutput.c:31:20: error: malloc.h: No such file or directory
make[1]: *** [engineoutput.o] Error 1
make: *** [all] Error 2



Any suggestions to fix this are welcome

Re: compiling Xboard from Xboard GIT

PostPosted: 20 Oct 2010, 12:27
by H.G.Muller
malloc.h is a standard include file. At least on my (32-bit) Ubuntu 8.04 system.

Could you compile XBoard before? I don't think we changed anything in engineoutput.c for a long time, and especially the #include <malloc.h> must have always been there.

Re: compiling Xboard from Xboard GIT

PostPosted: 20 Oct 2010, 19:17
by imai
No problems with compiling Xboard-4.4.4 from ftp.gnu.org but here the configure file is included in the .tar.
I use a MacBook pro with OS SnowLeopard and gcc as compiler. There is no malloc.h file in the library but in Xcode there is the file OSMalloc.h which is used to allocate a memory block.
The funny thing is that in both cases, configure is checking for the presence of malloc.h, never finds it and only for xboard-4.4.4
it creates and installs the binary.
Any ideas ?

Re: compiling Xboard from Xboard GIT

PostPosted: 20 Oct 2010, 21:17
by Josh Pettus
I came across this before when I tried to complie xboard on the mac. I really don't remember how I fixed this. All i can say is that my current malloc.h file, according to spotlight, is in

/System/Library/Frameworks/Kernal.Framework/Versions/A/Headers/sys

I did make an install package for xboard a little while ago but I haven't updated it to the latest sources in a while. Anyway it is here.
viewtopic.php?f=19&t=50428

Re: compiling Xboard from Xboard GIT

PostPosted: 20 Oct 2010, 22:38
by H.G.Muller
It seems there is an autoconf problem on the mac. The autoconf.ac does contain a check on the presence of malloc.h.

The configure and makefiles are rarely changed. Can't you load a tar ball of the latest development release of the master branch at GNU Savannah, and use the configure file from that? Release tar balls, as opposed to git snapshots, should include a configure file. Not only in v4.4.x, but also in master.

Re: compiling Xboard from Xboard GIT

PostPosted: 21 Oct 2010, 11:41
by imai
H.G.Muller wrote:It seems there is an autoconf problem on the mac. The autoconf.ac does contain a check on the presence of malloc.h.

The configure and makefiles are rarely changed. Can't you load a tar ball of the latest development release of the master branch at GNU Savannah, and use the configure file from that? Release tar balls, as opposed to git snapshots, should include a configure file. Not only in v4.4.x, but also in master.


Mr. Muller
I downloaded xboard-master.tar.gz from http://git.savannah.gnu.org/cgit/xboard.git/commit/ but found no configure file in it.
autogen.sh, configure and make resulted in the same error.

Darklord

Can you jog your memory a bit on how you solved this problem earlier ? I found malloc.h in the same directory as idicated and another one in Macbook/Developer/SDK's/MacOSX10.6.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/sys.
So it seems checking for malloc.h is not done in the right places.
Console indicates that checking for stropts.h, sys/systeminfo.h and malloc.h were not found

Re: compiling Xboard from Xboard GIT

PostPosted: 21 Oct 2010, 12:18
by H.G.Muller
The link you give still looks like an ordinary git snapshot to me. Have you tried one of the specially prepared release tar balls from http://git.savannah.gnu.org/cgit/xboard.git ? Like http://git.savannah.gnu.org/cgit/xboard ... 806.tar.gz ?

Re: compiling Xboard from Xboard GIT

PostPosted: 21 Oct 2010, 20:39
by imai
H.G.Muller wrote:The link you give still looks like an ordinary git snapshot to me. Have you tried one of the specially prepared release tar balls from http://git.savannah.gnu.org/cgit/xboard.git ? Like http://git.savannah.gnu.org/cgit/xboard ... 806.tar.gz ?


I tried the mentioned release, found no configure file and got the same error after autogen.sh, configure and make.

I read the thread Darklord started about using alpha releases and he solved the same problem with a relocation of the malloc.h file. This may be a good temporary fix but a more permanent solution is preferable.
Can autoconf.ac be altered to include the right search for Macs ?

Re: compiling Xboard from Xboard GIT

PostPosted: 22 Oct 2010, 02:36
by Josh Pettus
Thats right! I remembered moving the file and that was where spotlight said the file was so that's why I told you that. I forgot I wrote it down on the thread, good thing too. For a temporary fix it has worked perfectly for me since then.

Sorry I wasn't very clear before. I was in a hurry to get to a class, and have been busy straight since then.

Re: compiling Xboard from Xboard GIT

PostPosted: 16 Nov 2010, 13:46
by imai
Finally I managed to compile an Xboard snapshot on my Mac with OSX 10.6.4.
This works for me :

./autogen.sh

./configure --includedir=/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/X11

sudo make install

Hope it will help other Mac users as well

Re: compiling Xboard from Xboard GIT

PostPosted: 17 Nov 2010, 09:24
by H.G.Muller
./configure --includedir=/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/X11 :shock:

How horrible!

Re: compiling Xboard from Xboard GIT

PostPosted: 17 Nov 2010, 20:46
by imai
It is not that bad, you can drag and drop it into the terminal but you have to know where malloc.h resides.

Re: compiling Xboard from Xboard GIT

PostPosted: 18 Nov 2010, 16:38
by Josh Pettus
When I try to compile the latest code of xboard on HGM6 on MacOSX it always stops with this...
Code: Select all
Undefined symbols:
  "_rl_reset_line_state", referenced from:
      _DoInputCallback in xboard.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[1]: *** [xboard] Error 1
make: *** [all] Error 2
Joshua-Pettuss-MacBook-Pro:xboard-f57476b 2 joshuapettus$

Re: compiling Xboard from Xboard GIT

PostPosted: 18 Nov 2010, 20:08
by H.G.Muller
This is an entry point of the GNU ReadLine library. Perhaps this is missing on your system. Arun recently put in ReadLine support, which is why earlier versions didnot have that problem. But even with the ReadLine support this version compiles without problems on my Ubuntu. So for me rl_set_line_state is apparently defined in some standard library.

I will notify Arun about this.