Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Coffee corner » Compile to 32 bit on Linux 64 bit
Compile to 32 bit on Linux 64 bit [message #49169] Sat, 30 December 2017 17:12 Go to next message
forlano is currently offline  forlano
Messages: 1114
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

has anybody tried to compile a U++ program for 32 bit from a 64 bit machine?
What package should I install?
I am tired two use two different computers.

Thanks,
Luigi
Re: Compile to 32 bit on Linux 64 bit [message #49174 is a reply to message #49169] Sun, 31 December 2017 16:33 Go to previous messageGo to next message
coolman is currently offline  coolman
Messages: 86
Registered: April 2006
Location: Czech Republic
Member
Hi,

Hard to say - I don't know your OS for the build and target binaries.

If your OS is Linux (Ubuntu), take a look at UPP cmake and scripts for the installation and building.

BR, Radek
Re: Compile to 32 bit on Linux 64 bit [message #49185 is a reply to message #49169] Wed, 03 January 2018 22:03 Go to previous messageGo to next message
Zbych is currently offline  Zbych
Messages: 315
Registered: July 2009
Senior Member
forlano wrote on Sat, 30 December 2017 17:12

has anybody tried to compile a U++ program for 32 bit from a 64 bit machine?
What package should I install?


I did - just simple console app (no GUI) and all I had to install was some multilib package.
I found in my notes for ubuntu 14.04:
sudo apt-get install gcc-multilib
sudo apt-get install gcc-4.9-multilib g++-4.9-multilib
sudo apt-get install gcc-5-multilib g++-5-multilib

And don't forget to add -m32 to compiler options.

[Updated on: Wed, 03 January 2018 22:36]

Report message to a moderator

Re: Compile to 32 bit on Linux 64 bit [message #49204 is a reply to message #49185] Sun, 07 January 2018 14:20 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1114
Registered: March 2006
Location: Italy
Senior Contributor
Zbych wrote on Wed, 03 January 2018 22:03
forlano wrote on Sat, 30 December 2017 17:12

has anybody tried to compile a U++ program for 32 bit from a 64 bit machine?
What package should I install?


I did - just simple console app (no GUI) and all I had to install was some multilib package.
I found in my notes for ubuntu 14.04:
sudo apt-get install gcc-multilib
sudo apt-get install gcc-4.9-multilib g++-4.9-multilib
sudo apt-get install gcc-5-multilib g++-5-multilib

And don't forget to add -m32 to compiler options.


Hello Zbych,

thanks for the answer. Can you post the .bm file you have used to compile the U++ package?
I have installed multilib and used -m32 option but still getting complain from the compiler.
Perhaps even the .h and lib used should be addressed properly.

thanks,
Luigi

[Updated on: Sun, 07 January 2018 14:21]

Report message to a moderator

Re: Compile to 32 bit on Linux 64 bit [message #49223 is a reply to message #49204] Mon, 08 January 2018 21:23 Go to previous messageGo to next message
Zbych is currently offline  Zbych
Messages: 315
Registered: July 2009
Senior Member
forlano wrote on Sun, 07 January 2018 14:20
Can you post the .bm file you have used to compile the U++ package?
I have installed multilib and used -m32 option but still getting complain from the compiler.
Perhaps even the .h and lib used should be addressed properly.


I just made a copy of GCC.bm and added -m32 to both compile and link options. My GCC32.bm:
BUILDER = "GCC";
COMPILER = "g++";
COMMON_OPTIONS = "-m32";
COMMON_CPP_OPTIONS = "-std=c++14";
COMMON_C_OPTIONS = "";
COMMON_LINK = "-m32";
COMMON_FLAGS = "";
DEBUG_INFO = "2";
DEBUG_BLITZ = "1";
DEBUG_LINKMODE = "1";
DEBUG_OPTIONS = "-O0";
DEBUG_FLAGS = "";
DEBUG_LINK = "";
RELEASE_BLITZ = "0";
RELEASE_LINKMODE = "1";
RELEASE_OPTIONS = "-O3 -ffunction-sections -fdata-sections";
RELEASE_FLAGS = "";
RELEASE_LINK = "-Wl,--gc-sections";
DEBUGGER = "gdb";
ALLOW_PRECOMPILED_HEADERS = "0";
DISABLE_BLITZ = "0";
PATH = "";
INCLUDE = "/usr/include/freetype2;/usr/include/gtk-2.0;/usr/include/glib-2.0;/usr/lib/glib-2.0/include;/usr/lib/gtk-2.0/include;/usr/include/cairo;/usr/include/pango-1.0;/usr/include/atk-1.0;/usr/include/gdk-pixbuf-2.0;/usr/lib/i386-linux-gnu/glib-2.0/include;/usr/lib/x86_64-linux-gnu/glib-2.0/include;/usr/lib/i386-linux-gnu/gtk-2.0/include;/usr/lib/x86_64-linux-gnu/gtk-2.0/include;/usr/include/gtk-3.0/gdk";
LIB = "/usr/X11R6/lib";
LINKMODE_LOCK = "0";


And I made the test on ubuntu 16.04 this time. All I had to install was:
sudo apt-get install gcc-multilib g++-multilib
sudo apt-get install lib32z1-dev

[Updated on: Mon, 08 January 2018 21:26]

Report message to a moderator

Re: Compile to 32 bit on Linux 64 bit [message #49247 is a reply to message #49223] Wed, 10 January 2018 15:18 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1114
Registered: March 2006
Location: Italy
Senior Contributor
Zbych wrote on Mon, 08 January 2018 21:23


And I made the test on ubuntu 16.04 this time. All I had to install was:
sudo apt-get install gcc-multilib g++-multilib
sudo apt-get install lib32z1-dev


I confirm that this works even on lubuntu 17.10 for CONSOLE appliccation.

However for GUI program it is not enough. Other libraries in :i386 version need to be installed.
At moment I was not able to install everything. The Xft lib in 32 bit mode cannot stay with the one in 64 bit (apt-get want to remove one to accomodate the other). So I preferred to not spoil the 64 bit system. Maybe exist some way to install what is necessery.

Luigi

edit: today I have installed libxft-dev:i386 . The installation removed the libxft-dev at 64 bit. However I was able to compile a 32 bit application.
Then I tried to compile the 64 bit application. Obviously the compiler complained the missing libxft-dev. I tried to install it but it removed the 32 bit version! A nightmare.
It seems libxft-dev cannot coexist in the same machine in 32 and 64 bit mode. This prevent to compile easily a program in 32 and 64 bit... at least on lubuntu

[Updated on: Thu, 11 January 2018 20:10]

Report message to a moderator

Re: Compile to 32 bit on Linux 64 bit [message #49264 is a reply to message #49247] Sat, 13 January 2018 18:16 Go to previous message
forlano is currently offline  forlano
Messages: 1114
Registered: March 2006
Location: Italy
Senior Contributor
forlano wrote on Wed, 10 January 2018 15:18


edit: today I have installed libxft-dev:i386 . The installation removed the libxft-dev at 64 bit. However I was able to compile a 32 bit application.
Then I tried to compile the 64 bit application. Obviously the compiler complained the missing libxft-dev. I tried to install it but it removed the 32 bit version! A nightmare.
It seems libxft-dev cannot coexist in the same machine in 32 and 64 bit mode. This prevent to compile easily a program in 32 and 64 bit... at least on lubuntu


Today I succeeded to compile a 32 bit GUI app on a 64 bit platform (Lubuntu 16.10).
I had to install several libraries (I I remember correctly):

libfreetype6:i386
libx11-dev:i386
libxrender-dev:i386

with:
sudo apt-get install LIBNAME

and then the tricky

libxft-dev:i386

that produced conflict with the 64 bit version. I tried to download it via

sudo apt-get download libxft-dev:i386

and then with a double click it opened the deb packager program that installed it without checking anything else.
At this point the compilation was OK. I tested the program on a real 32 bit computer and it worked.

Luigi
Previous Topic: Windows Meltdown patch and compilation speed
Next Topic: Interesting future feature, Radeon ProRenderer?
Goto Forum:
  


Current Time: Tue Jan 26 23:29:20 CET 2021

Total time taken to generate the page: 0.00879 seconds