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

Adding dartsim #12863

Merged
merged 19 commits into from
Oct 13, 2020
Merged

Adding dartsim #12863

merged 19 commits into from
Oct 13, 2020

Conversation

traversaro
Copy link
Contributor

Checklist

  • Title of this PR is meaningful: e.g. "Adding my_nifty_package", not "updated meta.yaml"
  • License file is packaged (see here for an example)
  • Source is from official source
  • Package does not vendor other packages. (If a package uses the source of another package, they should be separate packages or the licenses of all packages need to be packaged)
  • If static libraries are linked in, the license of the static library is packaged.
  • Build number is 0
  • A tarball (url) rather than a repo (e.g. git_url) is used in your recipe (see here for more details)
  • GitHub users listed in the maintainer section have posted a comment confirming they are willing to be listed there

Fix #12862.

@wolfv @Tobias-Fischer feel free to reply if you like to be added as maintainers, thanks!

@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 (recipes/dartsim) and found it was in an excellent condition.

@wolfv
Copy link
Member

wolfv commented Oct 10, 2020

Sweet! I’d be happy to be added!

@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 (recipes/dartsim) and found some lint.

Here's what I've got...

For recipes/dartsim:

  • There are 1 too many lines. There should be one empty line at the end of the file.

@traversaro
Copy link
Contributor Author

Sweet! I’d be happy to be added!

Done!

@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 (recipes/dartsim) and found it was in an excellent condition.

@traversaro
Copy link
Contributor Author

The win_64 build is working correctly on a clean environment locally, so I suspect there are some difference due to the specific version of VS2017 used. Do you have any suggestions on how to debug the CI failure? There is any simple process to download the C:/Miniconda/conda-bld/dartsim_1602369457250/work/build/CMakeFiles/CMakeOutput.log and C:/Miniconda/conda-bld/dartsim_1602369457250/work/build/CMakeFiles/CMakeError.log ?

@traversaro
Copy link
Contributor Author

In a4cb25c I tried a shot in the dark by compiling with the (MSVC ABI compatible) clang-cl compiler.

@traversaro
Copy link
Contributor Author

In a4cb25c I tried a shot in the dark by compiling with the (MSVC ABI compatible) clang-cl compiler.

This was failing even locally with the error:

-- Build files have been written to: C:/Users/STraversaro/Miniconda3/conda-bld/dartsim_1602411808657/work/build

Microsoft (R) Program Maintenance Utility Version 14.16.27032.1
Copyright (C) Microsoft Corporation.  All rights reserved.

Scanning dependencies of target dart-external-odelcpsolver
[  1%] Building CXX object dart/external/odelcpsolver/CMakeFiles/dart-external-odelcpsolver.dir/error.cpp.obj
clang-cl.exe: error: no such file or directory: '/permissive-'
NMAKE : fatal error U1077: 'C:\Users\STraversaro\Miniconda3\Library\bin\clang-cl.exe' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\nmake.exe"' : return code '0x2'
Stop.

@traversaro
Copy link
Contributor Author

I was able to display CMakeOutput.log and CMakeError.log, but I could not find anything different w.r.t. to the equivalent version that I had locally. Anyhow, I noticed that a lot of check_cxx_source_compiles tests were actually failing even if they should not, and then I realized that dart is hardcoding the MSVC names for most of its dependencies (see https://github.com/dartsim/dart/blob/e18046107679ff71a0da75dbbf2982b5650ff490/cmake/Findassimp.cmake#L29). So, even if that is not the cause of the failure, is better to fix that.

In a4cb25c I tried a shot in the dark by compiling with the (MSVC ABI compatible) clang-cl compiler.

This was failing even locally with the error:

This was just before you did not added clang to the build dependencies, so an old clang 5.0 was used.

@wolfv
Copy link
Member

wolfv commented Oct 13, 2020

I jsut tried locally with MSVC and the issues appears to be in the urdf_sensor/sensor.h header file. far (and near?) appear to be reserved words in MSVC?

I added #undef far; #undef near to the sensor.h header, and then it works.

Next problem is missing freeglut on windows. I am looking into that rn.

@wolfv
Copy link
Member

wolfv commented Oct 13, 2020

@traversaro how should we handle this? Patch urdfdom_headers?

@wolfv
Copy link
Member

wolfv commented Oct 13, 2020

adding - freeglut # [win] to host and run seems to make it work.

@wolfv
Copy link
Member

wolfv commented Oct 13, 2020

cython/cython#1959 this is the issue we're hitting on urdfdom_headers. Going to send a patch to there as well.

@traversaro
Copy link
Contributor Author

@traversaro how should we handle this? Patch urdfdom_headers?

For the windows.h nasty macro collision, typically the best solution is to avoid as much as possible the inclusion of windows.h, and when it is included in a compilation unit make sure that the compilation unit is as small as possible and windows.h is included as the last include. In this case, I am not sure in which compilation unit you had the near/far problem. However, until it creates problem the patch in conda-forge/urdfdom_headers-feedstock#7 is ok for me.

@traversaro
Copy link
Contributor Author

adding - freeglut # [win] to host and run seems to make it work.

Unless I am missing something, freeglut is an optional dependency also on other platforms (see https://github.com/dartsim/dart/blob/185fbc2a171e364a00be49c5fe1e5ffb945429c5/dart/gui/CMakeLists.txt#L15), so I think it is better if we either enable it on all platforms, or we disable it everywhere. However, the CI builds continues to fail always at the same point during configuration even with this modifications.

@traversaro
Copy link
Contributor Author

traversaro commented Oct 13, 2020

Note that even if the build works correctly on win_64, we noticed some problems that basically prevent to link the resulting static library in any executable, see gazebosim/gz-physics#87 (comment) . I fixed them in dartsim/dart#1510, but applying that patch exposes an assimp issue (conda-forge/assimp-feedstock#12), as the build fails with:

[ 53%] Linking CXX executable test_Distance.exe
LINK: command "C:\PROGRA~2\MIB055~1\2017\ENTERP~1\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\test_Distance.dir\objects1.rsp /out:test_Distance.exe /implib:test_Distance.lib /pdb:C:\Users\STraversaro\Miniconda3\envs\dart-deps\src\dart\build-ninja\unittests\comprehensive\test_Distance.pdb /version:0.0 /machine:x64 /LTCG /INCREMENTAL:NO /subsystem:console ..\..\lib\dart.lib ..\..\lib\gtest.lib ..\gtest_main.lib ..\..\lib\dart-collision-bullet.lib ..\..\lib\gtest.lib ..\..\lib\dart.lib ..\..\dart\external\odelcpsolver\dart-external-odelcpsolver.lib C:\Users\STraversaro\Miniconda3\envs\dart-deps\Library\lib\fcl.lib C:\Users\STraversaro\Miniconda3\envs\dart-deps\Library\lib\ccd.lib C:\Users\STraversaro\Miniconda3\envs\dart-deps\Library\bin\assimp-vc141-mt.dll C:\Users\STraversaro\Miniconda3\envs\dart-deps\Library\lib\boost_system.lib C:\Users\STraversaro\Miniconda3\envs\dart-deps\Library\lib\boost_filesystem.lib C:\Users\STraversaro\Miniconda3\envs\dart-deps\Library\lib\octomap.lib C:\Users\STraversaro\Miniconda3\envs\dart-deps\Library\lib\octomath.lib C:\Users\STraversaro\Miniconda3\envs\dart-deps\Library\lib\BulletDynamics.lib C:\Users\STraversaro\Miniconda3\envs\dart-deps\Library\lib\BulletCollision.lib C:\Users\STraversaro\Miniconda3\envs\dart-deps\Library\lib\LinearMath.lib C:\Users\STraversaro\Miniconda3\envs\dart-deps\Library\lib\BulletSoftBody.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:test_Distance.exe.manifest" failed (exit code 1107) with the following output:
C:\Users\STraversaro\Miniconda3\envs\dart-deps\Library\bin\assimp-vc141-mt.dll : fatal error LNK1107: invalid or corrupt file: cannot read at 0x300
NMAKE : fatal error U1077: 'C:\Users\STraversaro\Miniconda3\envs\dart-deps\Library\bin\cmake.exe' : return code '0xffffffff'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\nmake.exe"' : return code '0x2'

At this point, I wonder if it makes more sense to just merge this with skip: true # [win] and then work on Windows support in the feedstock.

@wolfv
Copy link
Member

wolfv commented Oct 13, 2020

yeah I am not sure why it locally works for me. It seems to me that the compiler checks are buggy. Next thing I'd try is to patch the dartsim CMake to remove the compiler checks and see if that fixes everything :)

@wolfv
Copy link
Member

wolfv commented Oct 13, 2020

yeah but why not merge this as is, and then we can do stuff over on the feedstock. That might be easier :)
We can also try to motivate some core-dartsim people by opening an issue over there.

@traversaro
Copy link
Contributor Author

yeah but why not merge this as is, and then we can do stuff over on the feedstock. That might be easier :)

👍

@wolfv
Copy link
Member

wolfv commented Oct 13, 2020

@traversaro do you want to push with skip: true # [win]?

@wolfv
Copy link
Member

wolfv commented Oct 13, 2020

and maybe squash the commits :)

@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 (recipes/dartsim) and found some lint.

Here's what I've got...

For recipes/dartsim:

  • Selectors are suggested to take a <two spaces>#<one space>[<expression>] form. See lines [15]

@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 (recipes/dartsim) and found it was in an excellent condition.

@traversaro
Copy link
Contributor Author

@traversaro do you want to push with skip: true # [win]?

and maybe squash the commits :)

Ok, do you prefer that I squash them myself or that you merge with squash at GitHub level? Both are fine for me.

@wolfv wolfv merged commit 2f6b138 into conda-forge:master Oct 13, 2020
@wolfv
Copy link
Member

wolfv commented Oct 13, 2020

thanks, awesome! Squashing isn't enabled for this repo but I think it's fine.

@traversaro
Copy link
Contributor Author

thanks, awesome! Squashing isn't enabled for this repo but I think it's fine.

Thanks, good to know about the squashing.

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

Successfully merging this pull request may close these issues.

Package Dynamic Animation and Robotics Toolkit Simulator (DARTSim)
3 participants