-
Notifications
You must be signed in to change notification settings - Fork 160
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
Define version only once in CMakeLists #144
base: master
Are you sure you want to change the base?
Conversation
First of all, I'm not the project developer, but just a spare-time contributor, so I don't represent the project officially. The following is my personal opinion. TL; DR: I'm working on a competing patch that would make this Pull Request obsolete. Don't use
|
The CPU architecture detection code was initially added during a IBM POWER port, and it was later extended to ARM too. But both are unnecessary, and was added due to unfamiliarity of the codebase by respective contributors. The CMake script does two things only: (1) If the CPU is non-x86, set the macro SSE_CORRECT_DENORMALS. (2) If the CPU is IBM POWER, set the macro NO_WARN_X86_INTRINSICS. Both can be supported using C macros only, without the need to modify the CMake script. It does nothing but reducing the code portability by limiting supported CPUs to a hardcoded list. For example, fundamentally there's nothing to stop the codebase from working on RISC-V, but because nobody has allowlisted the CPU yet, it fails the check. In the future, as new users arrive, the check will be longer and longer for no good reason. See also: PR thliebig#144. Signed-off-by: Yifeng Li <[email protected]>
The original contributor used "uint" in all code, which is a non-standard language extension that doesn't exist in ISO C or ISO C++, and causes build failures on macOS as reported by PR thliebig#144. Replace all "uint" with "unsigned int" for standard conformance to maximize portability. Signed-off-by: Yifeng Li <[email protected]>
I've opened PR #146 and PR #147 to fix both problems "properly" as a replacement of this Pull Request. You're invited to test it on PPC and macOS (note that |
@biergaizi Thank you, I will look into your code today. Generally I agree with your reasoning. To be clear, my aim was merely to make the project compile with minimal sensible fixes so that it can be used by ppc users (riscv is not yet supported in MacPorts, one would have to fix a lot more stuff prior to building this one). So I did not try to redesign anything. |
P. S. I will close this PR in favor of new ones once confirm that the build on ppc works. |
The CPU architecture detection code was initially added during a IBM POWER port, and it was later extended to ARM too. But both are unnecessary, and was added due to unfamiliarity of the codebase by respective contributors. The CMake script does two things only: (1) If the CPU is non-x86, set the macro SSE_CORRECT_DENORMALS. (2) If the CPU is IBM POWER, set the macro NO_WARN_X86_INTRINSICS. Both can be supported using C macros only, without the need to modify the CMake script. It does nothing but reducing the code portability by limiting supported CPUs to a hardcoded list. For example, fundamentally there's nothing to stop the codebase from working on RISC-V, but because nobody has allowlisted the CPU yet, it fails the check. In the future, as new users arrive, the check will be longer and longer for no good reason. See also: PR thliebig#144. Signed-off-by: Yifeng Li <[email protected]>
The CPU architecture detection code was initially added during a IBM POWER port, and it was later extended to ARM too. But both are unnecessary, and was added due to unfamiliarity of the codebase by respective contributors. The CMake script does two things only: (1) If the CPU is non-x86, set the macro SSE_CORRECT_DENORMALS. (2) If the CPU is IBM POWER, set the macro NO_WARN_X86_INTRINSICS. Both can be supported using C macros only, without the need to modify the CMake script. It does nothing but reducing the code portability by limiting supported CPUs to a hardcoded list. For example, fundamentally there's nothing to stop the codebase from working on RISC-V, but because nobody has allowlisted the CPU yet, it fails the check. In the future, as new users arrive, the check will be longer and longer for no good reason. See also: PR thliebig#144. Signed-off-by: Yifeng Li <[email protected]>
The original contributor used "uint" in all code, which is a non-standard language extension that doesn't exist in ISO C or ISO C++, and causes build failures on macOS as reported by PR #144. Replace all "uint" with "unsigned int" for standard conformance to maximize portability. Signed-off-by: Yifeng Li <[email protected]>
Whats the status here? |
@thliebig Ah, this should be merged, I guess. |
I think this line 26 can be just removed?? It is already set in line 18? Am I missing something? |
The CPU architecture detection code was initially added during a IBM POWER port, and it was later extended to ARM too. But both are unnecessary, and was added due to unfamiliarity of the codebase by respective contributors. The CMake script does two things only: (1) If the CPU is non-x86, set the macro SSE_CORRECT_DENORMALS. (2) If the CPU is IBM POWER, set the macro NO_WARN_X86_INTRINSICS. Both can be supported using C macros only, without the need to modify the CMake script. It does nothing but reducing the code portability by limiting supported CPUs to a hardcoded list. For example, fundamentally there's nothing to stop the codebase from working on RISC-V, but because nobody has allowlisted the CPU yet, it fails the check. In the future, as new users arrive, the check will be longer and longer for no good reason. See also: PR #144. Signed-off-by: Yifeng Li <[email protected]>
UPD. I dropped PowerPC-related stuff from here and a fix to headers in favor of other PR, retaining only a trivial CMakeLists improvement.