Mesos
  1. Mesos
  2. MESOS-688

error of "unused_local_typedefs" in thirdparty/boost

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.12.0
    • Fix Version/s: 0.12.0
    • Component/s: release
    • Labels:
    • Environment:

      Fedora 19, Linux 3.10.9, x86_64, g++ 4.8.1

      Description

      Compilation error under g++ 4.8.1 (Fedora 19)
      ....
      ../3rdparty/libprocess/3rdparty/boost-1.53.0/boost/variant/variant.hpp: In member function 'void boost::variant<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>::operator<(const U&) const':
      ../3rdparty/libprocess/3rdparty/boost-1.53.0/boost/variant/variant.hpp:2254:135: error: typedef 'boost_static_assert_typedef_2254' locally defined but not used [-Werror=unused-local-typedefs]
      BOOST_STATIC_ASSERT( false && sizeof(U) );
      ^
      cc1plus: all warnings being treated as errors
      ....

      It is a well-known bug in boost.
      https://svn.boost.org/trac/boost/ticket/8546
      https://groups.google.com/forum/#!topic/v8-dev/vxzTVQ5fJ4s

      Before it is fixed totally in boost, the error can be just suppressed here
      mesos/src/Makefile.am: line 73
      MESOS_CPPFLAGS += -Wall -Werror

      =======

      MESOS_CPPFLAGS += -Wall -Werror -Wno-unused-local-typedefs.

      yf

        Issue Links

          Activity

          Show
          Brenden Matthews added a comment - FYI: https://reviews.apache.org/r/11974/
          Hide
          Yong Fu added a comment -

          Try boost 1.54. The problem is still there.
          ...
          ../3rdparty/libprocess/3rdparty/boost-1.54.0/boost/unordered/detail/unique.hpp: In member function 'boost::unordered::detail::table_impl<Types>::value_type& boost::unordered::detail::table_impl<Types>::operator[](const key_type&)':
          ../3rdparty/libprocess/3rdparty/boost-1.54.0/boost/unordered/detail/unique.hpp:337:54: error: typedef 'mapped_type' locally defined but not used [-Werror=unused-local-typedefs]
          typedef typename value_type::second_type mapped_type;
          ^
          cc1plus: all warnings being treated as errors
          make[2]: *** [sched/libmesos_no_3rdparty_la-sched.lo] Error 1
          make[2]: Leaving directory `/home/yfu/projects/BADS/mesos/src'
          make[1]: *** [check] Error 2
          make[1]: Leaving directory `/home/yfu/projects/BADS/mesos/src'
          ...

          It seems boost fixed some of this but made more. Maybe we should try Ben Malher's patch?

          BTW: mesos/3rdparty/libprocess/3rdparty/boost-1.53.0/README still uses third_party as directory name (should be changed as 3rparty)

          Show
          Yong Fu added a comment - Try boost 1.54. The problem is still there. ... ../3rdparty/libprocess/3rdparty/boost-1.54.0/boost/unordered/detail/unique.hpp: In member function 'boost::unordered::detail::table_impl<Types>::value_type& boost::unordered::detail::table_impl<Types>::operator[](const key_type&)': ../3rdparty/libprocess/3rdparty/boost-1.54.0/boost/unordered/detail/unique.hpp:337:54: error: typedef 'mapped_type' locally defined but not used [-Werror=unused-local-typedefs] typedef typename value_type::second_type mapped_type; ^ cc1plus: all warnings being treated as errors make [2] : *** [sched/libmesos_no_3rdparty_la-sched.lo] Error 1 make [2] : Leaving directory `/home/yfu/projects/BADS/mesos/src' make [1] : *** [check] Error 2 make [1] : Leaving directory `/home/yfu/projects/BADS/mesos/src' ... It seems boost fixed some of this but made more. Maybe we should try Ben Malher's patch? BTW: mesos/3rdparty/libprocess/3rdparty/boost-1.53.0/README still uses third_party as directory name (should be changed as 3rparty)
          Hide
          Yong Fu added a comment -
          Show
          Yong Fu added a comment - See https://reviews.apache.org/r/11974/
          Hide
          Yong Fu added a comment -
          Show
          Yong Fu added a comment - https://reviews.apache.org/r/11974/
          Hide
          Vinod Kone added a comment -

          Brenden, your fix in https://reviews.apache.org/r/11974/ doesn't seem to work for OSX 10.8.4 (i686-apple-darwin11-llvm-gcc-4.2) or CentOS 5.5 (gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-54)).

          I get the following error:

          ➜ ~/workspace/apache/mesos/build git:(master) ✗ PYTHON_VERSION=2.6 ../configure --disable-optimize
          checking build system type... x86_64-apple-darwin12.5.0
          checking host system type... x86_64-apple-darwin12.5.0
          checking target system type... x86_64-apple-darwin12.5.0
          checking for a BSD-compatible install... /usr/bin/install -c
          checking whether build environment is sane... yes
          checking for a thread-safe mkdir -p... ../install-sh -c -d
          checking for gawk... no
          checking for mawk... no
          checking for nawk... no
          checking for awk... awk
          checking whether make sets $(MAKE)... yes
          checking whether make supports nested variables... yes
          checking for style of include used by make... GNU
          checking for g+... g+
          checking whether the C++ compiler works... yes
          checking for C++ compiler default output file name... a.out
          checking for suffix of executables...
          checking whether we are cross compiling... no
          checking for suffix of object files... o
          checking whether we are using the GNU C++ compiler... yes
          checking whether g++ accepts -g... yes
          checking dependency style of g++... gcc3
          checking for ar... ar
          checking the archiver (ar) interface... ar
          checking how to print strings... printf
          checking for gcc... gcc
          checking whether we are using the GNU C compiler... yes
          checking whether gcc accepts -g... yes
          checking for gcc option to accept ISO C89... none needed
          checking dependency style of gcc... gcc3
          checking for a sed that does not truncate output... /usr/bin/sed
          checking for grep that handles long lines and -e... /usr/bin/grep
          checking for egrep... /usr/bin/grep -E
          checking for fgrep... /usr/bin/grep -F
          checking for ld used by gcc... /usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld
          checking if the linker (/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) is GNU ld... no
          checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm
          checking the name lister (/usr/bin/nm) interface... BSD nm
          checking whether ln -s works... yes
          checking the maximum length of command line arguments... 196608
          checking whether the shell understands some XSI constructs... yes
          checking whether the shell understands "+="... yes
          checking how to convert x86_64-apple-darwin12.5.0 file names to x86_64-apple-darwin12.5.0 format... func_convert_file_noop
          checking how to convert x86_64-apple-darwin12.5.0 file names to toolchain format... func_convert_file_noop
          checking for /usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld option to reload object files... -r
          checking for objdump... no
          checking how to recognize dependent libraries... pass_all
          checking for dlltool... no
          checking how to associate runtime and link libraries... printf %s\n
          checking for archiver @FILE support... no
          checking for strip... strip
          checking for ranlib... ranlib
          checking command to parse /usr/bin/nm output from gcc object... ok
          checking for sysroot... no
          checking for mt... no
          checking if : is a manifest tool... no
          checking for dsymutil... dsymutil
          checking for nmedit... nmedit
          checking for lipo... lipo
          checking for otool... otool
          checking for otool64... no
          checking for -single_module linker flag... yes
          checking for -exported_symbols_list linker flag... yes
          checking for -force_load linker flag... yes
          checking how to run the C preprocessor... gcc -E
          checking for ANSI C header files... yes
          checking for sys/types.h... yes
          checking for sys/stat.h... yes
          checking for stdlib.h... yes
          checking for string.h... yes
          checking for memory.h... yes
          checking for strings.h... yes
          checking for inttypes.h... yes
          checking for stdint.h... yes
          checking for unistd.h... yes
          checking for dlfcn.h... yes
          checking for objdir... .libs
          checking if gcc supports -fno-rtti -fno-exceptions... no
          checking for gcc option to produce PIC... -fno-common -DPIC
          checking if gcc PIC flag -fno-common -DPIC works... yes
          checking if gcc static flag -static works... no
          checking if gcc supports -c -o file.o... yes
          checking if gcc supports -c -o file.o... (cached) yes
          checking whether the gcc linker (/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) supports shared libraries... yes
          checking dynamic linker characteristics... darwin12.5.0 dyld
          checking how to hardcode library paths into programs... immediate
          checking whether stripping libraries is possible... yes
          checking if libtool supports shared libraries... yes
          checking whether to build shared libraries... yes
          checking whether to build static libraries... yes
          checking how to run the C++ preprocessor... g++ -E
          checking for ld used by g++... /usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld
          checking if the linker (/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) is GNU ld... no
          checking whether the g++ linker (/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) supports shared libraries... yes
          checking for g++ option to produce PIC... -fno-common -DPIC
          checking if g++ PIC flag -fno-common -DPIC works... yes
          checking if g++ static flag -static works... no
          checking if g++ supports -c -o file.o... yes
          checking if g++ supports -c -o file.o... (cached) yes
          checking whether the g++ linker (/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) supports shared libraries... yes
          checking dynamic linker characteristics... darwin12.5.0 dyld
          checking how to hardcode library paths into programs... immediate
          configure: creating ./config.lt
          config.lt: creating libtool
          ===========================================================
          Setting up build environment for x86_64 darwin12.5.0
          ===========================================================
          checking whether we are using the GNU C++ compiler... (cached) yes
          checking whether g++ accepts -g... (cached) yes
          checking dependency style of g++... (cached) gcc3
          checking whether we are using the GNU C compiler... (cached) yes
          checking whether gcc accepts -g... (cached) yes
          checking for gcc option to accept ISO C89... (cached) none needed
          checking dependency style of gcc... (cached) gcc3
          checking for the pthreads library -lpthreads... no
          checking whether pthreads work without any flags... no
          checking whether pthreads work with -Kthread... no
          checking whether pthreads work with -kthread... no
          checking for the pthreads library -llthread... no
          checking whether pthreads work with -pthread... no
          checking whether pthreads work with -pthreads... no
          checking whether pthreads work with -mthreads... no
          checking for the pthreads library -lpthread... no
          checking whether pthreads work with --thread-safe... no
          checking whether pthreads work with -mt... no
          checking for pthread-config... no
          configure: error: failed to find pthreads

          Show
          Vinod Kone added a comment - Brenden, your fix in https://reviews.apache.org/r/11974/ doesn't seem to work for OSX 10.8.4 (i686-apple-darwin11-llvm-gcc-4.2) or CentOS 5.5 (gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-54)). I get the following error: ➜ ~/workspace/apache/mesos/build git:(master) ✗ PYTHON_VERSION=2.6 ../configure --disable-optimize checking build system type... x86_64-apple-darwin12.5.0 checking host system type... x86_64-apple-darwin12.5.0 checking target system type... x86_64-apple-darwin12.5.0 checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... ../install-sh -c -d checking for gawk... no checking for mawk... no checking for nawk... no checking for awk... awk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking for style of include used by make... GNU checking for g+ ... g + checking whether the C++ compiler works... yes checking for C++ compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking for ar... ar checking the archiver (ar) interface... ar checking how to print strings... printf checking for gcc... gcc checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /usr/bin/sed checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for fgrep... /usr/bin/grep -F checking for ld used by gcc... /usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld checking if the linker (/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) is GNU ld... no checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm checking the name lister (/usr/bin/nm) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 196608 checking whether the shell understands some XSI constructs... yes checking whether the shell understands "+="... yes checking how to convert x86_64-apple-darwin12.5.0 file names to x86_64-apple-darwin12.5.0 format... func_convert_file_noop checking how to convert x86_64-apple-darwin12.5.0 file names to toolchain format... func_convert_file_noop checking for /usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld option to reload object files... -r checking for objdump... no checking how to recognize dependent libraries... pass_all checking for dlltool... no checking how to associate runtime and link libraries... printf %s\n checking for archiver @FILE support... no checking for strip... strip checking for ranlib... ranlib checking command to parse /usr/bin/nm output from gcc object... ok checking for sysroot... no checking for mt... no checking if : is a manifest tool... no checking for dsymutil... dsymutil checking for nmedit... nmedit checking for lipo... lipo checking for otool... otool checking for otool64... no checking for -single_module linker flag... yes checking for -exported_symbols_list linker flag... yes checking for -force_load linker flag... yes checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fno-common -DPIC checking if gcc PIC flag -fno-common -DPIC works... yes checking if gcc static flag -static works... no checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.o... (cached) yes checking whether the gcc linker (/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) supports shared libraries... yes checking dynamic linker characteristics... darwin12.5.0 dyld checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking how to run the C++ preprocessor... g++ -E checking for ld used by g++... /usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld checking if the linker (/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) is GNU ld... no checking whether the g++ linker (/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) supports shared libraries... yes checking for g++ option to produce PIC... -fno-common -DPIC checking if g++ PIC flag -fno-common -DPIC works... yes checking if g++ static flag -static works... no checking if g++ supports -c -o file.o... yes checking if g++ supports -c -o file.o... (cached) yes checking whether the g++ linker (/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) supports shared libraries... yes checking dynamic linker characteristics... darwin12.5.0 dyld checking how to hardcode library paths into programs... immediate configure: creating ./config.lt config.lt: creating libtool =========================================================== Setting up build environment for x86_64 darwin12.5.0 =========================================================== checking whether we are using the GNU C++ compiler... (cached) yes checking whether g++ accepts -g... (cached) yes checking dependency style of g++... (cached) gcc3 checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking dependency style of gcc... (cached) gcc3 checking for the pthreads library -lpthreads... no checking whether pthreads work without any flags... no checking whether pthreads work with -Kthread... no checking whether pthreads work with -kthread... no checking for the pthreads library -llthread... no checking whether pthreads work with -pthread... no checking whether pthreads work with -pthreads... no checking whether pthreads work with -mthreads... no checking for the pthreads library -lpthread... no checking whether pthreads work with --thread-safe... no checking whether pthreads work with -mt... no checking for pthread-config... no configure: error: failed to find pthreads
          Hide
          Vinod Kone added a comment -

          This is what config.log shows

          configure:18133: checking for the pthreads library -lpthreads
          configure:18166: gcc -o conftest -g -Wno-unused-local-typedefs conftest.c -lpthreads >&5
          cc1: error: unrecognized command line option "-Wno-unused-local-typedefs"
          configure:18166: $? = 1
          configure: failed program was:

          /* confdefs.h */
          #define PACKAGE_NAME "mesos"
          #define PACKAGE_TARNAME "mesos"
          #define PACKAGE_VERSION "0.15.0"
          #define PACKAGE_STRING "mesos 0.15.0"
          #define PACKAGE_BUGREPORT ""
          #define PACKAGE_URL ""
          #define PACKAGE "mesos"
          #define VERSION "0.15.0"
          #define STDC_HEADERS 1
          #define HAVE_SYS_TYPES_H 1
          #define HAVE_SYS_STAT_H 1
          #define HAVE_STDLIB_H 1
          #define HAVE_STRING_H 1
          #define HAVE_MEMORY_H 1
          #define HAVE_STRINGS_H 1
          #define HAVE_INTTYPES_H 1
          #define HAVE_STDINT_H 1
          #define HAVE_UNISTD_H 1
          #define HAVE_DLFCN_H 1
          #define LT_OBJDIR ".libs/"
          /* end confdefs.h. */
          #include <pthread.h>
          int
          main ()
          { | pthread_t th; pthread_join(th, 0); | pthread_attr_init(0); pthread_cleanup_push(0, 0); | pthread_create(0,0,0,0); pthread_cleanup_pop(0); | ; | return 0; | }

          configure:18175: result: no
          configure:18078: checking whether pthreads work without any flags
          configure:18166: gcc -o conftest -g -Wno-unused-local-typedefs conftest.c >&5
          cc1: error: unrecognized command line option "-Wno-unused-local-typedefs"
          configure:18166: $? = 1

          Show
          Vinod Kone added a comment - This is what config.log shows configure:18133: checking for the pthreads library -lpthreads configure:18166: gcc -o conftest -g -Wno-unused-local-typedefs conftest.c -lpthreads >&5 cc1: error: unrecognized command line option "-Wno-unused-local-typedefs" configure:18166: $? = 1 configure: failed program was: /* confdefs.h */ #define PACKAGE_NAME "mesos" #define PACKAGE_TARNAME "mesos" #define PACKAGE_VERSION "0.15.0" #define PACKAGE_STRING "mesos 0.15.0" #define PACKAGE_BUGREPORT "" #define PACKAGE_URL "" #define PACKAGE "mesos" #define VERSION "0.15.0" #define STDC_HEADERS 1 #define HAVE_SYS_TYPES_H 1 #define HAVE_SYS_STAT_H 1 #define HAVE_STDLIB_H 1 #define HAVE_STRING_H 1 #define HAVE_MEMORY_H 1 #define HAVE_STRINGS_H 1 #define HAVE_INTTYPES_H 1 #define HAVE_STDINT_H 1 #define HAVE_UNISTD_H 1 #define HAVE_DLFCN_H 1 #define LT_OBJDIR ".libs/" /* end confdefs.h. */ #include <pthread.h> int main () { | pthread_t th; pthread_join(th, 0); | pthread_attr_init(0); pthread_cleanup_push(0, 0); | pthread_create(0,0,0,0); pthread_cleanup_pop(0); | ; | return 0; | } configure:18175: result: no configure:18078: checking whether pthreads work without any flags configure:18166: gcc -o conftest -g -Wno-unused-local-typedefs conftest.c >&5 cc1: error: unrecognized command line option "-Wno-unused-local-typedefs" configure:18166: $? = 1
          Hide
          Brenden Matthews added a comment -

          Hmm, I guess old versions of GCC don't handle unknown warning flags the same as newer ones?

          I suppose another fix is to only apply this for GCC 4.8. I'll send a patch shortly.

          Show
          Brenden Matthews added a comment - Hmm, I guess old versions of GCC don't handle unknown warning flags the same as newer ones? I suppose another fix is to only apply this for GCC 4.8. I'll send a patch shortly.
          Show
          Brenden Matthews added a comment - https://reviews.apache.org/r/14164/
          Hide
          Timothy St. Clair added a comment -

          Just as a side note, I have a patch-set which removes all the 3rd-party elements, which I would argue is the better approach in the long run.
          see https://fedoraproject.org/wiki/Mesos_packaging for details.

          Show
          Timothy St. Clair added a comment - Just as a side note, I have a patch-set which removes all the 3rd-party elements, which I would argue is the better approach in the long run. see https://fedoraproject.org/wiki/Mesos_packaging for details.
          Hide
          Neil Conway added a comment -

          AFAIK this is fixed: we add -Wno-unused-local-typedef to CXXFLAGS when appropriate/necessary.

          Show
          Neil Conway added a comment - AFAIK this is fixed: we add -Wno-unused-local-typedef to CXXFLAGS when appropriate/necessary.

            People

            • Assignee:
              Brenden Matthews
              Reporter:
              Yong Fu
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development