Skip to content

odin: makefile: fix parallel build #904

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

Merged
merged 1 commit into from
Aug 8, 2019

Conversation

tgorochowik
Copy link
Contributor

This PR fixes the Makefile for Odin to allow parallel builds (e.g. make -j$(nproc))

Description

There were two issues with the way the targets are defined.

  1. The .%.build target cannot depend on both clean and _init. It works
    fine with a single-core build, but when executing it in parallel, the
    clean target breaks the _init target. To make it work in parallel the
    _init target now directly depends on the clean target.

  2. The _set_<xxx> targets have to be executed before the _build_it
    target - they cannot be executed at the same time. This has been
    reworked to use a dynamically defined targets to avoid creating an extra
    wrapper target for each of them.

Motivation and Context

To be able to build Odin using multiple cores.

How Has This Been Tested?

Both mutli and single job builds work for Odin.

Types of changes

  • Bug fix (change which fixes an issue)
  • New feature (change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

There were two issues with the way the targets are defined.

1. The .%.build target cannot depend on both clean and _init. It works
fine with a single-core build, but when executing it in parallel, the
clean target breaks the _init target. To make it work in parallel the
_init target now directly depends on the clean target.

2. The _set_<xxx> targets have to be executed before the _build_it
target - they cannot be executed at the same time. This has been
reworked to use a dynamically defined targets to avoid creating an extra
wrapper target for each of them.

Signed-off-by: Tomasz Gorochowik <[email protected]>
@probot-autolabeler probot-autolabeler bot added build Build system lang-make CMake/Make code Odin Odin II Logic Synthesis Tool: Unsorted item labels Aug 8, 2019
@jeanlego
Copy link
Contributor

jeanlego commented Aug 8, 2019

looks good to me :)

thanks for this!

@jeanlego jeanlego merged commit cb8c583 into verilog-to-routing:master Aug 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Build system lang-make CMake/Make code Odin Odin II Logic Synthesis Tool: Unsorted item
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants