[vsipl++] fftm compile problem

Day, John John.Day at EssexCorp.com
Thu Jun 28 11:31:50 UTC 2007


Jules,
We tried building vsipl++1.3 on Windows using the Cygwin enviroment, but had many problems. However (surprisingly) we were successful in building using standalone MinGW with Msys and gcc/g++/g77 3.4.5, with only two minor glitches:
1. MinGW didn't have sys/times.h, so we created one with just a tms structure which satisfied the make.
2. Modified vendor\fftw\kernel\alloc.c to allow compilation of our_alloc16()
 
The two build examples, fft.exe and example1.exe were linked and ran OK, which suggests that our compiler switches and linkage issues were resolved OK.
 
But we are still having a problem compiling the Judd/Cottel BeamformEx code (http://hpec-si.com/MinimumVarianceBeamformerExample.pdf) in files BeamformEx.cpp and beam_steer_coeff.cpp
[See listing compile/link commands and errors at end of this message]
 
BeamformEx.cpp: pg 7
// Create a cholesky object
 vsip::chold<vsip::cscalar_f, vsip::by_reference>
          chold_object(vsip::chold<vsip::cscalar_f, vsip::by_reference>::lower,nh);
I was able to get this to compile by changing the first parameter of the constructor to (vsip::mat_uplo)0, since it seems to be looking for an enumeration of zero.
 
beam_steer_coeff.cpp: pg37
k *= (2.0 * M_PI/sv);
This statement causes the error, possibly due to incorrect overloading of *= operator. 
 
I can get all of the beamformer files to compile and link if I comment out this last statement. 
Is this still a config problem, or is this code possibly out of date? A comment on page 43 suggests that this is using a very early implementation of VSIPL++.
 
We are trying to get this beamformer working to do signal processing on some towed-array sonar data. Are there any other adaptive beamformers available similar to this in the VSIPL++ community, either commercially or as free software? 
 
Thanks for your help and suggestions,
John Day

>set files=BeamformEx\BeamformEx.cpp BeamformEx\array.cpp BeamformEx\beam_steer_coef.cpp BeamformEx\data_input.cpp BeamformEx\param_mvdr.cpp BeamformEx\phat.cpp 
>g++ -c -I src -I ./src   -I./vendor/clapack/SRC -I/usr/local/include/fftw3  -DVSIP_IMPL_FFTW3=1 -DVSIP_IMPL_PAR_SERVICE=0 -DVSIP_IMPL_FFT_USE_FLOAT=1 -DVSIP_IMPL_FFT_USE_DOUBLE=1 -DVSIP_IMPL_FFT_USE_LONG_DOUBLE=1 -DVSIP_IMPL_PROVIDE_FFT_FLOAT=1 -DVSIP_IMPL_PROVIDE_FFT_DOUBLE=1 -DVSIP_IMPL_PROVIDE_FFT_LONG_DOUBLE=1 -I/lapack -DVSIP_IMPL_USE_CBLAS=0 -g -O2 -I./src BeamformEx\BeamformEx.cpp BeamformEx\array.cpp BeamformEx\beam_steer_coef.cpp BeamformEx\data_input.cpp BeamformEx\param_mvdr.cpp BeamformEx\phat.cpp  
BeamformEx\BeamformEx.cpp: In function `int main(int, char**)':
BeamformEx\BeamformEx.cpp:220: error: `lower' is not a member of `vsip::chold<vsip::cscalar_f,  by_reference>'
src/vsip/core/expr/scalar_block.hpp: In instantiation of `vsip::impl::Scalar_block_base<1u, double>':
src/vsip/core/expr/scalar_block.hpp:69:   instantiated from `vsip::impl::Scalar_block<1u, double>'
src/vsip/core/expr/binary_block.hpp:76:   instantiated from `vsip::impl::Binary_expr_block<1u, vsip::impl::op::Mult, vsip::Dense<1u, vsip::scalar_f, vsip::tuple<0u, 1u, 2u>, vsip::Local_map>, vsip::scalar_f, vsip::impl::Scalar_block<1u, double>, double>'
src/vsip/vector.hpp:45:   instantiated from `vsip::const_Vector<vsip::scalar_f, const vsip::impl::Binary_expr_block<1u, vsip::impl::op::Mult, vsip::Dense<1u, vsip::scalar_f, vsip::tuple<0u, 1u, 2u>, vsip::Local_map>, vsip::scalar_f, vsip::impl::Scalar_block<1u, double>, double> >'
src/vsip/vector.hpp:270:   instantiated from `vsip::Vector<T, B>& vsip::Vector<T, B>::operator*=(const T0&) [with T0 = double, T = vsip::scalar_f, Block = vsip::Dense<1u, vsip::scalar_f, vsip::tuple<0u, 1u, 2u>, vsip::Local_map>]'
BeamformEx\beam_steer_coef.cpp:71:   instantiated from here
src/vsip/core/expr/scalar_block.hpp:60: error: `vsip::impl::Scalar_block_base<D, Scalar>::map_' has incomplete type
src/vsip/core/parallel/local_map.hpp:32: error: declaration of `struct vsip::Local_or_global_map<1u>'



 
________________________________

From: Jules Bergmann [mailto:jules at codesourcery.com]
Sent: Wed 6/27/2007 7:33 AM
Cc: Day, John; vsipl++ at codesourcery.com
Subject: Re: [vsipl++] fftm compile problem



John,

A couple of bits:

- It should be possible to build Sourcery VSIPL++ with MinGW on windows.
  Unfortunately, you won't be able to use MinGW with the windows binary
package from our website, because that has been built with Intel C++,
which IIUC has a different C++ ABI than GCC on windows.

To use MinGW, you will need to build the library from the source
package.  This requires you to run configure, so you will need either
MSys or cygwin (something to provide the equiv of /bin/sh).


- MinGW GCC 3.4.5 will work fine (we use 3.4.4 to build our Linux binary
pacakges).  GCC 4.1/4.2 will give better performance, but that is
another matter ...


- The compile error you're seeing is a result of the library not being
able to find a FFT backend.  This happens because you're missing some
macro definitions that need to be on the command line.

If you look in the file 'lib/pkgconfig/vsipl++.pc' of the binary
package, you will see a line:

cppflags=-I${includedir}  -DVSIP_IMPL_PAR_SERVICE=0
-DVSIP_IMPL_IPP_FFT=1 -DVSIP_IMPL_FFT_USE_FLOAT=1
-DVSIP_IMPL_FFT_USE_DOUBLE=1 -DVSIP_IMPL_FFT_USE_LONG_DOUBLE=1
-DVSIP_IMPL_PROVIDE_FFT_FLOAT=1 -DVSIP_IMPL_PROVIDE_FFT_DOUBLE=1
-DVSIP_IMPL_PROVIDE_FFT_LONG_DOUBLE=0 -DVSIP_IMPL_USE_CBLAS=2

These macros tell the library which FFT backends to use (in this case,
we're using the IPP FFT, which happens to be how the windows binary
package was configured).

Those definitions need to be on the command line when you compile.

You might retry compiling fft.cpp as

g++ -c -I/usr/local/include -DVSIP_IMPL_PAR_SERVICE=0
-DVSIP_IMPL_IPP_FFT=1 -DVSIP_IMPL_FFT_USE_FLOAT=1
-DVSIP_IMPL_FFT_USE_DOUBLE=1 -DVSIP_IMPL_FFT_USE_LONG_DOUBLE=1
-DVSIP_IMPL_PROVIDE_FFT_FLOAT=1 -DVSIP_IMPL_PROVIDE_FFT_DOUBLE=1
-DVSIP_IMPL_PROVIDE_FFT_LONG_DOUBLE=0 -DVSIP_IMPL_USE_CBLAS=2

That should fix the compilation errors.  However, the above mentioned
problem of ICC and MinGW C++ ABI's being incompatible still remains of
course!

- Sourcery VSIPL++ can be built with Cygwin too.


Do you have MSYS installed along with MinGW?  If so, you should
configure the library from the source package.  The following configure
command would be a good starting point:

        configure                               \
                --with-lapack=simple-builtin    \
                --enable-fft=builtin

Let us know how that works!

                                -- Jules


Stefan Seefeld wrote:
> Day, John wrote:
>> Stefan wrote:
>>>> You mention the windows binary release, which is configured / compiled
>>>> for use with Intel's IPP and MKL libraries. But then you are talking about
>>>> the source distribution, and mingw. To help you a little further it
>>>> is important to know what Sourcery VSIPL++ package you use .....
>> 
>> At first I tried to build the source distribution using MinGW and g++ 3.4.5, but the build failed trying to configure ATLAS and I was not able to produce the config files.
>
> Right, configuring ATLAS is not easy. We have never attempted to support ATLAS
> on Windows. Note, however, that there are a number of configure options to work
> around those problems by using alternate lapack implementations, or none at all
> (thus disabling parts of the functionality provided by the VSIPL++ spec). You
> can find out more about these in the quickstart
> (http://www.codesourcery.com/public/vsiplplusplus/sourceryvsipl++-1.3/quickstart/ch02s03.html)
>
>> So then I tried using the IA32 binary, just to see if I could compile the example fft.cpp (and the BeamformEx files) from the MS-DOS command line:
>> 
>>> g++ -c -I/usr/local/include fft.cpp
>> 
>> That's when the error occurred. I did not configure the fft backends or anything else. Nor did I expect the link step to work because there are no .a libraries in the Windows binary.
>
> That is strange, as the Windows binary package is configured / built
> for use with Intel's IPP and MKL. I'm thus not sure what causes the
> error message you are reporting. Please note that the suggested way
> to build applications with Sourcery VSIPL++ is to query compiler options
> from the vsipl++.pc files that are part of binary releases. It is possible,
> or even likely, that you are missing some important macro definition that
> causes the built-in FFT backends to be masked.
>
>> I suppose I will have to set up a Cygwin environment, but I was hoping that MinGW alone would work.
>
> The only supported compiler on Windows is Intel's ICC. We haven't attempted
> to build using GCC on Windows, though we are now considering it.
>
> Regards,
>               Stefan
>


--
Jules Bergmann
CodeSourcery
jules at codesourcery.com
(650) 331-3385 x705
 
 
 
 
 
 
 
This electronic message and any files transmitted with it contain information which may be privileged and/or proprietary. The information is intended for use solely by the intended recipient(s). If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of this information is prohibited. If you have received this electronic message in error, please advise the sender by reply email or by telephone (301-939-7000) and delete the message.



More information about the vsipl++ mailing list