Skip to content

Conversation

@ron-at-swgy
Copy link
Contributor

This pull request adds several references to the system identifier __OpenBSD__ in
checks where __FreeBSD__ is included. I have validated that each of the FreeBSD
checks are also appropriate for OpenBSD.

It should be noted that I'm still working through a completely successful build, but these changes are necessary to make incremental progress towards that goal.

First, the fenv structure definition referenced in ortools/util/fp_utils.h

fenv in fp_utils

The fenv struct is similar in shape to that of FreeBSD. For reference, the official CVSWeb repository shows a definition of:

/*
 * fenv_t represents the entire floating-point environment.
 */
typedef	struct {
	struct {
		unsigned int __control;		/* Control word register */
		unsigned int __status;		/* Status word register */
		unsigned int __tag;		/* Tag word register */
		unsigned int __others[4];	/* EIP, Pointer Selector, etc */
	} __x87;
	unsigned int __mxcsr;			/* Control, status register */
} fenv_t;

This is in alignment with that of the FreeBSD project.

Changes in sysinfo.cc

The file ortools/base/sysinfo.cc uses a number of system calls and
expects a /proc filesystem in some cases. Like FreeBSD, OpenBSD also
defines getrusage in sys/resource.h, has no proc filesystem, and
needs to include sys/time.h.

References:

Update to python package

The ortools/python/setup.py.in file has been updated to include OpenBSD
as a classified for the package targets.

Update zvector

The ortools/util/zvector.h header should include machine/endian.h,
just like FreeBSD.

References:

@google-cla
Copy link

google-cla bot commented Jun 4, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

OpenBSD does not have a /proc filesystem
OpenBSD also defines `getrusage` in sys/resource.h
Add OpenBSD classifier to python package
Include OpenBSD in machine/endian.h check
@lperron lperron merged commit 28bf3b0 into google:stable Jun 5, 2024
@Mizux Mizux added this to the v9.12 milestone Nov 5, 2024
@Mizux Mizux self-assigned this Mar 3, 2025
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

Successfully merging this pull request may close these issues.

3 participants