/bin/sh: mpic++ command not found in Eclipse for Parallel Application Developers - eclipse

I'm trying to use Eclipse for Parallel Application Developers to do some MPI stuff but I can't get the program to compile. Below is the error I'm getting in the console:
Description Resource Path Location Type
/bin/sh: mpic++: command not found prog C/C++ Problem
I use mpic++ from the command line (bash shell) to successfully compile programs. When I run the command using bourne shell I get an error.
/bin/sh mpic++
/usr/local/bin/mpic++: /usr/local/bin/mpic++: cannot execute binary file
When I use sudo I still get the same error. But when I first change to the bourne shell then run the mpic++ command it works.
/bin/sh
sh-3.2$ mpic++
clang: error: no input files
I've been looking at ways to change the shell used by eclipse so I can use the bash shell because I can call mpic++ without any problems. I've also tried launching eclipse with sudo but that didn't work.

I have compiled mpi in eclipse successfully. Please follow the steps:
In terminal type:
$ which mpicxx
/usr/local/bin/mpicxx
You should get the mpicxx binary path as result. I have my mpicxx in /usr/local/bin/ directory.
In eclipse, go to project properties:
Set GCC C Compiler as: /usr/local/bin/mpicxx
Also set GCC C+ Compiler as: /usr/local/bin/mpicxx
Set MacOS X C++ Linker as: /usr/local/bin/mpicxx. Also set All options as -L/usr/local/lib

Related

Cannot run 'make' in VScode Terminal

For a school assignment, I am trying to compile a C file using a provided Makefile in Vscode. The makefile contains the following:
CFLAGS += -std=gnu11 -g
EXES = greet
all: $(EXES)
clean:
rm -f $(EXES)
greet: greet.c
# don't treat all and clean as file targets
.PHONY: all clean
When I run make in the VScode terminal, it gives me:
bash: make: command not found
Why is this happening? The assignment says this:
The accompanying Makefile will build the program greet. Thus, you can compile the
program by running make. The make program will print out each command that it uses to
compile the program. Note that if you run make twice in a row, the second time it won’t do
anything, because it knows your source file hasn’t changed.
Run the program using the following command:
./greet
I don't know if this has anything to do with my tasks.json file in VScode?
I also ran across this VSCode extension: https://naereen.github.io/Makefiles-support-for-VSCode/
It says Vscode now has something built-in: https://github.com/microsoft/vscode/tree/master/extensions/make
I don't know how to install this.

Command line tools not accessible from Eclipse on OSX

I am using Eclipse on a macOS machine. CMake is present on my machine at /usr/local/bin/cmake and has been installed using Homebrew. Eclipse is at the latest version (2018-09).
I have the following target in a Makefile, which has been set up and is visible from Eclipse:
all:
./configure
Rscript -e "Rcpp::compileAttributes()"
R CMD INSTALL --no-multiarch --with-keep.source .
Inside the configure file, there is this code:
cd src/build;cmake ..
However, when I double click the all target in Eclipse, I get the following message:
make all
./configure
./configure: line 1: cmake: command not found
make: *** [all] Error 127
I remember that some time ago this target worked out of the box on macOS. I can also launch CMake from a terminal without any trouble.
echo $PATH shows different behaviour:
If called from a standard macOS terminal, it yields /usr/local/sbin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin
If called from a TM Terminal inside Eclipse, it yields /usr/bin:/bin:/usr/sbin:/sbin
What is the most canonical way to have Eclipse detect my CMake installation ?
For macOS High Sierra 10.13.6, the solution provided here works. This must be performed to see the changes immediately.

Setting up GTK+ on Mac

I'm trying to set up GTK on Mac but keep getting errors while compiling my code. I'm new to Mac so don't have a lot of knowledge. I installed GTK using homebrew. The current version installed is GTK 2.24.28_2. While compiling the program I get the following errors:
clang: error: no such file or directory: 'pkg-config --cflags gtk+2.24.28_2'
clang: error: no such file or directory: 'pkg-config --libs gtk+2.24.28_2'
Wrong quote types. You want backticks, `, which are to the left of the 1 key. You're using straight quotes, ', which are to the left of the Return key.
In addition, the name of the package that you give to pkg-config is just gtk+-2.0; the rest of the version number doesn't go there.
Technical explanation: the shell takes anything between `...`, runs it as a command, and inserts the output of that command back into the command line. The shell takes everything between '...' and places it as a single string unprocessed in the command line. So you're not running pkg-config at all; instead, you're passing the whole pkg-config invocation as an argument, which is not what you want. pkg-config's job is to print the flags that gcc/clang need to find a package, so you use `...` to run pkg-config and copy those flags back into your gcc/clang command line instead.

Cannot install Date::Calc perl module

I'm running Solaris on my machine and I would need to install the Date::Calc perl module in order for one of my scripts to work.
When I run the following command:
sudo perl -MCPAN -e 'install Date::Calc'
I get the following error:
Tests succeeded but one dependency not OK (Bit::Vector)
STBEY/Date-Calc-6.3.tar.gz
[dependencies] -- NA
Running make install
make test had returned bad status, won't install without force
I have no prior experience in Perl development, so I have no clue about what the error might be or where to get more information.
What should I do to fix this?
When trying to install Bit::Vector first, i.e. when running the following command:
sudo perl -MCPAN -e 'install Bit::Vector'
i get the following error message:
Checking if your kit is complete...
Looks good
Writing Makefile for Bit::Vector
Writing patchlevel.h for /usr/bin/perl (5.012003)
cp lib/Bit/Vector/Overload.pm blib/lib/Bit/Vector/Overload.pm
cp Vector.pm blib/lib/Bit/Vector.pm
cp Vector.pod blib/lib/Bit/Vector.pod
cp lib/Bit/Vector/Overload.pod blib/lib/Bit/Vector/Overload.pod
cp lib/Bit/Vector/String.pod blib/lib/Bit/Vector/String.pod
cp lib/Bit/Vector/String.pm blib/lib/Bit/Vector/String.pm
cc -c -DPTR_IS_LONG -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV -xO4 -DVERSION=\"7.2\" -DXS_VERSION=\"7.2\" -KPIC "-I/usr/perl5/5.12/lib/i86pc-solaris-64int/CORE" BitVector.c
sh: line 1: cc: not found
*** Error code 127
make: Fatal error: Command failed for target `BitVector.o'
STBEY/Bit-Vector-7.2.tar.gz
/usr/bin/make -- NOT OK
'YAML' not installed, will not store persistent state
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible
I installed gcc via the following commands (as adviced here):
pkg install gcc-45
pkg install system/header
but I still get the same error when trying to install Bit::Vector. Indeed, when I type cc on the command-line, I get the command not found error. When I type gcc, however, I get gcc: no input files.
The error means that Bit::Vector (a dependency of Date::Calc) failed to install for some reason. Bit::Vector requires compiling C code, which means your CPAN configuration will need access to the C compiler and libraries (and headers) that were used to build your perl.
From what I understand, that can sometimes be painful on Solaris.
If you have another C compiler available, you might consider building and installing a local Perl using perlbrew.
So it turns out that the only option is to install the Oracle Solaris Studio prior to installation of new perl modules which need to compile C code.
From a related discussion at Oracle Solaris forum:
CC modification in /usr/perl5/5.12/lib/i86pc-solaris-64int/Config.pm
will not resolve the compilation issue. New errors will be produced
and some part will not use this variable.
By default, this method to build modules will use perl compiled
options. And in this case, as we used Oracle Studio, this software
will be required because some options are not available with gcc.
I tried with Oracle Studio, and the compilation was done successfully.
If you want to use gcc, then this will be very tricky to modify
several perl config files. An another method is to compile manually
each necessary modules after you customize each Makefile.

How to uninstall opencv in Ubuntu?

I have the following system:
Linux 64 bit LTS 12.04
I have multiple installations of opencv library on the system.
I want to know the procedure to remove all opencv libraries from the system.
I am having trouble while executing my program through Eclipse IDE.
Though I can build the project when I try to execute it, it gives the following error:
OpenCV Error: Assertion failed (k == STD_VECTOR_MAT) in release, file /build/buildd /opencv-2.3.1/modules/core/src/matrix.cpp, line 1364
terminate called after throwing an instance of 'cv::Exception'
what(): /build/buildd/opencv-2.3.1/modules/core/src/matrix.cpp:1364: error: (-215) k == STD_VECTOR_MAT in function release
Confusing thing is I am not able to find the path specified in the error i.e.
/build/buildd/opencv-2.3.1/modules/core/src/matrix.cpp
I am able to compile the same source code using command line tool gcc and using pkg-config.
However I am unable to do the same through eclipse IDE.
You can also uninstall by going to the "build" folder directory of opencv from terminal, and execute the following
make uninstall
cd ..
sudo rm -r build
sudo rm -r /usr/local/include/opencv2 /usr/local/include/opencv /usr/include/opencv /usr/include/opencv2 /usr/local/share/opencv /usr/local/share/OpenCV /usr/share/opencv /usr/share/OpenCV /usr/local/bin/opencv* /usr/local/lib/libopencv*
I remember I used this command a while ago to remove all opencv related things. It is interactive which promote you to remove the file. choose y or n depending.Take your time and be-careful
$> sudo find / -name "*opencv*" -exec rm -i {} \;
The correct way is cd /path/to/cv/build then sudo make uninstall. Of course you will have to have the source code with you
I tried the exec rm thing but nothing changed. Also FYI, sudo apt-get remove libopencv-* did not remove openCV for me