hdl / containers

Building and deploying container images for open source electronic design automation (EDA)
https://hdl.github.io/containers/
Apache License 2.0
106 stars 24 forks source link

Add openFPGALoader #36

Closed umarcor closed 2 years ago

umarcor commented 2 years ago

@trabucayre, this is an attempt at building openFPGALoader on a Debian Buster container. I used https://github.com/trabucayre/openFPGALoader#compile-and-install as a reference.

As you can see in the dockerfile, I had to install pkg-config, apart from the ones listed in the README.

The build is failing because /usr/bin/ld: cannot find -ludev (see https://github.com/hdl/containers/runs/3092703249?check_suite_focus=true#step:4:285). However, it seems to be found by cmake: Found libudev, version 241 (see https://github.com/hdl/containers/runs/3092703249?check_suite_focus=true#step:4:196). Any guess?

trabucayre commented 2 years ago

pkg-config is listed a little further. But this mean, this is a bad idea and must be move with rest of requirements (it's now fixed).

The build failure is related to STATIC_LIB=ON. in your Dockerfile you install dynamics libraries but cmake try to link to .a libraries. Most of libraries packaged for debian have no more static version so the solution is to suppress -DSTATIC_LIB=ON or to set to OFF

umarcor commented 2 years ago

pkg-config is listed a little further. But this mean, this is a bad idea and must be move with rest of requirements (it's now fixed).

Thanks!

The build failure is related to STATIC_LIB=ON. in your Dockerfile you install dynamics libraries but cmake try to link to .a libraries. Most of libraries packaged for debian have no more static version so the solution is to suppress -DSTATIC_LIB=ON or to set to OFF

Ok. I was hoping that an static build would make it easier to handle the runtime images. It's ok to build it dynamically (it works). However, we now need to define the runtime dependencies in the last stage. For now, udev is installed only. Should we add libftdi1-2 and libhidapi-libusb0 too?

trabucayre commented 2 years ago

The build failure is related to STATIC_LIB=ON. in your Dockerfile you install dynamics libraries but cmake try to link to .a libraries. Most of libraries packaged for debian have no more static version so the solution is to suppress -DSTATIC_LIB=ON or to set to OFF

Ok. I was hoping that an static build would make it easier to handle the runtime images. It's ok to build it dynamically (it works). However, we now need to define the runtime dependencies in the last stage. For now, udev is installed only. Should we add libftdi1-2 and libhidapi-libusb0 too?

libftdi1-2 is absolutely required it's not an optional dependency (most of the cable are based on FTDI converters). Since libusb is required by libftdi1-2 I assume it's not required to add this explicitly

For libhidapi-libusb0 it's optional but without this library there is no support for CMSIS-DAP cables.

In fact udev is not an absolute requirement since it's only used to select a device by it's path (/dev/ttyUSBx).

It's more or less a question of global size induce by short or long list of libraries to integrate

umarcor commented 2 years ago

It's more or less a question of global size induce by short or long list of libraries to integrate

I don't think size is a problem in this case. It's sensible to have all those dependencies by default.

trabucayre commented 2 years ago

LGTM