How do I compile QScintilla and Eric6 on Linux? - linux

First I install QScintilla by following steps:
1:
cd Qt4Qt5
qmake qscintilla.pro
sudo make
make install
2:
cd ../designer-Qt4Qt5
qmake designer.pro
sudo make
sudo make install
3:
cd ../Python
python3 configure.py --pyqt=PyQt5
sudo make
And here I met the problem :
QAbstractScrollArea: No such file or directory
and problem:
qprinter.h: No such file or directory
But I finally solved them by manually add required files.
Goes on:
sudo make install
4:
then I go to install eric6 by typing:
sudo python3 install.py
But I got:
Checking dependencies
Python Version: 3.4.0
Found PyQt5
Sorry, please install QScintilla2 and
its PyQt5/PyQt4 wrapper.
Error: /usr/lib/python3/dist-packages/PyQt5/Qsci.so: undefined symbol: _ZTI13QsciScintilla

The main problem is that you are linking against Qt4 rather than Qt5. This is why the QAbstractScrollArea and QPrinter headers are reported as missing, and why you later get the undefined symbol error.
QScintilla uses a features file to control compile-time configuration, and its sources need to be patched to get a good build for Qt5.
So first unpack a fresh set of sources, and then make these changes:
designer-Qt4Qt5/designer.pro:
TARGET = qscintillaplugin_qt5
Qt4Qt5/features/qscintilla2.prf:
} else {
LIBS += -lqscintilla2_qt5
}
}
} else {
LIBS += -lqscintilla2_qt5
}
Qt4Qt5/qscintilla.pro:
TARGET = qscintilla2_qt5
...
features.path = $$[QT_INSTALL_ARCHDATA]/mkspecs/features
This will ensure that you get independent qscintilla libs for Qt5.
With that done, take the following steps to build (as a normal user):
cd 'path/to/src/Qt4Qt5'
# this is essential for correct linking
export QMAKEFEATURES="$PWD/features"
# make sure you use the right qmake!
qmake-qt5 'qscintilla.pro'
make
# plugin for Qt5 Designer
cd '../designer-Qt4Qt5'
qmake-qt5 'designer.pro' INCLUDEPATH+='../Qt4Qt5' QMAKE_LIBDIR+='../Qt4Qt5'
make
# Python bindings
cd '../Python'
python3 'configure.py' --pyqt='PyQt5' --qmake='/usr/bin/qmake-qt5' \
--qsci-incdir='../Qt4Qt5' --qsci-libdir='../Qt4Qt5'
make
If successful, you can then install everything (as root):
cd 'path/to/src/Qt4Qt5'
make install
cd '../designer-Qt4Qt5'
make install
cd '../Python'
make install

ekhumoro's solution above did not quite work for me - let's just say maybe I missed something, or it's an environment-specific thing.
Anyway.... I did what ekhumoro advised except didn't edit these three files: (XXX)
- designer-Qt4Qt5/designer.pro
- Qt4Qt5/features/qscintilla2.prf
- Qt4Qt5/qscintilla.pro
the reason for editing them seems sound, but at the end of the day Eric install failed with:
Sorry, please install QScintilla2 and its PyQt5/PyQt4 wrapper.
Error:
dlopen(/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/PyQt5/Qsci.so, 2):
Library not loaded: libqscintilla2_qt5.12.dylib
^^^^
Referenced from: /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/PyQt5/Qsci.so
Reason: image not found
note the _qt5 marked with ^^^^ - theoretically that should resolve, but for me it did not. I tried all kinds of things to no avail. May be my ignorance of some setting.
I expected ekhumoro's instructions to work, since the edits suggested for the 3 files - see (XXX) - configure Make to create libraries with _qt5.
I tried many things - symlinks, etcetc., but at the end of the day, leaving out (XXX) allowed everything to proceed properly.
So - in summary, *if you don't need to have QScintilla work simultaneously with PyQt4 and PyQt5*, do ekhumoro's advice minus the stuff at (XXX) - that way, Eric should install without problems.
Take care with the information above: it will probably clobber QScintilla libs for Qt4

I guess the most important is --pyqt=PyQt5 which leads to using sip/qscimod5.sip instead of sip/qscimod4.sip. Difference is that it contains line %Import QtWidgets/QtWidgetsmod.sip which is essential for QAbstractScrollArea.

Related

unable to execute 'x86_64-conda_cos6-linux-gnu-gcc': No such file or directory (pysam installation)

I am trying to install pysam.
After excecuting:
python path/to/pysam-master/setup.py build
This error is produced:
unable to execute 'x86_64-conda_cos6-linux-gnu-gcc': No such file or directory
error: command 'x86_64-conda_cos6-linux-gnu-gcc' failed with exit status 1
There are similar threads, but they all seem to address the problem assumig administriator rights, which I do not have. Is there a way around to install the needed files?
DISCLAIMER: This question derived from a previous post of mine.
manually installing pysam error: "ImportError: No module named version"
But since it might require a different approach, I made it a question of its own.
You can also receive the same error while installing some R packages if R was installed using conda (as I had).
Then just install the package by executing: conda install gxx_linux-64 to have that command available.
Source:
https://github.com/RcppCore/Rcpp/issues/770#issuecomment-346716808
It looks like Anaconda had a new release (4.3.27) that sets the C compiler path to a non-existing executable (quite an embarrassing bug; I'm sure they'll fix it soon). I had a similar issue with pip installing using the latest Miniconda, which I fixed by using the 4.3.21 version and ensuring I was not doing something like conda update conda.
See https://repo.continuum.io/miniconda/ which has release dates and versions.
It should now be safe to update conda. This is fixed in the following python packages for linux-64:
python-3.6.2-h0b30769_14.tar.bz2
python-2.7.14-h931c8b0_15.tar.bz2
python-2.7.13-hac47a24_15.tar.bz2
python-3.5.4-hc053d89_14.tar.bz2
The issue was as Jon Riehl described - we (Anaconda, formerly Continuum) build all of our packages with a new GCC package that we created using crosstool-ng. This package does not have gcc, it has a prefixed gcc - the missing command you're seeing, x86_64-conda_cos6-linux-gnu-gcc. This gets baked into python, and any extension built with that python goes looking for that compiler. We have fixed the issue using the _PYTHON_SYSCONFIGDATA_NAME variable that was added to python 3.6. We have backported that to python 2.7 and 3.5. You'll now only ever see python using default compilers (gcc), and you must set the _PYTHON_SYSCONFIGDATA_NAME to the appropriate filename to have the new compilers used. Setting this variable is something that we'll put into the activate scripts for the compiler package, so you'll never need to worry about it. It may take us a day or two to get new compiler packages out, though, so post issues on the conda-build issue tracker if you'd like to use the new compilers and need help getting started.
Relevant code changes are at:
py27: https://github.com/anacondarecipes/python-feedstock/tree/master-2.7.14
py35: https://github.com/anacondarecipes/python-feedstock/tree/master-3.5
py36: https://github.com/anacondarecipes/python-feedstock
The solution that worked for me was to use the conda to install the r packages:
conda install -c r r-tidyverse
or r-gggplot2, r-readr
Also ensure that the installation is not failing because of admin privileges.
It will save you a great deal of pain
After upgrading Golang to 1.19.1, I started to get:
# runtime/cgo
cgo: C compiler "x86_64-conda-linux-gnu-cc" not found: exec: "x86_64-conda-linux-gnu-cc": executable file not found in $PATH
Installing gcc_linux-64 from the same channel, has resolved it:
conda install -c anaconda gcc_linux-64
Somewhere in your $PATH (e.g., ~/bin), do
ln -sf $(which gcc) x86_64-conda_cos6-linux-gnu-gcc
Don't put this in a system directory or conda's bin directory, and remember to remove the link when the problem is resolved upstream. gcc --version should be version 6.
EDIT: I understand the sentiment in the comments against manipulating system paths, but maybe we can use a little critical thinking for the actual case in hand before reciting doctrine. What actually have we done with the command above? Nothing more than putting an executable (symlink) called x86_64-conda_cos6-linux-gnu-gcc in one's personal ~/bin directory.
If putting something in one's personal ~/bin directory broke future conda (after it fixes the C compiler path to point to gcc it embeds), then that would be a bug with conda. Would the existence of this verbosely named compiler mess with anything else? Unlikely either. Even if something did pick it up, it's just your system gcc after all...

Python3.5 installation fails: cannot open libpython3.5m.so.1.0

I'm trying to install Python 3.5.2 on CentOS 7. The build appears to succeed, but executing python3 elicits
python3: error while loading shared libraries: libpython3.5m.so.1.0: cannot open shared object file: No such file or directory
I checked this question as the only link that appeared to help. ldd does show the file as missing, and it does not seem to exist anywhere, although /usr/lib/libpython3.5m.so exists.
By any chance, is /usr/lib/libpython3.5m.so the correct file? I have no problem making a link, but I don't want to shoot myself in the foot if it's wrong. I also wonder whether there are related layers of yak fur waiting for me. Perhaps I need to make clean and rebuild with other options?
Much along the same lines as the quoted question, I still need to repair LD_LIBRARY_PATH. The global solution is at least a workaround:
export LD_LIBRARY_PATH=/usr/lib/
The problem was mostly in locating the wayward file.
You should make it by ./configure --enable-shared
then
make && make install
after that,
vim /etc/ld.so.conf.d/python3.conf && and add a new line
/usr/local/lib
try /sbin/ldconfig
hope it works !

make: Nothing to be done for `STAR'

I want to test rna-star code. I have Ubuntu 12.04 on my machine.I have downloaded all the packages necessary:
sudo apt-get update
sudo apt-get install g++
sudo apt-get install make
But in the installation step I have problem running make command on STAR executable file.on the installation manual I see it says:
Unzip/tar STAR_x.x.x.tgz file into a directory of your choice <
STARsource >, cd < STARsource > and run make. The source code will be
compiled and the STAR executable will be generated.
when I run 'make STAR' it says:
make: Nothing to be done for `STAR'.
any suggestion?
This means that the "STAR" target does not exist. In a makefile, you define targets (implicit or explicit) and make takes care of building in the correct orders the dependencies for your target.
You should read documentation on this project or glance at the makefile : it's likely you need to run "make" without parameters (which is stated in your documentation excerpt), something like :
tar zxvf star...tgz
cd star...
make
So I just ran into the same problem.
Apparently the following solved it:
Redirect to source map: cd STAR-2.5.3a/source
The Makefile is in this location, after this just enter the command make.
It should start running. If you work in a cluster do not forget to edit your shell configuration before using;
export PATH=$HOME/STAR-2.5.3a/source:$PATH

How to compile GTK2 source code?

I'm trying to modify GTK2 on Ubuntu Oneiric.
I download the source:
apt-get source libgtk2.0-0
cd gtk+2.0-2.24.6/
I try to compile and overwrite the current GTK2:
./configure --prefix=/usr
sudo make
Soemhow I get an error (I have all the necessary libraries and the build-essential package etc):
In file included from gtkquery.c:26:0:
gtkquery.h:31:2: error: #error "gtkfilechooserprivate.h is not supported API for general use"
By the way, I am able to modify and recompile GTK3 with no problems with the same steps.
If use debuild, I get thousands of
dpkg-source: error: cannot represent change to gtk+2.3.0-2.24.6/gtk+2.0-2.24.6/something: binary file contents changed
You won't get anything near the Ubuntu-provided build if you try building it by hand that way -- you'll miss all the ./configure options and other settings. (Look into debian/rules for the full details of what they're setting.)
Instead, try debian/rules build.
For reasons I haven't investigated yet (possibly including me not understanding how it should work), that didn't work on the first package I tried, but setting up pbuilder let me build the package I wanted.
It might feel like overkill to get a clean chroot as a build environment, but it is way too easy to build yourself problems that no one else in the world can replicate because you've got something funny on your local system.

Cannot run Code::Blocks: libwx_gtk2u-2.8.so.0 not found

I am trying to install Code::Blocks 10.05 from (non-SVN) sources (codeblocks-10.05-src.tar.bz2). My OS is Ubuntu 11.04. I needed to download and install wxWidgets first (I now have wxGTK-2.8.12), which seemed to work. I compiled it according to these instructions:
http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Linux
Then I configured C::B with
./configure --with-wx-config=/opt/wx/2.8/bin/wx-config
and ran
export LDFLAGS="-Wl,-R /opt/wx/2.8/lib"
make
sudo -i
make install
When trying to run C::B, I get the following error:
codeblocks: error while loading shared libraries: libwx_gtk2u-2.8.so.0: cannot open shared object file: No such file or directory
The same question was asked here: error while loading shared libraries, but the suggested solution (namely adding the wxWidgets config to the options passed to configure) didn't work for me.
The output of wx-config --prefix is /opt/wx/2.8,
The output of wx-config --libs is -L/opt/wx/2.8/lib -pthread -lwx_gtk2u-2.8,
and that of which wx-config is /opt/wx/2.8/bin/wx-config.
I looked for the library and found /opt/wx/lib/libwx_gtk2u-2.8.so.0 to be a link to libwx_gtk2u-2.8.so.0.8.0 in the same folder.
What might be wrong here?
The problem is that the program cannot find the WX widgets libraries at run time. You will need to set your LD_LIBRARY_PATH variable to include the location of wxWidgets like this:
LD_LIBRARY_PATH=/opt/wx/2.8/lib ./codeblocks
The reason why its failing is because you compiled codeblocks against wxWidgets found in /opt/ and not the one installed in /usr/; the program doesn't know to look in /opt for the wx libraries.
Probably the easiest way to get code::blocks up and running on Ubuntu is to just install it via the Synaptic Package Manager. Just type in codeblocks into 'Quick search'. Find codeblocks on the list and just right-click to mark for install. Any dependencies and missing libraries needed will automatically be handled and installed by Synaptic as necessary.
If you're interested in trying the C::B nightly builds on Ubuntu then you'll want to checkout Jens' unofficial debian-repository here.
You can visit Why do I have to define LD_LIBRARY_PATH with an export every time I run my application? for a more generic case. For a particular case like yours you can follow the below given steps
If you had installed wxGTK then you would see the file in /usr/local/lib. You would get this error when the the above path is not as part of the makefile. I received this error while starting wxFormBuilder after building from source on CentOS. There are 2 approaches.
Approach 1: Putting the path in .bashrc
gedit /home/{your-username}/.bashrc
Then after the line # User specific aliases and functions paste the following
export $LD_LIBRARY_PATH=/usr/local/lib.
This would work for fine but for the current login, but for other users like root you might have to do the same in the respective .bashrc files.
Approach 2: Creating your own conf files
cd /etc/ld.so.conf.d
gedit wxformbuilder.conf
Give the path /usr/local/lib and save the file.
ldconfig (To update the library path).

Resources