YosysHQ / oss-cad-suite-build

Multi-platform nightly builds of open source digital design and verification tools
ISC License
774 stars 70 forks source link

pkg-config support #55

Open byzantic opened 1 year ago

byzantic commented 1 year ago

Hi

First of all congrats on putting together such an enormously useful distribution!

However, I did come across an issue with using the supplied pkg-config support for verilator. Obviously, if the cad suite is installed as well as other tools, one must add the configuration directory in to the existing pkg-config configuration, using the PKG_CONFIG_PATH environment variable:

PKG_CONFIG_PATH=/pathto/oss-cad-suite/share/pkgconfig

(subtext: I didn't do this at first and it fell over ..)

I use pkg-config verilator command in my makefiles, and even with the above, the commands failed. The reason is that if one looks in the supplied oss-cad-suite/share/pkgconfig/verilator.pc file, the prefix there is based on the build directory when the distribution was built, i.e. it contains:

prefix=/yosyshq

This can be fixed in invocations by using the --def-prefix flag, which 'guesses' the correct prefix, e.g.:

pkg-config --define-prefix --cflags verilator

So, perhaps not an issue per se, because it's difficult to see how it could be changed, but it does require a little care during use.