Ubuntu WSL is listed in Clion toolchains but says "not found" - windows-10

Unlike this question or this one, CLion seems to detect the WSL correctly:
You can see that Ubuntu-20.04 is listed but still not found :
Versions :
Windows 10 : 1803
WSL : 1 (since windows 1803 does not support WSL 2)
WSL Distrib : Ubuntu 20.04 from Windows store
CLion : 2021.2.3
Has anyone ever faced this issue?

The issue seem to be, that clion can't find the cmake, C compiler, or C++ compiler of the WSL. My guess is that you haven't installed those yet.
You can install gcc with:
sudo apt install build-essential
This article explains how to build cmake:
Go to — https://cmake.org/files/ That shows all the list of the versions of cmake, I use cmake-3.15.0-rc1.tar.gz.
Open your terminal or bash and download it.
wget https://cmake.org/files/v3.15/cmake-3.15.0-rc1.tar.gz
After downloading, then untar.
tar -xvzf cmake-3.15.0-rc1.tar.gz
cd cmake-3.15.0-rc1/
./bootstrap
sudo make
sudo make install
cd /bin/
sudo cp cmake /usr/bin/
Now don’t forget we are currently in cmake-3.15.0-rc1/ just go back by entering cd ... that takes you up one directory back.
Now copy the directory to /usr/bin/share
sudo cp -r cmake-3.15.0-rc1/ /usr/share/cmake-3.15
export CMAKE_ROOT=/usr/share/cmake-3.15
After you have done that, clion should be able to detect everything correctly.

I asked the CLion support and this if the answer (which fixed my problem)
Actually, the best way to solve this is to update Windows. If it's not possible, then in CLion go to Help | Find Action, type "Registry...", select it and in the opened list find and and disable the wsl.execute.with.wsl.exe option. It should help.

Related

Intellij IDEA 2017.2 can't add openjk 9 on Linux Mint 18

I am using Intellij IDEA 2017.2.5 on Linux Mint 18.2 and trying to add new openjdk-9 SDK but IDEA does not accept openjdk 9 as valid JDK:
I have installed all of my SDKs using apt-get from ppa standard repositories.
This is my update-alternatives --config java/javac output:
Although Intellij declared it would support JDK 9 here, but it seems it is not yet fully compatible with at least opensdk-9.
Maybe refactoring SDK directory and removing 'jre' folder misleads the IDEA to find the SDK 9 home folder.
Any idea why Intellij IDEA claims 'The selected directory is not a valid home for JDK' ?
“ Ubuntu PPA for OpenJDK” currently has very old build of openjdk-9(9~b115-1ubuntu1).
So the IDEA does not recognize it as a valid SDK.
I removed current installed version:
sudo apt-get remove '^openjdk-9.*'
Then I have downloaded newer .deb build(9~b181) files including jre,jre-headless,... from launchpad build archive.
sudo dpkg -i openjdk-9-jre-headless_9_b181-4_amd64.deb
openjdk-9-jre_9_b181-4_amd64.deb
openjdk-9-jdk-headless_9_b181-4_amd64.deb
openjdk-9-jdk_9_b181-4_amd64.deb
Just Execute the above command at a single line, line breaks are for better readability.
Ignore any error complaining about:
"Package libpng16-16 is not installed."
Next execute the following:
sudo apt-get install -f
Now after installing this build of openjdk-9 the IDEA is happy with SDK home.
Thanks #y.bedrov for his useful comment.
Update:
However this solution enables you to declare openjdk-9 in the mentioned IDEA version(2017-2) but you are not able to compile any class within the IDEA itself.
You can only compile your application with elder jdk and run it with openjdk-9. There is an other issue which indicates this here.
In the newer IDEA versions(I have tested 2017.3) this build of openjdk is not allowed to be used as new SDK any more, see this issue.
The short reason is an issue in Debian package which contains incorrectly compiled lib/jrt-fs.jar file.
See this Answer for more information

Open MPI Files Can´t Be Found For (RegCM) Installation

I tried to install a climate modelling programm (RegCM) for which I used Ubuntu on VMware Workstation, GNU fortran compiler and Open MPI.
Like suggested [https://gforge.ictp.it/gf/download/docmanfileversion/35/758/Install_RegCM4.3.pdf] I installed the GNU fortran compiler, Open MPI, unpacked RegCM Version 4.4.5 and configured RegCM (./configure CC=gcc FC=gfortran).
In 'sudo make' the Error
'Error: Can't open included file 'mpif.h''
appears. In 'RegCM-4.3.5.8/Main/mpplib' which was searched is no file with that name but one can be found in 'openmpi-1.10.2/ompi/include'. Just to give it a try copied 'mpif.h' in the searched directory.
It worked but now a new Error appeared:
'Can't open included file 'mpif-config.h''
which again can be found in 'openmpi-1.10.2/ompi/include'. Again copied the same Error arised with another file.
I also tried a older Version of RegCM (4.3) with the same effect.
Any suggestions on this?
? Which version of Ubuntu are you using ? Like "Ubuntu 16.04 - amd64".
mpif.h, mpif-config.h : sudo apt-get install libopenmpi-dev
Note : RegCM-4.3.5.8 is buggy. No luck with '4.3.5.8' here, any contemporary OS. RegCM-4.5.0 → RegCM-4.5.0.tar.gz
https://gforge.ictp.it/gf/download/frsrelease/252/1580/RegCM-4.5.0.tar.gz builds with no errors : Tested with Ubuntu 16.04 - 64bits and PCLinuxOS2016 -32bits.

Qt Creator 3.0.1 + GDB 7.4 : debug doesn't work

On my Linux Mint 13, if I try to debug my Qt application, I see in the output:
&"warning: GDB: Failed to set controlling terminal: Invalid argument\n"
If I try to break execution, I see in the status line: Stop requested... , and after several seconds: Attempting to interrupt. That's it, nothing more.
I've seen some old questions related to similar issue, and I found the only answer here, but it doesn't work for me, unfortunately: I have created file /etc/ld.so.conf.d/Qt.conf with the following contents:
# Qt libraries
/opt/Qt5.2.1/5.2.1/gcc/lib
But nothing changed.
UPD: After Qt Creator restart, behavior changed a bit: now it stucks on the "Setting breakpoints..." stage, and after 40 seconds shows this message:
The gdb process has not responded to a command within 40 second(s).
This could mean it is stuck in an endless loop or taking longer than
expected to perform the operation. You can choose between waiting
longer or aborting debugging.
I also upgraded gdb to latest 7.7: I installed libncurses5-dev package: sudo apt-get install libncurses5-dev , which is needed to build gdb.
I downloaded latest gz archive from http://ftp.gnu.org/gnu/gdb to the temporary folder, and executed the following commands:
tar xvfz gdb-*.gz
cd gdb*
./configure
make
cp gdb/gdb /usr/local/bin
I also set up my Qt project to use gdb from /usr/local/bin . It is used now, but nothing is changed.
By the way, in Windows it works. How to solve it in Ubuntu 12.04 (Linux Mint 13)?

Advice regarding installing ARM toolchain on Ubuntu VM (64bit)

Trying to compile Linux kernel for arm platform on a Ubuntu virtual machine
$make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
It fails as follows
arm-none-linux-gnueabi-gcc: not found
Tried to install
$sudo apt-get install arm-none-linux-gnueabi-gcc
E: unable to locate package arm-none-linux-gnueabi-gcc
Where to find the correct package? how to include it in the system? (I found a couple of links on line that didn't work for me). It would be great if you could provide a correct solution or reference.
The Ubuntu package names are gcc-arm-linux-gnueabi/gcc-arm-linux-gnueabihf.
For building the kernel, which one you use does not make much difference. For building anything else, "gnueabihf" is the hard-float version. For any modern ARM processor (this statement excludes the Raspberry PI), this is the one you would want.
Download arm-2013.05-24-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 from https://sourcery.mentor.com/GNUToolchain/
or https://sourcery.mentor.com/sgpp/lite/arm/portal/subscription?#template=lite
Get correct version of the arm-none-linux-gnueabi toolchain (i.e. targetting GNU/Linux rather than EABI).
untar it
tar xvf arm-2013.05-24-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
open bashrc
vi .bashrc
at the end add below comand
export PATH=$PATH:{path to toolchain}arm-2013.05/bin
e.g export PATH=$PATH:/home/vinay/under_linux/arm-2013.05/bin
save it and quit the terminal.
then you can cross-compile without everytime export.
Also take of correct toolchain there are two toolchain available choose according to your requirement.
Cross compile error "arm-none-eabi-g++ cannot find entry symbol"

can't run stipdet in open cv

I 'm trying to run some precompiled code (source code is not available) on Ubuntu, which requires openCV to be installed. I installed the latest version of openCV (from the SVN) yesterday, and installed it according to the debian install guide on the openCV website (cmake -> make -> sudo make install) and everything seemed to go fine.
I tried to run stipdet program but this gives me following error.
bash: ./stipdet: cannot execute binary file
Please can anyone help me with this error?
What does:
file $(which stipdet)
...say? I'm guessing it was built for a CPU you don't have.
You need to run chmod 755 ./stipdet to make stipdet executable.

Resources