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

cann't find icc and daal.h file

likeyou
Beginner
1,554 Views

Hi, 

I am not expert of compiler.

I tried to runt the "makefile" of the example of daal under the "intel/daal/examples/cpp".

using icc and got below error " icc: not found"

But when I type "icc -v" I could get below information "icc version 18.0.0 (gcc version 5.0.0 compatibility)"

make _make_ex _IA=intel64 RES_EXT=so
make[1]: Entering directory '/home/intel/intel/compilers_and_libraries_2018.0.128/linux/daal/examples/cpp'
icc -Wall -w -I./source/utils ./source/association_rules/assoc_rules_apriori_batch.cpp -o _results/intel_intel64_parallel_so/assoc_rules_apriori_batch.exe -Wl,--start-group "./../../lib/intel64_lin"/libdaal_core.so "./../../lib/intel64_lin"/libdaal_thread.so -L"./../../../tbb/lib/intel64_lin/gcc4.4" -ltbb -ltbbmalloc -lpthread -ldl -Wl,--end-group
/bin/sh: 1: icc: not found
makefile:159: recipe for target '_results/intel_intel64_parallel_so/assoc_rules_apriori_batch.exe' failed
make[1]: *** [_results/intel_intel64_parallel_so/assoc_rules_apriori_batch.exe] Error 127
make[1]: Leaving directory '/home/xiaojia.song/intel/intel/compilers_and_libraries_2018.0.128/linux/daal/examples/cpp'
makefile:143: recipe for target 'sointel64' failed
make: *** [sointel64] Error 2

If I change the compiler to GNU (gcc), the error of "daal.h: No such file or directory" will appear.

sudo make libintel64 compiler=gnu
make _make_ex _IA=intel64 RES_EXT=a
make[1]: Entering directory '/home/intel/intel/compilers_and_libraries_2018.0.128/linux/daal/examples/cpp'
g++ -Wall -w -I./source/utils  -m64 ./source/association_rules/assoc_rules_apriori_batch.cpp -o _results/gnu_intel64_parallel_a/assoc_rules_apriori_batch.exe -Wl,--start-group "./../../lib/intel64_lin"/libdaal_core.a "./../../lib/intel64_lin"/libdaal_thread.a -L"./../../../tbb/lib/intel64_lin/gcc4.4" -ltbb -ltbbmalloc -lpthread -ldl -Wl,--end-group
./source/association_rules/assoc_rules_apriori_batch.cpp:52:18: fatal error: daal.h: No such file or directory
compilation terminated.
makefile:159: recipe for target '_results/gnu_intel64_parallel_a/assoc_rules_apriori_batch.exe' failed
make[1]: *** [_results/gnu_intel64_parallel_a/assoc_rules_apriori_batch.exe] Error 1
make[1]: Leaving directory '/home/xiaojia.song/intel/intel/compilers_and_libraries_2018.0.128/linux/daal/examples/cpp'
makefile:141: recipe for target 'libintel64' failed
make: *** [libintel64] Error 2

 

Does these error have relation with the daal license?

I am using a free version and not sure whether it needs a license?

or another hint for these errors?

Thanks in advances.

0 Kudos
13 Replies
Gennady_F_Intel
Moderator
1,554 Views

please  source all needed environments. You may do that something like similar: 

source /opt/intel/compilers_and_libraries_2018.0.128/linux/bin/compilervars.sh intel64

then call make with some option ( see make help)

make libintel64
make _make_ex _IA=intel64 RES_EXT=a
make[1]: Entering directory `/nfs/home/gfedorov/intel/compilers_and_libraries_2018.0.128/linux/daal/examples/cpp'
mkdir -p _results/intel_intel64_parallel_a
icc -Wall -w -I./source/utils ./source/association_rules/assoc_rules_apriori_batch.cpp -o _results/intel_intel64_parallel_a/assoc_rules_apriori_batch.exe -Wl,--start-group "/opt/intel/compilers_and_libraries_2018.0.128/linux/daal/lib/intel64_lin"/libdaal_core.a "/opt/intel/compilers_and_libraries_2018.0.128/linux/daal/lib/intel64_lin"/libdaal_thread.a -L"/opt/intel/compilers_and_libraries_2018.0.128/linux/tbb/lib/intel64_lin/gcc4.4" -ltbb -ltbbmalloc -lpthread -ldl -Wl,--end-group
_results/intel_intel64_parallel_a/assoc_rules_apriori_batch.exe > _results/intel_intel64_parallel_a/assoc_rules_apriori_batch.res

 

 

0 Kudos
Abhishek_S_6
Beginner
1,554 Views

Hi

I am also facing the similar issue.

I have did what you said but still getting similar issue.

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,554 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
Abhishek_S_6
Beginner
1,554 Views

Hi Andrey

This is what I am getting now

abhi@ubuntu:/opt/intel/compilers_and_libraries_2018.2.199/linux/daal/examples/cpp$ sudo make libintel64 example=cholesky_dense_batch mode=run compiler=gnu
make _make_ex _IA=intel64 RES_EXT=a
make[1]: Entering directory '/opt/intel/compilers_and_libraries_2018.2.199/linux/daal/examples/cpp'
mkdir -p _results/gnu_intel64_parallel_a
g++ -Wall -w -I./source/utils  -m64 ./source/cholesky/cholesky_dense_batch.cpp -o _results/gnu_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
./source/cholesky/cholesky_dense_batch.cpp:52:18: fatal error: daal.h: No such file or directory
compilation terminated.
makefile:165: recipe for target '_results/gnu_intel64_parallel_a/cholesky_dense_batch.exe' failed
make[1]: *** [_results/gnu_intel64_parallel_a/cholesky_dense_batch.exe] Error 1
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
0 Kudos
Andrey_G_Intel2
Employee
1,554 Views

Hello again!

you forgot to implement solution from upper answers - need to call DAAL (and/or Intel Compiler) environment setup script.

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

Andrey

0 Kudos
Abhishek_S_6
Beginner
1,554 Views

Hello Andrey

I have tried what you said, still getting the same error.

abhi@ubuntu:/opt/intel/compilers_and_libraries_2018.2.199/linux/daal/examples/cpp$ source ../../bin/daalvars.sh intel64
abhi@ubuntu:/opt/intel/compilers_and_libraries_2018.2.199/linux/daal/examples/cpp$ sudo make libintel64 example=cholesky_dense_batch mode=run compiler=gnu
[sudo] password for abhi: 
make _make_ex _IA=intel64 RES_EXT=a
make[1]: Entering directory '/opt/intel/compilers_and_libraries_2018.2.199/linux/daal/examples/cpp'
g++ -Wall -w -I./source/utils  -m64 ./source/cholesky/cholesky_dense_batch.cpp -o _results/gnu_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
./source/cholesky/cholesky_dense_batch.cpp:52:18: fatal error: daal.h: No such file or directory
compilation terminated.
makefile:165: recipe for target '_results/gnu_intel64_parallel_a/cholesky_dense_batch.exe' failed
make[1]: *** [_results/gnu_intel64_parallel_a/cholesky_dense_batch.exe] Error 1
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
0 Kudos
Andrey_G_Intel2
Employee
1,554 Views

Hello!

I have checked your way with one small change - I don`t use sudo - and it is work for me on "Ubuntu 16.04.3 LTS".

Could you do couple of experiments and send results here?

1) 

echo $0

echo $SHELL

sudo echo $0

sudo echo $SHELL

2)

source ../../bin/daalvars.sh intel64

echo $DAALROOT

sudo echo $DAALROOT

 

Andrey

0 Kudos
Abhishek_S_6
Beginner
1,554 Views

Hi

When I do without sudo, it give 'permission denied' error! This is the output:

abhi@ubuntu:/opt/intel/compilers_and_libraries_2018.2.199/linux/daal/examples/cpp$ make libintel64 example=cholesky_dense_batch mode=run compiler=gnu
make _make_ex _IA=intel64 RES_EXT=a
make[1]: Entering directory '/opt/intel/compilers_and_libraries_2018.2.199/linux/daal/examples/cpp'
g++ -Wall -w -I./source/utils  -m64 ./source/cholesky/cholesky_dense_batch.cpp -o _results/gnu_intel64_parallel_a/cholesky_dense_batch.exe -Wl,--start-group "/opt/intel/compilers_and_libraries_2018.2.199/linux/daal/lib/intel64_lin"/libdaal_core.a "/opt/intel/compilers_and_libraries_2018.2.199/linux/daal/lib/intel64_lin"/libdaal_thread.a -lpthread -ldl -L"/opt/intel/compilers_and_libraries_2018.2.199/linux/tbb/lib/intel64_lin/gcc4.4" -ltbb -ltbbmalloc -Wl,--end-group
/usr/bin/ld: cannot open output file _results/gnu_intel64_parallel_a/cholesky_dense_batch.exe: Permission denied
collect2: error: ld returned 1 exit status
makefile:165: recipe for target '_results/gnu_intel64_parallel_a/cholesky_dense_batch.exe' failed
make[1]: *** [_results/gnu_intel64_parallel_a/cholesky_dense_batch.exe] Error 1
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

 

These are the output that you asked for:

abhi@ubuntu:~$ echo $0
/bin/bash
abhi@ubuntu:~$ echo $SHELL
/bin/bash
abhi@ubuntu:~$ sudo echo $0
[sudo] password for abhi: 
/bin/bash
abhi@ubuntu:~$ sudo echo $SHELL
/bin/bash
abhi@ubuntu:/opt/intel/compilers_and_libraries_2018.2.199/linux/daal/examples/cpp$ source ../../bin/daalvars.sh intel64
abhi@ubuntu:/opt/intel/compilers_and_libraries_2018.2.199/linux/daal/examples/cpp$ echo $DAALROOT
/opt/intel/compilers_and_libraries_2018.2.199/linux/daal
abhi@ubuntu:/opt/intel/compilers_and_libraries_2018.2.199/linux/daal/examples/cpp$ sudo echo $DAALROOT
/opt/intel/compilers_and_libraries_2018.2.199/linux/daal
 
Thank you
0 Kudos
Andrey_G_Intel2
Employee
1,554 Views

Hello!

Do you actually have daal.h under /opt/intel/compilers_and_libraries_2018.2.199/linux/daal/include?

Could you also print CPATH value after daalvars.sh call:

source ../../bin/daalvars.sh intel64

sudo echo $CPATH

?

Also could you try to copy /opt/intel/compilers_and_libraries_2018.2.199/linux/daal/examples somewhere where abhi has write permissions and try to build & run examples in that place, but without sudo? Call of daalvars.sh should be stayed as is.

Andrey

0 Kudos
Ying_H_Intel
Employee
1,554 Views

Hello

​As i understand, 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.  So all kind of errors...

for easily solution, you may copy the whole  examples to your home folder , and do all things with your 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


Best Regards,
​Ying

0 Kudos
Abhishek_S_6
Beginner
1,554 Views

Hi

I can found daal.h under ..linux/daal/include folder.

abhi@ubuntu:/opt/intel/compilers_and_libraries_2018.2.199/linux/daal/examples/cpp$ source ../../bin/daalvars.sh intel64
abhi@ubuntu:/opt/intel/compilers_and_libraries_2018.2.199/linux/daal/examples/cpp$ sudo echo $CPATH
[sudo] password for abhi: 
/opt/intel/compilers_and_libraries_2018.2.199/linux/daal/include:/opt/intel/compilers_and_libraries_2018.2.199/linux/daal/include:/opt/intel/compilers_and_libraries_2018.2.199/linux/ipp/include:/opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/include:/opt/intel/compilers_and_libraries_2018.2.199/linux/pstl/include:/opt/intel/compilers_and_libraries_2018.2.199/linux/tbb/include:/opt/intel/compilers_and_libraries_2018.2.199/linux/tbb/include:/opt/intel/compilers_and_libraries_2018.2.199/linux/daal/include
 
I think I got it working as per your suggestions. Thank you!
 
Now I got directory _results/gnu_intel64_parallel_a. It contains two files: cholesky_dense_batch.exe & cholesky_dense_batch.res. I think last file contains result. It have a matrix:
1.000     0.000     0.000     0.000     0.000     
2.000     3.000     0.000     0.000     0.000     
4.000     5.000     6.000     0.000     0.000     
7.000     8.000     9.000     10.000    0.000     
11.000    12.000    13.000    14.000    15.000 
 
Is this the final result ? How can I know whether result is correct or not? Any method to cross-verify?
Thanks a lot for your patience and help :-)
 
 
0 Kudos
Andrey_G_Intel2
Employee
1,554 Views

Hello again! :-)

we have found root of problem and ready to give solution which don`t require to copy any files.

The root of problem: shell which run under sudo doesn`t inherit environment from parent shell. It is expected behavior (at least at ubuntu) and done by security reasons.

Solution: to run daalvars.sh script and make in one shell under sudo. 

    sudo ../../bin/daalvars.sh intel64;make libintel64 example=cholesky_dense_batch mode=run compiler=gnu

and to answer your other questions.

yes, it is expected final result of this example.

yes, method of cross-verification is exist. It depend on used algorithm and for most of DAAL cases not trivial. Because of it, we don`t put verification into examples to keep examples readable. Main purpose of DAAL examples - to show basic scenario of how to "call algorithm".

Andrey

 

0 Kudos
Abhishek_S_6
Beginner
1,554 Views

Hi Andrey

Actually what worked was I changed the permissions of /opt/intel folder so that system can read and write to any directory within intel folder.Other wise it was still giving permission denied error.

Glad that it got fixed! Thanks Andrey

Could you please into this post also: https://software.intel.com/en-us/forums/intel-data-analytics-acceleration-library/topic/777565 ;

0 Kudos
Reply