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

Consider providing a conda environment.yml which creates an environment including all needed open source EDA tools #906

Open
mithro opened this issue Mar 8, 2022 · 12 comments

Comments

@mithro
Copy link

mithro commented Mar 8, 2022

Thanks to the work by @proppy tools like OpenROAD, the SkyWater PDK, Magic, Netgen, etc are all now packaged in conda @ https://github.com/hdl/conda-eda -- There are even packages for cross compilers for things like RISC-V architecture which can be found @ https://github.com/hdl/conda-compilers

This means that silicon compiler could provide a conda environment.yml file (https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#create-env-file-manually) which installs all the requirements needed to run Silicon Compiler.

@proppy
Copy link

proppy commented Mar 8, 2022

additionally maybe also consider packaging siliconcompiler w/ a recipe that depends on the external tools listed here https://docs.siliconcompiler.com/en/latest/user_guide/installation.html#external-tools, so that people could do conda install siliconcompiler to get a full blown installation.

@proppy
Copy link

proppy commented Mar 8, 2022

potentially also depends on hdl/conda-eda#175 depending if siliconcompiler needs the full klayout functionality or can live with the subset distributed on pypi

@aolofsson
Copy link
Member

Interesting! There are quite a lot of tricky dependancies between the tool versions that we are running into. We'll take a look to see how much work it would be. This does require peple to use conda, which is a barrier to some. (but perhaps not a big one?)

@mithro
Copy link
Author

mithro commented Mar 9, 2022

@aolofsson -- Conda is pretty common and well accepted in the ML and scientific worlds. Like all packaging systems it has some people who hate it.

@WRansohoff
Copy link
Contributor

Thank you for the suggestion! We started looking into the LiteX conda-eda recipes, and they look very promising.

I do have a couple questions, which might stem from a misconfiguration or improper usage on my end. I used a fresh Ubuntu 20.04 VM to test these installation steps. After installing miniconda and activating a new environment, I can install surelog and yosys with the recommended commands, e.g.:

conda install --channel "LiteX-Hub" surelog

I encounter issues with magic and netgen, though - they produce errors referring to incompatible glibc versions, but the error messages appear to indicate that the system has a compatible version installed:

[...]
UnsatisfiableError: The following specifications were found to be incompatible with your system:

  - feature:/linux-64::__glibc==2.31=0
  - magic -> libgcc-ng[version='>=9.3.0'] -> __glibc[version='>=2.17']

Your installed version is: 2.31

The OpenROAD install command produces a similar 'UnsatisfiableErorr', but it doesn't provide more verbose information:

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: \
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed

UnsatisfiableError:

Are these common issues, possibly caused by missing dependencies? I can also open an issue on the conda-eda repository if they are atypical.

@mithro
Copy link
Author

mithro commented Mar 10, 2022

FYI - @proppy

@mithro
Copy link
Author

mithro commented Mar 10, 2022

Please do report the issue on the upstream repositories!

I have asked @proppy to look into what is going on here. I believe it is because these packages are still very new (less than a week old) and need a little bit more work. The only way things will get better is to have users finding and reporting these issues!

@proppy
Copy link

proppy commented Mar 11, 2022

@WRansohoff some of those package do depend on conda-forge, can you confirm if/this also happen when using a conda-forge based environment? (either by using https://github.com/conda-forge/miniforge#miniforge3 or folllowing https://conda-forge.org/docs/user/introduction.html#how-can-i-install-packages-from-conda-forge)

@WRansohoff
Copy link
Contributor

WRansohoff commented Mar 11, 2022

Ah, I must have missed that dependency. Using conda-forge to install the packages seems to work, e.g.:

conda install -c conda-forge --channel "LiteX-Hub" openroad

Thank you for the clarification, and for packaging open-source EDA tools like this!

We might want to look into packaging specific versions of the tools to ensure compatibility with our scripts - it looks like the conda scripts build yosys, openroad, etc from the tip of main. But it looks like the conda-eda README contains instructions for building the packages.

@proppy
Copy link

proppy commented Mar 11, 2022

We might want to look into packaging specific versions of the tools to ensure compatibility with our scripts - it looks like the conda scripts build yosys, openroad, etc from the tip of main.

The intent behind this versioning schema is that https://github.com/hdl/conda-eda/actions build intermediate version daily and version them against the output of git-describe before uploading them https://anaconda.org/LiteX-Hub/repo.

That allows us to get most of the intermediate version packages, see for example https://anaconda.org/LiteX-Hub/magic/files.

Downstream tools (like siliconcompiler) are then free to depends on the (range of) version(s) they've been QA'ed against by specifying an explicit version constraint: https://docs.conda.io/projects/conda-build/en/latest/resources/package-spec.html#package-match-specifications

@WRansohoff
Copy link
Contributor

Great, thank you!

We have a few things to work out before we can fully support using conda env create to setup a working dev environment, but your recipes made it easy to get most of the way there with a very small script!

@siddharth-joshi
Copy link

Hi all, really appreciate the work you've all been doing. I was curious if there has been movement here? I'm about to embark on a fresh install so was curious re: if SC had been included in conda?

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

No branches or pull requests

5 participants