0.8rc7 tar ball fails to compile on an i686 system

Bug #1186586 reported by Pekka Jääskeläinen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pocl
Fix Released
Undecided
Erik Schnetter

Bug Description

It fails when trying to build the VML on my Pentium4:

/usr/local/stow/llvm-3.3/bin/clang++ -Xclang -ffake-address-space-map -std=c++11 -fno-exceptions -emit-llvm -c -target i686-pc-linux-gnu -o acos.cc.bc ./../vecmathlib/pocl/acos.cc -include ../../../include/x86_64/types.h
In file included from ./../vecmathlib/pocl/acos.cc:3:
In file included from ./../vecmathlib/pocl/pocl-compat.h:8:
In file included from ./../vecmathlib/pocl/../vecmathlib.h:57:
./../vecmathlib/pocl/../vec_double_sse2_scalar.h:509:26: error: use of undeclared identifier '_mm_cvtsi64_sd'; did you mean '_mm_cvtsi32_sd'?
    return _mm_cvtsd_f64(_mm_cvtsi64_sd(_mm_setzero_pd(), v));
                         ^~~~~~~~~~~~~~
                         _mm_cvtsi32_sd
/usr/local/stow/llvm-3.3/bin/../lib/clang/3.3/include/emmintrin.h:409:1: note: '_mm_cvtsi32_sd' declared here
_mm_cvtsi32_sd(__m128d __a, int __b)
^
In file included from ./../vecmathlib/pocl/acos.cc:3:
./../vecmathlib/pocl/pocl-compat.h:20:9: warning: 'M_PI' macro redefined
#define M_PI M_PI_F
        ^
/usr/include/math.h:367:10: note: previous definition is here
# define M_PI 3.14159265358979323846 /* pi */
         ^
1 warning and 1 error generated.
make[4]: *** [acos.cc.bc] Error 1
make[4]: Leaving directory `/mnt/localstorage/visit0r/src/pocl-0.8rc1/lib/kernel/x86_64'

The fix is to either a) disable VML when building for i686 b) create a separate kernel library dir for i686/x86 where VML is never used, or c) fix VML to work on i686.

Revision history for this message
Erik Schnetter (schnetter) wrote :

VML should work on this architecture. It should detect exactly what SSE2 intrinsics are supported, and should use only those. Can you show me the content of /proc/cpuinfo (assuming this is Linux) or equivalent?

In particular, I'm looking for a line such as

flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 popcnt aes lahf_lm ida arat dtherm tpr_shadow vnmi flexpriority ept vpid

that would e.g. tell me whether sse2 is supported.

Revision history for this message
Erik Schnetter (schnetter) wrote :

Could you also tell me whether you are creating a 32bit or a 64bit executable? That would be the difference between the architectures x86_64 and x86.

Changed in pocl:
assignee: nobody → Erik Schnetter (schnetter)
status: New → Incomplete
Revision history for this message
Erik Schnetter (schnetter) wrote :

I have updated VML. Can you try the newest version?

Changed in pocl:
status: Incomplete → Fix Committed
Revision history for this message
Pekka Jääskeläinen (pekka-jaaskelainen) wrote :

Now builds and the basic test suite works also with VML.

Only a warning remains:

In file included from ./../vecmathlib/pocl/isnan.cc:3:
./../vecmathlib/pocl/pocl-compat.h:20:9: warning: 'M_PI' macro redefined
#define M_PI M_PI_F
        ^
/usr/include/math.h:367:10: note: previous definition is here
# define M_PI 3.14159265358979323846 /* pi */
         ^
1 warning generated.

Revision history for this message
Pekka Jääskeläinen (pekka-jaaskelainen) wrote :

rc7 fails now on Pentium4:

In file included from ../vecmathlib/pocl/../vecmathlib.h:89:
../vecmathlib/pocl/../vec_sse_double2.h:477:38: error: cannot initialize a parameter of type 'real_t' (aka 'double') with an lvalue of type 'const vector_t' (aka 'const __m128d')
      return floatprops::convert_int(v);
                                     ^
../vecmathlib/pocl/../floatprops.h:260:37: note: passing argument to parameter 'x' here
    static int_t convert_int(real_t x) { return int_t(x); }
                                    ^
1 error generated.

Changed in pocl:
status: Fix Committed → Confirmed
status: Confirmed → New
summary: - 0.8rc1 tar ball fails to compile on an i686 system
+ 0.8rc7 tar ball fails to compile on an i686 system
Revision history for this message
Erik Schnetter (schnetter) wrote :

The file vec_double_sse2_scalar.h does not exist any more in VML, it was renamed. If you still see this error message, can you then remove and re-checkout the vecmathlib directory, and start a clean build?

Revision history for this message
Erik Schnetter (schnetter) wrote :

This should be corrected now. Can you try again?

Revision history for this message
Pekka Jääskeläinen (pekka-jaaskelainen) wrote :

The basic test suite now works with my Pentium 4.

Changed in pocl:
status: New → Fix Committed
Changed in pocl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.