From: John P. <jwp...@gm...> - 2017-11-15 15:55:35
|
On Tue, Nov 14, 2017 at 11:23 PM, Griffith, Boyce Eugene < bo...@em...> wrote: > We are running into a problem with errno and/or ENOMEM on an Ubuntu system > using either Clang 3.8 or GCC 5.4, which are the compilers on whatever LTS > version of Ubuntu is being used on this system. > > With clang, the error looks like: > > ========== > > make[2]: Entering directory '/srv/clang-sfw/linux/libmesh/ > 1.2.0/objs-debug' > CXX src/mesh/libmesh_dbg_la-exodusII_io_helper.lo > In file included from ../LIBMESH/src/mesh/exodusII_io_helper.C:32: > In file included from ./include/libmesh/system.h:30: > In file included from ./include/libmesh/fem_function_base.h:29: > In file included from ./include/libmesh/dense_vector.h:31: > In file included from ../LIBMESH/contrib/eigen/eigen/Eigen/Dense:1: > In file included from ../LIBMESH/contrib/eigen/eigen/Eigen/Core:256: > ../LIBMESH/contrib/eigen/eigen/Eigen/src/Core/util/Memory.h:168:5: error: > use of undeclared identifier > '__errno_location'; did you mean 'exII::__errno_location'? > errno = ENOMEM; // according to the standard > ^ > /usr/include/x86_64-linux-gnu/bits/errno.h:54:20: note: expanded from > macro 'errno' > # define errno (*__errno_location ()) > ^ > /usr/include/x86_64-linux-gnu/bits/errno.h:50:13: note: > 'exII::__errno_location' declared here > extern int *__errno_location (void) __THROW __attribute__ ((__const__)); > ^ > 1 error generated. > Makefile:14763: recipe for target 'src/mesh/libmesh_dbg_la-exodusII_io_helper.lo' > failed > make[2]: *** [src/mesh/libmesh_dbg_la-exodusII_io_helper.lo] Error 1 > CXX src/mesh/libmesh_dbg_la-nemesis_io_helper.lo > In file included from ../LIBMESH/src/mesh/nemesis_io_helper.C:31: > In file included from ./include/libmesh/numeric_vector.h:32: > In file included from ./include/libmesh/dense_subvector.h:25: > In file included from ./include/libmesh/dense_vector.h:31: > In file included from ../LIBMESH/contrib/eigen/eigen/Eigen/Dense:1: > In file included from ../LIBMESH/contrib/eigen/eigen/Eigen/Core:256: > ../LIBMESH/contrib/eigen/eigen/Eigen/src/Core/util/Memory.h:168:5: error: > use of undeclared identifier > '__errno_location'; did you mean 'exII::__errno_location'? > errno = ENOMEM; // according to the standard > ^ > /usr/include/x86_64-linux-gnu/bits/errno.h:54:20: note: expanded from > macro 'errno' > # define errno (*__errno_location ()) > ^ > /usr/include/x86_64-linux-gnu/bits/errno.h:50:13: note: > 'exII::__errno_location' declared here > extern int *__errno_location (void) __THROW __attribute__ ((__const__)); > ^ > 1 error generated. > Makefile:14987: recipe for target 'src/mesh/libmesh_dbg_la-nemesis_io_helper.lo' > failed > > ========== > > It looks like there is an attempt to work around this on some compilers > (LIBMESH_COMPILER_HAS_BROKEN_ERRNO_T), but manually setting that flag to > 1 did not seem to make any difference. > > This is with libMesh 1.2.0. > > Is there an easy workaround? > I think that --disable-eigen can also "fix" this, with the obvious caveat that you won't be able to use eigen. Short of that fix, using a different compiler is probably the quickest thing to try. My theory about this error was that it is caused when the C header file <errno.h> is included from within a C++ namespace. A workaround that fixed the problem on at least one system was to just #include <errno.h> before the enclosing namespace, but that fix does not appear to work in general... -- John |