-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Build on MacOs (10.9) #2
Comments
The first error is fixed as of 4e21f5e. The second error is curious as State is a friend so should be able to access the private member (and can in my non-clang Linux build). |
thanks @dominichamon, I'm still having bunch of issues (and 4e21f5e fixes the first one I reported): https://gist.github.com/dcoeurjo/8443935 |
This is really useful, thank you. I don't have an OSX machine to test on right now. I just pushed commit c44662e that should help with some (or all) of those errors. Please let me know. |
Few warnings that are reported as "errors" (thanks to -Werror option):
and
Beside this warnings, there is no more build errors ;) |
BTW, it'd be better to have the binary and libs compiled in the current cmake build directory rather than in the source tree (bin/, libs/). I'm running the benchmark_test |
I've run the benchmark test and it's a bit weird: the process uses only 5% of my CPU and does nothing to the std:err. in this example, I've let it run 16min (wall clock) and then kill it with CTRL-C
|
Commit e2633b9 has the warning(error) fixes. If you want to submit a patch for cmake i'm happy to take it. The idea is that it should be creating bin and lib in the project root so you have bin, lib, include, src in the project root. Are you seeing something different? There may be a runtime issue with osx that i don't know about.. it sounds like either one of the clocks isn't ticking or there's a thread issue. I'll try to get an osx test machine going to check it out. |
I'll prepare a pull-request for the cmake stuff. (And no idea for the OS issue ;)) |
I've just updated my working copy and the current release works perfectly on MacOS ! ;) I'm closing this issue and I've also push a pull-request with some cmake edits (make install). |
This patch addresses issue google#341 by adding the function MakeUnpredictable. The MakeUnpredictable(...) functions can be used to prevent the optimizer from knowing the value of the specified 'object'. The function returns the "laundered" input, either by reference if the input was a non-const lvalue reference, or by value (when the input was a const lvalue or rvalue). When MakeUnpredictable is supplied a non-const lvalue, the object referenced by the input is made unpredictable and the return value can be ignored. Otherwise, only the return value is considered "unpredictable". In the latter the MakeUnpredictable function is marked [[nodiscard]] and a warning is emitted if the return value is ignored. For example: ```c++ int divide_by_two(int Value) { const int Divisor = 2; DoNotOptimize(Divisor); // INCORRECT! Has no effect on Divisor MakeUnpredictable(Divisor); // INCORRECT! should warn that return is ignored. // Correct Usage google#1 return Value / MakeUnpredictable(Divisor); // Correct Usage google#2 const int Divisor = MakeUnpredictable(2); return Value / Divisor; } ```
This patch addresses issue google#341 by adding the function MakeUnpredictable. The MakeUnpredictable(...) functions can be used to prevent the optimizer from knowing the value of the specified 'object'. The function returns the "laundered" input, either by reference if the input was a non-const lvalue reference, or by value (when the input was a const lvalue or rvalue). When MakeUnpredictable is supplied a non-const lvalue, the object referenced by the input is made unpredictable and the return value can be ignored. Otherwise, only the return value is considered "unpredictable". In the latter the MakeUnpredictable function is marked [[nodiscard]] and a warning is emitted if the return value is ignored. For example: ```c++ int divide_by_two(int Value) { const int Divisor = 2; DoNotOptimize(Divisor); // INCORRECT! Has no effect on Divisor MakeUnpredictable(Divisor); // INCORRECT! should warn that return is ignored. // Correct Usage google#1 return Value / MakeUnpredictable(Divisor); // Correct Usage google#2 const int Divisor = MakeUnpredictable(2); return Value / Divisor; } ```
Update based on suggestion google#2 from @brenoguim
Use PMU clock cycles in aarch64 when it was enabled to allows user mode code to read
the project does not compile on MacOs (maverick 10.9).
(as traced in the cmake output, the compiler is Clang 5.0)
The text was updated successfully, but these errors were encountered: