Intel® oneAPI Data Analytics Library
Learn from community members on how to build compute-intensive applications that run efficiently on Intel® architecture.

Issues running DAAL example on Windows with gcc

Antonio_R_
Beginner
371 Views

Hello,

I'm trying to run the DAAL examples compiling with Mingw on Windows 10 with cmd and i'm running into a very strange issue. I've set the env variables, can compile the .cpp but when I get into the linking part the problem in the sshot below shows up:

 

C:\daal-daal_2017_update3>g++ -v -I%DAALINCLUDE% cholesky_dense_batch.cpp -L%DAALLIB% -ldaal_core -ldaal_sequential -lpthread -lm -o cholesky_dense_batch.exe
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/lto-wrapper.exe
Target: mingw32
Configured with: ../gcc-4.8.1/configure --prefix=/mingw --host=mingw32 --build=mingw32 --without-pic --enable-shared --enable-static --with-gnu-ld --enable-lto --enable-libssp --disable-multilib --enable-languages=c,c++,fortran,objc,obj-c++,ada --disable-sjlj-exceptions --with-dwarf2 --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --with-gmp=/usr/src/pkg/gmp-5.1.2-1-mingw32-src/bld --with-mpc=/usr/src/pkg/mpc-1.0.1-1-mingw32-src/bld --with-mpfr= --with-system-zlib --with-gnu-as --enable-decimal-float=yes --enable-libgomp --enable-threads --with-libiconv-prefix=/mingw32 --with-libintl-prefix=/mingw --disable-bootstrap LDFLAGS=-s CFLAGS=-D_USE_32BIT_TIME_T
Thread model: win32
gcc version 4.8.1 (GCC)
COLLECT_GCC_OPTIONS='-v' '-I' 'C:/Progra~2/IntelSWTools/compilers_and_libraries_2017.2.187/windows/daal/include' '-LC:/Progra~2/IntelSWTools/compilers_and_libraries_2017.2.187/windows/daal/lib/intel64' '-o' 'cholesky_dense_batch.exe' '-shared-libgcc' '-mtune=generic' '-march=pentiumpro'
 c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/cc1plus.exe -quiet -v -I C:/Progra~2/IntelSWTools/compilers_and_libraries_2017.2.187/windows/daal/include -iprefix c:\mingw\bin\../lib/gcc/mingw32/4.8.1/ cholesky_dense_batch.cpp -quiet -dumpbase cholesky_dense_batch.cpp -mtune=generic -march=pentiumpro -auxbase cholesky_dense_batch -version -o C:\Users\Antonio\AppData\Local\Temp\ccmJGKW8.s
GNU C++ (GCC) version 4.8.1 (mingw32)
        compiled by GNU C version 4.8.1, GMP version 5.1.2, MPFR version 3.1.2, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/include/c++"
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/include/c++/mingw32"
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/include/c++/backward"
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/include"
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/../../../../include"
ignoring duplicate directory "/mingw/include"
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/include-fixed"
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/../../../../mingw32/include"
ignoring duplicate directory "/mingw/include"
#include "..." search starts here:
#include <...> search starts here:
 C:/Progra~2/IntelSWTools/compilers_and_libraries_2017.2.187/windows/daal/include
 c:\mingw\bin\../lib/gcc/mingw32/4.8.1/include/c++
 c:\mingw\bin\../lib/gcc/mingw32/4.8.1/include/c++/mingw32
 c:\mingw\bin\../lib/gcc/mingw32/4.8.1/include/c++/backward
 c:\mingw\bin\../lib/gcc/mingw32/4.8.1/include
 c:\mingw\bin\../lib/gcc/mingw32/4.8.1/../../../../include
 c:\mingw\bin\../lib/gcc/mingw32/4.8.1/include-fixed
 c:\mingw\bin\../lib/gcc/mingw32/4.8.1/../../../../mingw32/include
End of search list.
GNU C++ (GCC) version 4.8.1 (mingw32)
        compiled by GNU C version 4.8.1, GMP version 5.1.2, MPFR version 3.1.2, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 1ebc2a6f92fbd3aadc367a20a63fdf9f
COLLECT_GCC_OPTIONS='-v' '-I' 'C:/Progra~2/IntelSWTools/compilers_and_libraries_2017.2.187/windows/daal/include' '-LC:/Progra~2/IntelSWTools/compilers_and_libraries_2017.2.187/windows/daal/lib/intel64' '-o' 'cholesky_dense_batch.exe' '-shared-libgcc' '-mtune=generic' '-march=pentiumpro'
 as -v -I C:/Progra~2/IntelSWTools/compilers_and_libraries_2017.2.187/windows/daal/include -o C:\Users\Antonio\AppData\Local\Temp\ccirkCd4.o C:\Users\Antonio\AppData\Local\Temp\ccmJGKW8.s
GNU assembler version 2.24 (mingw32) using BFD version (GNU Binutils) 2.24
COMPILER_PATH=c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/;c:/mingw/bin/../libexec/gcc/
LIBRARY_PATH=c:/mingw/bin/../lib/gcc/mingw32/4.8.1/;c:/mingw/bin/../lib/gcc/;c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/lib/;c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../
COLLECT_GCC_OPTIONS='-v' '-I' 'C:/Progra~2/IntelSWTools/compilers_and_libraries_2017.2.187/windows/daal/include' '-LC:/Progra~2/IntelSWTools/compilers_and_libraries_2017.2.187/windows/daal/lib/intel64' '-o' 'cholesky_dense_batch.exe' '-shared-libgcc' '-mtune=generic' '-march=pentiumpro'
 c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/collect2.exe -Bdynamic -u ___register_frame_info -u ___deregister_frame_info -o cholesky_dense_batch.exe c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../crt2.o c:/mingw/bin/../lib/gcc/mingw32/4.8.1/crtbegin.o -LC:/Progra~2/IntelSWTools/compilers_and_libraries_2017.2.187/windows/daal/lib/intel64 -Lc:/mingw/bin/../lib/gcc/mingw32/4.8.1 -Lc:/mingw/bin/../lib/gcc -Lc:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/lib -Lc:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../.. C:\Users\Antonio\AppData\Local\Temp\ccirkCd4.o -ldaal_core -ldaal_sequential -lpthread -lm -lstdc++ -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt c:/mingw/bin/../lib/gcc/mingw32/4.8.1/crtend.o
C:\Users\Antonio\AppData\Local\Temp\ccirkCd4.o:cholesky_dense_batch.cpp:(.text+0x2346): undefined reference to `daal::data_management::interface1::SubtensorDescriptor<float>::~SubtensorDescriptor()'
C:\Users\Antonio\AppData\Local\Temp\ccirkCd4.o:cholesky_dense_batch.cpp:(.text+0x2370): undefined reference to `daal::data_management::interface1::SubtensorDescriptor<float>::~SubtensorDescriptor()'
C:\Users\Antonio\AppData\Local\Temp\ccirkCd4.o:cholesky_dense_batch.cpp:(.text+0x256f): undefined reference to `daal::data_management::interface1::SubtensorDescriptor<float>::~SubtensorDescriptor()'
C:\Users\Antonio\AppData\Local\Temp\ccirkCd4.o:cholesky_dense_batch.cpp:(.text+0x259f): undefined reference to `daal::data_management::interface1::SubtensorDescriptor<float>::~SubtensorDescriptor()'
C:\Users\Antonio\AppData\Local\Temp\ccirkCd4.o:cholesky_dense_batch.cpp:(.text+0x2917): undefined reference to `daal::data_management::interface1::Tensor::getSize() const'
C:\Users\Antonio\AppData\Local\Temp\ccirkCd4.o:cholesky_dense_batch.cpp:(.text+0x295e): undefined reference to `daal::data_management::interface1::SubtensorDescriptor<float>::~SubtensorDescriptor()'
C:\Users\Antonio\AppData\Local\Temp\ccirkCd4.o:cholesky_dense_batch.cpp:(.text+0x298c): undefined reference to `daal::data_management::interface1::SubtensorDescriptor<float>::~SubtensorDescriptor()'
C:\Users\Antonio\AppData\Local\Temp\ccirkCd4.o:cholesky_dense_batch.cpp:(.text+0x2a60): undefined reference to `daal::algorithms::cholesky::interface1::Input::set(daal::algorithms::cholesky::InputId, daal::services::interface1::SharedPtr<daal::data_management::interface1::NumericTable> const&)'
C:\Users\Antonio\AppData\Local\Temp\ccirkCd4.o:cholesky_dense_batch.cpp:(.text+0x2a9f): undefined reference to `daal::algorithms::cholesky::interface1::Result::get(daal::algorithms::cholesky::ResultId) const'
C:\Users\Antonio\AppData\Local\Temp\ccirkCd4.o:cholesky_dense_batch.cpp:(.text$_ZN4daal4BasenwEj[__ZN4daal4BasenwEj]+0xffffd3fd): undefined reference to `daal::services::daal_malloc(unsigned int, unsigned int)'
c:\mingw\bin/ld.exe: C:\Users\Antonio\AppData\Local\Temp\ccirkCd4.o: bad reloc address 0x15 in section `.text$_ZN4daal4BasenwEj[__ZN4daal4BasenwEj]'
collect2.exe: error: ld returned 1 exit status

I don't uderstand why it doesn't find  those references because they are in the files (I can compile the examples in Visual Studio with Intel C and VC). It appears to me that the #include path is wrong but I don't thats the case because the whole library would be wrong if so.

 

Any help is appreciated. Thanks for your time and patience.

 

0 Kudos
1 Reply
VictoriyaS_F_Intel
371 Views

Hello Antonio,

Here are the reasons why Intel DAAL examples cannot be built with MinGW:

  • MinGW compiler is not supported by Intel DAAL 2017. Please find the list of the compilers supported for Windows in Intel DAAL System Requirements.
  • Intel DAAL DLLs are written in C++ and are built with Visual Studio runtime. When you try to build some example with MinGW, you see "undefined reference" errors because Visual Studio and MinGW mangle C++ names differently. That is why MinGW linker cannot find the expected symbols in the library. Please see the following MinGW Wiki page for more information: "Interoperability of Libraries Created by Different Compiler Brands"

Best regards,

Victoriya

 

0 Kudos
Reply