Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

SDLT sample code fails to build :(

David_M_17
Novice
561 Views

Greetings Intel C++ forum.

I downloaded the Image Processing: Averaging Filter with SDLT from: https://software.intel.com/en-us/code-samples/intel-c-compiler/application-domains/finance/averaging-filter-sdlt

I am running on Linux so I downloaded the .tar.gz file.

I went to my linux box and uncompressed and untared the directory and looked at the readme - then I loaded intel 17 compilers and typed make.  Unfortunately - this did not build a binary.  I got numerous errors - a few of those errors are copied and pasted below.  I s there something wrong with the compiler setup ? Is there a problem in the download package that requires an update?  I look forward to more information.

Thank you kindly,

-David M.

[AveragingFilter_SDLT]$ module load intel/17
[AveragingFilter_SDLT]$ make
icpc -c -restrict -xCORE-AVX2 -std=c++11 -I /home/anoop -g -O2  -o release/AverageFilter.o src/AverageFilter.cpp 
In file included from /storage/packages/intel/compilers_and_libraries_2017.0.098/linux/compiler/include/sdlt/aligned.h(32),
                 from /storage/packages/intel/compilers_and_libraries_2017.0.098/linux/compiler/include/sdlt/linear_index.h(31),
                 from /storage/packages/intel/compilers_and_libraries_2017.0.098/linux/compiler/include/sdlt/aligned_accessor.h(31),
                 from /storage/packages/intel/compilers_and_libraries_2017.0.098/linux/compiler/include/sdlt/sdlt.h(28),
                 from src/AverageFilter.cpp(22):
/storage/packages/intel/compilers_and_libraries_2017.0.098/linux/compiler/include/sdlt/fixed.h(238): error: expected an operator
      operator "" _fixed()
               ^

In file included from /storage/packages/intel/compilers_and_libraries_2017.0.098/linux/compiler/include/sdlt/aligned.h(32),
                 from /storage/packages/intel/compilers_and_libraries_2017.0.098/linux/compiler/include/sdlt/linear_index.h(31),
                 from /storage/packages/intel/compilers_and_libraries_2017.0.098/linux/compiler/include/sdlt/aligned_accessor.h(31),
                 from /storage/packages/intel/compilers_and_libraries_2017.0.098/linux/compiler/include/sdlt/sdlt.h(28),
                 from src/AverageFilter.cpp(22):
/storage/packages/intel/compilers_and_libraries_2017.0.098/linux/compiler/include/sdlt/fixed.h(236): error: "constexpr" is not valid here
      SDLT_INLINE constexpr
                  ^

In file included from /storage/packages/intel/compilers_and_libraries_2017.0.098/linux/compiler/include/sdlt/aligned.h(32),
                 from /storage/packages/intel/compilers_and_libraries_2017.0.098/linux/compiler/include/sdlt/linear_index.h(31),
                 from /storage/packages/intel/compilers_and_libraries_2017.0.098/linux/compiler/include/sdlt/aligned_accessor.h(31),
                 from /storage/packages/intel/compilers_and_libraries_2017.0.098/linux/compiler/include/sdlt/sdlt.h(28),
                 from src/AverageFilter.cpp(22):
/storage/packages/intel/compilers_and_libraries_2017.0.098/linux/compiler/include/sdlt/fixed.h(242): error: expected a ";"
  } // namepace v2
  ^

In file included from /storage/packages/intel/compilers_and_libraries_2017.0.098/linux/compiler/include/sdlt/aligned.h(32),
                 from /storage/packages/intel/compilers_and_libraries_2017.0.098/linux/compiler/include/sdlt/linear_index.h(31),
                 from /storage/packages/intel/compilers_and_libraries_2017.0.098/linux/compiler/include/sdlt/aligned_accessor.h(31),
                 from /storage/packages/intel/compilers_and_libraries_2017.0.098/linux/compiler/include/sdlt/sdlt.h(28),
                 from src/AverageFilter.cpp(22):
/storage/packages/intel/compilers_and_libraries_2017.0.098/linux/compiler/include/sdlt/fixed.h(243): error: expected an operator
  using v2::operator "" _fixed;

0 Kudos
7 Replies
Anoop_M_Intel
Employee
561 Views

Hi David,

Which version of GCC are you using on your machine? I am not able to reproduce this problem on my machine and the GCC version on my machine is 4.9.

Thanks and Regards
Anoop

0 Kudos
David_M_17
Novice
561 Views

? gcc?

I was using intel 17 compiler - see icpc?

specifically 17.0.0.

I will give gcc a try - that means I will have to edit the makefile.  I was trying to reproduce the example without any changes exactly as packaged with the intel compiler examples before I made any alterations.  But I will edit the make file to use gcc instead of icpc - intel compilers.

-David

0 Kudos
David_M_17
Novice
561 Views

OK - I edited the Makefile by replacing icpc with gcc.

This didn't work as gcc doesn't recognize any of the flags used.   As I keep on editing out the flags I just get more and more errors.   The Makefile contains this line:

gcc: 
        @echo "please use Intel(R) C++ Compiler 16.0 in Intel(R) Parallel Studio XE 2016 update 1 or newer"

So with this annotation and the numerous errors I get trying to convert to gcc - I don't really think this is designed to work with gcc?  If it were tested with gcc why wouldn't intel provide a gcc path in the makefile with the Intel path?  Maybe you could provide the Makefile you use with gcc?   I could attach the Makefile to this but I think you wrote it?

I also notice the Makefile has this line the compiler flags: 

-I /home/anoop

Were there files in /home/anoop that were not included in the tar.gz file?

-David

0 Kudos
Anoop_M_Intel
Employee
561 Views

Hi David,

/home/Anoop was the local directory where I had the SDLT headers before the headers were shipped with Intel Compiler. So you can remove -I /home/Anoop from the Makefile. ICC 17.0 is compatible with GCC 4.1 to GCC 5.2. Depending upon the version of GCC on your machine, ICC gets into that compatibility mode and only support the C++11 features supported by the underlying GCC version. Could you please share the GCC version on that machine.

Thanks and Regards
Anoop

0 Kudos
David_M_17
Novice
561 Views

Of course, I should have thought about that.  The underlying gcc is 4.4. Full gcc attached.

 

 

 

 

0 Kudos
David_M_17
Novice
561 Views

Thanks for your comment.  I switched to gcc 5.3 and this builds fine now.    Although you report gcc 4.1 minimum is required it seems it needs more than that - 4.4.7 did not work.    The system I use has several versions of gcc and intel compilers for different projects. If I load intel 17 and gcc 5.3 modules this builds fine.

The code is now running and I can run both the Serial version and the SDLT version.   Is the SDLT version non-serial?   Is the SDLT version threaded as well?   Are there multiple optimizations in the SDLT version or is it just a change to SDLT? 

Thank you,

-David

 

0 Kudos
Anoop_M_Intel
Employee
561 Views

Hi David,

I am glad that the program worked for you with more recent version of GCC. SDLT implementation depends a lot on the latest C++11 features. SDLT is all about changing the memory layout for the data structure to make it more vector friendly. So we chose to demonstrate this feature with a single threaded code sample. But the same can be extended to have multi-threaded support too.

Thanks and Regards
Anoop

0 Kudos
Reply