Forum > FPC development

FPC-LLVM installer ?

<< < (7/7)

Fred vS:
Hello everybody.

Coming back to the initial title of the topic and following all the advices from previous posts, here all the steps to compile fpc-llvm on Debian 11 64 bit.
Those steps should be the same for all Debian childs like Ubuntu, Mint, ...

-1) Install last stable LLVM version (with Debian 11 it is LLVM 13):

--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- ~>  sudo apt install llvm-13
-2) Install clang-13:

--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- ~>  sudo apt install clang-13
-3) Download fpc main source and unzip it.
    https://gitlab.com/freepascal.org/fpc/source/-/archive/main/source-main.zip

-4) Edit your /etc/fpc.cfg and add this line (it is gcc 10 on Debian 11) :

--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ----Fl/usr/lib/gcc/x86_64-linux-gnu/10/
-5) Script to build fpc (buildfpcllvm.sh) :

--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---  #!/bin/sh  COMPILER=/usr/lib/fpc/3.2.2/ppcx64 make clean make all FPC=$COMPILER OPT="-Fl/usr/local/lib" OPTNEW="-Clv13.0 -XlS-13" FPCMAKEOPT="-Clv13.0 -XlS-13" LLVM=1
-6) Run the script in fpc root source directory:

--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- > buildfpcllvm.sh
-7) Cross your fingers and do something fun. (compilation of fpc-llvm takes much more time than "classical" fpc.)

-8) When all is done, you may try fpc-llvm with this:

--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- > /directory_of_fpc_source-main/compiler/ppcx64 -il If you get this the compilation was OK:

--- Quote ---7.0
7.1
8.0
Xcode-11.0
9.0
Xcode-11.4
10.0
Xcode-12.0
11.0
11.1
Xcode-12.5
12.0
Xcode-13.0
13.0
Xcode-13.3
14.0
15.0
--- End quote ---

-9) Installation of fpc-llvm (warning it will remove all previous install of fpc 3.3.1., so make a backup or change the directory target):

The install script (installfpcllvm.sh)  ( Note: it uses the new compiler ):

--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---#!/bin/sh COMPILER=/directory_of_fp_source-main/compiler/ppcx64make FPC=$COMPILER install OPT="-Clv13.0 -XlS-13" INSTALL_PREFIX=/usr/ 
Run the script with root permission:

--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- > sudo installfpcllvm.sh 

-10) Test fpc-llvm:

--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---> /usr/lib/fpc/3.3.1/ppcx64 -il
If all was ok, you should have the same result as step 8 ).

-11) Using fpc-llvm for your application:
       Just add those fpc parameters: -Clv13.0 -XlS-13 for compilation.

-12) Enjoy.

Fre;D

Navigation

[0] Message Index

[*] Previous page

Go to full version