powervr-graphics / Native_SDK

C++ cross-platform 3D graphics SDK. Includes demos & helper code (resource loading etc.) to speed up development of Vulkan, OpenGL ES 2.0 & 3.x applications
https://docs.imgtec.com/sdk-documentation/html/introduction.html
MIT License
702 stars 197 forks source link

[BUG] Not compiling on BBB #70

Closed JDuchniewicz closed 3 years ago

JDuchniewicz commented 3 years ago

Description

Fails to build with following error:

make[2]: *** No rule to make target '../external/PVRScope/../../lib/Linux_armv7l/libPVRScopeDeveloper.a', needed by 'bin/OpenGLESPVRScopeExample'.  Stop.
make[1]: *** [CMakeFiles/Makefile2:1646: examples/OpenGLES/PVRScopeExample/CMakeFiles/OpenGLESPVRScopeExample.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

Repro steps

Clone the repository, configure with:

cmake .. -DPVR_BUILD_OPENGLES2_EXAMPLES=1 -DPVR_WINDOW_SYSTEM=NullWS -DCMAKE_BUILD_TYPE=Debug

Then build.

Environment

uname -a Linux beaglebone 4.19.94-ti-r64 #1buster SMP PREEMPT Fri May 21 23:57:28 UTC 2021 armv7l GNU/Linux

Additional Info

omarzohdi commented 3 years ago

Hey Jakub,

It looks like cmake is looking for the library in the incorrect folder. If you take a look at the contents of Native_SDK/lib/ you'll notice that the folder Linux_armv7l doesn't exist. However, you'll see Linux_armv7 and Linux_armv7hf do. I'd say a workaround to get you up and running is to copy and rename the Linux_armv7 to Linux_armv7l and see if the build process succeeds in that case.

Alternatively, you can kick cmake from the top-level folder and it should work correctly (note this will generate & build all of the examples)

I'll open an internal ticket to make sure that we map the architectures to the correct folders when running cmake from the examples' folders.

Cheer, Omar.

JDuchniewicz commented 3 years ago

Hi Omar,

I renamed it but it still fails to compile:

/usr/bin/ld.gold: error: ../../../../external/PVRScope/../../lib/Linux_armv7l/libPVRScopeDeveloper.a(DeviceScope.cpp.o) uses VFP register arguments, output does not
collect2: error: ld returned 1 exit status

It seems like Linux_armv7 uses VFP and BBB (armv7l) does not use the Vector Floating Point coprocessor.

I think that libraries may need recompiling for armv7l specifically.

omarzohdi commented 3 years ago

Hi, Jakub, yes you're right, it seems I was a bit hasty in my response. I've run a few more tests and it seems that the PVRScopeExample is not supported on the BeagleBone Black. As far as I can see the PVRScopeExample is not meant to be generated or built for OpenGL 2.0. Kicking a build from the top level will exclude that example from the build. The error seems to pop up when you try to build the example from its folder, correct?

Out of curiosity did you clone the repo from Github or did you use the SDK that ships with the BeagleBone Black Image?

JDuchniewicz commented 3 years ago

I followed the steps outlined in the Imagination's University Programme, Practical lesson 9. It asks for cloning the code from GH and installing.

The error is generated when I run the build from created cmake-build folder.

omarzohdi commented 3 years ago

I see, so It seems this is a regression. If you take a look here you'll see the two PVRScope examples were removed from the list of examples to be built when targeting OpenGL 2.0. The change was override in later commits.

To solve your issue, as quickly as possible, you can just remove the PVRScopeExample & PRVScopeRemote examples from the list in the CMakeLists.txt file and you should be good to go. I'll be patching the issue as soon as possible to reflect the changes. Do let me know if everything works after that change.

Thank you for bringing up the issue! Omar.

JDuchniewicz commented 3 years ago

I can confirm that reverting that change fixes the issue. Thank you for the support!

omarzohdi commented 3 years ago

Glad to hear it was fixed! I'll close the issue and if anything else pops up that you need help with feel free to open more.