Skip to content

Compile instructions

Pascal Coin edited this page Sep 26, 2018 · 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 (Graphical version) 64 bits
  • In Ubuntu desktop 16.04.1, there was a old Lazarus installation issue. See FAQ 01 (at the end of this document) if needed
  • In Ubuntu server, it can only be compiled with Free Pascal Compiler. See section Install Free Pascal Compiler
  • You can compile with Delphi (Tested Delphi 10.2 Tokyo), or with Lazarus (Tested version 1.8)
  • 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 OpenSSL

  • Pascal Coin uses OpenSSL code (cryptographic code maintained by OpenSSL.org)
  • Introduced on PascalCoin v3, only OpenSSL v1.1 is allowed. Usage of OpenSSL v1.0 is deprecated

OpenSSL for Windows

  • If you want to compile for WINDOWS, obtain precompiled OpenSSL DLL's. They are provided on Wallet installers and current Github releases.
    • libcrypto-1_1.dll <- 32 bits
    • libcrypto-1_1-x64.dll <- 64 bits

OpenSSL for Linux

Build OpenSSL for Linux

Building OpenSSL is only necessary in Linux. In Windows you can download a build version from https://indy.fulgan.com/SSL/ If you want to build on Windows, search how to on Google. Note: Tested with OpenSSL 1.1.0b (2016-Sep-26)

  • LINUX INSTRUCTIONS
  • Download OpenSSL from www.openssl.org (Preferred version 1.1.0b)
  • Unzip files to any folder, we will call it "OpenSSLSourceFolder"
  • Open a linux terminal
    • Go to "OpenSSLSourceFolder" cd /"OpenSSLSourceFolder"
    • Create a temporary destination folder mkdir tmp_openssl
    • Config build options with this temporary destination directory ./config shared --prefix=/"OpenSSLSourceFolder"/tmp_openssl
    • Execute make and install make install
    • We will find a file called "libcrypto.so.1.1" at folder "OpenSSLSourceFolder"/tmp_openssl/lib
    • copy "libcrypto.so.1.1" to your executable folder (where you have been compiled PascalCoinWalletLazarus = "SOURCE_CODE_FOLDER")
    • DON'T RENAME this file, because Pascal Coin executable needs a file called "libcrypto.so.1.1" when compiled in Linux with OpenSSL v1.1 option enabled
  • If you download a version 1.0, then file name of compiled OpenSSL library must be "libcrypto.so.1.0.0" and save it at "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

Compile Pascal Coin

Compile with Delphi

(In Delphi, you can only run on Windows)

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

Compile with Lazarus

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

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 -Tlinux -O- -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")

FAQ

FAQ 01

Question: My Lazarus does not compile with Linux. (Error example: file "interfaces" not found or missing).

Answer: In a fresh Ubuntu 16.04.1 (perhaps other versions too) with Lazarus 1.6 (downloaded and fresh installed) you cannot compile Pascal Coin (and not any other Pascal program).
This is because you must build the Lazarus core.

Solution:

  • Open Lazarus and close all projects
  • Go to menu "Tools" > "Configure Build Lazarus"
  • Select Profile to build "Clean Up+ Build all"
  • Click to "Build"
    • Lazarus will build itself and reboot
  • Open Lazarus again and see if you can compile without "interfaces" file error
    • If not, then try again to build Lazarus selecting other Profile to build options (Perhaps "Debug IDE")
    • If not... sorry... google search ;-)

FAQ 02

Question: Application shows a "file not found libeay32.dll" or "libcrypto.so.1.1" or "libeay64.dll"...

Solution: Your OpenSSL library is not correctly installed. Read "Download OpenSSL" section

Clone this wiki locally