Software Archive
Read-only legacy content
17061 Discussions

Issue compiling Embree with KNC support using icpc

Jason_L_2
Beginner
475 Views

I'm attempting to build a version of Intel's Embree with MIC support. I encounter this error:

[ 52%] Building CXX object builddir/ospray/intel64/embree-v2.7.1/kernels/xeonphi/CMakeFiles/embree_xeonphi.dir/__/common/scene_subdiv_mesh.cpp.o
cd /home/development/OSPRay-0.10.1/build/builddir/ospray/intel64/embree-v2.7.1/kernels/xeonphi && /opt/intel/compilers_and_libraries_2016.3.210/linux/bin/intel64/icpc   -DDONT_WARN_INCLUDE_EMBREE_INTERNALS=1 -DOSPRAY_TASKING_TBB -DTASKING_LOCKSTEP -D__TARGET_XEON_PHI__ -Dembree_xeonphi_EXPORTS -I/home/development/OSPRay-0.10.1/build -I/opt/intel/compilers_and_libraries_2016.3.210/linux/tbb/include -I/home/development/OSPRay-0.10.1 -I/home/development/OSPRay-0.10.1/ospray/include -I/home/development/OSPRay-0.10.1/build/builddir/ospray/intel64/embree-v2.7.1 -I/home/development/OSPRay-0.10.1/ospray/embree-v2.7.1/include -I/home/development/OSPRay-0.10.1/ospray/embree-v2.7.1/kernels/xeonphi -I/home/development/OSPRay-0.10.1/build/builddir/ospray/intel64/embree-v2.7.1/kernels/xeonphi  -mmic -restrict -Wall -wd177 -fasm-blocks -fPIC -std=c++11 -O3 -g -DNDEBUG -fp-model fast -fimf-precision=low -fasm-blocks -no-inline-max-total-size -inline-factor=200 -fPIC  -fma  -restrict -no-prec-div -no-prec-sqrt  -mGLOB_default_function_attrs="use_vec_for_imul=on;use_fast_math=on;gather_scatter_loop_jknzd=on;gather_scatter_loop_unroll=2;use_gather_scatter_hint=on;c_sch_nop_insertion=on;c_avoid_movz_and_movs=off;c_avoid_integer_ciscization=on;avoid_long_vector_ints=on;avoid_loads_with_extend=on;smart_mem_conflicts=on"  -mP2OPT_hlo_prefetch=F  -fPIC   -o CMakeFiles/embree_xeonphi.dir/__/common/scene_subdiv_mesh.cpp.o -c /home/development/OSPRay-0.10.1/ospray/embree-v2.7.1/kernels/common/scene_subdiv_mesh.cpp
/usr/linux-k1om-4.7/linux-k1om/../x86_64-k1om-linux/include/c++/4.7.0/bits/move.h(186): error #137: expression must be a modifiable lvalue
        __a = _GLIBCXX_MOVE(__b);
        ^
/usr/linux-k1om-4.7/linux-k1om/../x86_64-k1om-linux/include/c++/4.7.0/bits/move.h(187): error #137: expression must be a modifiable lvalue
        __b = _GLIBCXX_MOVE(__tmp);
        ^
/usr/linux-k1om-4.7/linux-k1om/../x86_64-k1om-linux/include/c++/4.7.0/bits/move.h(186): error #137: expression must be a modifiable lvalue
        __a = _GLIBCXX_MOVE(__b);
        ^
/usr/linux-k1om-4.7/linux-k1om/../x86_64-k1om-linux/include/c++/4.7.0/bits/move.h(187): error #137: expression must be a modifiable lvalue
        __b = _GLIBCXX_MOVE(__tmp);
        ^
/usr/linux-k1om-4.7/linux-k1om/../x86_64-k1om-linux/include/c++/4.7.0/bits/move.h(186): error #137: expression must be a modifiable lvalue
        __a = _GLIBCXX_MOVE(__b);
        ^
/usr/linux-k1om-4.7/linux-k1om/../x86_64-k1om-linux/include/c++/4.7.0/bits/move.h(187): error #137: expression must be a modifiable lvalue
        __b = _GLIBCXX_MOVE(__tmp);
        ^
/usr/linux-k1om-4.7/linux-k1om/../x86_64-k1om-linux/include/c++/4.7.0/bits/move.h(186): error #137: expression must be a modifiable lvalue
        __a = _GLIBCXX_MOVE(__b);
        ^
/usr/linux-k1om-4.7/linux-k1om/../x86_64-k1om-linux/include/c++/4.7.0/bits/move.h(187): error #137: expression must be a modifiable lvalue
        __b = _GLIBCXX_MOVE(__tmp);
        ^
compilation aborted for /home/development/OSPRay-0.10.1/ospray/embree-v2.7.1/kernels/common/scene_subdiv_mesh.cpp (code 2)
make[2]: *** [builddir/ospray/intel64/embree-v2.7.1/kernels/xeonphi/CMakeFiles/embree_xeonphi.dir/__/common/scene_subdiv_mesh.cpp.o] Error 2
make[2]: Leaving directory `/home/development/OSPRay-0.10.1/build'
make[1]: *** [builddir/ospray/intel64/embree-v2.7.1/kernels/xeonphi/CMakeFiles/embree_xeonphi.dir/all] Error 2
make[1]: Leaving directory `/home/development/OSPRay-0.10.1/build'
make: *** [all] Error 2

Any idea how to resolve? Here's some details about the system: mpss 3.7.1, Ubuntu 14.04, icpc (ICC) 16.0.3 20160415

I set up the mpss on Ubuntu by following these instructions: http://arrayfire.com/getting-started-with-the-intel-xeon-phi-on-ubuntu-1... I'm able to run a test program so I think the installation went successfully.

I've also successfully run an OSPRay-based renderer on the KNC on the same system using a pre-built version of Embree; the compilation issue persists.

0 Kudos
6 Replies
Kevin_D_Intel
Employee
475 Views

I did not find any similar previous reports of this specific error so I need to inquire w/Development. They may need a reproducing test case. Would you be able to compile with -P and then attach the resulting .i file to a reply in the meantime?

0 Kudos
Kevin_D_Intel
Employee
475 Views

I'm waiting for some additional advice; however, I was given some guidance "that a workaround would be to disable the diagnostic.  Though it is an error, it is a discretionary error. Adding -wd137 should make this go away."

Having a reproducing test case will help expedite the investigation w/Development so if you can produce the .i file we'd appreciate that.
 

0 Kudos
Jason_L_2
Beginner
475 Views

Thanks for your reply. For now I have worked around the issue by using a pre-built embree distribution but I still can not build embree from source with KNC support.

I ran the following command (using embree v2.9.0 source):

cd /home/development/embree/build/kernels/xeonphi && icpc   -DTASKING_LOCKSTEP -D__TARGET_XEON_PHI__ -Dembree_xeonphi_EXPORTS -I/home/development/embree/build -I/home/development/embree/include -I/home/development/embree/kernels/xeonphi -I/home/development/embree/build/kernels/xeonphi  -mmic -restrict -Wall -wd177 -fasm-blocks -fPIC -std=c++11 -O3 -g -DNDEBUG -fp-model fast -fimf-precision=low -fasm-blocks -no-inline-max-total-size -inline-factor=200 -fPIC  -fma  -restrict -no-prec-div -no-prec-sqrt  -mGLOB_default_function_attrs="use_vec_for_imul=on;use_fast_math=on;gather_scatter_loop_jknzd=on;gather_scatter_loop_unroll=2;use_gather_scatter_hint=on;c_sch_nop_insertion=on;c_avoid_movz_and_movs=off;c_avoid_integer_ciscization=on;avoid_long_vector_ints=on;avoid_loads_with_extend=on;smart_mem_conflicts=on"  -mP2OPT_hlo_prefetch=F  -fPIC  -P -o scene_subdiv_mesh.cpp.i /home/development/embree/kernels/common/scene_subdiv_mesh.cpp

I attached the output file.

I also tried compiling one of the problematic files with the -wd137 flag and the addition of that flag did allow the compilation to complete successfully.

0 Kudos
Kevin_D_Intel
Employee
475 Views

Thank you for the .i file. I am able to reproduce the error #137 and directed the issue to our Developers for deeper analysis. The -wd137 appears to lead to infinite compilation unfortunately.

(Internal tracking id: DPD200413875)

(Resolution Update on 08/27/2016): Development closed the internal tracking report as "not a defect" believing the issue was with the Embree sources. See subsequent posts for details.

0 Kudos
Judith_W_Intel
Employee
475 Views

 

I think this is a bug in the Embree sources not the compiler.

I reduced the code to the following -- which gives similar compilation errors with GNU and clang also:

#include <algorithm>

// foo is actually embree::ParallelRadixSort::Task<Ty, Key>::radixIteration
template <class Ty>
void foo(Ty* __restrict const src, Ty* __restrict const dst)      // Note that src and dest are declared const and therefore can't be swapped
{
   std::swap(src,dst);
}

int main() {
    int* ip;
    foo(ip,ip);
    return 0;
}

Perhaps you need to post this in the Embree forum here:

https://software.intel.com/en-us/forums/embree-photo-realistic-ray-tracing-kernels

good luck,

Judy

 

 

 

0 Kudos
BenthinC_Intel
Employee
475 Views

Hi,

sorry for the delay but I just came across this today. I've fixed the "const" declaration in Embree's "knc" branch. Please let me know whether this works for you.

0 Kudos
Reply