Build Error:libpython2.7.so: undefined reference to `minor

When I build the latest Slicer source from Github
I got these errors:
[ 43%] Linking C shared library …/…/…/lib/python2.7/lib-dynload/_hashlib.so
[ 44%] Built target extension_hashlib
[ 44%] Linking C shared library …/…/…/lib/python2.7/lib-dynload/_ssl.so
[ 45%] Built target extension_ssl
[ 45%] Built target extension_zlib
[ 91%] Built target libpython-shared
[ 97%] Built target pgen
[ 97%] Linking C executable …/…/bin/python
Creating ‘bin/./Modules/Setup.local’
/usr/bin/ld: …/…/lib/libpython2.7.so: undefined reference to minor' /usr/bin/ld: ../../lib/libpython2.7.so: undefined reference tomajor’
/usr/bin/ld: …/…/lib/libpython2.7.so: undefined reference to `makedev’
collect2: error: ld returned 1 exit status
make[5]: *** [CMakeBuild/python/CMakeFiles/python.dir/build.make:92: bin/python] Error 1
make[4]: *** [CMakeFiles/Makefile2:4311: CMakeBuild/python/CMakeFiles/python.dir/all] Error 2
make[3]: *** [Makefile:141: all] Error 2
make[2]: *** [CMakeFiles/python.dir/build.make:119: python-prefix/src/python-stamp/python-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:1431: CMakeFiles/python.dir/all] Error 2
make: *** [Makefile:95: all] Error 2

OS:Ubuntu18.10
QT:5.12.2
Cmake:3.14.1

Thanks for reporting the problem.

Two approaches to move forward:

(1) build https://github.com/python-cmake-buildsystem/python-cmake-buildsystem specifying options -DPYTHON_VERSION:STRING=2.7.15 and -DBUILD_LIBPYTHON_SHARED:BOOL=1 and report issue in the associated tracker.

(2) Waiting this is addressed, you could also try building the branch python3-support ? See https://github.com/Slicer/Slicer/pull/1118

Since we will very soon switch to Python3 (most likely today), testing this would also be helpful.