Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017 Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
<== Date ==> <== Thread ==>

Subject: Re: EPICS 7.0.1-pre1 (spinlock.hpp)
From: Dirk Zimoch <dirk.zimoch@psi.ch>
To: <core-talk@aps.anl.gov>
Date: Thu, 23 Nov 2017 16:34:12 +0100
On 22.11.2017 13:28, Dirk Zimoch wrote:
The vxWorks 6.2 and 6.3 builds failed here:
In file included from
/usr/local/epics/base-7.0.1/include/os/vxWorks/boost/smart_ptr/detail/spinlock_pool.hpp:25,

                 from
/usr/local/epics/base-7.0.1/include/os/vxWorks/boost/smart_ptr/shared_ptr.hpp:38,

                 from
/usr/local/epics/base-7.0.1/include/os/vxWorks/boost/shared_ptr.hpp:17,
                 from
/usr/local/epics/base-7.0.1/include/os/vxWorks/boost/tr1/memory.hpp:56,
                 from ../../src/misc/pv/sharedPtr.h:133,
                 from ../pv/pvType.h:41,
                 from ../pv/pvIntrospect.h:17,
                 from ../pv/pvData.h:24,
                 from ../../src/json/print.cpp:11:
/usr/local/epics/base-7.0.1/include/os/vxWorks/boost/smart_ptr/detail/spinlock.hpp:47:52:
boost/smart_ptr/detail/spinlock_pt.hpp: No such file or directory

When comparing with vxWorks 6.6 and 6.7, I see the following includes:

/usr/local/epics/base-7.0.1/include/os/vxWorks/boost/smart_ptr/detail/spinlock_pool.hpp \

/usr/local/epics/base-7.0.1/include/os/vxWorks/boost/smart_ptr/detail/spinlock.hpp \

/usr/local/epics/base-7.0.1/include/os/vxWorks/boost/smart_ptr/detail/spinlock_sync.hpp \


That means in spinlock.hpp vxWorks 6.6 and 6.7 take the branch
#elif defined( BOOST_SP_HAS_SYNC )
#  include <boost/smart_ptr/detail/spinlock_sync.hpp>

But vxWorks 6.2 and 6.3 want to take the branch
#elif defined(BOOST_HAS_PTHREADS)
#  include <boost/smart_ptr/detail/spinlock_pt.hpp>

I checked that vxWorks 6 indeed defines _POSIX_THREADS as checked in posix_features.hpp:
      // POSIX defines _POSIX_THREADS > 0 for pthread support,
      // however some platforms define _POSIX_THREADS without
      // a value, hence the (_POSIX_THREADS+0 >= 0) check.
      // Strictly speaking this may catch platforms with a
      // non-functioning stub <pthreads.h>, but such occurrences should
      // occur very rarely if at all.
# if defined(_POSIX_THREADS) && (_POSIX_THREADS+0 >= 0) && !defined(BOOST_HAS_WINTHREADS) && !defined(BOOST_HAS_MPTASKS)
#        define BOOST_HAS_PTHREADS
#     endif

But the file boost/smart_ptr/detail/spinlock_pt.hpp is missing. I copied it from another boost installation to see what happens. VxWorks 6.2 has pthread_mutex_lock(). It implements it with semTake() but does some magic before to follow posix rules. Maybe it is better to use semTake directly in a vxWorks specific implementation? Also I don't think that vxWorks 6.2 supports multi-core processors. Thus intLock() may be faster and still safe?


Now I get another error with vxWorks 6.2:

In file included from ../../src/misc/pvUnitTest.cpp:12:
../../src/misc/pv/pvUnitTest.h: In function `detail::testPassx
testFieldEqual(const boost::shared_ptr<const epics::pvData::PVStructure>&,
   const char*, typename PVD::value_type)':
../../src/misc/pv/pvUnitTest.h:156: error: syntax error before `>' token
../../src/misc/pv/pvUnitTest.h:158: error: syntax error before `>' token
../../src/misc/pv/pvUnitTest.h:160: error: syntax error before `>' token
../../src/misc/pv/pvUnitTest.h: In function `detail::testPassx
testFieldEqual(const boost::shared_ptr<const epics::pvData::PVStructure>&,
   const char*, typename PVD::const_svector)':
../../src/misc/pv/pvUnitTest.h:177: error: syntax error before `>' token

And with vxWorks 6.3:

/afs/psi.ch/project/vxworks/WindRiverGPP3.3/gnu/3.4.4-vxworks-6.3/x86-linux2/bin/../lib/gcc/powerpc-wrs-vxworks/3.4.4/../../../../include/c++/3.4.4/xstring: In function `void testLogicException()': /afs/psi.ch/project/vxworks/WindRiverGPP3.3/gnu/3.4.4-vxworks-6.3/x86-linux2/bin/../lib/gcc/powerpc-wrs-vxworks/3.4.4/../../../../include/c++/3.4.4/xstring:78: internal compiler error: in expand_expr_real, at expr.c:8417
Please submit a full bug report,
with preprocessed source if appropriate.
Contact support@windriver.com for instructions.


Replies:
Re: EPICS 7.0.1-pre1 (spinlock.hpp) Johnson, Andrew N.
References:
EPICS 7.0.1-pre1 Andrew Johnson
Re: EPICS 7.0.1-pre1 Dirk Zimoch

Navigate by Date:
Prev: Re: EPICS 7.0.1-pre1 (pdbsingle.cpp) Michael Davidsaver
Next: Re: EPICS 7.0.1-pre1 (spinlock.hpp) Johnson, Andrew N.
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
Navigate by Thread:
Prev: Re: EPICS 7.0.1-pre1 (pdbsingle.cpp) Michael Davidsaver
Next: Re: EPICS 7.0.1-pre1 (spinlock.hpp) Johnson, Andrew N.
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
ANJ, 23 Nov 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·