Skip to content

Compile instructions

Pascal Coin edited this page Jan 21, 2021 · 15 revisions

HOW TO COMPILE PASCAL COIN

This page contains guide to compile PascalCoin for all platforms.

COMPATIBILITY:

  • In Windows, it's tested with XP, Windows 7 and Windows 10.
  • In Linux, is tested on Ubuntu 16.04.1 and 20.04 64 bits
  • You can compile with:
    • Delphi (10.3.2 Community edition) GUI version
    • FPC (Free Pascal Compiler 3.2.0) DAEMON
    • Lazarus (2.0.10) GUI version & DAEMON & WINDOWS SERVICE
  • Cross-compatible if using Lazarus (Windows + Linux + Mac) (Note: Not tested in Mac, only Windows or Ubuntu)

PLEASE READ CAREFULLY:

Download and install dependencies:

Download Pascal Coin source code

  • Create a source code folder, we will call this folder "SOURCE_CODE_FOLDER"
  • Download Pascal Coin source code from: https://github.com/PascalCoin/PascalCoin (use latest Release branch).
  • Unzip or put source code in SOURCE_CODE_FOLDER

Download Blockchain (optional)

  • You don't need to obtain the Blockchain, but it is quicker if you have downloaded it rather than waiting for the App to download it from other nodes...
  • You will find a valid BlockChain at SourceForge Pascal Coin downloads: https://sourceforge.net/projects/pascalcoin/files/ - Search for "BlockChain" file
  • Blockchain must be unziped and stored in the Pascal Coin data folder: (We will call it "PASCALCOIN_DATA_FOLDER")
    • Pascal Coin data folder for Windows: c:\Users(your user)\AppData\Roaming\PascalCoin\Data
    • Pascal Coin data folder for Linux: /home/(your user)/PascalCoin/Data
  • REMEMBER TO PUT BLOCKCHAIN IN CORRECT "PASCALCOIN_DATA_FOLDER"
  • REMEMBER TO GRANT PERMISIONS TO USER AT "PASCALCOIN_DATA_FOLDER"

Download/Install Free Pascal Compiler

Free Pascal Compiler is useful to compile PascalCoin on linux servers, otherwise you can use Lazarus (recommended use latests Lazarus version)

  • On Linux server edition, install FPC (Free Pascal Compiler) v3.2.0 (Optionally, look at this old tutorial: http://www.freepascal.org/docs-html/user/usersu5.html )
    • PLEASE NOTE: Use latest FreePascal version! (Do not use direct links, navigate and find latest versions)
    • Download source code from: https://sourceforge.net/projects/freepascal/files/Linux/3.2.0/ (or latest)
    • Download fpc-3.2.0.x86_64-linux.tar (or correct CPU/System version) (or latest)
    • Unzip file: tar -xvf fpc-3.2.0.x86_64-linux.tar (or downloaded version)
    • install fpc: ./install.sh
    • check that FreePascal is installed by executing: fpc (will show fpc options)
    • Version used and tested with this tutorial is FreePascal 3.0.4

Compile Pascal Coin

GUI PascalCoin Wallet & block explorer

Compile with Delphi

(In Delphi, you can only run on Windows)

  • Just open Delphi, open project "pascalcoin_wallet_classic.dpr" located at "SOURCE_CODE_FOLDER"
  • Build + Compile
  • Exe file will be: "pascalcoin_wallet_classic.exe"

Compile with Lazarus

  • Just open Lazarus (tested with Lazarus 2.0.10 and FPC 3.2)
  • Open project "pascalcoin_wallet_classic.lpi"
  • Check that
  • Build + Compile
  • Executable file will be: "pascalcoin_wallet_classic"

DAEMON PascalCoin (full node)

Compile with Free Pascal Compiler (Linux servers editions, daemon)

  • Free Pascal Compiler is useful for execute as a daemon in Linux server
  • go to "SOURCE_CODE_FOLDER"
  • run command
fpc -Fucore -Fulibraries/synapse -Fulibraries/pascalcoin -Fulibraries/sphere10 -Fulibraries/generics.collections  -Fulibraries/hashlib4pascal -Fulibraries/paszlib -Fulibraries/abstractmem -Fulibraries/regex -Tlinux -O- -v0 -opascalcoin_daemon pascalcoin_daemon.pp
  • Execute like a daemon with nohup ./pascalcoin_daemon -r &
  • Make sure you have OpenSSL crypto lib in base daemon dir (file "libcrypto.so.1.1")

WINDOWS SERVICE PascalCoin (full node)

Compile with Lazarus

  • Open & Compile pascalcoin_daemon.lpi using Lazarus
  • Install service executing pascalcoin_daemon -i