Menu

#3 Unused local typedef errors when compiling with clang

0.1
pending
None
2015-12-11
2015-11-11
Anonymous
No

Copied from: https://sourceforge.net/u/mbradle/blog/2015/02/compiling-nucnet-tools-with-the-llvmclang-compiler/

Dear Sir,
I have trried as what you said, but I encountered the following errors:
In file included from /opt/local/include/boost/lexical_cast/detail/converter_lexical.hpp:54:
/opt/local/include/boost/lexical_cast/detail/converter_lexical_streams.hpp:210:17: error:
unused typedef 'boost_static_assert_typedef_212'
[-Werror,-Wunused-local-typedef]
BOOST_STATIC_ASSERT_MSG(( sizeof(T) <= sizeof(CharT)),
^
/opt/local/include/boost/static_assert.hpp:36:48: note: expanded from macro
'BOOST_STATIC_ASSERT_MSG'
define BOOST_STATIC_ASSERT_MSG( B, Msg ) BOOST_STATIC_ASSERT( B )
^
/opt/local/include/boost/static_assert.hpp:170:16: note: expanded from macro
'BOOST_STATIC_ASSERT'
BOOST_JOIN(boost_static_assert_typedef_, LINE) BOOST_...
^
/opt/local/include/boost/config/suffix.hpp:544:28: note: expanded from macro
'BOOST_JOIN'
define BOOST_JOIN( X, Y ) BOOST_DO_JOIN( X, Y )
^
/opt/local/include/boost/config/suffix.hpp:545:31: note: expanded from macro
'BOOST_DO_JOIN'
define BOOST_DO_JOIN( X, Y ) BOOST_DO_JOIN2(X,Y)
^
/opt/local/include/boost/config/suffix.hpp:546:32: note: expanded from macro
'BOOST_DO_JOIN2'
define BOOST_DO_JOIN2( X, Y ) X##Y
^
<scratch space="">:103:1: note: expanded from here
boost_static_assert_typedef_212
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [../../obj/auxiliary.o] Error 1

Discussion

  • Bradley S. Meyer

    This is an issue with boost. I've changed the build Makefile not to treat unused local typedefs as errors, to the code will compile with clang. Try

    cd nucnet-tools-code
    svn up
    cd examples/network
    make clean
    make run_single_zone

    You will get a lot of warnings, but the code will compile. I want to leave the warnings in to remind me to address this issue when boost fixes things. If you want to suppress these warnings, however, edit ../../build/Makefile to change the lines

     # Temporarily ignore unused local typedefs in clang as errors until
     # boost fixes this.
    
     ifeq ($(GC), clang++)
        CFLAGS+= -Wno-error=unused-local-typedef
      endif
    

    to

     # Temporarily ignore unused local typedefs in clang as errors until
     # boost fixes this.
    
     ifeq ($(GC), clang++)
        CFLAGS+= -Wno-unused-local-typedef
      endif
    

    I will leave the ticket pending.

     
  • Bradley S. Meyer

    • status: open --> pending
     
  • Anonymous

    Anonymous - 2015-12-11

    Dear sir,

    Every time I encontered the problem below, can you help me find ways to solve it:
    .............

    when I run*

    MacBook:analysis mumu$ make all_analysis

    In file included from ../../nnt/auxiliary.cpp:29:0:
    ../../nnt/auxiliary.h:37:33: fatal error: boost/tuple/tuple.hpp: No such file or directory
    #include <boost tuple="" tuple.hpp="">
    ^
    compilation terminated.
    make: [../../obj/auxiliary.o] Error 1
    gedeMacBook:analysis mumu$ make all_analysis
    g++ -Werror -Wall -Wpointer-arith -Wcast-qual -Wwrite-strings -fshort-enums -fno-common -g -ansi -Wconversion -O0 -Wno-deprecated xml2-config --cflags gsl-config --cflags -I../../vendor/libnucnet/0.23/src -I../../vendor/wn_matrix/0.15/src -I../../vendor/libstatmech/0.8/src -I../../vendor/libnuceq/0.5/src -I../.. -c -o ../../obj/auxiliary.o ../../nnt/auxiliary.cpp
    In file included from ../../nnt/auxiliary.cpp:29:0:
    ../../nnt/auxiliary.h:37:33: fatal error: boost/tuple/tuple.hpp: No such file or directory
    #include <boost tuple="" tuple.hpp="">
    ^
    compilation terminated.
    make:
    [../../obj/auxiliary.o] Error 1

    • Then I try to install boost and also try to install source of boost on mac
    • sudo port install boost
      Password:
      ---> Computing dependencies for boost
      ---> Cleaning boost
      ---> Scanning binaries for linking errors
      ---> Found 1 broken file(s), matching files to ports
      ---> Found 1 broken port(s), determining rebuild order
      ---> Rebuilding in order
      guile18 @1.8.8
      ---> Computing dependencies for guile18
      ---> Cleaning guile18
      ---> Scanning binaries for linking errors
      ---> Found 1 broken file(s), matching files to ports
      ---> Found 1 broken port(s), determining rebuild order
      ---> Rebuilding in order
      guile18 @1.8.8
      ---> Computing dependencies for guile18
      ---> Fetching distfiles for guile18
      ---> Verifying checksums for guile18
      ---> Extracting guile18
      ---> Applying patches to guile18
      ---> Configuring guile18
      ---> Building guile18
      ---> Staging guile18 into destroot
      Error: org.macports.destroot for port guile18 returned: command execution failed
      Please see the log file for port guile18 for details:
      /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_guile18/guile18/main.log
      Error: Unable to upgrade port: 1
      Error rebuilding guile18
      while executing
      "error "Error rebuilding $portname""
      (procedure "revupgrade_scanandrebuild" line 395)
      invoked from within
      "revupgrade_scanandrebuild broken_port_counts $opts"
      (procedure "macports::revupgrade" line 5)
      invoked from within
      "macports::revupgrade $opts"
      (procedure "action_revupgrade" line 2)
      invoked from within
      "action_revupgrade $action $portlist $opts"
      (procedure "action_target" line 96)
      invoked from within
      "$action_proc $action $portlist [array get global_options]"
      (procedure "process_cmd" line 103)
      invoked from within
      "process_cmd $remaining_args"
      invoked from within
      "if { [llength $remaining_args] > 0 } {
    # If there are remaining arguments, process those as a command
    set exit_status [process_cmd $remaining..."
    (file "/opt/local/bin/port" line 5268)
    
     
    • Bradley S. Meyer

      I've moved this to the discussion board.

       

Anonymous
Anonymous

Add attachments
Cancel