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

Updates for OpenBSD build support #4257

Merged
merged 1 commit into from
Jun 5, 2024
Merged

Updates for OpenBSD build support #4257

merged 1 commit into from
Jun 5, 2024

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:

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
66 of 114 checks passed
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.

2 participants