Compiling error with source code at Ubuntu 20.04

Dear all,

I got an compiling error when I do "make " with the mantid in ubuntu 20.04(master branch in github):

[62%] — “mantid/qt/widgets/common/inc/MantidQtWidgets/Common/Python/Sip.h:41:36: error: ‘struct _sipSimpleWrapper’ has no member named ‘u’ " (line 41 of Sip.h: “return static_cast<T *>(wrapper->u.cppPtr);”)

I don’t know how to fix this and would be very grateful if anyone can help me. Thanks a lot!

Best regards,

Hi Jiyizi,

First off, the usual disclaimer. Ubuntu 20.04 isn’t officially supported yet by the project, as we’re waiting for our Conda packaging strategy . So the usual warnings apply, this is ad-hoc, things might break, your data might be invalid…etc.

That being said I personally develop on 20.04 and I’ve built master correctly today and it works 99% of the time.

Looking at the lines in question this code is conditionally compiled depending on your sip version. It looks like your hitting the code for SIP < 7 which shouldn’t be happening on 20.04 IMO, but should be an easy fix once we work out where this older package is coming from.

I have a couple of questions:

  • How did you get the dependencies to build to project? E.g. the .deb developer package available on Sourceforge or something else?

  • If you have installed the dependencies through apt or dpkg, could you post what sip version you have (from apt-cache show python-sip)? Locally I have 4.19.21+dfsg-1build1 which provides sip-api-12.x

  • If you are using Conda or similar, could you check what version of sip packaging you are using?

  • Could you post the sections related to sip from your CMakeCache.txt by going to your build folder, running the following and pasting the output?
    grep -i sip CMakeCache.txt

Dear DavidFair,

Thanks for you help, I‘m new to the SIP and I will check it’s installationt. Here are the information for your questions.

  1. I just install the dependencies by hand (apt and pip), maybe I should use the .deb package on Sourceforge.

  2. The “apt-cache show python-sip” cmd gets:

jiyizi@Dolores:~$ apt-cache show python-sip
Package: python-sip
Architecture: amd64
Version: 4.19.21+dfsg-1build1
Priority: optional
Section: universe/python
Source: sip4
Origin: Ubuntu
Maintainer: Ubuntu Developers <>
Original-Maintainer: Debian Python Modules Team <>
Installed-Size: 298
Provides: sip-api-12.0, sip-api-12.1, sip-api-12.2, sip-api-12.3, sip-api-12.4, sip-api-12.5, sip-api-12.6, sip-api-12.7
Depends: python-enum34, python2 (<< 2.8), python2 (>= 2.7~), python2:any (<< 2.8), python2:any (>= 2.7~), libc6 (>= 2.4)
  1. The results from “grep -i sip CMakeCache.txt” are:
jiyizi@Dolores:build$ grep -i sip CMakeCache.txt 
//The SIP flags used to build PyQt5
PYQT5_SIP_FLAGS:STRING=-n sip -t WS_X11 -t Qt_5_12_4
//The Qt version tag used by PyQt5's .sip files
FIND_PACKAGE_MESSAGE_DETAILS_PyQt5:INTERNAL=[5.14.1][Qt_5_12_4][/usr/local/share/sip/PyQt5][-n sip -t WS_X11 -t Qt_5_12_4][/usr/lib/python3/dist-packages/PyQt5/uic/][v()]
//Details about finding SIP
//ADVANCED property for variable: PYQT5_SIP_DIR
//ADVANCED property for variable: PYQT5_SIP_FLAGS

Best regards,

Dear DavidFair,

I re-install the build dependencies with the .dev developer package and degrade the sip to 4.19.25 (The original one is 6.1.1). Now the mantid project is built on Ubuntu 18.04 and 20.04 successfully.

Thanks for you Help!

Best regards,

Glad to hear it’s working for you Jiyizi :slightly_smiling_face:

I think 6.1.1 a particularly old sip, whilst the Ubuntu meta package is only at 4.19.25 but provides 12.x inside. I guess someone felt like having clear release numbering would make it too easy…