Compiling v. 5.34.28 with Intel Compiler Collection

I decided to use ROOT installation in Gentoo Linux from their maintainer. Before that I used their ebuild but slightly modified (just added target linuxx8664icc). Now an official ebuild (script to automatically build binary from src) was modified to be much better. :slight_smile:
Bit I think that my problem is not related to OS but to ROOT and compiler.

I encountered with the following error:

xiar cru lib/libmathtext.a graf2d/mathtext/src/mathtextview.o graf2d/mathtext/src/fontembedps.o graf2d/mathtext/src/mathrenderstyle.o graf2d/mathtext/src/mathtext.o graf2d/mathtext/src/mathtextencode.o graf2d/mathtext/src/mathrender.o graf2d/mathtext/src/mathtextparse.o graf2d/mathtext/src/mathrendertoken.o graf2d/mathtext/src/fontembed.o cp -f cint/cint/include/systypes.h cint/cint/include/sys/types.h Create static library lib/libVc.a ar: creating lib/libVc.a ar: math/vc/src/trigonometric__DVC_IMPL_SSE+XOP+FMA4__mxop__mfma4.cpp.o: No such file or directory /var/tmp/portage/sci-physics/root-5.34.28-r1/work/root/math/vc/Module.mk:44: recipe for target 'lib/libVc.a' failed make: *** [lib/libVc.a] Error 1 make: *** Waiting for unfinished jobs.... xiar: executing 'ar' ==> lib/libReflex.so done

I have latest C++ compiler:

icpc version 15.0.2 (gcc version 4.8.4 compatibility)

I just looked into config.log file and found the following:

Checking SIMD specific compiler flags trying to compile with option -xAVX echo "int main() { return 0; }" > conftest.cxx icc -fPIC -restrict -m64 -wd1572 -wd279 -xAVX -O -m64 conftest.cxx -o conftest Compilation OK trying to compile with option -xSSE4.1 echo "int main() { return 0; }" > conftest.cxx icc -fPIC -restrict -m64 -wd1572 -wd279 -xSSE4.1 -O -m64 conftest.cxx -o conftest Compilation OK trying to compile with option -xSSSE3 echo "int main() { return 0; }" > conftest.cxx icc -fPIC -restrict -m64 -wd1572 -wd279 -xSSSE3 -O -m64 conftest.cxx -o conftest Compilation OK trying to compile with option -xSSE3 echo "int main() { return 0; }" > conftest.cxx icc -fPIC -restrict -m64 -wd1572 -wd279 -xSSE3 -O -m64 conftest.cxx -o conftest Compilation OK trying to compile with option -xSSE2 echo "int main() { return 0; }" > conftest.cxx icc -fPIC -restrict -m64 -wd1572 -wd279 -xSSE2 -O -m64 conftest.cxx -o conftest Compilation OK trying to compile with option -mxop echo "int main() { return 0; }" > conftest.cxx icc -fPIC -restrict -m64 -wd1572 -wd279 -mxop -O -m64 conftest.cxx -o conftest icc: command line warning #10159: invalid argument for option '-m' Compilation OK Result: -xAVX -xSSE4.1 -xSSSE3 -xSSE3 -xSSE2 -DVC_IMPL=SSE+XOP+FMA4~-mxop~-mfma4 -xAVX~-mxop~-mfma4
As I understand, XOP (and any FMA) is not supported by my CPU, but config script doesn’t think like that. Am i right? What should I do?

processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 45 model name : Intel(R) Core(TM) i7-3820 CPU @ 3.60GHz stepping : 7 microcode : 0x710 cpu MHz : 3799.968 cache size : 10240 KB physical id : 0 siblings : 8 core id : 0 cpu cores : 4 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes 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 eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid xsaveopt bugs : bogomips : 7200.25 clflush size : 64 cache_alignment : 64 address sizes : 46 bits physical, 48 bits virtual power management:
I also checked Wikipedia, and it says that Intel doesn’t support FMA4 (only FMA3).
XOP
FMA

The problem is in file configure during check for SIMD compiler flags:

    if test -n "$avxcxxflag" && ! $xop_broken && ! $fma4_broken; then
        for flag in '-mxop -mfma4'; do
            check_cxxopt $flag
            if test $cxxopt_result -eq 1; then
                flag=`echo $flag|tr ' ' '~'`
                ssecxxflags="$ssecxxflags -DVC_IMPL=SSE+XOP+FMA4~$flag $avxcxxflag~$flag"
                break;
            fi
        done
    fi
    ssecxxflags="${ssecxxflags# }"
    result "$avxcxxflag $ssecxxflags"

libVc.a comes from $ROOTSYS/math/vc/
I will inform our math expert

Hi,

Probably Vc is not supported for that compiler. I would just switch off Vc in the configure part (-DVc=Off if using CMake)

Lorenzo

I just manually set

--- a/configure 2015-03-24 12:50:05.000000000 +0300
+++ b/configure 2015-05-05 17:29:25.363000770 +0300
@@ -6198,8 +6198,8 @@
     compiler_version=`echo "$preprocessor_output"|sed '2!d'|awk -F. '{ print ($1*100+$2)*100+$3 }'`
     avx_broken=false
     sse_broken=false
-    xop_broken=false
-    fma4_broken=false
+    xop_broken=true
+    fma4_broken=true
     case $compiler in
         ICC)
             vcflags="$vcflags -diag-disable 913"

and it was compiled successfully. Moreover, you may see special flags for ICC. It works.

I also tried to add -Werror-all to

conftest: conftest.cxx
        \$(CXX) \$(CFLAGS) $cxxopt \$(LDFLAGS) \$< -o \$@

to convert warning to error but without success. Maybe I did it in a wrong way…

So, from my point of view the main problem is with only FMA4&XOP flags (others work). GCC flags -mxop -mfma4 don’t have analogues in ICC. Other SIMDs do have, see -xAVX -mavx and others below.

    # check for SIMD compiler flags
    message "Checking SIMD specific compiler flags"
    $avx_broken || for flag in '-xAVX' '-mavx' '/arch:AVX'; do
        check_cxxopt $flag
        if test $cxxopt_result -eq 1; then
            avxcxxflag=$flag
            break;
        fi
    done
    $sse_broken || for tuples in '-xSSE4.1;-msse4.1' '-xSSSE3;-mssse3' '-xSSE3;-msse3' '-xSSE2;-msse2;/arch:SSE2'; do
        save_IFS="$IFS"
        IFS=';'
        for flag in $tuples; do
            IFS="$save_IFS"
            check_cxxopt $flag
            if test $cxxopt_result -eq 1; then
                ssecxxflags="$ssecxxflags $flag"
                break;
            fi
        done
    done
    if test -n "$avxcxxflag" && ! $xop_broken && ! $fma4_broken; then
        for flag in '-mxop -mfma4'; do
            check_cxxopt $flag
            if test $cxxopt_result -eq 1; then
                flag=`echo $flag|tr ' ' '~'`
                ssecxxflags="$ssecxxflags -DVC_IMPL=SSE+XOP+FMA4~$flag $avxcxxflag~$flag"
                break;
            fi
        done
    fi