VOGONS


First post, by Silpion

User metadata
Rank Newbie
Rank
Newbie

Hi,

I'm fairly new to compiling on linux but after some hours I managed to compile the CVS version of dosbox on my linux PC (Athlon64 3200, Suse Linux 10.1 (x86_64). Unfortunately it runs really slow (compared with my should-be-slower-notebook on WinXP with a precompiled build).

I already tried some compiler flags mentioned in this topic:
DOSBOX .65 CVS build and optimization benchmark results
which boosted the executable to 10 MB but did not result in a big performance boost.

The next thing I realised was that in my builds the dynamic cpu was not supported (and C_DYNAMIC_X86 in config.h was not set). Since then I'm trying to compile dosbox with dynamic CPU simulation. If I manually define C_DYNAMIC_X86 to 1 I get lots of error messages saying:
"error: cast from ('void*' or 'Bit8u*' or 'Bit32u*') to 'Bit32u' loses precision"

Is there any way to compile the dynamic cpu on linux?

Reply 1 of 14, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

the dynamic core compiles on linux just fine.
it's the 64 bit that doesn't work.

Water flows down the stream
How to ask questions the smart way!

Reply 2 of 14, by Silpion

User metadata
Rank Newbie
Rank
Newbie

I tried to compile it with
./configure build/host/target=i686-suse-linux and i686-pc-linux-gnu

C_DYNAMIC_X86 gets automaticly defined with these but it still claims to lose precision. 🙁

Is there a way to compile dosbox as X86 on a 64 bit system?

Reply 4 of 14, by Silpion

User metadata
Rank Newbie
Rank
Newbie

Still does not work. 🙁

./configure reports a few things that worry me:

checking for i686-suse-linux-gcc... no
checking for gcc... gcc
...
checking size of int *... 8

It seems to always use the 64bit gcc, regardless what I set in CFLAGS, CXXFLAGS or as --host/target. Can this compiler create 32bit output? I have installed the gcc-32bit package but i can not find it in '/usr/bin/'. There are only two gcc-executables: 'gcc-4.1' and 'gcc-4.2' and one link ('gcc' -> 'gcc-4.1'). Each one returns "Target: x86_64-suse-linux" when executed with '-v'.

Reply 5 of 14, by MiniMax

User metadata
Rank Moderator
Rank
Moderator

Umm - I am no developer, but I think i remember something about gcc-4.x not working for compilation of DOSBox?? I could be totally wrong. Maybe you can search the forum for examples of what the devs are using?

Edit: Nah - forget about that. It was some profiling/optimization that didn't work with gcc-4x.
DOSBOX .65 CVS build and optimization benchmark results

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 6 of 14, by `Moe`

User metadata
Rank Oldbie
Rank
Oldbie

gcc-4.x works great with everything, I don't use anything else. There is exactly one program that needs gcc-3 for a good reason (it's qemu, which messes with gcc internals), all others should _always_ use the latest (stable) gcc.

I am on AMD64 as well, and you need to do a 32-bit build to use the dynamic core at the moment. This includes setting --target=i686-something AND both CFLAGS and CXXFLAGS to include -m32, AND installing all relevant libs in a 32-bit variant (mainly libc, SDL and X11, more for optional features) AND possibly adding -I / -L options to C(XX)FLAGS for 32-bit include/library paths.

I don't know enough SuSE to help you with that, but usually there are "emul" or "32bit-devel"-packages available for major software libs. It's not for the faint-hearted, but it's worth it 😉

Reply 7 of 14, by Silpion

User metadata
Rank Newbie
Rank
Newbie

Okay, I checked whether -devel-32bit libs are installed. Include files in /usr/include seem to be for both /usr/lib and /usr/lib64. I set

LDFLAGS="-L/usr/lib"
CFLAGS="-march=i686 -mtune=i686 -mt32 -O3 -L/usr/lib"
CXXFLAGS=$CFLAGS
make distclean
./configure --target=i686-pc-linux-gnu
make

but still got the "loses precision" error.

After that I tried to compile SDL_sound to use your precompiled build. I had to give up at:

grep: /usr/lib64/libstdc++.la: No such file or directory

The positive side is that I did not reset the environment variables and have now a good method to see which lib directory gcc uses 🙄
Sadly -L/usr/lib seems to get ignored.

Reply 9 of 14, by `Moe`

User metadata
Rank Oldbie
Rank
Oldbie

Moreover, check that your C(XX)FLAGS are actually used. You may have to "export CFLAGS CXXFLAGS ..." in your shell before running configure.

Reply 10 of 14, by Silpion

User metadata
Rank Newbie
Rank
Newbie

Oh well, I screwed up. 😵
Dosbox was not the only program I tried to compile and some media libraries ran amok with the stored dependancies.

I reinstalled Suse in the current version 10.2, it reintegrated my /home partition perfectly (I really begin to love linux).

I'm currently away from home but will be back in the middle of next week and immediatly try the additional export command, thanks for all help. 😀

Reply 11 of 14, by Silpion

User metadata
Rank Newbie
Rank
Newbie

Using the export command worked. 😀

Unfortunately, it seems that you can only install one version of some libraries on OpenSuse, 32 bit or 64 bit. They're listed in the software configuration as alternatives but I couldn't figure out how to install both at the same time. 🙁

A compile made in a 32bit virtual machine complained about the same thing, it could not find the shared object of the 32bit version of the libraries.

I'll continue trying next week...

Reply 12 of 14, by glid_tester

User metadata
Rank Newbie
Rank
Newbie

On my Debian64 I couldn't find a way around the errors for dosbox 0.72 (e.g. compile it for 32-bit emulation), but I was able to apply Gulikoza's patch, did some modifications to make it compile and it works with openglide now.

@Gulikoza: I have no web page to put the new patch on (tested for x32 and x64 Debian Linux), but if you want to have it, just give me an email adress to send it to.

Reply 13 of 14, by gulikoza

User metadata
Rank Oldbie
Rank
Oldbie

What patch are you talking about? You can attach it here on the forum.
And use the 0.73 sources, they should compile w/o problems on x86_64.

http://www.si-gamer.net/gulikoza

Reply 14 of 14, by glid_tester

User metadata
Rank Newbie
Rank
Newbie

The sources compile fine, I was talking about the openglide patch for Dosbox. But as I see now, you already updated it, so you probably don't need my patch.