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

Enable compilation of part that depend on sdformat and dartsim on Windows #12

Merged
merged 26 commits into from
Mar 27, 2021

Conversation

traversaro
Copy link
Contributor

@traversaro traversaro commented Mar 19, 2021

This required a bit of tricks to work with the heavily patched DART 6.9.5 to work on Windows, to switch to use VS2019 and to apply locally gazebosim/gz-physics#148 . However, unit tests seems to be working fine now.

Fix #7 .
Fix #8 .

Checklist

  • Used a personal fork of the feedstock to propose changes
  • Bumped the build number (if the version is unchanged)
  • Reset the build number to 0 (if the version changed)
  • Re-rendered with the latest conda-smithy (Use the phrase @conda-forge-admin, please rerender in a comment in this PR for automated rerendering)
  • Ensured the license file is being packaged.

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

@traversaro traversaro changed the title [WIP] Enable dartsim compilation on Windows [WIP] Enable compilation of dartsim-dependent part on Windows Mar 19, 2021
@traversaro
Copy link
Contributor Author

As a preliminary step, I enabled tests to ensure that we did not had any regression, but there are some failures, it seems due to a missing libode run_export.

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I wanted to let you know that I linted all conda-recipes in your PR (recipe) and found some lint.

Here's what I've got...

For recipe:

  • requirements: host: libode >= 0.16.2 should not contain a space between relational operator and the version, i.e. libode >=0.16.2

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

@traversaro traversaro changed the title [WIP] Enable compilation of dartsim-dependent part on Windows [WIP] Enable compilation of part that depend on sdformat and dartsim on Windows Mar 19, 2021
@traversaro
Copy link
Contributor Author

Some parts of dart are missing on Windows:

Could NOT find DART (missing: collision-ode) (Required is at least version "6.9")

@traversaro
Copy link
Contributor Author

Blocked by conda-forge/dartsim-feedstock#7 .

@traversaro traversaro reopened this Mar 26, 2021
@traversaro
Copy link
Contributor Author

New discovery:

2021-03-26T22:05:58.4925838Z C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\include\type_traits(1271,2): error: static_assert failed due to requirement '_Always_false<std::_Aligned<192, 16, double, false>>' "You've instantiated std::aligned_storage<Len, Align> with an extended alignment (in other words, Align > alignof(max_align_t)). Before VS 2017 15.8, the member type would non-conformingly have an alignment of only alignof(max_align_t). VS 2017 15.8 was fixed to handle this correctly, but the fix inherently changes layout and breaks binary compatibility (*only* for uses of aligned_storage with extended alignments). Please define either (1) _ENABLE_EXTENDED_ALIGNED_STORAGE to acknowledge that you understand this message and that you actually want a type with an extended alignment, or (2) _DISABLE_EXTENDED_ALIGNED_STORAGE to silence this message and get the old non-conformant behavior."
2021-03-26T22:05:58.4929720Z         static_assert(_Always_false<_Aligned>,

I guess this is something that was never spotted as ignition-physics was never compiled to target VS2017 C++ std library (even if via the clang-cl compiler). However, I think the desired behavior is the proper standard-compliant one, so I will try to define _ENABLE_EXTENDED_ALIGNED_STORAGE. If that does not work, we can simply try to switch to VS2019.

@traversaro
Copy link
Contributor Author

Still two missing simbols:

2021-03-27T11:06:27.1964055Z EntityManagementFeatures.cc.obj : error LNK2019: unresolved external symbol "protected: __cdecl dart::dynamics::BodyNode::BodyNode(class dart::dynamics::BodyNode *,class dart::dynamics::Joint *,struct dart::common::detail::ComposeData<class dart::common::detail::CompositeData<class std::map<class std::type_index,class std::unique_ptr<class dart::common::Aspect::Properties,struct std::default_delete<class dart::common::Aspect::Properties> >,struct std::less<class std::type_index>,class std::allocator<struct std::pair<class std::type_index const ,class std::unique_ptr<class dart::common::Aspect::Properties,struct std::default_delete<class dart::common::Aspect::Properties> > > > >,struct dart::common::detail::GetProperties>,struct dart::common::detail::GetProperties,class dart::dynamics::BodyNode> const &)" (??0BodyNode@dynamics@dart@@IEAA@PEAV012@PEAVJoint@12@AEBU?$ComposeData@V?$CompositeData@V?$map@Vtype_index@std@@V?$unique_ptr@VProperties@Aspect@common@dart@@U?$default_delete@VProperties@Aspect@common@dart@@@std@@@2@U?$less@Vtype_index@std@@@2@V?$allocator@U?$pair@$$CBVtype_index@std@@V?$unique_ptr@VProperties@Aspect@common@dart@@U?$default_delete@VProperties@Aspect@common@dart@@@std@@@2@@std@@@2@@std@@UGetProperties@detail@common@dart@@@detail@common@dart@@UGetProperties@234@VBodyNode@dynamics@4@@detail@common@2@@Z) referenced in function "public: struct std::pair<class dart::dynamics::FreeJoint *,class dart::dynamics::BodyNode *> __cdecl dart::dynamics::Skeleton::createJointAndBodyNodePair<class dart::dynamics::FreeJoint,class dart::dynamics::BodyNode>(class dart::dynamics::BodyNode *,struct dart::dynamics::FreeJoint::Properties const &,struct dart::common::detail::ComposeData<class dart::common::detail::CompositeData<class std::map<class std::type_index,class std::unique_ptr<class dart::common::Aspect::Properties,struct std::default_delete<class dart::common::Aspect::Properties> >,struct std::less<class std::type_index>,class std::allocator<struct std::pair<class std::type_index const ,class std::unique_ptr<class dart::common::Aspect::Properties,struct std::default_delete<class dart::common::Aspect::Properties> > > > >,struct dart::common::detail::GetProperties>,struct dart::common::detail::GetProperties,class dart::dynamics::BodyNode> const &)" (??$createJointAndBodyNodePair@VFreeJoint@dynamics@dart@@VBodyNode@23@@Skeleton@dynamics@dart@@QEAA?AU?$pair@PEAVFreeJoint@dynamics@dart@@PEAVBodyNode@23@@std@@PEAVBodyNode@12@AEBUProperties@FreeJoint@12@AEBU?$ComposeData@V?$CompositeData@V?$map@Vtype_index@std@@V?$unique_ptr@VProperties@Aspect@common@dart@@U?$default_delete@VProperties@Aspect@common@dart@@@std@@@2@U?$less@Vtype_index@std@@@2@V?$allocator@U?$pair@$$CBVtype_index@std@@V?$unique_ptr@VProperties@Aspect@common@dart@@U?$default_delete@VProperties@Aspect@common@dart@@@std@@@2@@std@@@2@@std@@UGetProperties@detail@common@dart@@@detail@common@dart@@UGetProperties@234@VBodyNode@dynamics@4@@detail@common@2@@Z)
2021-03-27T11:06:27.1979768Z SDFFeatures.cc.obj : error LNK2001: unresolved external symbol "protected: __cdecl dart::dynamics::BodyNode::BodyNode(class dart::dynamics::BodyNode *,class dart::dynamics::Joint *,struct dart::common::detail::ComposeData<class dart::common::detail::CompositeData<class std::map<class std::type_index,class std::unique_ptr<class dart::common::Aspect::Properties,struct std::default_delete<class dart::common::Aspect::Properties> >,struct std::less<class std::type_index>,class std::allocator<struct std::pair<class std::type_index const ,class std::unique_ptr<class dart::common::Aspect::Properties,struct std::default_delete<class dart::common::Aspect::Properties> > > > >,struct dart::common::detail::GetProperties>,struct dart::common::detail::GetProperties,class dart::dynamics::BodyNode> const &)" (??0BodyNode@dynamics@dart@@IEAA@PEAV012@PEAVJoint@12@AEBU?$ComposeData@V?$CompositeData@V?$map@Vtype_index@std@@V?$unique_ptr@VProperties@Aspect@common@dart@@U?$default_delete@VProperties@Aspect@common@dart@@@std@@@2@U?$less@Vtype_index@std@@@2@V?$allocator@U?$pair@$$CBVtype_index@std@@V?$unique_ptr@VProperties@Aspect@common@dart@@U?$default_delete@VProperties@Aspect@common@dart@@@std@@@2@@std@@@2@@std@@UGetProperties@detail@common@dart@@@detail@common@dart@@UGetProperties@234@VBodyNode@dynamics@4@@detail@common@2@@Z)
2021-03-27T11:06:27.1996974Z SDFFeatures.cc.obj : error LNK2019: unresolved external symbol "protected: __cdecl dart::dynamics::ShapeNode::ShapeNode(class dart::dynamics::BodyNode *,struct dart::common::detail::ComposeData<class dart::common::detail::CompositeData<class std::map<class std::type_index,class std::unique_ptr<class dart::common::Aspect::Properties,struct std::default_delete<class dart::common::Aspect::Properties> >,struct std::less<class std::type_index>,class std::allocator<struct std::pair<class std::type_index const ,class std::unique_ptr<class dart::common::Aspect::Properties,struct std::default_delete<class dart::common::Aspect::Properties> > > > >,struct dart::common::detail::GetProperties>,struct dart::common::detail::GetProperties,class dart::common::EmbeddedPropertiesAspect<class dart::dynamics::EntityNode<class dart::dynamics::TemplatedJacobianNode<class dart::dynamics::FixedJacobianNode> >,struct dart::dynamics::detail::EntityNodeProperties>,class dart::dynamics::FixedFrame,class dart::dynamics::ShapeFrame> const &)" (??0ShapeNode@dynamics@dart@@IEAA@PEAVBodyNode@12@AEBU?$ComposeData@V?$CompositeData@V?$map@Vtype_index@std@@V?$unique_ptr@VProperties@Aspect@common@dart@@U?$default_delete@VProperties@Aspect@common@dart@@@std@@@2@U?$less@Vtype_index@std@@@2@V?$allocator@U?$pair@$$CBVtype_index@std@@V?$unique_ptr@VProperties@Aspect@common@dart@@U?$default_delete@VProperties@Aspect@common@dart@@@std@@@2@@std@@@2@@std@@UGetProperties@detail@common@dart@@@detail@common@dart@@UGetProperties@234@V?$EmbeddedPropertiesAspect@V?$EntityNode@V?$TemplatedJacobianNode@VFixedJacobianNode@dynamics@dart@@@dynamics@dart@@@dynamics@dart@@UEntityNodeProperties@detail@23@@34@VFixedFrame@dynamics@4@VShapeFrame@84@@detail@common@2@@Z) referenced in function "public: class dart::dynamics::ShapeNode * __cdecl dart::dynamics::BodyNode::createShapeNode<class dart::dynamics::Shape,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &>(class std::shared_ptr<class dart::dynamics::Shape> const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??$createShapeNode@VShape@dynamics@dart@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@BodyNode@dynamics@dart@@QEAAPEAVShapeNode@12@AEBV?$shared_ptr@VShape@dynamics@dart@@@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@5@@Z)
2021-03-27T11:06:27.2022786Z ShapeFeatures.cc.obj : error LNK2001: unresolved external symbol "protected: __cdecl dart::dynamics::ShapeNode::ShapeNode(class dart::dynamics::BodyNode *,struct dart::common::detail::ComposeData<class dart::common::detail::CompositeData<class std::map<class std::type_index,class std::unique_ptr<class dart::common::Aspect::Properties,struct std::default_delete<class dart::common::Aspect::Properties> >,struct std::less<class std::type_index>,class std::allocator<struct std::pair<class std::type_index const ,class std::unique_ptr<class dart::common::Aspect::Properties,struct std::default_delete<class dart::common::Aspect::Properties> > > > >,struct dart::common::detail::GetProperties>,struct dart::common::detail::GetProperties,class dart::common::EmbeddedPropertiesAspect<class dart::dynamics::EntityNode<class dart::dynamics::TemplatedJacobianNode<class dart::dynamics::FixedJacobianNode> >,struct dart::dynamics::detail::EntityNodeProperties>,class dart::dynamics::FixedFrame,class dart::dynamics::ShapeFrame> const &)" (??0ShapeNode@dynamics@dart@@IEAA@PEAVBodyNode@12@AEBU?$ComposeData@V?$CompositeData@V?$map@Vtype_index@std@@V?$unique_ptr@VProperties@Aspect@common@dart@@U?$default_delete@VProperties@Aspect@common@dart@@@std@@@2@U?$less@Vtype_index@std@@@2@V?$allocator@U?$pair@$$CBVtype_index@std@@V?$unique_ptr@VProperties@Aspect@common@dart@@U?$default_delete@VProperties@Aspect@common@dart@@@std@@@2@@std@@@2@@std@@UGetProperties@detail@common@dart@@@detail@common@dart@@UGetProperties@234@V?$EmbeddedPropertiesAspect@V?$EntityNode@V?$TemplatedJacobianNode@VFixedJacobianNode@dynamics@dart@@@dynamics@dart@@@dynamics@dart@@UEntityNodeProperties@detail@23@@34@VFixedFrame@dynamics@4@VShapeFrame@84@@detail@common@2@@Z)
2021-03-27T11:06:27.2033744Z bin\ignition-physics3-dartsim-plugin.dll : fatal error LNK1120: 2 unresolved externals

@traversaro
Copy link
Contributor Author

Still two missing simbols:

The missing symbols are of DART, and come from DART code. So either there are some linking problems in DART itself, or it is some corner case incompatibility between MSVC anc clang-cl ABI handling.

@traversaro
Copy link
Contributor Author

@conda-forge-admin, please rerender

@traversaro
Copy link
Contributor Author

With VS2019 there is a template-related compilation error instead:

2021-03-27T11:43:59.2993044Z %PREFIX%\Library\include\dart/dynamics/ShapeFrame.hpp(212): note: see declaration of 'dart::dynamics::ShapeFrame::asShapeFrame'
2021-03-27T11:43:59.2995974Z %PREFIX%\Library\include\dart/common/AspectWithVersion.hpp(80): error C2974: 'dart::common::detail::AspectWithState': invalid template argument for 'CompositeT', type expected
2021-03-27T11:43:59.3009841Z %PREFIX%\Library\include\dart/common/detail/AspectWithVersion.hpp(50): note: see declaration of 'dart::common::detail::AspectWithState'
2021-03-27T11:43:59.3013227Z %PREFIX%\Library\include\dart/dynamics/EndEffector.hpp(58): note: see reference to class template instantiation 'dart::common::AspectWithStateAndVersionedProperties<dart::dynamics::Support,dart::dynamics::detail::SupportStateData,dart::dynamics::detail::SupportPropertiesData,dart::dynamics::EndEffector,&void dart::dynamics::detail::SupportUpdate(dart::dynamics::Support *),&void dart::dynamics::detail::SupportUpdate(dart::dynamics::Support *)>' being compiled
2021-03-27T11:43:59.3017390Z %PREFIX%\Library\include\dart/common/AspectWithVersion.hpp(80): error C2976: 'dart::common::detail::AspectWithState': too few template arguments
2021-03-27T11:43:59.3019464Z %PREFIX%\Library\include\dart/common/detail/AspectWithVersion.hpp(50): note: see declaration of 'dart::common::detail::AspectWithState'
2021-03-27T11:43:59.3022176Z %PREFIX%\Library\include\dart/common/CompositeJoiner.hpp(129): warning C4250: 'dart::common::CompositeJoiner<dart::dynamics::FixedJacobianNode,dart::common::SpecializedForAspect<dart::dynamics::Support>>': inherits 'dart::dynamics::EntityNode<dart::dynamics::TemplatedJacobianNode<dart::dynamics::FixedJacobianNode>>::dart::dynamics::EntityNode<dart::dynamics::TemplatedJacobianNode<dart::dynamics::FixedJacobianNode>>::setName' via dominance

@traversaro traversaro changed the title [WIP] Enable compilation of part that depend on sdformat and dartsim on Windows Enable compilation of part that depend on sdformat and dartsim on Windows Mar 27, 2021
@traversaro
Copy link
Contributor Author

Finally working @Tobias-Fischer ! Thanks a lot for the help.

@traversaro
Copy link
Contributor Author

@conda-forge-admin, please rerender

@github-actions
Copy link
Contributor

Hi! This is the friendly automated conda-forge-webservice.
I tried to rerender for you, but it looks like there was nothing to do.

@traversaro traversaro merged commit c586d76 into conda-forge:master Mar 27, 2021
@traversaro traversaro deleted the add-dart-windows branch March 27, 2021 15:41
@Tobias-Fischer
Copy link
Contributor

Great work, thanks!

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.

Add sdformat to win build Add dartsim to win build
3 participants