Forum > Unix

compile pascal source on Linux by FPC ?

(1/3) > >>

tissatussa:
hi, to compile a chess engine (Booot v6.5) i downloaded a set .pas files (with .dpr and .dproj file) but i'm not able to compile it on Linux (Xubuntu 22.04) .. i have FPC v3.2.2 installed and even Lazarus, but i'm stuck .. in terminal i tried :


--- Code: Pascal  [+][-]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";}};} ---$ fpc ./booot6.dprFree Pascal Compiler version 3.2.2+dfsg-9ubuntu1 [2022/04/11] for x86_64Copyright (c) 1993-2021 by Florian Klaempfl and othersTarget OS: Linux for x86-64Compiling ./booot6.dprCompiling uBitBoards.pasCompiling uMagic.pasuMagic.pas(91,6) Error: Identifier not found "Result"uMagic.pas(113,5) Error: Identifier not found "Result"uMagic.pas(135,5) Error: Identifier not found "Result"uMagic.pas(147,5) Error: Identifier not found "Result"uMagic.pas(157,5) Error: Identifier not found "Result"uMagic.pas(171,4) Error: Identifier not found "result"uMagic.pas(177,5) Error: Identifier not found "result"uMagic.pas(182,5) Error: Identifier not found "result"uMagic.pas(212,4) Error: Identifier not found "Result"uMagic.pas(347,11) Error: Identifier not found "Result"uMagic.pas(362,4) Error: Identifier not found "Result"uMagic.pas(421) Fatal: There were 11 errors compiling module, stoppingFatal: Compilation abortedError: /usr/bin/ppcx64 returned an error exitcode
the package does not have any README file .. do i need to add some parameters / options ?
i'm not a beginner at Linux, but i never did any Pascal.
i guess compiling my source should be pretty simple .. can anybody help me out ?

Fred vS:
Hello.

Try to compile after adding this at begin of unit ( after: unit uMagic; )

--- Code: Pascal  [+][-]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";}};} ---{$mode delphi} {$h+}
[EDIT] You may also use the mode parameter for fpc:

--- Code: Pascal  [+][-]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";}};} ---$ fpc -Mdelphi ./booot6.dpr
[EDIT2] You may also try the excellent "pure fpc" chess engine from Roland:
https://gitlab.com/rchastain/moustique

tissatussa:
indeed, the first line of 'uMagic.pas' is 'unit uMagic;' so i added '{$mode delphi} {$h+}' on the next line, as you suggest, but now i get this error :


--- Code: Pascal  [+][-]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";}};} ---$ fpc ./booot6.dprFree Pascal Compiler version 3.2.2+dfsg-9ubuntu1 [2022/04/11] for x86_64Copyright (c) 1993-2021 by Florian Klaempfl and othersTarget OS: Linux for x86-64Compiling ./booot6.dprCompiling uBitBoards.pasCompiling uMagic.pasuMagic.pas(405,6) Warning: Label not defined "l1"Compiling uBoard.pasCompiling uAttacks.pasuAttacks.pas(30,4) Error: Identifier not found "Result"uAttacks.pas(34,4) Error: Identifier not found "Result"uAttacks.pas(38,4) Error: Identifier not found "Result"uAttacks.pas(42,4) Error: Identifier not found "Result"uAttacks.pas(46,4) Error: Identifier not found "Result"uAttacks.pas(63,3) Error: Identifier not found "Result"uAttacks.pas(69,4) Error: Identifier not found "Result"uAttacks.pas(91,7) Error: Identifier not found "Result"uAttacks.pas(99,7) Error: Identifier not found "Result"uAttacks.pas(103,3) Error: Identifier not found "Result"uAttacks.pas(123,3) Error: Identifier not found "Result"uAttacks.pas(132,3) Error: Identifier not found "Result"uAttacks.pas(139,7) Error: Identifier not found "Result"uAttacks.pas(145,6) Error: Identifier not found "Result"uAttacks.pas(152,6) Error: Identifier not found "Result"uAttacks.pas(161,7) Error: Identifier not found "Result"uAttacks.pas(178,7) Error: Identifier not found "Result"uAttacks.pas(186,9) Error: Identifier not found "Result"uAttacks.pas(187,9) Error: Identifier not found "Result"uAttacks.pas(196,3) Error: Identifier not found "Result"uAttacks.pas(200,9) Error: Identifier not found "Result"uAttacks.pas(206,3) Error: Identifier not found "Result"uAttacks.pas(209,7) Error: Identifier not found "Result"uAttacks.pas(214,7) Error: Identifier not found "Result"uAttacks.pas(219,7) Error: Identifier not found "Result"uAttacks.pas(229,3) Error: Identifier not found "Result"uAttacks.pas(237,7) Error: Identifier not found "Result"uAttacks.pas(282,3) Error: Identifier not found "Result"uAttacks.pas(333,7) Error: Identifier not found "Result"uAttacks.pas(341,3) Error: Identifier not found "Result"uAttacks.pas(356,7) Error: Identifier not found "Result"uAttacks.pas(375,7) Error: Identifier not found "Result"uAttacks.pas(397,3) Error: Identifier not found "Result"uAttacks.pas(403,7) Error: Identifier not found "Result"uAttacks.pas(406,3) Error: Identifier not found "Result"uAttacks.pas(409) Fatal: There were 35 errors compiling module, stoppingFatal: Compilation abortedError: /usr/bin/ppcx64 returned an error exitcode
your second option didn't succeed either :


--- Code: Pascal  [+][-]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";}};} ---$ fpc --Mdelphi ./booot6.dprError: Illegal parameter: --MdelphiError: /usr/bin/ppcx64 returned an error exitcode
it failed .. i guess your '--' should be '-' so i did this, but it also failed :


--- Code: Pascal  [+][-]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";}};} ---$ fpc -Mdelphi ./booot6.dprFree Pascal Compiler version 3.2.2+dfsg-9ubuntu1 [2022/04/11] for x86_64Copyright (c) 1993-2021 by Florian Klaempfl and othersTarget OS: Linux for x86-64Compiling ./booot6.dprCompiling uBitBoards.pasCompiling uMagic.pasuMagic.pas(403,6) Warning: Label not defined "l1"Compiling uBoard.pasCompiling uAttacks.pasuAttacks.pas(406,11) Note: Call to subroutine "function SquareAttackedBB(sq:LongInt;AllPieses:Int64;var Board:TBoard):Int64;" marked as inline is not inlineduAttacks.pas(406,11) Note: Call to subroutine "function FindMinAttacker(Square:LongInt;MyAttackers:Int64;var Occupied:Int64;var Attackers:Int64;var Board:TBoard):LongInt;" marked as inline is not inlinedCompiling uHash.pasuHash.pas(4,40) Fatal: Can't find unit Ansistrings used by uHashFatal: Compilation abortedError: /usr/bin/ppcx64 returned an error exitcode

Fred vS:
Hum, difficult to give a diagnostic without seeing the source...  :-[

Maybe in uHash.pas, in uses section,  remove Ansistrings unit.


--- Quote ---it failed .. i guess your '--' should be '-'
--- End quote ---
Ooops, yes, fixed in previous post.

tissatussa:
i can put a ZIP with the source here.

your newest option (compile the Moustique chess engine) DID succeed according to the compilation line on that page : i get a working binary.

Navigation

[0] Message Index

[#] Next page

Go to full version