Cannot compile Volk

Dear list,

I am trying to compile gnuradio using MSVC2010 but I cannot compile
Volk. I tried with next and master branches but no luck. Nevertheless,
if I use maint branch it works correctly. I am compiling the code for
x64 target. Please find the output of compiler. It is in spanish but it
means “unresolved external symbol xxx”.

Thanks for your help.

2>volk_machine_sse2.obj : error LNK2019: smbolo externo _m_punpcklwd
sin resolver al que se hace referencia en la funcin _mm_cvtpi16_ps
2>volk_machine_avx.obj : error LNK2001: smbolo externo _m_punpcklwd sin
resolver
2>volk_machine_sse2.obj : error LNK2019: smbolo externo _mm_cvt_pi2ps
sin resolver al que se hace referencia en la funcin _mm_cvtpi16_ps
2>volk_machine_avx.obj : error LNK2001: smbolo externo _mm_cvt_pi2ps
sin resolver
2>volk_machine_sse2.obj : error LNK2019: smbolo externo _m_punpckhwd
sin resolver al que se hace referencia en la funcin _mm_cvtpi16_ps
2>volk_machine_avx.obj : error LNK2001: smbolo externo _m_punpckhwd sin
resolver
2>volk_machine_sse2.obj : error LNK2019: smbolo externo _m_pcmpgtw sin
resolver al que se hace referencia en la funcin _mm_cvtpi16_ps
2>volk_machine_avx.obj : error LNK2001: smbolo externo _m_pcmpgtw sin
resolver
2>volk_machine_sse2.obj : error LNK2019: smbolo externo
_mm_setzero_si64 sin resolver al que se hace referencia en la funcin
_mm_cvtpi16_ps
2>volk_machine_avx.obj : error LNK2001: smbolo externo _mm_setzero_si64
sin resolver
2>volk_machine_sse2.obj : error LNK2019: smbolo externo _mm_set_pi16
sin resolver al que se hace referencia en la funcin “void __cdecl
volk_16i_32fc_dot_prod_32fc_a_sse(class std::complex *,short
const *,class std::complex const *,unsigned int)”
(?volk_16i_32fc_dot_prod_32fc_a_sse@@YAXPEAV?$complex@M@std@@PEBFPEBV12@I@Z)
2>volk_machine_avx.obj : error LNK2001: smbolo externo _mm_set_pi16 sin
resolver

Pol H.
Research Engineer, MSc
[email protected]

Centre Tecnolgic de Telecomunicacions de Catalunya (CTTC)
Engineering Unit
Parc Mediterrani de la Tecnologia
Av. Carl Friedrich Gauss, 7
08860 Castelldefels, Barcelona (Spain)
Tel: +34 93 396 71 70 Ext: 2177
Fax. +34 93 645 29 01
www.cttc.es

On 07/16/2012 06:45 AM, Pol H. wrote:

Dear list,

I am trying to compile gnuradio using MSVC2010 but I cannot compile
Volk. I tried with next and master branches but no luck. Nevertheless,
if I use maint branch it works correctly. I am compiling the code for
x64 target. Please find the output of compiler. It is in spanish but it
means “unresolved external symbol xxx”.

Hmm… looks like a win64 problem. this post seem to have the same
issue: Developer Software Forums - Intel Community

It seems to suggest there is a matter of including headers in the
correct order. I will get back to this thread if I figure it out!

-josh

The problem is that volk_16i_32fc_dot_prod_32fc_a_sse is using MMX
instructions which it seems that you cant do in 64 bit windows

These should probably be replaced with SSE equivalent functions
m0 = _mm_set_pi16(*(aPtr+3), *(aPtr+2), *(aPtr+1), (aPtr+0));
m1 = _mm_set_pi16(
(aPtr+7), *(aPtr+6), *(aPtr+5), *(aPtr+4));

-josh

Alright, i have kind of a fix. Here is the diff:

Basically, it looks like you cant MMX on win64. So I added mmx as an
optional parameter to the 3 machine definitions that get used on
windows. When on MSVC 64bit, the mmx arch will get overruled.

On the kernel side, I added LV_HAVE_MMX to the dot prod kernel. Since
this kernel requires MMX, in this case the build system will prevent its
building when MMX is not available (aka mmx is overruled):

-josh

Dear Josh,

Your patch works for me. Now I am compiling next branch. Hope you could
commit to git.

Thanks for your effort.

Pol H.
Research Engineer, MSc
[email protected]

Centre Tecnolgic de Telecomunicacions de Catalunya (CTTC)
Engineering Unit
Parc Mediterrani de la Tecnologia
Av. Carl Friedrich Gauss, 7
08860 Castelldefels, Barcelona (Spain)
Tel: +34 93 396 71 70 Ext: 2177
Fax. +34 93 645 29 01
www.cttc.es

Alright, i have kind of a fix. Here is the diff:

Basically, it looks like you cant MMX on win64. So I added mmx as an
optional parameter to the 3 machine definitions that get used on
windows. When on MSVC 64bit, the mmx arch will get overruled.

On the kernel side, I added LV_HAVE_MMX to the dot prod kernel. Since
this kernel requires MMX, in this case the build system will prevent its
building when MMX is not available (aka mmx is overruled):

-josh

On 07/16/2012 10:42 AM, Josh B. wrote:

2>volk_machine_avx.obj : error LNK2001: smbolo externo _m_punpckhwd sin
2>volk_machine_sse2.obj : error LNK2019: smbolo externo _mm_set_pi16
sin resolver al que se hace referencia en la funcin “void __cdecl
volk_16i_32fc_dot_prod_32fc_a_sse(class std::complex *,short
const *,class std::complex const *,unsigned int)”

(?volk_16i_32fc_dot_prod_32fc_a_sse@@address@hidden@std@@address@hidden@Z)

On 07/17/2012 12:20 AM, Pol H. wrote:

Dear Josh,

Your patch works for me. Now I am compiling next branch. Hope you could
commit to git.

Thanks for your effort.

Thanks for testing.

Here is a commit with comments justifying my changes. I hope the
gnuradio devs will accept this:
http://gnuradio.org/cgit/jblum.git/commit/?h=volk_mmx_fix&id=cf8b2a8ff57ff6d3fd4b78a897854cc9a6f49fe1

-josh

On Tue, Jul 17, 2012 at 10:35 AM, Josh B. [email protected] wrote:

Here is a commit with comments justifying my changes. I hope the
gnuradio devs will accept this:

http://gnuradio.org/cgit/jblum.git/commit/?h=volk_mmx_fix&id=cf8b2a8ff57ff6d3fd4b78a897854cc9a6f49fe1

This was merged into master->next.

Johnathan