Build wxPython on Ubuntu 17.10

On Ubuntu 16.04, wxPython can be installed via the following commands.
sudo apt update
sudo apt-get -y install python3-pip
sudo pip3 install -U -f wxPython
sudo apt-get install libsdl-ttf2.0-0

There is no wxPython release for Ubuntu 17.10 yes, the ubuntu-16.04 is not compatible. I used the following commands to build wxPython.
sudo apt install pkg-config libgtk-3-dev libwebkitgtk-3.0-dev freeglut3-dev libgstreamer1.0-dev libgstreamer-plugins-good1.0-dev
sudo apt install libsm-dev libnotify-dev libsdl2-dev libtiff5-dev libjpeg-dev libgstreamer-plugins-base1.0-dev libqt5gstreamer-dev libboost1.62-dev
sudo apt-get install python3-venv

follow instructions on this page
cd ~/tmp
python3 -m venv builder_py
source builder_py/bin/activate
pip3 install -U pip six wheel setuptools
pip3 download wxPython
pip3 wheel -v wxPython-4.0.1.tar.gz 2>&1 | tee build.log

outside the virtualenv:
pip3 install ~/tmp/wxPython-4.0.1-cp36-cp36m-linux_x86_64.whl

Posted in Uncategorized | Leave a comment

build gede

build gede on Ubuntu 16.04 xenial with Qt5.8

Download gede-2.0.3.tar.xz from
tar xf gede-2.0.3.tar.xz
cd ~/oss/gede-2.0.3/src
Info: creating stash file ~/oss/gede-2.0.3/src/.qmake.stash
~/oss/gede-2.0.3/src$ make

Posted in CPP, GUI, QT | Leave a comment

Build tea editor

Build tea on macOS sierra

Install qt5: brew install qt5
download tea source code from
unzip ~/Downloads/
cd tea-qt-master
cp -r bin/ /Applications
add /Applications/ to PATH environment variable in ~/.profile

Build tea on Ubuntu 16.04 xenial

sudo apt-get install mesa-common-dev
sudo apt-get install libglu1-mesa-dev
cd tea-qt-master/
Info: creating stash file ~/oss/tea-qt-master/.qmake.stash
Project MESSAGE:
Project MESSAGE:
Project MESSAGE:

Posted in CPP, macOS, Open Source, QT | Leave a comment

wxBoxSizer Horizontal alignment flags are ignored with wxEXPAND

Newer version of wxWidgets reports error:

 ./src/common/sizer.cpp(2091): assert "!(flags & (wxALIGN_RIGHT | wxALIGN_CENTRE_HORIZONTAL))" failed in DoInsert(): Horizontal alignment flags are ignored with wxEXPAND

[1] wxBoxSizer::DoInsert(unsigned long, wxSizerItem*)
[2] WXMSearchReplaceDialog::WXMSearchReplaceDialog(wxWindow*, int, wxPoint const&, wxSize const&) …

wxBoxSizer* BoxSizer2;
BoxSizer2 = new wxBoxSizer(wxVERTICAL);

The fix is removing both like the following:

BoxSizer2->Add(BoxSizer4, 1, wxALL|wxEXPAND, 0);

Another change:

StaticBoxSizer1 = new wxStaticBoxSizer(wxVERTICAL, Panel3, _(“Text Mode”));
StaticBoxSizer1->Add(WxCheckBoxPrintSyntax, 0, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 1); // remove |wxALIGN_CENTER_VERTICAL

To build wxMEdit-3.1.tar.gz with wxWidgets-3.1.0.tar.bz2:

./configure --with-wx-config=~/oss/wxWidgets-3.1.0/wx-config

There is one place need change:

unsigned long FilePathHash(const wxString& name)
 return wxStringHash::stringHash(FilePathNormalCase(name).wc_str());
Posted in CPP, GUI, Open Source | Leave a comment

Solution to valgrind: failed to start tool memcheck/callgrind

Background: I need to run memcheck/callgrind on a system without privilege to install software, so I build valgrind from source code.

Valgrind-3.12.0.tar.bz2 on Ubuntu 14.04 trusty
tar xf valgrind-3.12.0.tar.bz2
onegazhang@trusty:~/oss/valgrind-3.12.0$ VALGRIND_LIB=/home/onegazhang/oss/valgrind-3.12.0 coregrind/valgrind
valgrind: failed to start tool ‘memcheck’ for platform ‘amd64-linux’: No such file or directory

The solution is passing VALGRIND_LIB environment variable to valgrind.
onegazhang@trusty:~/oss/valgrind-3.12.0$ VALGRIND_LIB=/home/onegazhang/oss/valgrind-3.12.0/memcheck coregrind/valgrind
valgrind: no program specified
valgrind: Use –help for more information.

callgrind tool reported another error: ERROR: object ‘/home/onegazhang/oss/valgrind-3.12.0/callgrind/’ from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored. It is fixed by copying the library to desired location.

onegazhang@trusty:~/oss/valgrind-3.12.0$ cp -p /home/onegazhang/oss/valgrind-3.12.0/coregrind/ /home/onegazhang/oss/valgrind-3.12.0/callgrind

Then callgrind works in the same way as memcheck.

onegazhang@trusty:~/workspace$ VALGRIND_LIB=/home/onegazhang/oss/valgrind-3.12.0/callgrind /home/onegazhang/oss/valgrind-3.12.0/coregrind/valgrind –tool=callgrind ./memleak

Btw, the above procedure also worked on arm platform.

Posted in CPP, debug, Open Source | Leave a comment

Install Eclipse Plugin

I failed to install PyDev5.7 Eclipse plugin on Ubuntu 16.04 guest OS hosted by macOS sierra. Can’t access MarketPlace, can’t install by adding url to update site. fortunately there is 3rd way: unzip to eclipse/dropins folder. Eclipse version is eclipse-cpp-neon-3-linux-gtk-x86_64.

Posted in Eclipse, IDE | Leave a comment

Solution to Java program unable to find valid certification path to requested target

On macOS sierra, some Java program encountered error: PKIX path building failed: unable to find valid certification path to requested target

Popular google answer suggested to use keytool to add certificate to $JAVA_HOME/jre/lib/security/cacerts.This solution probably works on other OS like Ubuntu, but it does not work on macOS sierra. I still got such error after adding certificate to $JAVA_HOME.

The root cause is that the application in trouble does not refer to $JAVA_HOME/jre/lib/security/cacerts, but refer to a file in its own installation path like /Applications/ccollab_client/.install4j/jre.bundle/Contents/Home/jre/lib/security/cacerts. After I added certificate to this place, ccollab software works without problem.

Do a search, we’ll find a few cacerts file outside of $JAVA_HOME.

sudo find / -name cacerts -type f

like /Applications/

Posted in Java, Uncategorized | Tagged | Leave a comment