homebrew-gnuradio icon indicating copy to clipboard operation
homebrew-gnuradio copied to clipboard

Build fails due to boost on osx 10.9

Open gitfoxi opened this issue 12 years ago • 6 comments

Not sure if this is a 10.9 issue or if something has crept into Boost. Gnuradio compiles all the way and then during link it complains:

Undefined symbols for architecture x86_64:
  "boost::filesystem::path_traits::dispatch(boost::filesystem::directory_entry const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::codecvt<wchar_t, char, __mbstate_t> const&)", referenced from:
      boost::filesystem::path::path<boost::filesystem::directory_entry>(boost::filesystem::directory_entry const&, boost::enable_if<boost::filesystem::path_traits::is_pathable<boost::decay<boost::filesystem::directory_entry>::type>, void>::type*)in gr_prefs.cc.o
ld: symbol(s) not found for architecture x86_64

My C++ is a little rusty and this kind of crazy template error is exactly why I hate C++ and Boost. I think it's saying boost::filesystem is missing something -- or not really missing but some aspect is not showing up in the link.

I just built boost today for this reason and I think it was using clang c++11 where gnuradio is using gcc42. Could there be some fighting between the stdc++ libraries? I don't know. I'll keep digging. I'll try forcing boost to build with gcc42 and do some googling for related problems ...

gitfoxi avatar Oct 27 '13 18:10 gitfoxi

Looks like it fails not because of boost, but due to libc++ vs libstdc++ for std::codecvt and other std::* staff. There is a workaround discussed on MacPorts http://trac.macports.org/changeset/113092 to disable SWIG (which currently does not support C++11 code generation), but it has to be investigated.

yf avatar Nov 13 '13 10:11 yf

Ok, here it is a workaround:

  1. Unlink swig

    brew unlink swig
  2. Edit formula file /usr/Local/Library/Formula/gnuradio.rb find and comment out lines to disable swig and switch from gcc to clang:

      #          depends_on 'swig'
      #   # Force compilation with gcc-4.2
      #   ENV['CC'] = '/usr/local/bin/gcc-4.2'
      #   ENV['LD'] = '/usr/local/bin/gcc-4.2'
      #   ENV['CXX'] = '/usr/local/bin/g++-4.2'
    
  3. Run brew with -vd flags and tell ignore to warnings regarding libstdc++ vs libc++. Note that applications and recompile them on the next step.

  4. Recompile failed libstdc++ libs like: jpeg libtiff pango atk

  5. Now you can link swig back, but remember that there are still some issues: http://sourceforge.net/p/swig/bugs/1331/

yf avatar Nov 13 '13 12:11 yf

There seems to be an update to Macports that supports 10.9, including GRC. See http://gnuradio.4.n7.nabble.com/Status-of-GNU-Radio-with-OSX-10-9-td44553.html. Any chance of a similar fix for homebrew?

ghost avatar Feb 13 '14 21:02 ghost

same issue here. Any fixes?

est avatar Mar 07 '14 12:03 est

same issue

jmaxxz avatar Apr 04 '14 01:04 jmaxxz

ugggg Same issue after hours of work getting to this point :(

regulatre avatar Jul 13 '14 00:07 regulatre