In this blog post I will describe how to install basic Harbour on mac osx. It is a really basic installation but it is also fully functional. In the next blog post I will describe how to install Qt and hbQt to create software that can run on Windows, linux and osx.
From your osx gui, install XCode from the App Store. I then used ssh to connect from another server or you can open a terminal window on osx.
First of all we need to accept the XCode license, and we can do this just by invoking one executable.
sudo git
Follow the on-screen instructions to confirm the license.
As usual, I will run Harbour from a directory and I won’t install it system-wide: with this setup I can have multiple different versions available. I will clone the repository with git in order to receive upstream commits.
git clone https://github.com/harbour/core.git harbour Cloning into 'harbour'... remote: Counting objects: 275833, done. remote: Compressing objects: 100% (76/76), done. remote: Total 275833 (delta 13), reused 3 (delta 3), pack-reused 275754 Receiving objects: 100% (275833/275833), 116.30 MiB | 297.00 KiB/s, done. Resolving deltas: 100% (216982/216982), done. Checking connectivity... done. cd harbour make -j 4
On my mac mini end-2015 it took less than 2 minutes to complete. I then run
bin/darwin/clang/hbtest Harbour Regression Test Suite Copyright (c) 1999-2016, Viktor Szakats http://harbour-project.org/ --------------------------------------------------------------------------- Version: Harbour 3.2.0dev (r1606292102) Compiler: LLVM/Clang C 7.3 (clang-703.0.31) (64-bit) OS: Darwin 15.5.0 x86_64 Date, Time: 2016-07-01 17:25:22 Shortcut opt.: On Switches: =========================================================================== R No. Line TestCall() -> Result | Expected --------------------------------------------------------------------------- ! 613 MAIN_HVMA(368) saArray[ 1000 ] Result: "E 2 BASE 1132 Bound error (array access) OS:0 #:0 A:2:A:{.[1].};N:1000 " Expected: "E 2 BASE 1132 Bound error (array access) OS:0 #:0 " ! 614 MAIN_HVMA(369) saArray[ 1000 ] := 1 Result: "E 2 BASE 1133 Bound error (array assign) OS:0 #:0 A:1:N:1000 " Expected: "E 2 BASE 1133 Bound error (array assign) OS:0 #:0 " ! 743 MAIN_HVMA(541) RTSTR( 00000500000000000000 ) Result: " 16 500000000000000" Expected: " 21 500000000000000" ! 744 MAIN_HVMA(542) RTSTR( 0500000000000000 ) Result: " 16 500000000000000" Expected: " 17 500000000000000" ! 1088 MAIN_MATH(354) Str( 1234567890 * 1234567890 ) Result: " 1524157875019052100" Expected: " 1524157875019052000" ! 2894 MAIN_ARRAY(158) ASize( NIL ) Result: "E 1 BASE 2023 Argument error (ASIZE) OS:0 #:0 A:1:U:NIL " Expected: "E 1 BASE 2023 Argument error (ASIZE) OS:0 #:0 " ! 2895 MAIN_ARRAY(159) ASize( {} ) Result: "E 1 BASE 2023 Argument error (ASIZE) OS:0 #:0 A:1:A:{.[0].} " Expected: "E 1 BASE 2023 Argument error (ASIZE) OS:0 #:0 " ! 2896 MAIN_ARRAY(160) ASize( ErrorNew() ) Result: "E 1 BASE 2023 Argument error (ASIZE) OS:0 #:0 A:1:O:ERROR Object " Expected: "E 1 BASE 2023 Argument error (ASIZE) OS:0 #:0 " ! 2897 MAIN_ARRAY(169) ASize( NIL, 0 ) Result: "E 1 BASE 2023 Argument error (ASIZE) OS:0 #:0 A:2:U:NIL;N:0 " Expected: "E 1 BASE 2023 Argument error (ASIZE) OS:0 #:0 " ! 2898 MAIN_ARRAY(170) ASize( NIL, 1 ) Result: "E 1 BASE 2023 Argument error (ASIZE) OS:0 #:0 A:2:U:NIL;N:1 " Expected: "E 1 BASE 2023 Argument error (ASIZE) OS:0 #:0 " ! 2899 MAIN_ARRAY(171) ASize( NIL, -1 ) Result: "E 1 BASE 2023 Argument error (ASIZE) OS:0 #:0 A:2:U:NIL;N:-1 " Expected: "E 1 BASE 2023 Argument error (ASIZE) OS:0 #:0 " ! 2922 MAIN_ARRAY(213) Array( 1, 0, -10 ) Result: "E 2 BASE 1131 Bound error (array dimension) OS:0 #:0 A:3:N:1;N:0;N:-10 " Expected: "E 2 BASE 1131 Bound error (array dimension) OS:0 #:0 " ! 3061 MAIN_ARRAY(396) TAEVSM() Result: "N10N 9N 8N 7N 6 5" Expected: "N10N 9N 8N 7N 6N 5N 4N 3N 2N 1 0" ! 3062 MAIN_ARRAY(397) TASOSM1() Result: "NN 5NN 4 3{ 2, 1, 3 }" Expected: "NN 5NN 4NN 3NN 2NN 1NN 0NN 0NN 0NN 0NN 0NN 0NN 0 0{ }" ! 3063 MAIN_ARRAY(398) TASOSM2() Result: "NN 5NN 4 3{ 2, 1, 3 }" Expected: "NN 5NN 4NN 3NN 2NN 1NN 0NN 0NN 0NN 0NN 0 0{ }" ! 3183 MAIN_MISC(87) Set( 40 ) Result: 0 Expected: NIL ! 3192 MAIN_MISC(97) Set( 40 , -1 ) Result: 0 Expected: NIL =========================================================================== Test calls passed: 4757 ( 99.64 % ) Test calls failed: 17 ( 0.36 % ) ---------- Total: 4774 ( Time elapsed: 0.02 seconds ) WARNING ! Failures detected
to test that everything is fine. And of course it is. Otherwise it won’t complete Harbour build.
Now to complete the installation, I create a script in the user root directory that sets the enviromental variables to the path where I compiled Harbour.
PATH=$PATH:~/harbour/bin/darwin/clang
And now I can login, set the environment and use harbour as needed:
. set_harbour.sh harbour -build Harbour 3.2.0dev (r1606292102) Copyright (c) 1999-2016, http://harbour-project.org/ Harbour Build Info --------------------------- Version: Harbour 3.2.0dev (r1606292102) Compiler: LLVM/Clang C 7.3 (clang-703.0.31) (64-bit) Platform: Darwin 15.5.0 x86_64 PCode version: 0.3 ChangeLog last entry: 2016-06-29 23:02 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) ChangeLog ID: f8ec6e2c46068d3f1759c4d75a8f982fc391fb9e Built on: Jul 1 2016 17:21:51 Build options: (Clipper 5.3b) (Clipper 5.x undoc) ---------------------------