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

gvbam will compile but not run in out of tree builds #2

Closed
andoruB opened this issue Jan 7, 2015 · 14 comments
Closed

gvbam will compile but not run in out of tree builds #2

andoruB opened this issue Jan 7, 2015 · 14 comments
Assignees
Labels

Comments

@andoruB
Copy link

andoruB commented Jan 7, 2015

Tried compiling myself but only got the CLI executable. Went under ./src/gtk and tried to cmake from there but got this:

CMake Error at CMakeLists.txt:59 (INSTALL):
install DIRECTORY given no DESTINATION!

CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present.

Is there some way to compile the GUI executable?

EDIT: Found GTK and wxWidgets binaries, the GTK one gives this in the terminal:

terminate called after throwing an instance of 'Glib::FileError'

wxWidgets runs, but get notified that it cannot find the configuration file (don't know where to place it actually) and when I try to open any option from the menus I get this:

../src/gtk/scrolwin.cpp(205): assert "scrolled" failed in DoShowScrollbars(): window must be created
/usr/include/wx-3.0/wx/object.h(160): assert "wxDynamicCast(ptr, T)" failed in wxCheckCast():
wxStaticCast() used incorrectly
Segmentation fault

@EmperorArthur
Copy link
Owner

You need to build from the top level. That CMakeLists.txt has options for which binary you want to build. If you don't then the shared libraries never get built, and you're probably going to have some issues.

The whole purpose of the CMakeLists.txt files in the src directory is to make the binaries modular. In an ideal world we could rip out any three of the gui binaries by only deleting the directory and removing two or three lines from the top level CMakeLists.txt.

@EmperorArthur
Copy link
Owner

Also, what platform are you working on? I haven't done any testing on anything but my Linux machine, and there are some platform specific parts in the cmake files.

@andoruB
Copy link
Author

andoruB commented Jan 7, 2015

Thanks for the answer :)

In CMakeLists.txt I have:

option( ENABLE_GTK "Build the GTK+ GUI" ON )
option( ENABLE_WX "Build the wxWidgets port" ON )

Is that what you were referring to?

And I'm using CrunchBang Linux 11 "Waldorf" with unstable Debian repos.

@EmperorArthur
Copy link
Owner

Yes, that's what I'm referring to. I'll try to create a readme file with build instructions sometime soon. For now look here: http://vba-m.com/forum/Thread-how-to-build-vba-m-from-the-svn-code-in-linux

One other thing is if you're doing out of tree builds: mkdir build;cmake ..;make then gvbam will not work. I honestly just noticed the issue, and will figure out what's causing the problem asap.

For now you can manually run cmake .;make when you want to clean up all your files you can run git clean -fdX

@EmperorArthur EmperorArthur self-assigned this Jan 7, 2015
@EmperorArthur EmperorArthur changed the title No GUI? gvbam will compile but not run in out of tree builds Jan 7, 2015
@EmperorArthur
Copy link
Owner

I've added more error checking. Now I know that it's looking for '/usr/local/share/vbam/ui/vbam.ui' in out of tree builds. Now I just have to figure out what it's doing for regular builds and fix the issue.

@EmperorArthur
Copy link
Owner

Problem is in sGetUiFilePath from src/gtk/window.cpp:1540
I'm going to see if cmake exports the source directory to a compiler definition. If it does, then I'll just use that.

@EmperorArthur
Copy link
Owner

Out of tree builds should now work. Please test and let me know if it works.

@andoruB
Copy link
Author

andoruB commented Jan 7, 2015

I wish I could check, but git doesn't want to play nice:

$ git clone https://github.com/EmperorArthur/VBA-M.git
Cloning into 'VBA-M'...
remote: Counting objects: 10568, done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 10568 (delta 0), reused 0 (delta 0), pack-reused 10560
Receiving objects: 100% (10568/10568), 9.85 MiB | 1.64 MiB/s, done.
Resolving deltas: 100% (8054/8054), done.
fatal: did not receive expected object 465b3fc65f9bf502e719a5a5c558c797c3a4bc7b
fatal: index-pack failed

Any idea what's causing this?

@EmperorArthur
Copy link
Owner

You managed to catch things at just the wrong time. I occasionally use git gui's amend last commit feature, and force push to the repository. You were probably cloning the thing just as I was making changes.

Just delete the whole directory and try again. I think I'm pretty much done for the night so there shouldn't be any more issues.

@andoruB
Copy link
Author

andoruB commented Jan 8, 2015

Thanks for the answers, this fix, and all your endeavours :D
Retried and now it works :)
I the compilation went flawlessly, the GTK flavour of VBA-M works but the wx one doesn't, still get the same errors.

Also when doing a make install I get this:

CMake Error at cmake_install.cmake:48 (file):
file INSTALL cannot copy file
"/home/andoru/sources/VBA-M/src/sdl/vbam.cfg-example" to "/etc/vbam.cfg".

Makefile:66: recipe for target 'install' failed
make: *** [install] Error 1

So I'm guessing somewhere you hardcoded the paths to install stuff, as I set a custom prefix at the cmake step, set it to install in my home folder.

Also seems that the graphics settings seem a lot less thorough than the VBA-M I remember (under Windows), for example I have no ability to choose a custom scaler for fullscreen (so I would chose 3x and instead have black borders fill the rest of the screen). But I guess this might be due to the limits imposed by the OS.
Also the sound settings seem to be lacking as well.

And another issue is that the animations are a bit jerky and there are quite a few frames that are dropped, this is fixed only if I go in fullscreen or turn off compositing, but I guess this is due to the crap integrated video that I use ATM...

Anyway, thanks again for everything :)

EDIT: Forgot to mention that when running the GTK flavour, when the emulator is inactive (no ROM loaded) it takes about 5-10% CPU, any reasons for that?

@EmperorArthur
Copy link
Owner

Glad to help.

use sudo make install to get around your OS installation issue. (Hope that's the problem)

Honestly gvbam is the worst version. See Bug #4 for more details.

If you'll go ahead and open a new bug report for the wxvbam issue I'll try to find the problem, or at least come up with a nice script to build and install everything for you.

@andoruB
Copy link
Author

andoruB commented Jan 8, 2015

use sudo make install to get around your OS installation issue. (Hope that's the problem)

Not really, running that with root will only copy those files in their respective folders under / instead of /home/andoru/

Should I make a separate issue for the strange CPU usage too? :)

@EmperorArthur
Copy link
Owner

Yep. That's the expected behavior of make install. vbam.cfg is the default configuration file for vbam, individual users are supposed to overide it using the -c option. gvbam is also pretty bad in that it doesn't have use the proper icon unless it's installed in the system icon themes directory, and really wants a folder with all its ui elements in its system data directory as well.

wxvbam doesn't need a default and automatically generates a config file in ~/.wxvbam/wxvbam.conf
gvbam creates ~/.config/gvbam/config

Don't ask me why it's all set up that way. I just picked all this up a couple of months ago after the original maintainer abandoned it.

@EmperorArthur
Copy link
Owner

Also if you disable the SDL version it won't install that file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants