-
Notifications
You must be signed in to change notification settings - Fork 316
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
CMake scripts cleanups #680
Conversation
The code already checked for the WITH_AIO macro, and almost all configurable options in libiio and IIOD use the "WITH" prefix. Signed-off-by: Paul Cercueil <[email protected]>
yeah, the still shipping Zynq Images use old cmake - this would break too many boards in the field. The new Kuiper images that we are moving to use 3.13; I don't think that's the default image yet.
plus it causes all CI builds to fail. Centos like this:
|
FWIW, cmake 3.20.2 is already complaining about the used version...
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the cmake version bump question, looks a very good cleanup to me
@@ -17,9 +17,9 @@ | |||
#cmakedefine01 WITH_NETWORK_EVENTFD | |||
#cmakedefine01 WITH_IIOD_USBD | |||
#cmakedefine01 WITH_LOCAL_CONFIG | |||
#cmakedefine01 WITH_AIO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a comment which has noting to do with this... We should definitely consider about replacing aio for io_uring and liburing for libiio2 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I will definitely have a look at io_uring. I want to see if it can help us with zero-copy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has both ring buffers shared between kernel and userspace so that's something already in the right way... Another neat thing is that we can potential reduce a lot the number of syscalls.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I assume the IIO subsystem needs to support it (does it?).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think so. At least for normal reads/writes on sysfs stuff. Now for ioctl (not sure if that stuff was merged; and yes, it seems io_uring is also allowing to re-implement ioctl), the last time I checked I think IIO would have to support it...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://lwn.net/Articles/844875/ - not idea the outcome of the RFC
iiod/CMakeLists.txt
Outdated
@@ -24,7 +24,7 @@ find_library(LIBAIO_LIBRARIES aio) | |||
find_path(LIBAIO_INCLUDE_DIR libaio.h) | |||
|
|||
if (LIBAIO_LIBRARIES AND LIBAIO_INCLUDE_DIR) | |||
option(ENABLE_AIO "Build IIOD with async. I/O support" ON) | |||
option(WITH_AIO "Build IIOD with async. I/O support" ON) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean that we only provide the option if the libraries are installed in the system? If so, I'm not sure if it would not be better to always provide the option and look for the libraries if the option is enabled. Then make it explicit that dependencies are needed (cmake failure)... Otherwise, users might not even be aware that this feature is possible...
message(SEND_ERROR "Unable to find libusb-1.0 dependency.\n" | ||
"If you want to disable the USB backend, set WITH_USB_BACKEND=OFF.") | ||
endif() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, you can disregard my previous comment 👍
Isn't there a "backports" feature like on Ubuntu/Debian? |
@rgetz Now would maybe be a good time to branch libiio2. Then we can up the CMake requirements in the libiio2 branch. |
d20077e
to
b6d4eea
Compare
that makes total sense to me. |
but the CI failures still should be fixed, or you won't have much test coverage going forward... |
@rgetz yes. Don't worry ;) |
9707c35
to
73ec11b
Compare
Old OSes (CentOS 7, Ubuntu 16.04) require s6_addr32 to be defined for the IN6_IS_ADDR_LINKLOCAL() macro to work. Signed-off-by: Paul Cercueil <[email protected]>
This function is not used in libiio, but is used by IIOD. Signed-off-by: Paul Cercueil <[email protected]>
We do not want to compile with GNU-specific extensions, as we want the code to be as portable as possible. Thanksfully we don't actually need _GNU_SOURCE to be defined, removing it only triggers an error in network-unix.c about an undefined structure, which we can fix by including the right header. Signed-off-by: Paul Cercueil <[email protected]>
Instead of making build options available according to whether or not a library is found, only search for the library if the option has been enabled. This change may temporarily break the auto-builders (which will need to be updated), but it makes the build *reproductible*, and that's very important. Signed-off-by: Paul Cercueil <[email protected]>
Disable serial backend, enable ZSTD support. Signed-off-by: Paul Cercueil <[email protected]>
Disable serial and USB backends. Signed-off-by: Paul Cercueil <[email protected]>
Enable ZSTD support, except on Ubuntu 16.04 where it doesn't build, and explicitely set the build options as it is required now. Note that the serial backend is disabled on Ubuntu 16.04 as its version of libserialport is too old, and USB support in IIOD is disabled in CentOS 7 as its kernel headers are too old. Signed-off-by: Paul Cercueil <[email protected]>
Alright, it should be ready for merging now. Note that USB support in IIOD is disabled in CentOS 7, and UART support and ZSTD compression are disabled on Ubuntu 16.04, as the corresponding dependencies are too old on these OSes. |
With the changes introduced in [1], libiio now looks for system dependencies depending on enabled options. Hence, as the serial backend is enabled by default, libserialport has to be set as DEPENDS. This patch adds the SERIAL_BACKEND to the list of PACKAGECONFIG for libiio. [1]: analogdevicesinc/libiio#680 Signed-off-by: Nuno Sá <[email protected]>
With the changes introduced in [1], libiio now looks for system dependencies depending on enabled options. Hence, as the serial backend is enabled by default, libserialport has to be set as DEPENDS. This patch adds the SERIAL_BACKEND to the list of PACKAGECONFIG for libiio. [1]: analogdevicesinc/libiio#680 Signed-off-by: Nuno Sá <[email protected]>
This fix is still related with the changes introduced by [1]. If 'HAVE_DNS_SD' is ON, we need to have the correspondent avahi dependencies set... However, for microblaze builds, zeroconf is not part of the petalinux 'DISTRO_FEATURES'. Hence, we disable 'DHAVE_DNS_SD' if zeroconf is not present. [1]: analogdevicesinc/libiio#680 Signed-off-by: Nuno Sá <[email protected]>
This fix is still related with the changes introduced by [1]. If 'HAVE_DNS_SD' is ON, we need to have the correspondent avahi dependencies set... However, for microblaze builds, zeroconf is not part of the petalinux 'DISTRO_FEATURES'. Hence, we disable 'DHAVE_DNS_SD' if zeroconf is not present. [1]: analogdevicesinc/libiio#680 Signed-off-by: Nuno Sá <[email protected]>
A set of patches to cleanup the CMake scripts.
This change is a bit more invasive than usual, as it changes the behaviour of the script. For that reason, it is possible that the autobuilders will fail, as their scripts may have to be enabled.
Instead of auto-enabling functions according to the environment (available libraries etc), the options are now never auto-selected, and the environment is probed according to the enabled options.
The goal of this is to make the builds reproductible: now, using the same configuration on two systems will result in the same features being enabled in the library.
The scripts have also been updated to use the 3.x CMake features.