weixin_39702649
weixin_39702649
2020-12-02 01:40

Parallel Compilation

This enables parallel compilation in the Travis CI build.

该提问来源于开源项目:libdynd/libdynd

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

7条回答

  • weixin_39702649 weixin_39702649 5月前

    Okay, enabling parallel compilation for msvc made appveyor terribly slow, so that'll just have to be done via the arguments to cmake for now.

    点赞 评论 复制链接分享
  • weixin_39702649 weixin_39702649 5月前

    I just enabled parallel building for the conda build as well. I haven't taken the time to make the number of threads an option. I just set it to default at 5 so that it will run well on the two-core Travis CI machines. any thoughts on that?

    点赞 评论 复制链接分享
  • weixin_39678525 weixin_39678525 5月前

    Wow, is it actually twice as fast with clang? That's impressive, feel free to merge so long as nothing is terribly slow.

    点赞 评论 复制链接分享
  • weixin_39702649 weixin_39702649 5月前

    The only slowdown was because appveyor couldn't handle running msvc with the -MP flag. On my windows machine doing that speeds up compilation dramatically, but the single-core appveyor bot wouldn't have anything of it, so I removed that change. Merging now.

    点赞 评论 复制链接分享
  • weixin_39575502 weixin_39575502 5月前

    I wonder if it's worth using http://www.cmake.org/cmake/help/v3.0/module/ProcessorCount.html to set the default?

    点赞 评论 复制链接分享
  • weixin_39702649 weixin_39702649 5月前

    Yep, we could definitely do some kind of dynamic processor detection in the conda build. There really isn't any point in doing that in the Travis build. On the other hand, the conda build calls cmake and then make, so setting the number of cores automatically may need to be done in shell. I haven't found any way to have cmake set the default number of threads for a makefile yet.

    点赞 评论 复制链接分享
  • weixin_39702649 weixin_39702649 5月前

    Okay, I took a shot at it in https://github.com/libdynd/libdynd/pull/540.

    点赞 评论 复制链接分享

相关推荐