Skip to content
This repository has been archived by the owner on Jan 31, 2022. It is now read-only.

Add log4cplus version awareness, fix #116 #117

Merged
merged 2 commits into from
Sep 3, 2019
Merged

Conversation

lmoureaux
Copy link

@lmoureaux lmoureaux commented May 31, 2019

Description

log4cplus defines version macros, use them to fix the build failure mentioned in issue #116.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Motivation and Context

Closes #116

How Has This Been Tested?

Tested with log4cplus < 2.0.0.

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@jsturdy
Copy link
Contributor

jsturdy commented Jun 3, 2019

 #if LOG4CPLUS_VERSION < LOG4CPLUS_MAKE_VERSION(2, 0, 0)
                                               ^
/home/sturdy/src/sw/xhal/xhalcore/src/common/utils/XHALXMLParser.cpp: In constructor ‘xhal::utils::XHALXMLParser::XHALXMLParser(const string&)’:
/home/sturdy/src/sw/xhal/xhalcore/src/common/utils/XHALXMLParser.cpp:14:35: error: no matching function for call to ‘log4cplus::Appender::setLayout(std::unique_ptr<log4cplus::Layout>&)’
   myAppender->setLayout( myLayout );
                                   ^
/home/sturdy/src/sw/xhal/xhalcore/src/common/utils/XHALXMLParser.cpp:14:35: note: candidate is:
In file included from /data/sw/peta-stage/usr/include/log4cplus/spi/appenderattachable.h:33:0,
                 from /data/sw/peta-stage/usr/include/log4cplus/logger.h:36,
                 from /home/sturdy/src/sw/xhal/xhalcore/include/xhal/utils/XHALXMLParser.h:39,
                 from /home/sturdy/src/sw/xhal/xhalcore/src/common/utils/XHALXMLParser.cpp:1:
/data/sw/peta-stage/usr/include/log4cplus/appender.h:199:22: note: virtual void log4cplus::Appender::setLayout(std::auto_ptr<log4cplus::Layout>)
         virtual void setLayout(std::auto_ptr<Layout> layout);
                      ^
/data/sw/peta-stage/usr/include/log4cplus/appender.h:199:22: note:   no known conversion for argument 1 from ‘std::unique_ptr<log4cplus::Layout>’ to ‘std::auto_ptr<log4cplus::Layout>’
/home/sturdy/src/sw/xhal/xhalcore/src/common/utils/XHALXMLParser.cpp: In member function ‘std::experimental::optional<xhal::utils::Node> xhal::utils::XHALXMLParser::getNodeFromAddress(uint32_t)’:
/home/sturdy/src/sw/xhal/xhalcore/src/common/utils/XHALXMLParser.cpp:363:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^

@mexanick where does log4cplus get used on the CTP7?
How is it currently solved that the CTP7 is using log4cplus 2, or did you version match to what is provided with xdaq?

@lmoureaux
Copy link
Author

Under which version was this error obtained? I.e. is the version check wrong or is it the code for log4cplus 2?

#if LOG4CPLUS_VERSION < LOG4CPLUS_MAKE_VERSION(2, 0, 0)
                                              ^

What is the message before this snippet?

@jsturdy
Copy link
Contributor

jsturdy commented Jun 3, 2019

Under which version was this error obtained? I.e. is the version check wrong or is it the code for log4cplus 2?

#if LOG4CPLUS_VERSION < LOG4CPLUS_MAKE_VERSION(2, 0, 0)
                                              ^

What is the message before this snippet?

Indeed, I was curious myself, since the message from #116 had exactly the opposite message that is in this message. It turns out that the problem is in the make xhalarm call, as I had suspected from my initial comment regarding which log4cplus is actually being used on the CTP7.

Full message with fix:
arm-linux-gnueabihf-gcc -fomit-frame-pointer -pipe -fno-common -fno-builtin -Wall -std=c++14 -march=armv7-a -mfpu=neon -mfloat-abi=hard -mthumb-interwork -mtune=cortex-a9 -DEMBED -Dlinux -D__linux__ -Dunix -fPIC --sysroot=/data/sw/peta-stage -I/data/sw/peta-stage/usr/include -I/data/sw/peta-stage/include -std=gnu++14 -I/home/sturdy/src/sw/xhal/xhalcore/include -c -o src/linux/arm/utils/XHALXMLParser.o /home/sturdy/src/sw/xhal/xhalcore/src/common/utils/XHALXMLParser.cpp
/home/sturdy/src/sw/xhal/xhalcore/src/common/utils/XHALXMLParser.cpp:9:47: error: missing binary operator before token "("
 #if LOG4CPLUS_VERSION < LOG4CPLUS_MAKE_VERSION(2, 0, 0)
                                               ^
/home/sturdy/src/sw/xhal/xhalcore/src/common/utils/XHALXMLParser.cpp: In constructor ‘xhal::utils::XHALXMLParser::XHALXMLParser(const string&)’:
/home/sturdy/src/sw/xhal/xhalcore/src/common/utils/XHALXMLParser.cpp:14:35: error: no matching function for call to ‘log4cplus::Appender::setLayout(std::unique_ptr<log4cplus::Layout>&)’
   myAppender->setLayout( myLayout );
                                   ^
/home/sturdy/src/sw/xhal/xhalcore/src/common/utils/XHALXMLParser.cpp:14:35: note: candidate is:
In file included from /data/sw/peta-stage/usr/include/log4cplus/spi/appenderattachable.h:33:0,
                 from /data/sw/peta-stage/usr/include/log4cplus/logger.h:36,
                 from /home/sturdy/src/sw/xhal/xhalcore/include/xhal/utils/XHALXMLParser.h:39,
                 from /home/sturdy/src/sw/xhal/xhalcore/src/common/utils/XHALXMLParser.cpp:1:
/data/sw/peta-stage/usr/include/log4cplus/appender.h:199:22: note: virtual void log4cplus::Appender::setLayout(std::auto_ptr<log4cplus::Layout>)
         virtual void setLayout(std::auto_ptr<Layout> layout);
                      ^
/data/sw/peta-stage/usr/include/log4cplus/appender.h:199:22: note:   no known conversion for argument 1 from ‘std::unique_ptr<log4cplus::Layout>’ to ‘std::auto_ptr<log4cplus::Layout>’
/home/sturdy/src/sw/xhal/xhalcore/src/common/utils/XHALXMLParser.cpp: In member function ‘std::experimental::optional<xhal::utils::Node> xhal::utils::XHALXMLParser::getNodeFromAddress(uint32_t)’:
/home/sturdy/src/sw/xhal/xhalcore/src/common/utils/XHALXMLParser.cpp:363:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
Full message without fix:

(note it succeeds, with appropriate warnings, the arm compilation and fails, as expected, on the core compilation)

arm-linux-gnueabihf-gcc -fomit-frame-pointer -pipe -fno-common -fno-builtin -Wall -std=c++14 -march=armv7-a -mfpu=neon -mfloat-abi=hard -mthumb-interwork -mtune=cortex-a9 -DEMBED -Dlinux -D__linux__ -Dunix -fPIC --sysroot=/data/sw/peta-stage -I/data/sw/peta-stage/usr/include -I/data/sw/peta-stage/include -std=gnu++14 -I/home/sturdy/src/sw/xhal/xhalcore/include -c -o src/linux/arm/utils/XHALXMLParser.o /home/sturdy/src/sw/xhal/xhalcore/src/common/utils/XHALXMLParser.cpp
/home/sturdy/src/sw/xhal/xhalcore/src/common/utils/XHALXMLParser.cpp: In constructor ‘xhal::utils::XHALXMLParser::XHALXMLParser(const string&)’:
/home/sturdy/src/sw/xhal/xhalcore/src/common/utils/XHALXMLParser.cpp:10:36: warning: ‘auto_ptr’ is deprecated (declared at /data/bigdisk/sw/Xilinx/SDK/2016.2/gnu/aarch32/lin/gcc-arm-linux-gnueabi/arm-linux-gnueabihf/include/c++/4.9.2/backward/auto_ptr.h:87) [-Wdeprecated-declarations]
   std::auto_ptr<log4cplus::Layout> myLayout = std::auto_ptr<log4cplus::Layout>(new log4cplus::TTCCLayout());
                                    ^
/home/sturdy/src/sw/xhal/xhalcore/src/common/utils/XHALXMLParser.cpp:10:107: warning: ‘auto_ptr’ is deprecated (declared at /data/bigdisk/sw/Xilinx/SDK/2016.2/gnu/aarch32/lin/gcc-arm-linux-gnueabi/arm-linux-gnueabihf/include/c++/4.9.2/backward/auto_ptr.h:87) [-Wdeprecated-declarations]
   std::auto_ptr<log4cplus::Layout> myLayout = std::auto_ptr<log4cplus::Layout>(new log4cplus::TTCCLayout());
                                                                                                           ^
/home/sturdy/src/sw/xhal/xhalcore/src/common/utils/XHALXMLParser.cpp: In member function ‘std::experimental::optional<xhal::utils::Node> xhal::utils::XHALXMLParser::getNodeFromAddress(uint32_t)’:
/home/sturdy/src/sw/xhal/xhalcore/src/common/utils/XHALXMLParser.cpp:363:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
arm-linux-gnueabihf-gcc -std=gnu++14 -L/data/sw/peta-stage/lib -L/data/sw/peta-stage/usr/lib -L/data/sw/peta-stage/ncurses -shared  -o /home/sturdy/src/sw/xhal/xhalarm/lib/libxhal.so src/linux/arm/utils/XHALXMLParser.o -llog4cplus -lxerces-c -lstdc++
Running default target
mkdir -p pkg/xhal
make[1]: Leaving directory '/home/sturdy/src/sw/xhal/xhalarm'
make -C xhalcore
make[1]: Entering directory '/home/sturdy/src/sw/xhal/xhalcore'
Using BUILD_HOME=/home/sturdy/src/sw
OS Detected: centos7
BUILD_VERSION 1.0.105.dev
PREREL_VERSION -final.dev105
mkdir -p src/linux/x86_64/utils
gcc -O0 -g3 -fno-inline -Wall -pthread -fPIC -std=c++11 -m64 -I/usr/include/python2.7 -I/opt/xdaq/include -I/home/sturdy/src/sw/xhal/xhalcore/include -c src/common/utils/XHALXMLParser.cpp -o src/linux/x86_64/utils/XHALXMLParser.o
src/common/utils/XHALXMLParser.cpp: In constructor ‘xhal::utils::XHALXMLParser::XHALXMLParser(const string&)’:
src/common/utils/XHALXMLParser.cpp:10:8: warning: ‘template<class> class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
   std::auto_ptr<log4cplus::Layout> myLayout = std::auto_ptr<log4cplus::Layout>(new log4cplus::TTCCLayout());
        ^~~~~~~~
In file included from /opt/rh/devtoolset-8/root/usr/include/c++/8/memory:80,
                 from /opt/xdaq/include/log4cplus/layout.h:39,
                 from /opt/xdaq/include/log4cplus/appender.h:33,
                 from /opt/xdaq/include/log4cplus/spi/appenderattachable.h:33,
                 from /opt/xdaq/include/log4cplus/logger.h:36,
                 from /home/sturdy/src/sw/xhal/xhalcore/include/xhal/utils/XHALXMLParser.h:39,
                 from src/common/utils/XHALXMLParser.cpp:1:
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/unique_ptr.h:53:28: note: declared here
   template<typename> class auto_ptr;
                            ^~~~~~~~
src/common/utils/XHALXMLParser.cpp:10:52: warning: ‘template<class> class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
   std::auto_ptr<log4cplus::Layout> myLayout = std::auto_ptr<log4cplus::Layout>(new log4cplus::TTCCLayout());
                                                    ^~~~~~~~
In file included from /opt/rh/devtoolset-8/root/usr/include/c++/8/memory:80,
                 from /opt/xdaq/include/log4cplus/layout.h:39,
                 from /opt/xdaq/include/log4cplus/appender.h:33,
                 from /opt/xdaq/include/log4cplus/spi/appenderattachable.h:33,
                 from /opt/xdaq/include/log4cplus/logger.h:36,
                 from /home/sturdy/src/sw/xhal/xhalcore/include/xhal/utils/XHALXMLParser.h:39,
                 from src/common/utils/XHALXMLParser.cpp:1:
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/unique_ptr.h:53:28: note: declared here
   template<typename> class auto_ptr;
                            ^~~~~~~~
src/common/utils/XHALXMLParser.cpp:14:35: error: no matching function for call to ‘log4cplus::Appender::setLayout(std::auto_ptr<log4cplus::Layout>&)’
   myAppender->setLayout( myLayout );
                                   ^
In file included from /opt/xdaq/include/log4cplus/spi/appenderattachable.h:33,
                 from /opt/xdaq/include/log4cplus/logger.h:36,
                 from /home/sturdy/src/sw/xhal/xhalcore/include/xhal/utils/XHALXMLParser.h:39,
                 from src/common/utils/XHALXMLParser.cpp:1:
/opt/xdaq/include/log4cplus/appender.h:216:22: note: candidate: ‘virtual void log4cplus::Appender::setLayout(std::unique_ptr<log4cplus::Layout>)’
         virtual void setLayout(std::unique_ptr<Layout> layout);
                      ^~~~~~~~~
/opt/xdaq/include/log4cplus/appender.h:216:22: note:   no known conversion for argument 1 from ‘std::auto_ptr<log4cplus::Layout>’ to ‘std::unique_ptr<log4cplus::Layout>’
src/common/utils/XHALXMLParser.cpp: In member function ‘boost::optional<xhal::utils::Node> xhal::utils::XHALXMLParser::getNodeFromAddress(uint32_t)’:
src/common/utils/XHALXMLParser.cpp:363:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^

The PC installed version is:

cmsos-core-log4cplus.x86_64        2.0.0-1550763994.master.centos7.gcc8
cmsos-core-log4cplus-devel.x86_64  2.0.0-1550763994.master.centos7.gcc8

@lmoureaux lmoureaux changed the title Fix #116 (untested) Fix #116 Jun 3, 2019
@lmoureaux
Copy link
Author

Added missing include.

@mexanick
Copy link
Contributor

In terms of log4cplus version we are tied to whatever version is provided by xdaq (or, was provided in its distribution before xdaq 15). Considering the compilation for ctp7, one need to cross-compile the appropriate version of the log4cplus library and place it on the card as well as in our peta-stage area.

@mexanick mexanick self-requested a review June 12, 2019 08:26
@lmoureaux
Copy link
Author

This PR is about supporting both log4cplus 1.x (xDAQ 14) and log4cplus 2.x (xDAQ 15) from the same code base. I would envision the migration plan as follows:

  • Support building against either version (this PR)
  • Nothing changes for xDAQ 14
  • In the meantime, a branch of cmsgemos based on xDAQ 15 can use 2.x
  • When the switch to xDAQ 15 happens, all x86 packages switch to 2.x transparently
  • The switch on the CTP7 can happen whenever appropriate, or never if we're stuck with too old compiler versions

@jsturdy
Copy link
Contributor

jsturdy commented Jun 17, 2019

Still not working...

make xhalcore
make -C xhalarm
make[1]: Entering directory '/home/sturdy/src/sw/xhal/xhalarm'
Using BUILD_HOME=/home/sturdy/src/sw
OS Detected: centos7
BUILD_VERSION 1.0.105.dev
PREREL_VERSION -final.dev105
rm -rf src/linux/arm/utils/XHALXMLParser.o
rm -rf /home/sturdy/src/sw/xhal/xhalarm/lib/libxhal.so
rm -rf /home/sturdy/src/sw/xhal/xhalarm/lib
rm -rf pkg/xhal
mkdir -p -p src/linux/arm/utils
arm-linux-gnueabihf-gcc -fomit-frame-pointer -pipe -fno-common -fno-builtin -Wall -std=c++14 -march=armv7-a -mfpu=neon -mfloat-abi=hard -mthumb-interwork -mtune=cortex-a9 -DEMBED -Dlinux -D__linux__ -Dunix -fPIC --sysroot=/data/sw/peta-stage -I/data/sw/peta-stage/usr/include -I/data/sw/peta-stage/include -std=gnu++14 -I/home/sturdy/src/sw/xhal/xhalcore/include -c -o src/linux/arm/utils/XHALXMLParser.o /home/sturdy/src/sw/xhal/xhalcore/src/common/utils/XHALXMLParser.cpp
/home/sturdy/src/sw/xhal/xhalcore/src/common/utils/XHALXMLParser.cpp: In constructor ‘xhal::utils::XHALXMLParser::XHALXMLParser(const string&)’:
/home/sturdy/src/sw/xhal/xhalcore/src/common/utils/XHALXMLParser.cpp:12:36: warning: ‘auto_ptr’ is deprecated (declared at /data/bigdisk/sw/Xilinx/SDK/2016.2/gnu/aarch32/lin/gcc-arm-linux-gnueabi/arm-linux-gnueabihf/include/c++/4.9.2/backward/auto_ptr.h:87) [-Wdeprecated-declarations]
   std::auto_ptr<log4cplus::Layout> myLayout = std::auto_ptr<log4cplus::Layout>(new log4cplus::TTCCLayout());
                                    ^
/home/sturdy/src/sw/xhal/xhalcore/src/common/utils/XHALXMLParser.cpp:12:107: warning: ‘auto_ptr’ is deprecated (declared at /data/bigdisk/sw/Xilinx/SDK/2016.2/gnu/aarch32/lin/gcc-arm-linux-gnueabi/arm-linux-gnueabihf/include/c++/4.9.2/backward/auto_ptr.h:87) [-Wdeprecated-declarations]
   std::auto_ptr<log4cplus::Layout> myLayout = std::auto_ptr<log4cplus::Layout>(new log4cplus::TTCCLayout());
                                                                                                           ^
/home/sturdy/src/sw/xhal/xhalcore/src/common/utils/XHALXMLParser.cpp: In member function ‘std::experimental::optional<xhal::utils::Node> xhal::utils::XHALXMLParser::getNodeFromAddress(uint32_t)’:
/home/sturdy/src/sw/xhal/xhalcore/src/common/utils/XHALXMLParser.cpp:365:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
arm-linux-gnueabihf-gcc -std=gnu++14 -L/data/sw/peta-stage/lib -L/data/sw/peta-stage/usr/lib -L/data/sw/peta-stage/ncurses -shared  -o /home/sturdy/src/sw/xhal/xhalarm/lib/libxhal.so src/linux/arm/utils/XHALXMLParser.o -llog4cplus -lxerces-c -lstdc++
Running default target
mkdir -p pkg/xhal
make[1]: Leaving directory '/home/sturdy/src/sw/xhal/xhalarm'
make -C xhalcore
make[1]: Entering directory '/home/sturdy/src/sw/xhal/xhalcore'
Using BUILD_HOME=/home/sturdy/src/sw
OS Detected: centos7
BUILD_VERSION 1.0.105.dev
PREREL_VERSION -final.dev105
mkdir -p src/linux/x86_64/utils
gcc -O0 -g3 -fno-inline -Wall -pthread -fPIC -std=c++11 -m64 -I/usr/include/python2.7 -I/opt/xdaq/include -I/home/sturdy/src/sw/xhal/xhalcore/include -c src/common/utils/XHALXMLParser.cpp -o src/linux/x86_64/utils/XHALXMLParser.o
src/common/utils/XHALXMLParser.cpp: In constructor ‘xhal::utils::XHALXMLParser::XHALXMLParser(const string&)’:
src/common/utils/XHALXMLParser.cpp:16:35: error: use of deleted function ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = log4cplus::Layout; _Dp = std::default_delete<log4cplus::Layout>]’
   myAppender->setLayout( myLayout );
                                   ^
In file included from /opt/rh/devtoolset-8/root/usr/include/c++/8/memory:80,
                 from /opt/xdaq/include/log4cplus/layout.h:39,
                 from /opt/xdaq/include/log4cplus/appender.h:33,
                 from /opt/xdaq/include/log4cplus/spi/appenderattachable.h:33,
                 from /opt/xdaq/include/log4cplus/logger.h:36,
                 from /home/sturdy/src/sw/xhal/xhalcore/include/xhal/utils/XHALXMLParser.h:39,
                 from src/common/utils/XHALXMLParser.cpp:1:
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/unique_ptr.h:394:7: note: declared here
       unique_ptr(const unique_ptr&) = delete;
       ^~~~~~~~~~
In file included from /opt/xdaq/include/log4cplus/spi/appenderattachable.h:33,
                 from /opt/xdaq/include/log4cplus/logger.h:36,
                 from /home/sturdy/src/sw/xhal/xhalcore/include/xhal/utils/XHALXMLParser.h:39,
                 from src/common/utils/XHALXMLParser.cpp:1:
/opt/xdaq/include/log4cplus/appender.h:216:22: note:   initializing argument 1 of ‘virtual void log4cplus::Appender::setLayout(std::unique_ptr<log4cplus::Layout>)’
         virtual void setLayout(std::unique_ptr<Layout> layout);
                      ^~~~~~~~~
src/common/utils/XHALXMLParser.cpp: In member function ‘boost::optional<xhal::utils::Node> xhal::utils::XHALXMLParser::getNodeFromAddress(uint32_t)’:
src/common/utils/XHALXMLParser.cpp:365:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
make[1]: *** [Makefile:84: src/linux/x86_64/utils/XHALXMLParser.o] Error 1
make[1]: Leaving directory '/home/sturdy/src/sw/xhal/xhalcore'
make: *** [Makefile:32: xhalcore] Error 2

@lmoureaux, I've added you to a VM that has xdaq15 installed (gemdaq-build-xdaq15)

You should be set up if you do:

export PETA_STAGE=/data/sw/peta-stage
source /data/sw/Xilinx/SDK/2016.2/settings64.sh
. /opt/rh/devtoolset-8/enable

log4cplus defines version macros, use them to fix the build failure mentioned in issue #116.
@lmoureaux
Copy link
Author

Thank you for the VM, I could test it now. I find it weird that the new interface doesn't take a const reference to the pointer.

You should be set up if you do:

export PETA_STAGE=/data/sw/peta-stage
source /data/sw/Xilinx/SDK/2016.2/settings64.sh
. /opt/rh/devtoolset-8/enable

Cannot find -lwiscrpcsvc (will look for a solution if I ever need to link anything)

@jsturdy
Copy link
Contributor

jsturdy commented Jun 18, 2019

Cannot find -lwiscrpcsvc (will look for a solution if I ever need to link anything)

You would need to add /opt/wiscrpcsvc/lib to LD_LIBRARY_PATH (and probably /opt/xdaq/lib too)

@mexanick
Copy link
Contributor

is it still in progress, or ready to review?

@jsturdy jsturdy changed the title Fix #116 WIP: Fix #116 Jul 26, 2019
@jsturdy
Copy link
Contributor

jsturdy commented Jul 26, 2019

is it still in progress, or ready to review?

I'll test again, but I believe it's still WIP...
It was part of longer term work anyway, but can probably get folded in to cms-gem-daq-project/ctp7_modules#148

@lmoureaux
Copy link
Author

As far as I'm concerned it's ok. IIRC I was able to link by changing some env variables. In any case I don't expect linking to be a problem.

@jsturdy
Copy link
Contributor

jsturdy commented Aug 1, 2019

As far as I'm concerned it's ok. IIRC I was able to link by changing some env variables. In any case I don't expect linking to be a problem.

This branch still doesn't compile (xhalcore) due to previously discussed issues

bash-4.2$ which gcc
/opt/rh/devtoolset-8/root/usr/bin/gcc
bash-4.2$ make xhalcore
make -C xhalarm
make[1]: Entering directory '/home/sturdy/src/sw/xhal/xhalarm'
Using BUILD_HOME=/home/sturdy/src/sw
OS Detected: centos7
BUILD_VERSION 1.0.106.dev
PREREL_VERSION -final.dev106
rm -rf src/linux/arm/utils/XHALXMLParser.o
rm -rf /home/sturdy/src/sw/xhal/xhalarm/lib/libxhal.so
rm -rf /home/sturdy/src/sw/xhal/xhalarm/lib
rm -rf pkg/xhal
mkdir -p -p src/linux/arm/utils
arm-linux-gnueabihf-gcc -fomit-frame-pointer -pipe -fno-common -fno-builtin -Wall -std=c++14 -march=armv7-a -mfpu=neon -mfloat-abi=hard -mthumb-interwork -mtune=cortex-a9 -DEMBED -Dlinux -D__linux__ -Dunix -fPIC --sysroot=/data/sw/peta-stage -I/data/sw/peta-stage/usr/include -I/data/sw/peta-stage/include -std=gnu++14 -I/home/sturdy/src/sw/xhal/xhalcore/include -c -o src/linux/arm/utils/XHALXMLParser.o /home/sturdy/src/sw/xhal/xhalcore/src/common/utils/XHALXMLParser.cpp
/home/sturdy/src/sw/xhal/xhalcore/src/common/utils/XHALXMLParser.cpp: In constructor ‘xhal::utils::XHALXMLParser::XHALXMLParser(const string&)’:
/home/sturdy/src/sw/xhal/xhalcore/src/common/utils/XHALXMLParser.cpp:12:85: warning: ‘auto_ptr’ is deprecated (declared at /data/bigdisk/sw/Xilinx/SDK/2016.2/gnu/aarch32/lin/gcc-arm-linux-gnueabi/arm-linux-gnueabihf/include/c++/4.9.2/backward/auto_ptr.h:87) [-Wdeprecated-declarations]
   myAppender->setLayout(std::auto_ptr<log4cplus::Layout>(new log4cplus::TTCCLayout()));
                                                                                     ^
/home/sturdy/src/sw/xhal/xhalcore/src/common/utils/XHALXMLParser.cpp: In member function ‘std::experimental::optional<xhal::utils::Node> xhal::utils::XHALXMLParser::getNodeFromAddress(uint32_t)’:
/home/sturdy/src/sw/xhal/xhalcore/src/common/utils/XHALXMLParser.cpp:364:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
arm-linux-gnueabihf-gcc -std=gnu++14 -L/data/sw/peta-stage/lib -L/data/sw/peta-stage/usr/lib -L/data/sw/peta-stage/ncurses -shared  -o /home/sturdy/src/sw/xhal/xhalarm/lib/libxhal.so src/linux/arm/utils/XHALXMLParser.o -llog4cplus -lxerces-c -lstdc++
Running default target
mkdir -p pkg/xhal
make[1]: Leaving directory '/home/sturdy/src/sw/xhal/xhalarm'
make -C xhalcore
make[1]: Entering directory '/home/sturdy/src/sw/xhal/xhalcore'
Using BUILD_HOME=/home/sturdy/src/sw
OS Detected: centos7
BUILD_VERSION 1.0.106.dev
PREREL_VERSION -final.dev106
mkdir -p src/linux/x86_64
gcc -O0 -g3 -fno-inline -Wall -pthread -fPIC -std=c++11 -m64 -I/usr/include/python2.7 -I/opt/xdaq/include -I/home/sturdy/src/sw/xhal/xhalcore/include -c -o src/linux/x86_64/XHALInterface.o src/common/XHALInterface.cpp
src/common/XHALInterface.cpp: In constructor ‘xhal::XHALInterface::XHALInterface(const string&)’:
src/common/XHALInterface.cpp:10:8: warning: ‘template<class> class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
   std::auto_ptr<log4cplus::Layout> myLayout = std::auto_ptr<log4cplus::Layout>(new log4cplus::TTCCLayout());
        ^~~~~~~~
In file included from /opt/rh/devtoolset-8/root/usr/include/c++/8/memory:80,
                 from /opt/xdaq/include/log4cplus/layout.h:39,
                 from /opt/xdaq/include/log4cplus/appender.h:33,
                 from /opt/xdaq/include/log4cplus/spi/appenderattachable.h:33,
                 from /opt/xdaq/include/log4cplus/logger.h:36,
                 from /home/sturdy/src/sw/xhal/xhalcore/include/xhal/XHALInterface.h:17,
                 from src/common/XHALInterface.cpp:1:
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/unique_ptr.h:53:28: note: declared here
   template<typename> class auto_ptr;
                            ^~~~~~~~
src/common/XHALInterface.cpp:10:52: warning: ‘template<class> class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
   std::auto_ptr<log4cplus::Layout> myLayout = std::auto_ptr<log4cplus::Layout>(new log4cplus::TTCCLayout());
                                                    ^~~~~~~~
In file included from /opt/rh/devtoolset-8/root/usr/include/c++/8/memory:80,
                 from /opt/xdaq/include/log4cplus/layout.h:39,
                 from /opt/xdaq/include/log4cplus/appender.h:33,
                 from /opt/xdaq/include/log4cplus/spi/appenderattachable.h:33,
                 from /opt/xdaq/include/log4cplus/logger.h:36,
                 from /home/sturdy/src/sw/xhal/xhalcore/include/xhal/XHALInterface.h:17,
                 from src/common/XHALInterface.cpp:1:
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/unique_ptr.h:53:28: note: declared here
   template<typename> class auto_ptr;
                            ^~~~~~~~
src/common/XHALInterface.cpp:11:35: error: no matching function for call to ‘log4cplus::Appender::setLayout(std::auto_ptr<log4cplus::Layout>&)’
   myAppender->setLayout( myLayout );
                                   ^
In file included from /opt/xdaq/include/log4cplus/spi/appenderattachable.h:33,
                 from /opt/xdaq/include/log4cplus/logger.h:36,
                 from /home/sturdy/src/sw/xhal/xhalcore/include/xhal/XHALInterface.h:17,
                 from src/common/XHALInterface.cpp:1:
/opt/xdaq/include/log4cplus/appender.h:221:22: note: candidate: ‘virtual void log4cplus::Appender::setLayout(std::unique_ptr<log4cplus::Layout>)’
         virtual void setLayout(std::unique_ptr<Layout> layout);
                      ^~~~~~~~~
/opt/xdaq/include/log4cplus/appender.h:221:22: note:   no known conversion for argument 1 from ‘std::auto_ptr<log4cplus::Layout>’ to ‘std::unique_ptr<log4cplus::Layout>’
make[1]: *** [Makefile:88: src/linux/x86_64/XHALInterface.o] Error 1
make[1]: Leaving directory '/home/sturdy/src/sw/xhal/xhalcore'
make: *** [Makefile:32: xhalcore] Error 2

@lmoureaux
Copy link
Author

I don't understand how I could compile it in the first place but here is the fix, tested on gem904daq01 and gemdaq-build-xdaq15. There are two loggers...

@jsturdy jsturdy changed the title WIP: Fix #116 Add log4cplus version awareness, fix #116 Sep 3, 2019
@jsturdy jsturdy merged commit 76c67ae into develop Sep 3, 2019
@lpetre-ulb lpetre-ulb deleted the bugfix/log4cplus-2.0 branch February 29, 2020 13:21
@jsturdy jsturdy mentioned this pull request Mar 2, 2020
2 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

xDAQ15 brings log4cplus 2.0
3 participants