wolftype / versor

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

examples don't work #17

Closed porky11 closed 2 years ago

porky11 commented 7 years ago

I did everything as written in the readme. example: ./run.sh scratch/projects/games/rollball.cpp The first error I get is this:

/home/porky11/build/versor/scratch/projects/games/rollball.cpp: In Elementfunktion »virtual bool MyApp::onKeyDown(glv::GLV&)«:
/home/porky11/build/versor/scratch/projects/games/rollball.cpp:99:9: Fehler: »interface« wurde in diesem Gültigkeitsbereich nicht definiert
     if (interface.keyboard.code == 'i'){
         ^
wolftype commented 7 years ago

Hi -- the scratch folder is not entirely up to date yet with the newer API and not all .cpp files compile -- see this issue. That said, I've pushed a change which allows rollball.cpp to compile. If you find more that don't work, please feel free to add them here as a comment. Thanks!

porky11 commented 7 years ago

It seems to compile now, but in line 22 of run.sh the file ./bin/xInterface is not found

wolftype commented 7 years ago

I removed xInterface since it was an empty file. If you continue to receive errors about this file, try re-running ./build.sh (this will re-run the cmake file). Alternatively, you can run ./run.sh path-to-file --configure. The --confgure flag will also re-run the cmake file.

porky11 commented 7 years ago

I tried it, but now I get errors like this when executing after the target is built 100% ./run.sh: Zeile 22: 30492 Speicherzugriffsfehler ./bin/$TARGET

wolftype commented 7 years ago

hi -- thanks -- I clearly need to clean this up, but for the moment please note that not all files in the scratch/project/ directories are working.

On Sat, Apr 15, 2017 at 6:22 AM Fabio Krapohl notifications@github.com wrote:

I tried it, but now I get errors like this when executing after the target is built 100% ./run.sh: Zeile 22: 30492 Speicherzugriffsfehler ./bin/$TARGET

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/wolftype/versor/issues/17#issuecomment-294293072, or mute the thread https://github.com/notifications/unsubscribe-auth/ABEYXxciWTV15FSMRsaeq2t7Jydd3YJ0ks5rwMSOgaJpZM4LqLp8 .

wolftype commented 7 years ago

i just realized perhaps you are just running ./run.sh without a path to a file? try for example: ./run.sh examples/xBasic.cpp

porky11 commented 7 years ago

your example doesn't work for me either

wolftype commented 7 years ago

thanks -- could you please be more specific? if you type the following:

./buildAll.sh
./run.sh examples/xBasic.cpp

what exactly is the error being output?

porky11 commented 7 years ago

the first command does not generate warnings or errors the second outputs following:

Compiling and Running examples/xBasic.cpp
Directory is examples
Target is xBasic
[  0%] Built target gfx
[ 66%] Built target vsr
[100%] Built target vsrGfx
[100%] Linking CXX executable bin/xBasic
[100%] Built target xBasic
./run.sh: Zeile 22:  4837 Speicherzugriffsfehler  ./bin/$TARGET

(Speicherzugriffsfehler means memory access error)

wolftype commented 7 years ago

Strange to me that the error is coming from the run script itself, not the built executable. What happens if you run the built executable directly by typing:

./build/bin/xBasic On Sat, Apr 22, 2017 at 7:36 AM Fabio Krapohl notifications@github.com wrote:

the first command does not generate warnings or errors the second outputs following:

Compiling and Running examples/xBasic.cpp Directory is examples Target is xBasic [ 0%] Built target gfx [ 66%] Built target vsr [100%] Built target vsrGfx [100%] Linking CXX executable bin/xBasic [100%] Built target xBasic ./run.sh: Zeile 22: 4837 Speicherzugriffsfehler ./bin/$TARGET

(Speicherzugriffsfehler means memory access error)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/wolftype/versor/issues/17#issuecomment-296367336, or mute the thread https://github.com/notifications/unsubscribe-auth/ABEYX6s02M6anrx1H46O-uNLvFXj9Kh5ks5ryeYogaJpZM4LqLp8 .

porky11 commented 7 years ago

just the error

wolftype commented 7 years ago

I cannot duplicate this. What machine are you running on? Do all the examples behave this way?

porky11 commented 7 years ago

Gentoo linux, and yes, all examples, I tested

wolftype commented 7 years ago

Thanks for this information -- I am separating out the build steps to better debug what is happening. Would you mind trying the following branch and reporting back?

cd path/to/versor/repo
rm -rf build
git checkout gfx-update
git submodule update
./build.sh
./run.sh examples/xAlgebra.cpp

If the above works (it should spit out some numbers to your terminal), then also please try

./run.sh examples/xBasic.cpp

As always, please copy any output in your response. Thanks again!

wolftype commented 7 years ago

Oh, and please "git pull" before checking out the gfx-update branch

porky11 commented 7 years ago

I tried it again. xAlgebra.cpp works now. (I also switched to Arch Linux (i. e. Antergos)) But xBasic.cpp still gives this error:

Compiling and Running examples/xBasic.cpp
Directory is examples
Target is xBasic
[  0%] Built target gfx
[ 25%] Built target vsrGfx
[ 75%] Built target vsr
[100%] Linking CXX executable bin/xBasic
[100%] Built target xBasic
app is creating window context
app is adding itself to context events
genVertexArrayAPPLE supported
Shader Program Initialize
Program ID: 1
compiling vertex shader
compiling fragment shader
attaching shader to program
attaching shader to program
Link: 1  Validate: 1
ShaderProgram::get()
num uniforms: 4
num attributes: 3
./run.sh: Zeile 22: 20525 Speicherzugriffsfehler  (Speicherabzug geschrieben) ./bin/$TARGET
wolftype commented 7 years ago

thanks -- seems to have gotten farther before crashing. if you could, please output a backtrace log and post it here so I can see what function call is having the "Speicherzugriffsfehler" memory access error.

wolftype commented 7 years ago

another test to try is to comment out line #19 (bindGLV()) of xBasic.cpp

porky11 commented 7 years ago

I don't know how to output a backtrace log. Seems to have something to do with gdb, but I don't use this, I normally print to debug. Removing bindGLV didn't change anything. btw. I remembered "Speicherzugriffsfehler (Speicherabzug geschrieben)" is called "Segfault (Core Dumped)" on english systems.

wolftype commented 7 years ago

If you have gdb you could spit out a backtrace with the bt command

gdb ./build/bin/xBasic
run

program segfaults here, then type:

bt
JoelSjogren commented 6 years ago

Hello! I seem to have the same problem. I am running arch linux on a modern computer. I followed the instructions on your website to compile versor (git .... ./build.sh ./run.sh ....). Then on the main branch,

% gdb ./build/bin/rollball GNU gdb (GDB) 8.0.1 Copyright (C) 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-pc-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/. Find the GDB manual and other documentation resources online at: http://www.gnu.org/software/gdb/documentation/. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from ./build/bin/rollball...(no debugging symbols found)...done. (gdb) run Starting program: /home/joel/tmp-cool/versor/build/bin/rollball [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/libthread_db.so.1". app is creating window context app is adding itself to context events genVertexArrayAPPLE supported Shader Program Initialize Program ID: 1 compiling vertex shader compiling fragment shader attaching shader to program attaching shader to program Link: 1 Validate: 1 ShaderProgram::get() num uniforms: 4 num attributes: 3

Program received signal SIGSEGV, Segmentation fault. 0x00007ffff2d1fb60 in ?? () from /lib/libnvidia-glcore.so.384.69 (gdb) bt

0 0x00007ffff2d1fb60 in ?? () from /lib/libnvidia-glcore.so.384.69

1 0x00007ffff2de5bd3 in ?? () from /lib/libnvidia-glcore.so.384.69

2 0x00007ffff2dea3c4 in ?? () from /lib/libnvidia-glcore.so.384.69

3 0x00007ffff29b2bce in ?? () from /lib/libnvidia-glcore.so.384.69

4 0x00007ffff7b3a413 in fghDrawGeometrySolid () from /lib/libglut.so.3

5 0x00007ffff7b3ba8c in ?? () from /lib/libglut.so.3

6 0x000055555558f5fb in MyApp::onDraw() ()

7 0x000055555559006d in gfx::GFXSceneNode::onRender() ()

8 0x000055555558bb2d in gfx::GFXShaderNode::onRender() ()

9 0x000055555558aae5 in gfx::GFXStereoNode::onRender() ()

10 0x000055555558a4bd in gfx::GFXRenderNode::onRender() ()

11 0x000055555558d0ee in gfx::GFXApp::onFrame() ()

12 0x000055555558a25d in gfx::GlutInterface::Draw() ()

13 0x00007ffff7b41741 in fghRedrawWindow () from /lib/libglut.so.3

14 0x00007ffff7b41ba8 in ?? () from /lib/libglut.so.3

15 0x00007ffff7b43179 in fgEnumWindows () from /lib/libglut.so.3

16 0x00007ffff7b41c84 in glutMainLoopEvent () from /lib/libglut.so.3

17 0x00007ffff7b41d24 in glutMainLoop () from /lib/libglut.so.3

18 0x0000555555585a65 in main ()

wolftype commented 6 years ago

Thanks -- could you try running xBasic.cpp -- and also try with line 22 uncommented mRenderGraph.immediate(false)

JoelSjogren commented 6 years ago

gdb build/bin/xBasic
GNU gdb (GDB) 8.0.1 Copyright (C) 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-pc-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/. Find the GDB manual and other documentation resources online at: http://www.gnu.org/software/gdb/documentation/. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from build/bin/xBasic...(no debugging symbols found)...done. (gdb) run Starting program: /home/joel/tmp-cool/versor/build/bin/xBasic [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/libthread_db.so.1". app is creating window context app is adding itself to context events genVertexArrayAPPLE supported Shader Program Initialize Program ID: 1 compiling vertex shader compiling fragment shader attaching shader to program attaching shader to program Link: 1 Validate: 1 ShaderProgram::get() num uniforms: 4 num attributes: 3

Program received signal SIGSEGV, Segmentation fault. 0x00007ffff2d1fb60 in ?? () from /lib/libnvidia-glcore.so.384.69 (gdb) bt

0 0x00007ffff2d1fb60 in ?? () from /lib/libnvidia-glcore.so.384.69

1 0x00007ffff2de5bd3 in ?? () from /lib/libnvidia-glcore.so.384.69

2 0x00007ffff2dea3c4 in ?? () from /lib/libnvidia-glcore.so.384.69

3 0x00007ffff29b2bce in ?? () from /lib/libnvidia-glcore.so.384.69

4 0x00007ffff7b3a413 in fghDrawGeometrySolid () from /lib/libglut.so.3

5 0x00007ffff7b3ba8c in ?? () from /lib/libglut.so.3

6 0x000055555558e746 in MyApp::onDraw() ()

7 0x0000555555593b9d in gfx::GFXSceneNode::onRender() ()

8 0x000055555558fb7d in gfx::GFXShaderNode::onRender() ()

9 0x000055555558ebe5 in gfx::GFXStereoNode::onRender() ()

10 0x000055555558e23d in gfx::GFXRenderNode::onRender() ()

11 0x00005555555918ae in gfx::GFXApp::onFrame() ()

12 0x000055555558df3d in gfx::GlutInterface::Draw() ()

13 0x00007ffff7b41741 in fghRedrawWindow () from /lib/libglut.so.3

14 0x00007ffff7b41ba8 in ?? () from /lib/libglut.so.3

15 0x00007ffff7b43179 in fgEnumWindows () from /lib/libglut.so.3

16 0x00007ffff7b41c84 in glutMainLoopEvent () from /lib/libglut.so.3

17 0x00007ffff7b41d24 in glutMainLoop () from /lib/libglut.so.3

18 0x00005555555899b4 in main ()

(gdb)

JoelSjogren commented 6 years ago

After uncommenting I see xbasic-window

JoelSjogren commented 6 years ago

The output after uncommenting is

% ./run.sh examples/xBasic.cpp Compiling and Running examples/xBasic.cpp Directory is examples Target is xBasic [ 0%] Built target gfx [ 25%] Built target vsrGfx [ 75%] Built target vsr Scanning dependencies of target xBasic [ 75%] Building CXX object CMakeFiles/xBasic.dir/examples/xBasic.cpp.o [100%] Linking CXX executable bin/xBasic [100%] Built target xBasic app is creating window context app is adding itself to context events genVertexArrayAPPLE supported Shader Program Initialize Program ID: 1 compiling vertex shader compiling fragment shader attaching shader to program attaching shader to program Link: 1 Validate: 1 ShaderProgram::get() num uniforms: 4 num attributes: 3 GENERATING VBO id 1 GENERATING VBO id 2 initializing mesh buffer GENERATING VBO id 3 GENERATING VBO id 4 initializing mesh buffer GENERATING VBO id 5 GENERATING VBO id 6 NUM POINTS: 2 GENERATING VBO id 7 GENERATING VBO id 8 initializing mesh buffer GENERATING VBO id 9 GENERATING VBO id 10 GENERATING VBO id 11 GENERATING VBO id 12 initializing mesh buffer

porky11 commented 6 years ago

I had the same backtrace and after uncommenting the line it seems to work, looks as in the image

wolftype commented 6 years ago

Thanks for testing -- seems like a bug in immediate mode I need to sort out. On Tue, Sep 26, 2017 at 7:35 PM Fabio Krapohl notifications@github.com wrote:

I had the same backtrace and after uncommenting the line it seems to work, looks as in the image

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/wolftype/versor/issues/17#issuecomment-332365848, or mute the thread https://github.com/notifications/unsubscribe-auth/ABEYX2v3ApUk4qxE3DxGCS3Bnet9Fpv4ks5smYpKgaJpZM4LqLp8 .