-
Notifications
You must be signed in to change notification settings - Fork 192
Compile instructions
This page contains guide to compile PascalCoin for all platforms.
- 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 is a Lazarus installation issue. See FAQ 01 (at the end of this document)
- 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 version 2010), or with Lazarus (Tested version 1.6)
- Cross-compatible if using Lazarus (Windows + Linux + Mac) (Note: Not tested in Mac, only Windows or Ubuntu)
- 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
- Synapse is used to sockets connections
- Download Synapse source code from: http://www.ararat.cz/synapse/lib/exe/fetch.php/file:synapse40.zip (Tested with version Synapse40)
- Also you can download a new version from svn: https://sourceforge.net/p/synalist/code/HEAD/tree/trunk/
- If URL is broken, try searching "Synapse ararat" on Google and Download
- Unzip synapse source code at SOURCE_CODE_FOLDER/Synapse
- Result MUST be a tree folder like:
- SOURCE_CODE_FOLDER/Synapse/lib
- Pascal Coin uses OpenSSL code (cryptographic code maintained by OpenSSL.org)
- If you want to compile for WINDOWS, obtain OpenSSL DLL's from: https://indy.fulgan.com/SSL/
- If compiler is Delphi, you must obtain the 32 bit DLL file
- If compiler is Lazarus, you must obtain the 64 bit DLL file
- You must unzip file
libeay32.dlland put in "SOURCE_CODE_FOLDER" - If you compile with Lazarus, use
libeay64.dllbecause is 64 bits version
NOTE: You can also find libey32.dll and libey64d.dll files in the installation direction after running the PascalCoin installer.
- If you want to compile for Lazarus, obtain OpenSSL source code from: https://www.openssl.org/source/
- See section BUILD OPENSSL FOR LINUX
- Tested with openssl-1.1.0b.targ.gz (2016-Sep-26)
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
makeinstall - 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
- Go to "OpenSSLSourceFolder"
- 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"
- 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"
Free Pascal Compiler is useful to compile Pascal Coin on linux servers, otherwise you can use Lazarus
- On Linux server edition, install FPC (Free Pascal Compiler) v3.0
(Optionally, look at this old tutorial: http://www.freepascal.org/docs-html/user/usersu5.html )
- Download source code from: https://sourceforge.net/projects/freepascal/files/Linux/3.0.0/
- Download fpc-3.0.0.x86_64-linux.tar (or correct CPU/System version)
- Unzip file:
tar -xvf fpc-3.0.0.x86_64-linux.tar - install fpc:
./install.sh - check that FreePascal is installed by executing:
fpc(will show fpc options)
(In Delphi, you can only run on Windows)
- Just open Delphi 2010, open project "PascalCoinWallet.dpr" located at "SOURCE_CODE_FOLDER"
- Go to "Project > Options" and put "Synapse\lib" folder at Search Path option (This will enable Delphi to find Synapse source code)
- Build + Compile
- Exe file will be: "PascalCoinWallet.exe"
- Just open Lazarus (tested with Lazarus 1.6 and FPC 3.0)
- Open project "PascalCoinWalletLazarus.lpi"
- Check that
- Build + Compile
- Executable file will be: "PascalCoinWalletLazarus"
- Free Pascal Compiler is useful for execute as a daemon in Linux server
- go to "SOURCE_CODE_FOLDER"
- run command
fpc -FuUnits/PascalCoin/ -FuSynapse/lib/ -FuUnits/Utils/ 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")
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 ;-)
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
NOTE: You can also find libey32.dll and libey64d.dll files in the installation direction after running the PascalCoin installer.