EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Channel Archiver compilation error
From: "Wang, Lin" <[email protected]>
To: [email protected]
Cc: [email protected]
Date: Fri, 15 Dec 2017 18:49:58 +0800 (GMT+08:00)

Hello Kay,

I would like to build a Channel Archiver test environment to investigate data migration to Archiver Appliance.

When I built the latest Channel Archiver source code from github [1] within EPICS_BASE/src directory, I encountered the following error:

/usr/bin/g++ -c  -D_POSIX_C_SOURCE=199506L -D_POSIX_THREADS -D_XOPEN_SOURCE=500           -D_X86_64_  -DUNIX  -D_BSD_SOURCE -Dlinux  -D_REENTRANT   -g   -Wall     -D ARCH_VERSION=3 -D ARCH_RELEASE=0 -D ARCH_PATCH=0 -D ARCH_VERSION_TXT=\"3.0.0\" -I../../../../include -I../../../../include/os/Linux -I/usr/local/include -DFUX_XERCES  -m64      -MMD -I. -I../O.Common -I. -I.. -I../../../../include/os/Linux -I../../../../include        ../AVLTreeTest.cpp
In file included from ../AVLTreeTest.cpp:4:0:
../AVLTree.h: In instantiation of ‘bool AVLTree<Item>::find(Item&) [with Item = int]’:
../AVLTreeTest.cpp:37:24:   required from here
../AVLTree.h:80:46: error: ‘sort_compare’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
             comp = sort_compare(item, n->item);
                                              ^
../AVLTreeTest.cpp:7:12: note: ‘int sort_compare(const int&, const int&)’ declared here, later in the translation unit
 static int sort_compare(const int &a, const int &b)
            ^
In file included from ../AVLTreeTest.cpp:4:0:
../AVLTree.h: In instantiation of ‘bool AVLTree<Item>::insert(AVLItem<Item>*, AVLItem<Item>**) [with Item = int]’:
../AVLTree.h:61:28:   required from ‘void AVLTree<Item>::add(const Item&) [with Item = int]’
../AVLTreeTest.cpp:31:24:   required from here
../AVLTree.h:168:62: error: ‘sort_compare’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
         int comp = sort_compare(new_node->item, (*node)->item);
                                                              ^
../AVLTreeTest.cpp:7:12: note: ‘int sort_compare(const int&, const int&)’ declared here, later in the translation unit
 static int sort_compare(const int &a, const int &b)
            ^
In file included from ../AVLTreeTest.cpp:4:0:
../AVLTree.h: In instantiation of ‘void AVLTree<Item>::print_dot_node(FILE*, AVLItem<Item>*, int&) [with Item = int; FILE = _IO_FILE]’:
../AVLTree.h:286:34:   required from ‘void AVLTree<Item>::make_dotfile(const char*) [with Item = int]’
../AVLTreeTest.cpp:49:28:   required from here
../AVLTree.h:220:40: error: ‘toString’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
                 me, toString(node->item), (int)node->balance);
                                        ^
../AVLTreeTest.cpp:20:20: note: ‘const char* toString(const int&)’ declared here, later in the translation unit
 static const char *toString(const int &i)
                    ^
../../../../configure/RULES_BUILD:209: recipe for target 'AVLTreeTest.o' failed
make[2]: *** [AVLTreeTest.o] Error 1
make[2]: Leaving directory '/home/wanglin/base-3.14.12.3/src/ChannelArchiver/Tools/O.linux-x86_64'
../../../configure/RULES_ARCHS:63: recipe for target 'install.linux-x86_64' failed
make[1]: *** [install.linux-x86_64] Error 2
make[1]: Leaving directory '/home/wanglin/base-3.14.12.3/src/ChannelArchiver/Tools'
../../configure/RULES_DIRS:70: recipe for target 'Tools.install' failed
make: *** [Tools.install] Error 2

If I move sort_compare() and toString() methods to the position before "#include AVLTree.h" in Tools/AVLTreeTest.cpp as follows, the problem is gone.


#include <stdio.h>
#include <stdlib.h>

static int sort_compare(const int &a, const int &b)
{   return b-a; }

static const char *toString(const int &i)
{
    static char txt[10];
    sprintf(txt, "%d", i);
    return txt;
}

#include "AVLTree.h"
#include "UnitTest.h"

static int avl_last_number;
static bool tree_is_ordered;

static void avl_order_test(const int &i, void *)
{
    if (i < avl_last_number)
        tree_is_ordered = false;
    avl_last_number = i;
}

Will this workaround cause any issue? Is there any other solution recommended?


My platform is Debian 8 (Jessie), gcc/g++ 4.9.2



Thanks,

Lin


[1] https://github.com/EPICSTools/ChannelArchiver


Replies:
Re: Channel Archiver compilation error Michael Davidsaver

Navigate by Date:
Prev: modbus: problem on readInt32Array Davide Marcato
Next: Re: Channel Archiver compilation error Michael Davidsaver
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: modbus: problem on readInt32Array Davide Marcato
Next: Re: Channel Archiver compilation error Michael Davidsaver
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
ANJ, 21 Dec 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·