-
Notifications
You must be signed in to change notification settings - Fork 219
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
Issue building on MacOS #260
Comments
Hi, we would like to support clang builds, and this is general help-wanted area. There are a few known issues at this time. For your particular issue, it looks like tree_utils.h references Can you try adding |
I've also observed in our codebase, we don't consistently qualify |
If someone gets verible building and working on MacOS X, then we can set up Travis (or Kokoro) to make sure it continues to work and also publish prebuilt binaries in the same way we do Linux executables. |
Alright, it looks like it made some progress. My Cpp fu is not great though so I'm a little blind... error is as follows (I am also using Error
|
The general ticket for OS X build support is #64 . The build issue with |
@Alex-Mann Nevertheless, we would like to accept your fix of |
the date call for creating the version header is I wonder if maybe the default date implementatino on a Mac (or the zsh?) does not allow for all strformatting characters or has trouble with non-format characters such as T or Z in the format string ? @Alex-Mann or @fangism who have access to a Mac, can you play around with the date format to see what the culprit is ? |
Darwin (Mac OS X) gets Man page: |
Darwin:
Linux:
looks similar |
I just compiled the BSD date ( https://github.com/freebsd/freebsd/tree/master/bin/date ), and it also outputs things as expected
I wonder if maybe the git commands that extract a date, mmh. So some more investigation manually calling |
Using 'date' to format some date only really works with GNU date, so just use the raw time_t timestamp and format that in code. While at it, remove dependency on 'grep'. This will remove one of the problems compiling on Mac, found in #260. Signed-off-by: Henner Zeller <h.zeller@acm.org> GitHub PR #263 Copybara import of the project: - 3f52998 In create-version-header: use less system-specific featur... by Henner Zeller <h.zeller@acm.org> - 36294df Improve case ;; by Henner Zeller <h.zeller@acm.org> Closes #263 PiperOrigin-RevId: 305880225
Fixed the date issue in #263 |
I use m4/flex/bison with bazel (liveHD project) in linux/OSX using these rules. https://github.com/jmillikin/rules_flex As an example using the flex/bision/m4 when compiling yosys with bazel (LiveHD) (yosys uses flex/bison). |
More notes: Here are the rules that the Kythe project uses for locally-installed flex/bison: https://cs.opensource.google/kythe/kythe/+/master:tools/build_rules/lexyacc/BUILD This pushes the problem of dependencies like |
Looks like I can compile it with clang (on Linux) by manually setting the necessary link option for clang. However, I don't know enough bazel-fu to make this toolchain-dependent (i.e. only setting this when clang is in use)
Then, compiling and testing works with clang:
@fangism can you test if this will make it work on MacOS ? |
@hzeller I attempted to build on Mac with your patch. I get the same error message that @Alex-Mann got:
I assume that this is a problem with building m4. |
mmh, let's drill down to m4 specifically and see what we get. Can you try the following (after applying the patch) @rachitnigam ?
|
I get:
|
This looks like you might need to install |
I already have them installed (I found this github issue when trying to fix this) :
|
It's worth noting that
I also tried running the bazel command with |
So it looks like that the |
I don't see |
Instead of using the configure build, use the external flex bazel rule that is reported to be more portable to other platforms, at least MacOS #260
Alright, after a little bit of work, it should now be possible to compile verible on MacOS. There is one external dependency on a somewhat recent flex and bison, so before compiling you need to have these installed and set the path to their location: brew install flex bison
export PATH=$(brew --prefix flex)/bin:$(brew --prefix bison)/bin:$PATH Then
should work. There is one caveat though: the install procedure directly from bazel is not working yet as the |
One of the next steps: Creating a fresh binary automatically with each release #758 |
GNU install is included in the coreutils homebrew package. This is a proof-of-concept homebrew formula. The following works:
There are still some unresolved issues:
A stable version and a URL with git hash is needed to brew bottles. This then needs to be updated on each commit to produce new bottles. |
Oh, you are working on a brew packet ? It looks like you might enjoy tackling #758 @johanvdhaegen ? I think by default, bazel builds with Do you have a log of the failure with the FileUtil ? If it is a system incompatibilty issue, maybe we should switch to use I could also imagine that it is some sandboxing issue, that we want to write somewhere where the sandbox does not allow to. Though it would be a bit weird as bazel already has a pretty tight sandbox around running tests. With regard to the stable version requirements, we create a tag on each commit and create a release from there ( https://github.com/google/verible/releases ). So if we can hook to the brew build, that would be awesome (A discussion we should have on #758 ). |
Update:
Is not needed anymore for building verible on the Mac. So it should build straight with |
Yes, I verified that |
The test errors I have been seeing are from permission errors on https://github.com/google/googletest/blob/master/googletest/src/gtest.cc#L6723 I run homebrew under an account different from my regular user account, and test files left behind in |
I'll send a patch to gtest upstream. |
@hzeller I get build issues on M1 mac, have created a ticket: chipsalliance/homebrew-verible#10 |
@reportaman did you also try to compile directly without the brew package ? The brew package is still work-in-progress, so extracting the error from a direct compile might help find the issue. |
@hzeller I had, and I just did it again. Here's the result:
|
That error message sounds like it didn't find a compiler ( |
@hzeller Am using bazel for the very first time, not sure what would be the correct option. Came across this: bazelbuild/bazel#11628, though its not clear what needs to be done. |
Hi, I was wondering if it's now possible to install verible / build on MacOS? |
Verible builds for a while now on MacOs. There is a homebrew build and also the releases contain macOS binary builds. Only thing that is not working is that the install target would work. But I can't do anything about it as I don't have a mac, so waiting for someone with a mac to provide a pull request. Till then, use the |
Hi there,
I understand there that the C++ compiler that comes with Xcode is not supported for building verible... but are there any more details for how sub out the compiler and build on MacOS? Currently I'm getting the following error:
Any tips or help is appreciated.
The text was updated successfully, but these errors were encountered: