32 and 64 bit programs?

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

32 and 64 bit programs?

Postby arromdee » Jul 6th, '15, 02:28

I installed the 64 bit version of Mageia 5. Is it possible to compile and run a program as 32 bits? (dosbox-x only has dynamic x86 core implemented for 32 bits, it does not work with 64 bits.) There's a /usr/lib and /usr/lib64 directory for libraries and -m32 is a compiler flag for 32 bit, but how do the includes work? There's only one include directory.
arromdee
 
Posts: 40
Joined: Jul 27th, '12, 16:26

Re: 32 and 64 bit programs?

Postby ozky » Jul 6th, '15, 08:33

Where you need dosbox-x we already have dosbox in repos it's working fine with 64bit ?.
Image
Mageia user
User avatar
ozky
 
Posts: 581
Joined: Jul 2nd, '11, 08:48
Location: Nakkila Finland

Re: 32 and 64 bit programs?

Postby doktor5000 » Jul 6th, '15, 09:39

Yes, it is possible to cross-compile a program.
And for the includes, /usr/include just contains source code which is for any architecture.

What is your actual problem, and what is the command you run and what error message do you get?
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18057
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: 32 and 64 bit programs?

Postby arromdee » Jul 6th, '15, 10:26

doktor5000 wrote:And for the includes, /usr/include just contains source code which is for any architecture.


What happens when the header file for the 32 bit version doesn't match the one for the 64 bit version? Are we guaranteed that everything uses ifdefs and has the same header file, rather than using configure to generate a different header file for a 32 and 64 bit build, or otherwise having different headers between 32 and 64 bits?

What is your actual problem, and what is the command you run and what error message do you get?


No problem yet. I seek knowledge before doing things that might mess up my system irreversibly.

Where you need dosbox-x we already have dosbox in repos it's working fine with 64bit ?.


1) dosbox was last modified in 2010 unless you get the svn version (which I assume is not in the repo) and has a bunch of things missing (for instance, no integrated glide patch)

2) dosbox is very strict about not including fixes that don't directly fix a game
arromdee
 
Posts: 40
Joined: Jul 27th, '12, 16:26

Re: 32 and 64 bit programs?

Postby arromdee » Jul 6th, '15, 19:57

I just tried installing 32 bit development files. Upon trying to install 32 bit libSDL after already having development files for 64 bit SDL installed), I get this error when installing one of the prerequisites:

1 installation transactions failed

There was a problem during the installation:

file /usr/include/ggi/system.h from install of libgii-devel-1.0.2-20.mga5.i586 conflicts with file from package lib64gii-devel-1.0.2-20.mga5.x86_64


It appears that the include files are not, after all, the same between 32 and 64 bit. Does this means it is impossible for me to compile a program as 32 bit if it needs such files?
arromdee
 
Posts: 40
Joined: Jul 27th, '12, 16:26

Re: 32 and 64 bit programs?

Postby doktor5000 » Jul 6th, '15, 20:15

arromdee wrote:Does this means it is impossible for me to compile a program as 32 bit if it needs such files?

No it just means you cannot have all 32bit and x86_64 -devel packages installed in parallel.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18057
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: 32 and 64 bit programs?

Postby arromdee » Jul 7th, '15, 00:29

doktor5000 wrote:
arromdee wrote:Does this means it is impossible for me to compile a program as 32 bit if it needs such files?

No it just means you cannot have all 32bit and x86_64 -devel packages installed in parallel.


How is not being able to have the package installed, not the same as being impossible to compile? (Unless I keep uninstalling and reinstalling packages whenever I want to compile something?)
arromdee
 
Posts: 40
Joined: Jul 27th, '12, 16:26

Re: 32 and 64 bit programs?

Postby doktor5000 » Jul 7th, '15, 08:34

arromdee wrote:
doktor5000 wrote:No it just means you cannot have all 32bit and x86_64 -devel packages installed in parallel.

How is not being able to have the package installed, not the same as being impossible to compile? (Unless I keep uninstalling and reinstalling packages whenever I want to compile something?)

You did not pay attention to what I wrote, especially for you I've added some emphasis.

You want to compile a 32bit program or compile something against 32bit -devel packages, then install those.
You already have the x86_64 -devel packages installed and get file conflicts during installation? Then you need to remove the conflicting x86_64 -devel packages first.

And previously you mentioned "dosbox-x only has dynamic x86 core implemented for 32 bits, it does not work with 64 bits."
So you could only compile it against 32bit -devel packages. So yes, if you then afterwards want to compile something against
the x86_64 packages which are required for dosbox-x you need to keep uninstalling and installing. But that is your choice.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18057
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: 32 and 64 bit programs?

Postby arromdee » Jul 7th, '15, 09:02

What did you mean when you previously said

And for the includes, /usr/include just contains source code which is for any architecture.


? If what you said was actually true, I shouldn't have to keep uninstalling and installing since the code in /usr/include would be for both architectures.
arromdee
 
Posts: 40
Joined: Jul 27th, '12, 16:26

Re: 32 and 64 bit programs?

Postby doktor5000 » Jul 7th, '15, 09:17

The devel packages do not only include header files, but also .so shared objects or also called libraries.
The libraries can be installed in parallel as they go either in /usr/lib or /usr/lib64 but the headers cannot as they go to /usr/include.
The headers might be split out into separate packages to avoid the conflicts but that is just too much work for us packagers and would result
in several thousands of addtitional subpackages to maintain and file lists to keep updated.

But feel free to disbelieve me.
I have answered your questions and told you how to solve the file conflict you posted, it's EOT for me at this point.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18057
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: 32 and 64 bit programs?

Postby arromdee » Jul 7th, '15, 21:08

You seem to have answered my questions in a contradictory way.

You can't say that headers are architecture-independent in one post, and then later on, say that headers can have conflicts between architectures.
arromdee
 
Posts: 40
Joined: Jul 27th, '12, 16:26

Re: 32 and 64 bit programs?

Postby marja » Jul 8th, '15, 09:40

arromdee wrote:You seem to have answered my questions in a contradictory way.

I agree on "seem" ;)
You can't say that headers are architecture-independent in one post, and then later on, say that headers can have conflicts between architectures.


His answer to your question :
arromdee wrote:There's a /usr/lib and /usr/lib64 directory for libraries and -m32 is a compiler flag for 32 bit, but how do the includes work? There's only one include directory.


was:
doktor5000 wrote:And for the includes, /usr/include just contains source code which is for any architecture.


It was an answer about which directory to use.

He did not say "/usr/include just contains source code which is always exactly the same for any architecture."

Maybe it isn't?
User avatar
marja
 
Posts: 549
Joined: Aug 22nd, '11, 20:50


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest