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

Problem with glut on Fedora 35 #28

Open
StumpfMichael opened this issue Jan 26, 2022 · 23 comments
Open

Problem with glut on Fedora 35 #28

StumpfMichael opened this issue Jan 26, 2022 · 23 comments

Comments

@StumpfMichael
Copy link

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Author

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
Copy link
Owner

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

@StumpfMichael
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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

@wolftype
Copy link
Owner

wolftype commented Jan 28, 2022 via email

@StumpfMichael
Copy link
Author

@darnells
Copy link

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
Copy link
Author

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

@StumpfMichael
Copy link
Author

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
Copy link
Author

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
Copy link

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

@StumpfMichael
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Owner

wolftype commented Jan 30, 2022 via email

@StumpfMichael
Copy link
Author

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
Copy link
Author

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

@wolftype
Copy link
Owner

wolftype commented Feb 1, 2022

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.

@wolftype wolftype reopened this Feb 1, 2022
@StumpfMichael
Copy link
Author

StumpfMichael commented Feb 1, 2022

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

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

3 participants