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

daal cpp example compile error

QI_L_
Beginner
1,516 Views

 

I try to compile examples located in daal/examples/cpp using the following command (as mentioned in this tutorial https://software.intel.com/en-us/get-started-with-daal-for-macos#SET_ENV):

make libintel64 example=cholesky_batch.cpp mode=run

But got following error:

/Library/Developer/CommandLineTools/usr/bin/make _make_ex _IA=intel64 RES_EXT=a

make[1]: *** No rule to make target `_results/intel_intel64_parallel_a/cholesky_batch.cpp.res', needed by `_make_ex'.  Stop.

make: *** [libintel64] Error 2

So how should I set up for this?

0 Kudos
7 Replies
Ying_H_Intel
Employee
1,516 Views

Hi Qi,

The issue  seems be the name of example.  Could you please try

make libintel64 example=cholesky_dense_batch mode=run

and see if it can work?

Best Regards,

Ying

0 Kudos
QI_L_
Beginner
1,516 Views

 

Hi Ying, 

Thanks for the response. I changed the name and used sudo to try "mode=build " and "mode=run". However, I got error below:

/Library/Developer/CommandLineTools/usr/bin/make _make_ex _IA=intel64 RES_EXT=a

icc -Wall -w -stdlib=libstdc++ -I./source/utils ./source/cholesky/cholesky_dense_batch.cpp -o _results/intel_intel64_parallel_a/cholesky_dense_batch.exe -Wl,-rpath,"./../../lib" -Wl,-rpath,"./../../../tbb/lib" "./../../lib"/libdaal_core.a "./../../lib"/libdaal_thread.a -ltbb -ltbbmalloc -ldl

./source/cholesky/cholesky_dense_batch.cpp(33): catastrophic error: cannot open source file "daal.h"

  #include "daal.h"

                   ^

 

make[1]: *** [_results/intel_intel64_parallel_a/cholesky_dense_batch.exe] Error 4

 

make: *** [libintel64] Error 2


It looks like the compiler could not locate my daal.h header file. 

 

Ying H. (Intel) wrote:

Hi Qi,

The issue  seems be the name of example.  Could you please try

make libintel64 example=cholesky_dense_batch mode=run

and see if it can work?

Best Regards,

Ying

0 Kudos
Andrey_G_Intel2
Employee
1,516 Views

Hi Qi!

you need to set DAAL environment before DAAL usage. To do it, call daalvars.sh (with parameter intel64|ia32) from bin folder.

So, your command line should looks like: source ../../bin/daalvars.sh intel64; make libintel64 example=cholesky_dense_batch

Andrey

0 Kudos
Abhishek_S_6
Beginner
1,516 Views

Hi

I am able to compile my_first_daal_program.cpp program using DAAL using icpc.

I am still getting error in make command with Intel Parallel Studio 2018:

abhi@ubuntu:/opt/intel/compilers_and_libraries_2018.2.199/linux/daal/examples/cpp$ sudo make libintel64 example=cholesky_dense_batch.cpp mode=run
make _make_ex _IA=intel64 RES_EXT=a
make[1]: Entering directory '/opt/intel/compilers_and_libraries_2018.2.199/linux/daal/examples/cpp'
make[1]: *** No rule to make target '_results/intel_intel64_parallel_a/cholesky_dense_batch.cpp.exe', needed by '_make_ex'.  Stop.
make[1]: Leaving directory '/opt/intel/compilers_and_libraries_2018.2.199/linux/daal/examples/cpp'
makefile:147: recipe for target 'libintel64' failed
make: *** [libintel64] Error 2
 
And if I am not using file extension, I am getting
 
abhi@ubuntu:/opt/intel/compilers_and_libraries_2018.2.199/linux/daal/examples/cpp$ sudo make libintel64 example=cholesky_dense_batch mode=run
make _make_ex _IA=intel64 RES_EXT=a
make[1]: Entering directory '/opt/intel/compilers_and_libraries_2018.2.199/linux/daal/examples/cpp'
icc -Wall -w -I./source/utils  ./source/cholesky/cholesky_dense_batch.cpp -o _results/intel_intel64_parallel_a/cholesky_dense_batch.exe -Wl,--start-group "./../../lib/intel64_lin"/libdaal_core.a "./../../lib/intel64_lin"/libdaal_thread.a -lpthread -ldl -L"./../../../tbb/lib/intel64_lin/gcc4.4" -ltbb -ltbbmalloc -Wl,--end-group
/bin/sh: 1: icc: not found
makefile:165: recipe for target '_results/intel_intel64_parallel_a/cholesky_dense_batch.exe' failed
make[1]: *** [_results/intel_intel64_parallel_a/cholesky_dense_batch.exe] Error 127
make[1]: Leaving directory '/opt/intel/compilers_and_libraries_2018.2.199/linux/daal/examples/cpp'
makefile:147: recipe for target 'libintel64' failed
make: *** [libintel64] Error 2
 
Please help!
0 Kudos
Andrey_G_Intel2
Employee
1,516 Views

Hello!

your second variant is correct, example name needs to be specified without file extension.

I see that error caused by absence of icc (Intel Compiler) in PATH - "/bin/sh: 1: icc: not found". By default, DAAL examples makefile use icc as compiler for examples. So, you may fix problem in two ways:

1) add icc to the path. call compilervars.sh before calling daalvars.sh 

2) use makefile variable "compiler" to change compiler. for example, to run daal examples with gcc try this command line:

sudo make libintel64 example=cholesky_dense_batch mode=run compiler=gnu

note: compiler should support c++11. for gnu it is gcc > 5.0

Andrey

0 Kudos
Ying_H_Intel
Employee
1,516 Views

Thank you Andrey, add one more solution:

Here the main problem is

1. the example haven't write right for common users, so have to use SODU right

2 But. the environment  source ../../bin/daalvars.sh intel64 under user right,  don't valid  with sudo  rights, which cause  all kind of errors...

for easily solution,  please copy the whole  examples to your home folder , and do all things with your user account , for example,

> cp -r examples  ~/.
>cd ~/examples/cpp

>source /opt/intel/compilers_and_libraries_2018.x.xx/linux/bin/compilervars.sh intel64 (if you installed intel compiler and daal )

then call make with some option ( see make help)

>make libintel64 xxx

Best Regards,
​Ying

0 Kudos
ONUR_B_Intel
Employee
1,516 Views

UPDATE: Needed to rename makefile_lnx to makefile and daal_lnx.lst to daal_lnx.lst under examples/cpp folder to make it work.

 

Hi,

I installed DAAL and successfully ran Step 2 here: https://software.intel.com/en-us/get-started-with-daal-for-linux

I skipped Step 3 as optional. At Step 4, when I type command

$ make libintel64 example=cholesky_dense_batch compiler=intel threading=parallel

I get the error:

make: * * * No rule to make target 'libintel64'. Stop.

Need help. Thanks.

 

0 Kudos
Reply