Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting lapacke.h: No such file or directory doing manual build on centOS #26

Open
MarkLuds opened this issue Jan 17, 2022 · 2 comments

Comments

@MarkLuds
Copy link

MarkLuds commented Jan 17, 2022

here is the error i'm getting:
/bin/sh /home/trendalix1/Tensor/ext/libtool --mode=compile cc -O3 -ffast-math -I. -I/home/trendalix1/Tensor/ext -DPHP_ATOM_INC -I/home/trendalix1/Tensor/ext/include -I/home/trendalix1/Tensor/ext/main -I/home/trendalix1/Tensor/ext -I/opt/cpanel/ea-php74/root/usr/include/php -I/opt/cpanel/ea-php74/root/usr/include/php/main -I/opt/cpanel/ea-php74/root/usr/include/php/TSRM -I/opt/cpanel/ea-php74/root/usr/include/php/Zend -I/opt/cpanel/ea-php74/root/usr/include/php/ext -I/opt/cpanel/ea-php74/root/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/trendalix1/Tensor/ext/include/linear_algebra.c -o include/linear_algebra.lo
libtool: compile: cc -O3 -ffast-math -I. -I/home/trendalix1/Tensor/ext -DPHP_ATOM_INC -I/home/trendalix1/Tensor/ext/include -I/home/trendalix1/Tensor/ext/main -I/home/trendalix1/Tensor/ext -I/opt/cpanel/ea-php74/root/usr/include/php -I/opt/cpanel/ea-php74/root/usr/include/php/main -I/opt/cpanel/ea-php74/root/usr/include/php/TSRM -I/opt/cpanel/ea-php74/root/usr/include/php/Zend -I/opt/cpanel/ea-php74/root/usr/include/php/ext -I/opt/cpanel/ea-php74/root/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/trendalix1/Tensor/ext/include/linear_algebra.c -fPIC -DPIC -o include/.libs/linear_algebra.o
/home/trendalix1/Tensor/ext/include/linear_algebra.c:7:21: fatal error: lapacke.h: No such file or directory
#include <lapacke.h>
^
compilation terminated.
make: *** [include/linear_algebra.lo] Error 1

I can see that i have the lapacke.h files on the server with : find / -name lapacke.h
which returns:

/usr/include/openblas/lapacke.h
/usr/include/lapacke/lapacke.h

I also tried adding the include paths so it would find it with:

export PATH="$HOME/usr/include:$PATH"
export PATH="$HOME/usr/include/openblas:$PATH"
export PATH="$HOME/usr/include/lapacke:$PATH"
export PATH="$HOME/include:$PATH"

but it doesn't seem to find the file. Sorry if this is something obvious, i don't spend much time in the command line.

Thanks, Mark

@MarkLuds
Copy link
Author

MarkLuds commented Jan 18, 2022

for any c++ or command line novices like myself, to solve this i had to change the file path:

I went into the tensor file that was causing the problem. Below was the error:

/home/trendalix1/Tensor/ext/include/linear_algebra.c:7:21: fatal error: lapacke.h: No such file or directory
 #include <lapacke.h>

so i went to /home/trendalix1/Tensor/ext/include/linear_algebra.c

and found this line: #include <lapacke.h>

then i found the path where lapacke.h was /usr/include/lapacke/lapacke.h using find / -name lapacke.h in the command line as root user.

then i changed the path to the direct path:
#include "/usr/include/lapacke/lapacke.h"

and it worked!

It's been 2 days trying to get this to work, so i hope it helps someone else

@andrewdalpino
Copy link
Member

Thanks for sharing @MarkLuds!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants