Link errors building samples

Hi

I am trying to build the samples on the nano. I copied the samples over using the script in the samples directory and tried make

cd /usr/local/cuda/bin/
./cuda-install-samples-10.0.sh ~/work/
cd ~/work/NVIDIA_CUDA-10.0_Samples
make

/usr/local/cuda-10.0/bin/nvcc -ccbin g++ -m64 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_32,code=sm_32 -gencode arch=compute_53,code=sm_53 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_62,code=sm_62 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_72,code=sm_72 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_75,code=compute_75 -o simpleGLES_EGLOutput simpleGLES_EGLOutput.o -lGLESv2 -lEGL -ldrm
/usr/bin/ld: cannot find -lGLESv2
/usr/bin/ld: cannot find -lEGL

How do I install GLESv2 and EGl on the nano ?

Thanks in advance!

Hi,
Have you tried apt?

sudo apt-get install libgles2-mesa-dev libegl1-mesa-dev

Hi Miguel

Yes, they are both installed.

sudo apt-get install libgles2-mesa-dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
libgles2-mesa-dev is already the newest version (18.2.8-0ubuntu0~18.04.2).

sudo apt-get install libegl1-mesa-dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
libegl1-mesa-dev is already the newest version (18.2.8-0ubuntu0~18.04.2).

It maybe that findgleslib.mk does not find the correct path if both host and target are aarch64 ? That is, I am calling make on the nano. Maybe the findgleslib.mk file needs to be fixed ?

Hi,

Have you installed any EGL related library on your own?
It looks like the libraries are somehow broken.

I compiled the simpleGLES_EGLOutput sample and it can work correctly without issues.
Could you help to reflash the device and re-compile it again?

Thanks.

Thanks @AastaLL

It works with a fresh installation of the nano image

The location of libEGL is the same on both the fresh install and the broken installation

I installed a few things like librealsense and xrdp. How do I find out what broke ?

Hi,

Good to know this.

You can get some information by monitoring the link address of /usr/lib/aarch64-linux-gnu/libEGL.so.
It is possible that some installation overwrites the value and leads to this issue.

Thanks.

I manually fixed the links for libEGL and libGLES by looking at the fresh install that worked. Only the links were broken. The actual .so files had the same checksum.

I will set up the monitors when I recreate my environment from scratch again, and re-open this issue when I find out what changes the links

Thanks

Hi,

Thanks for the feedback.
Feel free to let us know if any further issue.

Thanks.