wolftype / versor

Versor Geometric Algebra Library
wolftype.github.io/versor/devel/html/
290 stars 47 forks source link

Problem with glut on Fedora 35 #28

Open StumpfMichael opened 2 years ago

StumpfMichael commented 2 years ago

Hi,

beside other things I have a problem with glut to build the examples.

Firstly, i had to include -lglut to versor/build/CMakeFiles/xBasic.dir/link.txt to resolve symbols with glutXXX.

When I run the application it says: freeglut ERROR: Function called without first calling 'glutInit' and stops running.

I have similar problems with other examples.

The functions of glut are referenced in versor/ext/gfx/gfx/gfx:glyphs.h, which is included in versor/include/vsr/draw/vsr_XXX_draw.h etc.

What is going wrong?

wolftype commented 2 years ago

I recently swapped in GLFW for Glut on the windowing side due to hyper-resolution issues with newer mac screens. Looks like on Mac glutInit is still called (allowing glutSolidSphere to work) but not so on Linux. I have a branch bug28-linux-graphics-glfw which calls glutInit when initializing GLFW window -- I am unable to test on Linux but perhaps you could? On mac, this causes a "double init" of Glut, but I haven't determined where the first init happens.

StumpfMichael commented 2 years ago

Understood. I cloned the bug28-linux-graphics-glfw and made some minor changes (lambdas in .h-files result in multiple references which the GCC linker apparently doesn't allow and I have to declare them const). Again I added manually -lglut to the link.txt's. Some graphical examples still run correctly as before like xMotor. Those who stopped because of the missing glutInit now crash with a Segmentation fault (core dumped).

StumpfMichael commented 2 years ago

The crashes happen immediately after opening the graphical window. If you want me to do further tests I would recommend to work on one specific example.

wolftype commented 2 years ago

you could try a different branch -- bug28-linux-graphics-glut -- which just avoids using GLFW altogher

StumpfMichael commented 2 years ago

I'll take a look. I'm not yet familiar with these graphics libraries, but perhaps I'll try to figure it out for myself over time.

StumpfMichael commented 2 years ago

There is no difference to run the examples of bug28-linux-graphics-glut or bug28-linux-graphics-glfw. The same binaries crash. During make the following the warning "Policy CMP0072 is not set" is shown, which is related to graphics libraries (for all branches I have tested so far).

StumpfMichael commented 2 years ago

Attached you can find some output of cmake to get an overview of the configuration cmake.log .

wolftype commented 2 years ago

Are you able to run in gdb and share the backtrace from the crash?

On Fri, Jan 28, 2022 at 5:10 AM StumpfMichael @.***> wrote:

Attached you can find some output of cmake to get an overview of the configuration cmake.log https://github.com/wolftype/versor/files/7957713/cmake.log .

— Reply to this email directly, view it on GitHub https://github.com/wolftype/versor/issues/28#issuecomment-1024067516, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIRQX7QNDGWU4N4D4QYLKLUYJTQTANCNFSM5M33LK2A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>

StumpfMichael commented 2 years ago

bug28-linux-graphics-glut-xFields-gdb-bt.log

darnells commented 2 years ago

I built the bug28-linux-graphics-glfw branch on Ubuntu 20.04 (Hyper-V VM on Windows 10) and I am seeing a circle, plane, and sphere when I use ./run.sh examples/xBasic.cpp.

image

Maybe its a version issue for a library dependency? Here's a list my package dependencies as listed in .circleci/config.yml.

libxrandr-dev | 2:1.5.2-0ubuntu1 | http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
libxinerama-dev |  2:1.1.4-2 | http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
libxcursor-dev |  1:1.2.0-2 | http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
libglew-dev |    2.1.0-4 | http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages
freeglut3-dev |    2.8.1-3 | http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages
 libxi-dev | 2:1.7.10-0ubuntu1 | http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
libxmu-dev | 2:1.1.3-0ubuntu1 | http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
StumpfMichael commented 2 years ago

Ok, let us concentrate on xBasic. I'll create a VM with the latest Ubuntu release and experiment with both OS's.

StumpfMichael commented 2 years ago

These are the corresponding packages on Fedora 35: libXrandr-devel-1.5.2-7.fc35.x86_64 libXinerama-devel-1.1.4-9.fc35.x86_64 libXcursor-devel-1.2.0-6.fc35.x86_64 glew-devel-2.1.0-10.fc35.x86_64 freeglut-devel-3.2.1-10.fc35.x86_64 libXi-devel-1.7.10-7.fc35.x86_64 libXmu-devel-1.1.3-7.fc35.x86_64

StumpfMichael commented 2 years ago

There is a difference of the freeglut version: (see: http://freeglut.sourceforge.net/)

ubuntu 20.04: 2.8.1 from 04/05/2013 fedora 35: 3.2.1 from 09/29/2019

darnells commented 2 years ago

It looks like both Debian and Ubuntu have chosen to stop at 2.8.1.

StumpfMichael commented 2 years ago

There you can find the reason for not updating freeglut on Debian/Ubuntu: https://sourceforge.net/p/freeglut/bugs/255/ I'll investigate, if it is related to the crash of versor's examples.

StumpfMichael commented 2 years ago

I downloaded the sources from freeglut 3.2.1 and applied the following patch: https://sourceforge.net/p/freeglut/code/1868/ Unfortunately the binaries of both branches still crash.

StumpfMichael commented 2 years ago

I downloaded the sources from freeglut 2.8.1. and installed the library on Fedora 35. xBasic does indeed run, but the other ones still crash. I'll run tests on Ubuntu 20.

StumpfMichael commented 2 years ago

I installed both branches on Ubuntu 20. There the examples do not crash at all. The installation was smoother (-lglut is already included, etc.). As far as I can tell the examples of bug28-linux-graphics-glfw work without major problems. Only when you click inside the window of xRoot the graphics disappear. The examples of bug28-linux-graphics-glut have more graphical problems. Sometimes you see nothing or only fragments. The linker complained four symbols (is_positive, has_inner, has_outer, Flip). I had to comment out line 14-16 of InstructionTest.cpp and line 42 of Product Test.cpp. I feel comfortable with Ubuntu and have no intention to fix problems of Fedora. Thank you for the support here. From my point of view the issue can be closed.

wolftype commented 2 years ago

Thanks for the thoroughness here. One quick question if you have the time: how does devel branch behave on Ubuntu 20?

On Sun, Jan 30, 2022 at 5:53 AM StumpfMichael @.***> wrote:

I installed both branches on Ubuntu 20. There the examples do not crash at all. The installation was smoother (-lglut is already included, etc.). As far as I can tell the examples of bug28-linux-graphics-glfw work without major problems. Only when you click inside the window of xRoot the graphics disappear. The examples of bug28-linux-graphics-glut have more graphical problems. Sometimes you see nothing or only fragments. The linker complained four symbols (is_positive, has_inner, has_outer, Flip). I had to comment out line 14-16 of InstructionTest.cpp and line 42 of Product Test.cpp. I feel comfortable with Ubuntu and have no intention to fix problems of Fedora. Thank you for the support here. From my point of view the issue can be closed.

— Reply to this email directly, view it on GitHub https://github.com/wolftype/versor/issues/28#issuecomment-1025117144, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIRQXYIXQ5D7AFHD3Z3MKLUYUKBZANCNFSM5M33LK2A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>

StumpfMichael commented 2 years ago

In the devel branch some binaries stop with the comment "freeglut ERROR: Function called without first calling 'GlutXXX'", with XXX being either SolidCone, SolidSphere or WireSphere. Those are xBasic, xFabricChain, xFabricChainConstrained,, xField, xMeet, xPointToCircle, xRobotArm and xTorusKnot. The others work well. In the bug28 branches xRawGlut shows a second triangle with flicker, in devel it is one clear triangle.

StumpfMichael commented 2 years ago

Sorry, the error message is slightly different: freeglut ERROR: Function called without first calling 'glutInit'.

wolftype commented 2 years ago

thanks -- re-opening issue as others are experiencing trouble on windows. i have a new branch bug28-remove-glut which removes glut calls and replaces the glutXXX calls with standardd render calls. so no needd for initiatialization. examples/xTorusKnot is a good example to try, as it attempts rendering both in immediate mode and "advanced" programmable render mode.

StumpfMichael commented 2 years ago

On Ubuntu 20 all the examples run very well. On Fedora 35 even xTorusKnot still crashes.