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

[BUG] shared_ptr of ConstraintContext doesn't compile with clang #2730

Closed
abergeron opened this issue Mar 4, 2019 · 3 comments
Closed

[BUG] shared_ptr of ConstraintContext doesn't compile with clang #2730

abergeron opened this issue Mar 4, 2019 · 3 comments

Comments

@abergeron
Copy link
Contributor

The current master doesn't build on mac because of this:

I've read that the C++ spec doesn't support destructors that throw for shared_ptr. I don't know if that is true, but clang doesn't like it and fails to compile with this:

[  8%] Building CXX object CMakeFiles/tvm.dir/src/api/api_arith.cc.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++  -DDMLC_USE_FOPEN64=0 -DTVM_LLVM_VERSION=60 -Dtvm_EXPORTS -I/Users/anakha/ext/tvm/include -I/Users/anakha/ext/tvm/3rdparty/dlpack/include -I/Users/anakha/ext/tvm/3rdparty/dmlc-core/include -I/Users/anakha/ext/tvm/3rdparty/rang/include -I/Users/anakha/ext/tvm/3rdparty/compiler-rt -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks -I/Users/anakha/miniconda/include -I/Users/anakha/ext/tvm/3rdparty/HalideIR/src -I/Users/anakha/ext/tvm/topi/include  -O2 -Wall -fPIC -fvisibility=hidden -std=c++11  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -mmacosx-version-min=10.11 -fPIC   -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -o CMakeFiles/tvm.dir/src/api/api_arith.cc.o -c /Users/anakha/ext/tvm/src/api/api_arith.cc
In file included from /Users/anakha/ext/tvm/src/api/api_arith.cc:6:
In file included from /Users/anakha/ext/tvm/include/tvm/expr.h:9:
In file included from /Users/anakha/ext/tvm/3rdparty/HalideIR/src/ir/Expr.h:7:
In file included from /Users/anakha/ext/tvm/3rdparty/HalideIR/src/tvm/node/node.h:9:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:477:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string_view:176:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__string:56:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/algorithm:643:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3604:7: error: 
      exception specification of overriding function is more lax than base
      version
class __shared_ptr_emplace
      ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4277:26: note: 
      in instantiation of template class
      'std::__1::__shared_ptr_emplace<tvm::arith::ConstraintContext,
      std::__1::allocator<tvm::arith::ConstraintContext> >' requested here
    ::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
                         ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4656:29: note: 
      in instantiation of function template specialization
      'std::__1::shared_ptr<tvm::arith::ConstraintContext>::make_shared<tvm::arith::Analyzer
      *, tvm::runtime::TVMArgValue>' requested here
    return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
                            ^
/Users/anakha/ext/tvm/src/api/api_arith.cc:112:29: note: in instantiation of
      function template specialization
      'std::__1::make_shared<tvm::arith::ConstraintContext, tvm::arith::Analyzer
      *, tvm::runtime::TVMArgValue>' requested here
            auto ctx = std::make_shared<ConstraintContext>(self.get(), args[0]);
                            ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3513:13: note: 
      overridden virtual function is here
    virtual ~__shared_weak_count();
            ^
1 error generated.
make[2]: *** [CMakeFiles/tvm.dir/src/api/api_arith.cc.o] Error 1
make[1]: *** [CMakeFiles/tvm.dir/all] Error 2
make: *** [all] Error 2

I'm not familiar enough with that part of the code to know what the proper fix would be.

@abergeron
Copy link
Contributor Author

By current master I mean eae76b3

@abergeron
Copy link
Contributor Author

git blame says this PR introduced the failing code: #2668

@tqchen

@tqchen
Copy link
Member

tqchen commented Mar 5, 2019

fixed by #2731 Thanks for reporting and sorry for the trouble

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

No branches or pull requests

2 participants