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
CPU detection in distro build #793
Comments
|
I could not reproduce, but the those lines removed in the diff should definitely be there. The checks for CPU features are done in on the source file
If by "CPU detection happening" you mean CMake generating of sleef_config_* headers, that has been there since pocl 1.0 or so, and it's independent of the host CPU when building with |
even if I build on a machine/CPU like From what I saw in my test results, something changed there with 1.4 over 1.3 |
If you're building a distro build, then yes, wherever you build. As you can see the clang arguments:
which means Clang should always compile for (and report features for) Intel Haswell. Unlike A pocl "distro" build precompiles several kernel libraries for different hardcoded CPU names with
It seems your Clang reports incorrect CPU extensions for some reason. Possibly a bug in Clang or something else, but doesn't seems to be a bug in pocl (so far). For "avx" kernel library, we use Try this command in your build environment: If it prints an error, your Clang (or build environment) is broken. |
|
I finally managed to test the above command and it does not print an error. However, I also see +++ /home/abuild/rpmbuild/BUILD/pocl-1.4/build/CMakeCache.txt 2035-04-29 21:36:36.660911810 +0000
@@ -412,7 +412,7 @@
LINK_COMMAND:FILEPATH=/usr/bin/ld
//The Host CPU to use with llc
-LLC_HOST_CPU:STRING=westmere
+LLC_HOST_CPU:STRING=pentium2
//LLVM assembler
LLVM_AS:FILEPATH=/usr/bin/llvm-as
@@ -563,7 +563,7 @@
//Clang's available with 64bit math
CLANG_HAS_64B_MATH:INTERNAL=ON
//Clang option used to specify the target cpu
-CLANG_MARCH_FLAG:INTERNAL=-march=
+CLANG_MARCH_FLAG:INTERNAL=-mcpu=
//Clang needs extra --rtlib flag for compiler-rt math
CLANG_NEEDS_RTLIB:INTERNAL=OFF
//Clang resource dir
@@ -849,7 +849,7 @@
Hwloc_hwloc_PREFIX:INTERNAL=
Hwloc_hwloc_VERSION:INTERNAL=
//Autodetected CPU
-LLC_HOST_CPU_AUTO:INTERNAL=westmere
+LLC_HOST_CPU_AUTO:INTERNAL=pentium2
//LLC_TRIPLE
LLC_TRIPLE:INTERNAL=x86_64-unknown-linux-gnu
//LLVM link test result
+++ /home/abuild/rpmbuild/BUILD/pocl-1.4/build/config.h 2035-04-29 21:36:30.340912151 +0000
@@ -166,7 +166,7 @@
/* used in lib/CL/devices/basic */
#define OCL_KERNEL_TARGET "x86_64-unknown-linux-gnu"
-#define OCL_KERNEL_TARGET_CPU "westmere"
+#define OCL_KERNEL_TARGET_CPU "pentium2"
#define PACKAGE_VERSION "1.4"And in one of the two build logs I see 1592 instances of such The other build.log has 0 of these. It seems, CLANG_MARCH_FLAG is set incorrectly and that seems to come from |
|
And the root of the trouble is that |
|
additionally, compiling the |
|
Sounds like a bug in Clang cpu detection. Pentium 2 is a 32bit cpu, the first CPU with x86-64 was athlon64. Compiling |
|
The simplest workaround could be to run cmake with With distro builds, the |
|
Indeed, it helps to add |
Related to #667, I found that with pocl-1.4, there is again CPU detection happening on the build machine.
The build environment has several significant diffs:
Our build call is around line 100 of https://build.opensuse.org/package/view_file/openSUSE:Factory/pocl/pocl.spec
This bug was found as part of my work on reproducible builds for openSUSE.
The text was updated successfully, but these errors were encountered: