[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
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

Compile on MacOS #98

Merged
merged 3 commits into from
Oct 18, 2017
Merged

Conversation

AlexandrGraschenkov
Copy link
Contributor

fix #26

Also I have problem with code compile. Fixed by changing type of connectivityMap to:

std::map<uint64_t,Eigen::Vector2i> connectivityMap;

Compile on MacOS 
fix JakobEngel#26

Also I have problem with code compile. Fixed by changing type of `connectivityMap` to:

    std::map<uint64_t,Eigen::Vector2i> connectivityMap;
@NikolausDemmel
Copy link
Collaborator

Thanks for the PR.

I guess we could also change the type of ConnectivityMap for all platforms, no?

@AlexandrGraschenkov
Copy link
Contributor Author

@NikolausDemmel updated. Not sure is it will compile normally on Linux.

@NikolausDemmel
Copy link
Collaborator

Thanks for the update.

I think removing the a aligning allocator is problematic. It doesn't result in a compile time error, but it might result in runtime alignment errors (which can sometimes happen and sometimes not, which makes them hard to track down).

What is the compilation error with the ConnectivityMap as is?

@NikolausDemmel
Copy link
Collaborator

Also, which version of OS X and which compiler?

@AlexandrGraschenkov
Copy link
Contributor Author
AlexandrGraschenkov commented Oct 17, 2017
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/map:820:5: error: 
      static_assert failed "Allocator::value_type must be same type as
      value_type"
    static_assert((is_same<typename allocator_type::value_type, value_type>::value),
    ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/alex/Documents/roadar/dso/src/OptimizationBackend/EnergyFunctional.h:121:6: note: 
      in instantiation of template class 'std::__1::map<unsigned long long,
      Eigen::Matrix<int, 2, 1, 0, 2, 1>, std::__1::less<unsigned long long>,
      Eigen::aligned_allocator<std::__1::pair<unsigned long long,
      Eigen::Matrix<int, 2, 1, 0, 2, 1> > > >' requested here
          > connectivityMap;

AppleClang 9.0.0.9000037, Mac OS Siera 10.12.6

@AlexandrGraschenkov
Copy link
Contributor Author
AlexandrGraschenkov commented Oct 18, 2017

After downgrade to AppleClang 8.1.0.8020042 it compiles without errors. With previous definition of connectivityMap works without crashes now.

@NikolausDemmel
Copy link
Collaborator

Hm... still curious about why more recent clang chokes on the allocator. But I'll merge for now. Thanks for iterating on this!

@NikolausDemmel NikolausDemmel merged commit 3198c8e into JakobEngel:master Oct 18, 2017
else()
set(BOOST_THREAD_LIBRARY boost_thread)
endif()

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P.S.: Just for the record, I noticed that cmake provides this as Boost_THREAD_LIBRARY, so we could have just used that... I will correct this at some point.

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

Successfully merging this pull request may close these issues.

Compiling with Boost thread on Mac
2 participants