How to compile Harbour for a Linux ARM machine ?

535 views
Skip to first unread message

Pritpal Bedi

unread,
Jun 16, 2020, 12:37:33 AM6/16/20
to Harbour Users
Hi All

Can someone point me to this direction ?


Best,
Pritpal Bedi
a student of software analysis & concepts


António

unread,
Jun 16, 2020, 9:53:12 AM6/16/20
to Harbour Users
Hello student (which I know is in fact a master, I wish I had your knowledge ;)

What i did on my humble Pi running Raspbian

  download harbour as a zip, unpack.
  apt-get install libcups-dev  and other needed development tools
  make

Nothing else needed, runs so well as on a x86_64 machine (just a little slower...)
Cheers,
António Vila-Chã
Viana do Castelo, Portugal
Message has been deleted

Rolaci

unread,
Jun 16, 2020, 1:42:52 PM6/16/20
to Harbour Users
Hi Pritpal!, try this batch file.works fine!.
Saludos.
build_harbour.sh

Alain Aupeix

unread,
Jun 16, 2020, 2:45:34 PM6/16/20
to harbou...@googlegroups.com, Rolaci
Le 16/06/2020 à 19:42, Rolaci a écrit :
Hi Pritpal!, try this batch file.works fine!.
Saludos.

Just 2 little remarks:

1) if apt works, no need to use apt-get

2) Not a good idea to make under sudo. Sudo is just needed for make install

A+
--

Alain Aupeix
Sites web : JujuLand | Pissobi-Lacassagne | Gadel
X.ubuntu 16.04 [ H.arbour 3.2.0dev (r2020-04-20 13:01) | Hw.gui 2.22-4 (r2848) | G.ramps 5.1.2


Francesco Perillo

unread,
Jun 16, 2020, 3:22:55 PM6/16/20
to harbou...@googlegroups.com
What I saw are basic instructions for compiling harbour and i'm sure Pritpal knows them...

I think he can be looking for cross-compiling instructions...

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/3b6a3b30-a4ef-558b-7a81-fd59224ec5d9%40wanadoo.fr.

Pritpal Bedi

unread,
Jun 17, 2020, 1:09:35 AM6/17/20
to Harbour Users
Hi 
 
I think he can be looking for cross-compiling instructions...


Not exactly but similar in nature.

Amazon has just introduced ARM processor empowered Linux instances in addition to x86_64. I launched one with Ubuntu 18.04, apt-get some packages, copy my Ubuntu specific application but it did not run. The application was compiled on x86_64 instance. So I suspected that Harbour build on both processors must be different. That is why I put the question to avoid any surprises I might encounter if I try to compile Harbour.

Pritpal Bedi

unread,
Jun 17, 2020, 1:13:40 AM6/17/20
to Harbour Users
Thanks Antonio


Hello student (which I know is in fact a master, I wish I had your knowledge ;)

:-) Thanks though I do not deserve it.

 
What i did on my humble Pi running Raspbian

  download harbour as a zip, unpack.
  apt-get install libcups-dev  and other needed development tools
  make

Nothing else needed, runs so well as on a x86_64 machine (just a little slower...)


It means I need to compile Harbour and my apps on an ARM machine instead of x86_64. I sit possible to generate ARM binaries while staying on x86_64 machine ?

fdaniele

unread,
Jun 17, 2020, 2:31:27 AM6/17/20
to Harbour Users
Thanks mr. Rolaci, your batch should be in harbour(s) site
ypu are a master like mr. Bedi ;-)

ciao !




Vlad

unread,
Jun 17, 2020, 4:20:22 AM6/17/20
to Harbour Users
In android (same archictecture) works.

export HB_PLATFORM="android"

make
sudo make install

Francesco Perillo

unread,
Jun 17, 2020, 7:09:04 AM6/17/20
to harbou...@googlegroups.com
You should not encounter big problems compiling harbour on linux ARM... android is a layer over linux after all....

In the past I compiled harbour to run on a ancient set-top-box... its plain c source code helps a lot.

The only problems you may encounter are:
- libraries... depending on the libs you need, expecially for connecting to external software
- time of compilation: I remember reading about 4 hours to compile harbour on a raspberry

Once you have compiled harbour on your arm-based server, you can compile your software to generate a arm-based executable.

To speed things up you may cross-compile harbour on windows or x86-based linux using a cross-compiler toolchain: the executables are for x86 but they create a final executable for arm.




--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.

Diego F

unread,
Jun 17, 2020, 2:02:26 PM6/17/20
to Harbour Users
HI, I create this batch file tested under Raspbian, and it's works perfect...

# previamente ejecutar para darle permisos de ejecucion al batch
# sudo chmod +x build_harbour.sh


sudo apt-get update -y
sudo apt-get install bash git gcc binutils fakeroot debhelper valgrind upx uncrustify subversion -y
sudo apt-get install autoconf automake intltool gdebi gdebi-core git-svn build-essential -y
sudo apt-get install libncurses5-dev libslang2-dev libx11-dev libgpm-dev -y
sudo apt-get install liballegro4.2-dev libcairo2-dev libcups2-dev libcurl4-openssl-dev -y
sudo apt-get install libfreeimage-dev libgs-dev libpcre++-dev -y
sudo apt-get install libmagic-dev unixodbc-dev libpq-dev -y
sudo apt-get install libexpat1-dev libmagic-dev libbz2-dev libsqlite3-dev -y
sudo apt-get install libcurl4-gnutls-dev -y
sudo apt install net-tools -y  

cd ~/
cd ~/harbour
export HB_WITH_PCRE=local
rem export HB_USER_CFLAGS="-fPIC"
export HB_WITH_CURL=/usr/include
cd /usr/include
sudo ln -s arm-linux-gnueabihf/curl

cd ~/harbour
make
sudo -E make install 

Diego

El martes, 16 de junio de 2020, 1:37:33 (UTC-3), Pritpal Bedi escribió:

António

unread,
Jun 20, 2020, 1:45:28 PM6/20/20
to Harbour Users

Hi Pritpal,

I'm not even capable of cross-compiling for Linux & Windows on the same x86_64 processor, so I'm sorry, can't help in building for ARM on x86_64.

My projects need Windows and Linux executables to be in sync, they are used in parallel, accessing the same data.
What I do: Development machine is Fedora + VirtualBox. Code on a Fedora partition, available as shared folders for Windows and couple of older Linux distributions virtual machines. So: Single code tree, multiple Harbour installations, but each one compiling for its own arch.

Experimenting with Pi involved transferring code to the little machine, and I was surprised no big issue found.

I know his is not a solution for you needs.
Unless you have some kind of virtual machine manager capable of emulating an ARM processor in parallel with running x86 machines...

Cheers,
António

Pritpal Bedi

unread,
Jun 21, 2020, 4:00:09 PM6/21/20
to Harbour Users
Hi All

This was easy. I did not read build instructions properly on harbour-core page. Viktor has done a wonderful job. I remained confused because there is no mention of "arm64" -arch on the page. At the end all done by these three lines of shell :

make-arm.sh
==========

export HB_CPU=arm64
export HB_BUILD_NAME=arm64
export HB_HOST_BIN=/develop/harbour/bin/linux/gcc
make


And that's it.


Thanks everybody who helped.
Reply all
Reply to author
Forward
0 new messages