Gridcoin Compiles on Xenial


I know it might not mean anything to the non-techs, and it might seem insignificant to the uber-techs.

I have successfully built the Gridcoin client on Xenial 16.04.4 with proper libraries, and confirmed it sees my testnet wallet, and overall is just working like it should. (No testplan per se.)

This is a major accomplishment for me, and makes me very excited. It takes 16 minutes to compile with 3 cores of i7-6820HQ CPU @ 2.70GHz and 3.2GB RAM.

I get some QT warnings, but they do not seem to break anything:

/usr/include/x86_64-linux-gnu/qt5/QtCore/qlogging.h:112:73: note: in expansion of macro ‘Q_ATTRIBUTE_FORMAT_PRINTF’
void critical(CategoryFunction catFunc, const char *msg, ...) const Q_ATTRIBUTE_FORMAT_PRINTF(3, 4);

Here is my build environment setup procedure.

### Xenial Build Environment References
http://wiki.gridcoin.us/Linux_guide
https://raw.githubusercontent.com/gridcoin/Gridcoin-Research/master/CompilingGridcoinOnLinux.txt
Google searches for libqt5charts for xenial (KDE Neon distribution)

https://88plug.com/linux/install-berkeley-4-8-db-libs-on-ubuntu-16-04

##########################################
### Intall libqt5charts5-dev and related files from Neon LTS
cat < <‘EOF’ > /etc/apt/sources.list.d/kde-neon-archive-xenial.list
deb http://archive.neon.kde.org/testing-qt xenial main
deb http://archive.neon.kde.org/user/lts xenial main
EOF
sudo apt update
sudo upgrade
sudo apt install ntp git build-essential curl libcurl4-openssl-dev libcurl3-dev libssl-dev libzip-dev libzip4 libdb-dev libdb++-dev \
libdb4.8-dev libdb4.8++-dev debhelper devscripts automake libtool pkg-config libprotobuf-dev protobuf-compiler libminiupnpc-dev \
autotools-dev libevent-dev bsdmainutils software-properties-common libboost-all-dev libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev \
libqrencode-dev qt-sdk qtcreator libqt5charts5-dev qt5-default qttools5-dev-tools libqt5webkit5-dev libqt5charts5-dev
sudo apt-get autoremove

### Change the distro back to Ubuntu from Neon
echo “DISTRIB_ID=Ubuntu” >> /etc/lsb-release

### Install BDB 4.8 on Xenial
sudo add-apt-repository ppa:bitcoin/bitcoin ## Stable
#sudo add-apt-repository ppa:bitcoin/rc ## testing
sudo apt update
sudo apt install libdb4.8-dev libdb4.8++-dev

##########################################
### New download
cd ~
git clone https://github.com/gridcoin/Gridcoin-Research
cd ~/Gridcoin-Research

### Optional if issues
git config –global http.sslverify false

##########################################
### Refresh download – master, hotfix, staging
cd ~/Gridcoin-Research
make clean
git fetch –all
git reset –hard origin/master

### Build Daemon
cd ~/Gridcoin-Research/src
make clean
mkdir obj
chmod 755 leveldb/build_detect_platform
make -j3 -f makefile.unix USE_UPNP=-
strip gridcoinresearchd
install -m 755 gridcoinresearchd ~/.Gridcoinresearchd/testnet/gridcoinresearchd
### The above probably wants sudo, and a target of /usr/bin

### Build GUI
cd ~/Gridcoin-Research
rm -f build/o.*
qmake gridcoinresearch.pro “USE_UPNP=-”
make -j3
strip gridcoinresearch
install -m 755 gridcoinresearch ~/.Gridcoinresearchd/testnet/gridcoinresearch
### The above probably wants sudo, and a target of /usr/bin

##########################################
### Refresh download, development
cd ~/Gridcoin-Research
make clean
git fetch –all
git reset –hard origin/development

### Build Autotools
cd ~/Gridcoin-Research
./autogen.sh
#./configure –with-incompatible-bdb ### If you do not have BDB 4.8
./configure
date ; make -j3 ; date
make install

###############################


GRC VM Template

Installed base OS

Ubuntu 16.04.4 LTS  because only LTS releases are worthy.  No auto-updates.
Copy over home directory and /etc/apt from my current TESTNET system

Split /home /usr /var /tmp into separate LVs.

lvcreate, edit /etc/fstab, mount on temp space, copy over, move old dir, reboot, remove old dir.

Shrunk root filesystem

grub
e
root=/dev/ram0 rw
^X

Wait for mdadm to finish complaining.
alias ll='ls -laF'
mkdir /mnt
lvm pvscan
lvm vgscan
lvm vgchange -a y
e2fsck -f /dev/ubuntu-vg/root
mount /dev/ubuntu-vg/root /mnt
cd /mnt
cp -a lib lib65 bin sbin /
cd /
umount /mnt
e2fsck -f /dev/ubuntu-vg/root
resize2fs -M /dev/ubuntu-vg/root
lvreduce -L 1120M /dev/ubuntu-vg/root
e2fsck -f /dev/ubuntu-vg/root
resize2fs /dev/ubuntu-vg/root
umount -a

power off VM since halt and reboot do not work.

Cleared free space

lvcreate -l 100%FREE -n deleteme ubuntu-vg
dd if=/dev/zero of=/dev/null bs=256k
lvremove /dev/ubuntu-vg/deleteme
swapoff /dev/ubuntu-vg/swap_1
dd if=/dev/zero of=/dev/ubuntu-vg/swap_1 bs=256k
for i in / /home /var /tmp /boot /usr ; do dd if=/dev/null of=${i}/deleteme bs=256k & rm ${i}/deleteme ; done
halt -p

Compacted

"\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd --compact "Xenial GRC Build.vdi"

Plans

Snapshot, test building.