Executing sudo make install in Eclipse CDT? - c++

I'm contributing to OpenCV using Eclipse Neon.
I edited the Build command in Project->Proprieties->C/C++ Build->Build command as sudo make -j8 install, so when I build the project, Eclipse compiles OpenCV and then install it in my system.
However, this is the returned error:
sudo make -j8 install all
sudo: no tty present and no askpass program specified
I think that this is because sudo asks the password and Eclipse can't give it. How can I do this? I've found this [question][1] on the topic, but I didn't understood the given [answer][2]

Instead of using sudo use an alternative, which uses GUI, like gksudo on Gnome / LXDE or kdesudo on KDE.
If you want to use sudo, you have to put the line
john ALL = NOPASSWD: /usr/bin/make
into the file /etc/sudoers, where john is your user name and /usr/bin/make is the path to the make executable. With this line, you can start make with sudo, but without enter the credentials.
But instead of entering this line directly to /etc/sudoers, you should better call sudo visudo, which opens the sudoers file in an editor and if you close the program, it checks the changes you made on the file.

Related

How to build PythonQt in ubutnu

I want to embed the python script in my c++ Qt application, By searching on the net I found that PythonQt is exactly what I am looking for but when I went to it's github repo there is build description given for windows system but not for ubuntu system so after cloning the repo if I include it's src in my Qt .pro file it gives me output that
Python.h not found, I think the reason is that I didn't build it in my system. Is there anyone who could tell me that how to build PythonQt in ubuntu. The link for their repo is this: https://github.com/MeVisLab/pythonqt
If this didn't work you can also suggest me some other thing which will help me to embed python scripts into my Qt c++ application.
First clone the repo by using the following command
https://github.com/MeVisLab/pythonqt.git
After that cd into the clone folder and execute the below command to build it into your system.
qmake
This command will generate the MakeFile into your current directory run the following command to completely build the PythonQt in your system.
sudo make all
sudo make install
While executing those commands if you get the following error
fatal error: 'private/qmetaobjectbuilder_p.h'
Run the below command to solve this
sudo apt install qtbase5-private-dev

Installing c++ boost using cygwin: can't find configure file

I'm trying to install Boost for c++. Since I use cygwin (on Windows 7) I follow these instructions for Unix.
I start by downloading boost_1_55_0.zip from sourceforge. The instructions tell me to run tar --bzip2 -xf /path/to/boost_1_55_0.zip but this doesn't work (probably because the downloaded file is .zip and not .tar.bz2; I can't find the latter anywhere to download), so instead I use winrar and unzip it into /usr/local.
After this the header-only libraries work fine, but I need the ones where a build is necessary.
The instructions tells me to go to the boost folder and run./configure --help, but this doesn't work; I get the message -bash: ./configure: No such file or directory. So I locate the file configure in the folder /usr/local/boost_1_55_0/tools/build/v2/engine/boehm_gc, go there and try again, and this time it works: I get the help for configure.
I then try to run ./configure --prefix=/usr/local/boost_1_55_0 --enable-cplusplus but get the error message configure: error: cannot run /bin/sh ./config.sub. I try it with only one or none of the options too but that doesn't help.
Any ideas?
I don't know what guide you're following, but to install boost I have done:
cd boost
./bootstrap.sh
./b2
./b2 install
stop
As report boost doc:
If you plan to build from the Cygwin bash shell, you're actually
running on a POSIX platform and should follow the instructions for
getting started on Unix variants. Other command shells, such as
MinGW's MSYS, are not supported—they may or may not work.

How to build and install Valgrind on Mac?

I am on Mac OS X using codeblocks 10.05
I downloaded Valgrind, and extracted a folder. I am completely lost from there, and have no idea how to build it.
I do not know ANY terminal/console commands and am generally new to programming, so I have no idea how to "build" or "compile" it. I just have a folder called Valgrind with a bunch of random files in it.
Could someone please tell me how to proceed? I already checked the website/documentation but it didn't really give me installation instructions, just usage instructions.
Thanks
PS: I know I already posted this question, but the previous question was shut down, for being too vague. I reposted this one with more info.
PSS: All that I am basically asking is what do I do to install Valgrind right after I download it from the website and extract the files?
Recommended:
Use brew: brew install valgrind
Manual Install:
Here's what worked on my Mac (10.6). Double-check you have the latest version, then change into the uncompressed directory
cd /users/(insert username here)/downloads/valgrind-3.17.0
I suggest you do as another posted and read the readme.
nano README
Commence the build; /usr/local is the place on the filesystem that the program will be installed to. There are many arguments like prefix that are available to customize the installation to your particular system if it doesn't work by default. Normally just using ./configure works perfectly well though.
./configure --prefix=/usr/local
make
sudo make install
Or you could probably get it from fink or macports or homebrew.
You can install it through brew for Mac:
brew install valgrind
You might have to manually link the entry to /usr/local/bin as brew refused to do it in my case:
$ ln /usr/local/Cellar/valgrind/3.8.1/bin/vgdb /usr/local/bin/vgdb
ln: /usr/local/bin/vgdb: Permission denied
$ sudo ln /usr/local/Cellar/valgrind/3.8.1/bin/vgdb /usr/local/bin/vgdb
On MacOS High Sierra
If you have the following error message:
brew install valgrind
valgrind: This formula either does not compile or function as expected on macOS
versions newer than Sierra due to an upstream incompatibility.
Fix
(1) To correctly install it, first, type the following command at the Terminal (which opens Valgrind’s formulae)
brew edit valgrind
And change the URL in head section
https://sourceware.org/git/valgrind.git
to
git://sourceware.org/git/valgrind.git
(2) Do an update for Homebrew:
brew update
(3) Finally, use the following command to install Valgrind from the HEAD:
brew install --HEAD valgrind
Sources
https://www.gungorbudak.com/blog/2018/04/28/how-to-install-valgrind-on-macos-high-sierra/
https://github.com/Homebrew/homebrew-core/issues/18998
For macOS Big Sur / Monterey:
brew tap LouisBrunner/valgrind
brew install --HEAD LouisBrunner/valgrind/valgrind
The core process is pretty simple:
Make sure you are in the correct directory.
First run:
./configure
when that is finished, run:
make
at this point you will need to su into root (this is relatively tricky to do, see the note at the end). As root, run:
make install
When this is finished you will have a working valgrind installation. Test it by running
valgrind ls -l
To su into root, you will need to have set up a root account. If you have not done this in the past, see the instructions from apple here.
To perform the actual su, you will first have to be running an account with administrator privileges. If you are not already doing so, you can switch users with the following:
su admin
where admin is the name of an user with administrator privileges (you will need to enter the password for this account). From there, you can then run su to go into root:
su
You will need to enter the root password that you set up earlier.
You may find it easier to use something like macports. How to install that is probably beyond the scope of this question, but they have a page dedicated to it on their site.
Once you have macports installed, you need to type:
sudo port install valgrind +universal
As you say you don't have any experience of command lines, let's just briefly go through the different parts of this command:
sudo means the rest of the command will run as root, and will ask for your password. This is needed for the installer to have the correct permissions
port is the command line tool for managing macports
install is a command for port. Try port help to see a list of commands.
valgrind tells macports what it should be installing
+universal is a variant. This tells macports to configure valgrind to support 32 bit and 64 bit support.

error while configuring Qt 4.6.2 on ubuntu - "You don't seem to have 'make' or 'gmake' in your PATH. cannot proceed"

I am trying to install Qt 4.6.2 on ubuntu. When I run the configure script I get the following error message "You don't seem to have 'make' or 'gmake' in your PATH. cannot proceed".
On echo of the PATH variable I get
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
on running the command
$which make , I get
/usr/bin/make
How do I proceed with this issue? I seem to have the make in the path env variable but still the config script throws cannot find make or gmake?
It not the problem of make or gmake, nor PATH, Just because you unzip the tarball without -a option. so, to solve this problem, just use 'unzip -a *.zip', it will be fine.
I recently encountered this error in a fedora32 docker container, because the which utility was not installed. I was compiling Qt 5.12.9.
dnf install which fixed the problem.
You should have been installed build-essentials but did not restart try either to restart or type:
export MAKE=/usr/bin/make
and make sure with echo $MAKE
I downloaded the source again. I am able to run configure without any problems. Seems like there was an issue with the earlier source.
you should install build essentials
sudo apt-get install build-essential
and typesudo apt make install

How do I install Audiere?

I'm trying to install PyAudiere (on MacOS 10.5), and it needs Audiere installed. I downloaded the Unix source from the Audiere website and ran configure and the makefile. I also tried adding audiere.h to the g++ include path with the command:
g++ -I /[...]/audiere-1.9.4/src audiere.h.
This did something, but I'm not sure what. When I try to install PyAudiere using
python setup.py install
it always says
error: audiere.h: No such file or directory.
Have I installed Audiere? If not, how do I do it?
Disclaimer: I know virtually nothing about mac OS
If you have run configure:
./configure
and the makefile:
make
Have you then run:
make install
Without running make install you have simply compiled the files but not installed them into your system. Under linux you might have to run sudo make install in order to get the administrative privileges required to install files.