question about older mamer program compilation , written in c++ - c++

This is a discussion on question about older mamer program compilation , written in c++ - c++ ; Hi all, On the internet there's the downloadable tarball mamer.tgz, for chess server. Mamer is a program to MAnage ME R, i.e. to manage chess players in Internet Chess Servers (FICS, ICC, and so on...) , written in c++ (no ...

+ Reply to Thread
Results 1 to 4 of 4

question about older mamer program compilation , written in c++

  1. Default question about older mamer program compilation , written in c++

    Hi all,

    On the internet there's the downloadable tarball mamer.tgz, for chess
    server.

    Mamer is a program to MAnage ME R,
    i.e. to manage chess players in Internet Chess Servers (FICS, ICC, and so
    on...) , written in c++ (no experience with it from me).

    Trying to compile mamer from sources, I got this:

    g++ -Wall -ggdb -c Tourney.cc
    In file included from
    /usr/lib/gcc/i486-slackware-linux/3.4.6/../../../../include/c++/3.4.6/backward/fstream.h:31,
    from Tourney.hh:19,
    from Tourney.cc:44:
    /usr/lib/gcc/i486-slackware-linux/3.4.6/../../../../include/c++/3.4.6/backward/backward_warning.h:32:2:
    warning: #warning This file includes at least one deprecated or antiquated
    header. Please consider using one of the 32 headers found in
    section 17.4.1.2 of the C++ standard. Examples include substituting the
    <X> header for the <X.h> header for C++ includes, or <iostream> instead of
    the deprecated header <iostream.h>. To disable this warning use
    -Wno-deprecated.
    In file included from /usr/include/math.h:65,
    from Tourney.hh:35,
    from Tourney.cc:44:
    /usr/include/bits/mathcalls.h:145: error: expected `)' before '/' token
    make: *** [Tourney.o] Error 1


    So I couldn't achieve the binaries files.

    About error message I could only retrieve this:

    /* Compute base-2 logarithm of X. */
    __MATHCALL (log2,, (_Mdouble_ __x)); <- line 145 of /usr/include/bits/mathcalls.h
    __END_NAMESPACE_C99
    #endif

    ---------------------------------------------------------------------

    Mamer looks very old:

    // Mamer.cc - Source file for the Mamer class
    //
    // Matthew E. Moses & Michael A. Long
    //
    // $Revision: 1.17 $
    // $Date: 1998/09/10 19:57:17 $
    //
    // $Author: mlong $
    // $Locker: $
    //
    ---------------------------------------------------------------------

    Can someone give me some hint to overcome this issue ?

    Thanks a lot,
    Giancarlo Bassi

  2. Default Re: question about older mamer program compilation , written in c++

    Giancarlo Bassi wrote:
    > On the internet there's the downloadable tarball mamer.tgz, for chess
    > server.
    > [..]
    > Trying to compile mamer from sources, I got this:
    >
    > g++ -Wall -ggdb -c Tourney.cc
    > [..]
    > In file included from /usr/include/math.h:65,
    > from Tourney.hh:35,
    > from Tourney.cc:44:
    > /usr/include/bits/mathcalls.h:145: error: expected `)' before '/'
    > token make: *** [Tourney.o] Error 1
    >
    >
    > So I couldn't achieve the binaries files.
    >
    > About error message I could only retrieve this:
    >
    > /* Compute base-2 logarithm of X. */
    > __MATHCALL (log2,, (_Mdouble_ __x)); <- line 145 of


    Without knowing what that line expands into it's rather impossible
    to tell why the error is there. What the definition of __MATHCALL
    macro looks like?

    Also, the two consecutive commas look suspicious (at least to me).

    > /usr/include/bits/mathcalls.h __END_NAMESPACE_C99
    > #endif
    >
    > ---------------------------------------------------------------------
    >
    > Mamer looks very old:
    >
    > // Mamer.cc - Source file for the Mamer class
    > //
    > // Matthew E. Moses & Michael A. Long
    > //
    > // $Revision: 1.17 $
    > // $Date: 1998/09/10 19:57:17 $


    You think 1998 is old?

    It's not old. It's just non-portable.

    > //
    > // $Author: mlong $
    > // $Locker: $
    > //
    > ---------------------------------------------------------------------
    >
    > Can someone give me some hint to overcome this issue ?


    V
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask



  3. Default Re: question about older mamer program compilation , written in c++

    Giancarlo Bassi:

    > /* Compute base-2 logarithm of X. */ __MATHCALL (log2,, (_Mdouble_
    > __x));



    Is that supposed to be two commas or could it possibly be a typo? Just
    one thought.


    --
    Tomás Ó hÉilidhe

  4. Default Re: question about older mamer program compilation , written in c++

    Thanks Victor and Tomás,

    About the call of log2 function, on Mamer.cc included in sources of
    mamer.tgz, I have this:
    ----------------------------------------------------------------------------

    if(params.rounds == 0) {
    switch(params.style) {
    case 'r':
    params.rounds = GetPlayerCount() - 1;
    break;
    case 's':
    params.rounds = (int)ceil(log2(GetPlayerCount())); ** <---- here **
    break;
    default:
    params.rounds = DEFAULT_ROUNDS;
    break;
    }
    }

    ------------------------------------------------------------
    while in /usr/include/bits/mathcalls.h

    #ifdef __USE_ISOC99
    __BEGIN_NAMESPACE_C99
    /* Compute base-2 exponential of X. */
    __MATHCALL (exp2,, (_Mdouble_ __x));

    /* Compute base-2 logarithm of X. */
    __MATHCALL (log2,, (_Mdouble_ __x)); ** <--- here **
    __END_NAMESPACE_C99
    #endif
    ---------------------------------------------------------

    At the start of the mathcalls,h there's this note:

    /* NOTE: Because of the special way this file is used by <math.h>, this
    file must NOT be protected from multiple inclusion as header files
    usually are.

    This file provides prototype declarations for the math functions.
    Most functions are declared using the macro:

    __MATHCALL (NAME,[_r], (ARGS...));

    This means there is a function `NAME' returning `double' and a function
    `NAMEf' returning `float'. Each place `_Mdouble_' appears in the
    prototype, that is actually `double' in the prototype for `NAME' and
    `float' in the prototype for `NAMEf'. Reentrant variant functions are
    called `NAME_r' and `NAMEf_r'.

    Functions returning other types like `int' are declared using the
    macro:

    __MATHDECL (TYPE, NAME,[_r], (ARGS...));

    This is just like __MATHCALL but for a function returning `TYPE'
    instead of `_Mdouble_'. In all of these cases, there is still
    both a `NAME' and a `NAMEf' that takes `float' arguments.

    Note that there must be no whitespace before the argument passed for
    NAME, to make token pasting work with -traditional. */

    ---------------------------------------------------------------------------
    Furthermore in Tourney.hh , on sources, there's

    #define log2(x) (log(x)/log(2))
    ---------------------------------------------------------------------------

    Is There simply unmatching of argument numbers, or more ?

    thx,
    GB

    ---
    "I'm no Pawn, I'm Donald Duck ! "
    -- Donald in MathMagic Land

    http://g-bassi.wikidot.com


    On Mon, 26 Nov 2007, Tomás Ó hÉilidhe wrote:

    > Giancarlo Bassi:
    >
    >> /* Compute base-2 logarithm of X. */ __MATHCALL (log2,, (_Mdouble_
    >> __x));

    >
    >
    > Is that supposed to be two commas or could it possibly be a typo? Just
    > one thought.
    >
    >
    > --
    > Tomás Ó hÉilidhe
    >


+ Reply to Thread

Similar Threads

  1. Can interfaces be written inside a program
    By Application Development in forum verilog
    Replies: 2
    Last Post: 11-05-2007, 07:11 PM
  2. how to compile a program written in incrtcl
    By Application Development in forum TCL
    Replies: 1
    Last Post: 09-06-2007, 07:32 AM
  3. Most popular program written in Java
    By Application Development in forum Java
    Replies: 12
    Last Post: 08-20-2007, 03:38 PM
  4. Machine intelligence- can this program be written ??
    By Application Development in forum PROLOG
    Replies: 5
    Last Post: 07-24-2006, 09:37 PM
  5. VB program running on older system
    By Application Development in forum basic.visual
    Replies: 0
    Last Post: 10-05-2004, 02:50 PM