Menu

Lib Boost Issues on OSX

Brad Olson
2014-06-27
2014-08-25
  • Brad Olson

    Brad Olson - 2014-06-27

    ERNE is 1.4.4 is failing to compile on my OSX systems.

    Lib Boost is installed, but it is having problems finding boost.filesystem even though it is installed.

    I tried installing boost both with brew and with MacPorts. This problem occurs on both OSX10.6 and OSX10.7 all with current versions of Xcode.

    Below is the boost part of ./configure from a 10.7 system

    ===== BOOST support (required) =====
    checking for Boost headers version >= 1.40.0... yes
    checking for Boost's header version... 1_55
    checking for the toolset name used by Boost for g++... xgcc42 -xgcc
    checking boost/system/error_code.hpp usability... yes
    checking boost/system/error_code.hpp presence... yes
    checking for boost/system/error_code.hpp... yes
    checking for the Boost system library... yes
    checking boost/filesystem/path.hpp usability... yes
    checking boost/filesystem/path.hpp presence... yes
    checking for boost/filesystem/path.hpp... yes
    checking for the Boost filesystem library... no
    configure: error: cannot find the flags to link with Boost filesystem

    Here is the same from a 10.6 system

    ===== BOOST support (required) =====
    checking for Boost headers version >= 1.40.0... /opt/local/include
    checking for Boost's header version... 1_55
    checking for the toolset name used by Boost for g++... xgcc42 -xgcc
    checking boost/system/error_code.hpp usability... yes
    checking boost/system/error_code.hpp presence... yes
    checking for boost/system/error_code.hpp... yes
    checking for the Boost system library... yes
    checking boost/filesystem/path.hpp usability... yes
    checking boost/filesystem/path.hpp presence... yes
    checking for boost/filesystem/path.hpp... yes
    checking for the Boost filesystem library... no
    configure: error: cannot find the flags to link with Boost filesystem

    I have recently compile other sources against boost (not ERNE) and not had issues.

     
  • Cristian Del Fabbro

    Dear Brad,
    the problem arise in the procedure (not wrote by me) for the autodection of the BOOST parameters (for details, see: https://github.com/tsuna/boost.m4/issues/19). I updated the code and tested successfully into this branch:
    https://sourceforge.net/p/erne/code/HEAD/tree/branches/1.4.4-1-osx-issue/

    Can you download and compile (there is a "Download snapshot" link) this version and confirm if it works for you?

    Best,
    Cristian

     
    • Nat

      Nat - 2014-08-21

      I found this issue through Google. The linked file helped me to get past the ./configure step, however I can not get the it to make now. I get the following error: In file included from data_structures/Hash.cpp:26:
      data_structures/Hash.h:139:2: error: reference to 'mutex' is ambiguous
      mutex* dummyMutex;
      ^
      /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/__mutex_base:25:24: note:
      candidate found by name lookup is 'std::__1::mutex'
      class _LIBCPP_TYPE_VIS mutex
      ^
      /usr/local/include/boost/thread/pthread/mutex.hpp:91:11: note: candidate found
      by name lookup is 'boost::mutex'
      class mutex
      ^
      1 error generated.

      Am I doing something incorrectly? Thanks,
      Nat

       
  • Cristian Del Fabbro

    Dear Nat, could you try modifing the 139th line of src/data_structures/Hash.h
    from:
    mutex dummyMutex;
    to:
    boost::mutex
    dummyMutex;

    and return a feedback to me? (I suppose that you will obtain a similar error but in another file)

    Thanks,
    Cristian

     
    • Nat

      Nat - 2014-08-22

      The new error output:

      data_structures/Hash.cpp:75:13: error: no viable overloaded '='
      dummyMutex = NULL;
      ~~~~~~~~~~ ^ ~~~~
      /usr/local/include/boost/thread/pthread/mutex.hpp:96:9: note: candidate function
      not viable: no known conversion from 'long' to 'boost::mutex &' for 1st
      argument
      BOOST_THREAD_NO_COPYABLE(mutex)
      ^
      /usr/local/include/boost/thread/detail/delete.hpp:55:5: note: expanded from
      macro 'BOOST_THREAD_NO_COPYABLE'
      BOOST_THREAD_DELETE_COPY_ASSIGN(CLASS)
      ^
      /usr/local/include/boost/thread/detail/delete.hpp:44:14: note: expanded from
      macro 'BOOST_THREAD_DELETE_COPY_ASSIGN'
      CLASS& operator=(CLASS&); \

       
  • Cristian Del Fabbro

    Dear Nat, try to modify the line
    dummyMutex = NULL;
    with
    dummyMutex = (boost::mutex *)NULL;

    Best,
    Cristian

     

Log in to post a comment.

Monday.com Logo