Skip to content

Add FreeBSD support - #10987

Closed
SquareRobin wants to merge 2 commits into
The-OpenROAD-Project:masterfrom
SquareRobin:freebsd-support
Closed

Add FreeBSD support#10987
SquareRobin wants to merge 2 commits into
The-OpenROAD-Project:masterfrom
SquareRobin:freebsd-support

Conversation

@SquareRobin

Copy link
Copy Markdown

Summary

FreeBSD has all the dependencies available in the default pkg repository, requires only minor changes to the build system and runs absolutely fine, BUT there are some concerns:

  • third-party/abc has a make call hardcoded in CmakeLists.txt - logic to switch to gmake on FreeBSD is needed (otherwise the build fails).
  • Bazel does not officially support FreeBSD. There's a community port, I haven't checked it out so Bazel might not work at all for FreeBSD.
  • GPU acceleration is problematic, Kokkos also does not target FreeBSD. Though if it can compile, it should work, even with CUDA (libc6-shim helped me get CUDA working In the past, I see no reason why it wouldn't work here).
  • tclsh and python3 binaries are absent, FreeBSD uses a different naming scheme - either the user will have to make the symlinks (eg., from python3.12 to python3) or the source files will have to be configured to use the proper names.
  • scripts in ./etc/ use bash, which is not present on the base system. IMHO, using bash for the dependency installer is superfluous, since most of the "bashisms" can be easily replaced with POSIX alternatives without affecting code readability. Or users can simply be told to install bash.

Signed-off-by: Igor Sokolov <disk.destroyer@yahoo.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for FreeBSD by adding package installation steps in DependencyInstaller.sh and configuring search paths and compiler definitions in src/CMakeLists.txt. Feedback on these changes includes guarding the FreeBSD package installation to only run when installing base or all packages (as it requires root privileges), and fixing a minor indentation issue. Additionally, in src/CMakeLists.txt, it is recommended to append /usr/local to CMAKE_PREFIX_PATH at the top of the file instead of using legacy global directory commands, and to use target_compile_definitions directly on the openroad target to ensure the _GNU_SOURCE definition is correctly applied.

Comment thread src/CMakeLists.txt
Comment thread src/CMakeLists.txt
Comment on lines +1503 to 1509
"FreeBSD")
_install_freebsd_packages
cat <<EOF
FreeBSD installs \`tclsh\` binary as \`tclsh86\` and any python 3 version as \`python3.XX\`,
not \`python3\`, you'll have to make symlinks to those programs yourself.
EOF
;;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There are two issues with this block:

  1. Unconditional Execution: _install_freebsd_packages is called unconditionally on FreeBSD, even if the user ran the script with -common (which is intended for non-root local prefix installations). Since pkg requires root privileges, this will fail or prompt for root unexpectedly. It should be guarded to only run when option is base or all.
  2. Indentation: Line 1505 uses a literal tab character for indentation, whereas the rest of the script consistently uses spaces.
Suggested change
"FreeBSD")
_install_freebsd_packages
cat <<EOF
FreeBSD installs \`tclsh\` binary as \`tclsh86\` and any python 3 version as \`python3.XX\`,
not \`python3\`, you'll have to make symlinks to those programs yourself.
EOF
;;
"FreeBSD")
if [[ "${option}" == "base" || "${option}" == "all" ]]; then
_install_freebsd_packages
fi
cat <<EOF
FreeBSD installs \`tclsh\` binary as \`tclsh86\` and any python 3 version as \`python3.XX\`,
not \`python3\`, you'll have to make symlinks to those programs yourself.
EOF
;;

still hacky, needs a lot more work to make it appropriate

Signed-off-by: Igor Sokolov <disk.destroyer@yahoo.com>
@SquareRobin

Copy link
Copy Markdown
Author

Got a successful Bazel build, but it requires modifying third-party rules and/or switching rule versions. Also a lot of issues with GNU-isms.

Too much work, closing this.

@SquareRobin SquareRobin closed this Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant