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

build with Scons

Farzaneh_T_
Beginner
924 Views

Hi,

I am trying to build a C++ code, which includes daal.h, with using Scons. I use the following Sconstruct script to run:

env = Environment(

         CPPPATH=['/opt/intel/daal/include'],
         CCFLAGS= ['/opt/intel/daal/include'],
         LIBPATH=['/opt/intel/daal/lib/intel64_lin'],
         LIBS=['daal_thread','daal_core','pthread','dl','tbb','stdc++','m'])
env['CXX'] = '/opt/intel/bin/icc'
env.Program(target = 'test_lr', source = ["test_lr.cpp"])

 

By running the script, I face the following error message:

$ ~/scons/bin/scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
/opt/intel/bin/icc -o test_lr test_lr.o -L/opt/intel/daal/lib/intel64_lin -ldaal_thread -ldaal_core -lpthread -ldl -ltbb -lstdc++ -lm
ld: cannot find -ltbb
scons: *** [test_lr] Error 1
scons: building terminated because of errors.

How can I tackle this problem.

Many thanks in advance.

Best,

Farzaneh

0 Kudos
1 Solution
Andrey_G_Intel2
Employee
924 Views

Hi Farzaneh!

Is it only error which you see?

It isn`t  LD_LIBRARY_PATH issue. It is compilation issue - compiler can`t find declaration of NumericTablePtr.

From your scons script I see that you use compilers_and_libraries_2016.2.181NumericTablePtr data type was introduces in later DAAL version. So, looks like you tried to use service.h from modern DAAL with old DAAL.

Andrey

View solution in original post

0 Kudos
3 Replies
Farzaneh_T_
Beginner
924 Views

Hi, I have updated the Scons script and now I don't get the error ld: cannot find -ltbb.

Here is the updated script:

env = Environment(
         CPPPATH=['/opt/intel/compilers_and_libraries_2016.2.181/linux/daal/include'],
         #CCFLAGS= ['/opt/intel/daal/include'],
         CCFLAGS=['-daal'],
         LIBPATH=['/opt/intel/daal/lib/intel64_lin',
                  '/opt/intel/compilers_and_libraries_2016.2.181/linux/tbb/lib/intel64_lin/gcc4.4',
                  '/opt/intel/compilers_and_libraries_2016.2.181/linux/daal/lib/intel64_lin',
                  '/opt/intel/compilers_and_libraries_2016.2.181/linux/compiler/lib/intel64_lin',
                  '/opt/intel/compilers_and_libraries_2016.2.181/linux/daal/lib',
                  '/opt/intel/compilers_and_libraries_2016.2.181/linux/daal/include'],
         LIBS=['daal_thread','daal_core','pthread','dl','tbb','stdc++','m','iomp5'])
env['CXX'] = '/opt/intel/bin/icc'
env.Program(target = 'test_lr', source = ["test_lr.cpp"])
~

Now I face another error message that the identifier "NumericTablePtr" is undefined:

In file included from trn_lr_norm_eq.cpp(37),
                 from test_lr.cpp(23):
service.h(161): error: identifier "NumericTablePtr" is undefined
  void printAprioriItemsets(NumericTablePtr largeItemsetsTable,
                            ^


I appreciate if you can tell me what else should be added to the LD_LIBRARY_PATH.

Best,

Farzaneh

 

0 Kudos
Andrey_G_Intel2
Employee
925 Views

Hi Farzaneh!

Is it only error which you see?

It isn`t  LD_LIBRARY_PATH issue. It is compilation issue - compiler can`t find declaration of NumericTablePtr.

From your scons script I see that you use compilers_and_libraries_2016.2.181NumericTablePtr data type was introduces in later DAAL version. So, looks like you tried to use service.h from modern DAAL with old DAAL.

Andrey

0 Kudos
Farzaneh_T_
Beginner
924 Views

Hi Andrey,

Thanks for reply. I have tried /opt/intel-2017 and was able to build the code without any problem.

Best,

Farzaneh

 

 

0 Kudos
Reply