daal cpp example compile error

daal cpp example compile error

 

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?

Tema de la cadena: 

Question
publicaciones de 8 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.

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

 

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. 

 

Quote:

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

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

dr_pain

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!

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

dr_pain

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

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.

 

Deje un comentario

Por favor inicie sesión para agregar un comentario. ¿No es socio? Únase ya