Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation Error #4

Closed
soumyabasu opened this issue Jul 19, 2013 · 3 comments
Closed

Installation Error #4

soumyabasu opened this issue Jul 19, 2013 · 3 comments
Labels

Comments

@soumyabasu
Copy link

$ clang++ -v
clang version 3.3
Target: x86_64-apple-darwin12.4.0
Thread model: posix

$ ./configure --prefix=.. --with-boost=..
-- The CXX compiler identification is Clang 3.3.0
-- Check for working CXX compiler: /usr/local/bin/clang++
-- Check for working CXX compiler: /usr/local/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Boost version: 1.53.0
-- Found the following Boost libraries:
--   unit_test_framework
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/Soumya/College/Research/ICSI/libbf/build

$ make
Scanning dependencies of target libbf
[  8%] Building CXX object src/bf/CMakeFiles/libbf.dir/bitvector.cc.o
[ 16%] Building CXX object src/bf/CMakeFiles/libbf.dir/counter_vector.cc.o
/Users/Soumya/College/Research/ICSI/libbf/src/bf/counter_vector.cc:46:52: warning: 
      unused parameter 'value' [-Wunused-parameter]
bool counter_vector::decrement(size_t cell, size_t value)
                                                   ^
1 warning generated.
[ 25%] Building CXX object src/bf/CMakeFiles/libbf.dir/hash.cc.o
In file included from /Users/Soumya/College/Research/ICSI/libbf/src/bf/hash.cc:1:
In file included from /Users/Soumya/College/Research/ICSI/libbf/src/bf/hash.h:5:
/Users/Soumya/College/Research/ICSI/libbf/src/bf/h3.h:17:27: error: constexpr
      variable 'byte_range' must be initialized by a constant expression
  constexpr static size_t byte_range =
                          ^
/Users/Soumya/College/Research/ICSI/libbf/src/bf/hash.h:29:28: note: in
      instantiation of template class 'bf::h3<unsigned long, 36>' requested
      here
  h3<size_t, max_obj_size> h3_;
                           ^
/Users/Soumya/College/Research/ICSI/libbf/src/bf/h3.h:18:5: note: 
      non-constexpr function 'max' cannot be used in a constant expression
    std::numeric_limits<unsigned char>::max() + 1;
    ^
/usr/include/c++/v1/limits:435:43: note: declared here
    _LIBCPP_INLINE_VISIBILITY static type max() throw() {return __base::max();}
                                          ^
In file included from /Users/Soumya/College/Research/ICSI/libbf/src/bf/hash.cc:1:
In file included from /Users/Soumya/College/Research/ICSI/libbf/src/bf/hash.h:5:
/Users/Soumya/College/Research/ICSI/libbf/src/bf/h3.h:63:5: error: fields must
      have a constant size: 'variable length array in structure' extension will
      never be supported
  T bytes_[N][byte_range];
    ^
In file included from /Users/Soumya/College/Research/ICSI/libbf/src/bf/hash.cc:1:
In file included from /Users/Soumya/College/Research/ICSI/libbf/src/bf/hash.h:4:
In file included from /usr/include/c++/v1/functional:471:
/usr/include/c++/v1/memory:1729:55: error: no member named 'value' in
      'std::__1::is_empty<bf::default_hash_function>'
                                bool = is_empty<_T1>::value,
                                       ~~~~~~~~~~~~~~~^
/usr/include/c++/v1/memory:1748:44: note: in instantiation of default argument
      for '__libcpp_compressed_pair_switch<bf::default_hash_function,
      std::__1::allocator<bf::default_hash_function>, false>' required here
  ...class _T2, unsigned = __libcpp_compressed_pair_switch<_T1, _T2>::value>
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/memory:1921:13: note: in instantiation of default argument
      for '__libcpp_compressed_pair_imp<bf::default_hash_function,
      std::__1::allocator<bf::default_hash_function> >' required here
    typedef __libcpp_compressed_pair_imp<_T1, _T2> base;
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/functional:997:35: note: in instantiation of template class
      'std::__1::__compressed_pair<bf::default_hash_function,
      std::__1::allocator<bf::default_hash_function> >' requested here
    __compressed_pair<_F, _Alloc> __f_;
                                  ^
/usr/include/c++/v1/functional:1253:13: note: in instantiation of template
      class 'std::__1::__function::__func<bf::default_hash_function,
      std::__1::allocator<bf::default_hash_function>, unsigned long
      (const bf::object &)>' requested here
        if (sizeof(_FF) <= sizeof(__buf_))
            ^
/Users/Soumya/College/Research/ICSI/libbf/src/bf/hash.cc:60:29: note: in
      instantiation of function template specialization
      'std::__1::function<unsigned long (const bf::object
      &)>::function<bf::default_hash_function>' requested here
    return double_hasher(k, std::move(h1), std::move(h2));
                            ^
In file included from /Users/Soumya/College/Research/ICSI/libbf/src/bf/hash.cc:1:
In file included from /Users/Soumya/College/Research/ICSI/libbf/src/bf/hash.h:4:
In file included from /usr/include/c++/v1/functional:471:
/usr/include/c++/v1/memory:1937:31: error: multiple overloads of
      '__compressed_pair' instantiate to the same signature 'void
      (_T1_param, _T2_param)'
    _LIBCPP_INLINE_VISIBILITY __compressed_pair(_T1_param __t1, _T2_param __t2)
                              ^
/usr/include/c++/v1/functional:997:35: note: in instantiation of template class
      'std::__1::__compressed_pair<bf::default_hash_function,
      std::__1::allocator<bf::default_hash_function> >' requested here
    __compressed_pair<_F, _Alloc> __f_;
                                  ^
/usr/include/c++/v1/functional:1253:13: note: in instantiation of template
      class 'std::__1::__function::__func<bf::default_hash_function,
      std::__1::allocator<bf::default_hash_function>, unsigned long
      (const bf::object &)>' requested here
        if (sizeof(_FF) <= sizeof(__buf_))
            ^
/Users/Soumya/College/Research/ICSI/libbf/src/bf/hash.cc:60:29: note: in
      instantiation of function template specialization
      'std::__1::function<unsigned long (const bf::object
      &)>::function<bf::default_hash_function>' requested here
    return double_hasher(k, std::move(h1), std::move(h2));
                            ^
/usr/include/c++/v1/memory:1933:40: note: previous declaration is here
    _LIBCPP_INLINE_VISIBILITY explicit __compressed_pair(_T1_param __t1...
                                       ^
In file included from /Users/Soumya/College/Research/ICSI/libbf/src/bf/hash.cc:1:
In file included from /Users/Soumya/College/Research/ICSI/libbf/src/bf/hash.h:4:
/usr/include/c++/v1/functional:1354:5: error: no matching conversion for
      functional-style cast from 'bf::default_hash_function' to
      'std::__1::function<unsigned long (const bf::object &)>'
    function(_STD::forward<_F>(__f)).swap(*this);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/Soumya/College/Research/ICSI/libbf/src/bf/hash.cc:66:14: note: in
      instantiation of function template specialization
      'std::__1::function<unsigned long (const bf::object
      &)>::operator=<bf::default_hash_function>' requested here
      fns[i] = default_hash_function(prng());
             ^
/usr/include/c++/v1/functional:1116:5: note: candidate constructor not viable:
      no known conversion from 'bf::default_hash_function' to 'nullptr_t' for
      1st argument
    function(nullptr_t) : __f_(0) {}
    ^
/usr/include/c++/v1/functional:1117:5: note: candidate constructor not viable:
      no known conversion from 'bf::default_hash_function' to 'const
      std::__1::function<unsigned long (const bf::object &)>' for 1st argument
    function(const function&);
    ^
/usr/include/c++/v1/functional:1118:5: note: candidate constructor not viable:
      no known conversion from 'bf::default_hash_function' to
      'std::__1::function<unsigned long (const bf::object &)>' for 1st argument
    function(function&&);
    ^
/usr/include/c++/v1/functional:1120:7: note: candidate template ignored:
      substitution failure [with _F = bf::default_hash_function]
      function(_F,
      ^
/usr/include/c++/v1/functional:1125:7: note: candidate constructor template not
      viable: requires 2 arguments, but 1 was provided
      function(allocator_arg_t, const _Alloc&) : __f_(0) {}
      ^
/usr/include/c++/v1/functional:1128:7: note: candidate constructor template not
      viable: requires 3 arguments, but 1 was provided
      function(allocator_arg_t, const _Alloc&, nullptr_t) : __f_(0) {}
      ^
/usr/include/c++/v1/functional:1130:7: note: candidate constructor template not
      viable: requires 3 arguments, but 1 was provided
      function(allocator_arg_t, const _Alloc&, const function&);
      ^
/usr/include/c++/v1/functional:1132:7: note: candidate constructor template not
      viable: requires 3 arguments, but 1 was provided
      function(allocator_arg_t, const _Alloc&, function&&);
      ^
/usr/include/c++/v1/functional:1134:7: note: candidate constructor template not
      viable: requires at least 3 arguments, but 1 was provided
      function(allocator_arg_t, const _Alloc& __a, _F __f,
      ^
/usr/include/c++/v1/functional:1114:5: note: candidate constructor not viable:
      requires 0 arguments, but 1 was provided
    function() : __f_(0) {}
    ^
5 errors generated.
make[3]: *** [src/bf/CMakeFiles/libbf.dir/hash.cc.o] Error 1
make[2]: *** [src/bf/CMakeFiles/libbf.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [all] Error 2
@mavam
Copy link
Owner

mavam commented Jul 20, 2013

Thanks for reporting the issue. It looks like an issue with your standard library setup:

      non-constexpr function 'max' cannot be used in a constant expression
    std::numeric_limits<unsigned char>::max() + 1;

The standard says that std::numeric_limits<T>::max is constexpr since C++11. How did you install Clang 3.3? I currently use 3.2 for development, which ships with XCode.

It looks like your include paths prioritize /usr/include/c++/ although your compiler executable resides in /usr/local/bin. Did you export a CXX environment variable prior to configuring? I.e., export CXX=$(which clang++).

Also, it's a good idea to add --enable-debug to the configure script command line since the rewrite has not yet seen extensive testing.

@zonpantli
Copy link

@Some3141 updating from Xcode 4.6.3 to Xcode 5 DP4 and sudo xcode-select -switch /Applications/Xcode5-DP4.app/ solved this problem for me.

@ghost ghost assigned mavam Aug 5, 2013
@soumyabasu
Copy link
Author

@zonpantli: Thanks a lot for the tip! I tried it with DP5, but that didn't quite work for me.

What ended up happening was that I removed llvm's version of clang and then re-ran the install script. It currently works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants