OPEN MPI is not working for me - centos

I have installed MPI and GCC seperatly using yum commands,
And now when I use following command:
mpic++ first.c -o first
it says:
bash: mpic++: command not found
Can somebody please help me? I will be very thankful.
Background: I am using centos 6.5, and i am new on linux, however I have good understanding of terminal.

Mpi environment is controlled by module in CentOS so you first have to load the mpi/openmpi-x86_64 module:
module load mpi/openmpi-x86_64

In my case (Centos 7.5) the module command was not available, so I just needed to add the MPI executables to my path.
I found their location by looking at the output of this command:
rpmquery -l openmpi-devel | grep cc
And then added the following to my path:
export PATH=$PATH:/usr/lib64/openmpi/bin/

See it: https://courses.cs.washington.edu/courses/csep524/13wi/mpi/mpi_setup.txt
I also install mpi from yum, but it can't help me. I use:
download mpich
cd
wget http://www.mpich.org/static/tarballs/3.0.2/mpich-3.0.2.tar.gz
tar xzf mpich-3.0.2.tar.gz
build mpich and install in home (can also see mpich-3.0.2/README)
cd mpich-3.0.2
./configure --prefix=$HOME/mpich-install 2>&1 | tee c.txt
make 2>&1 | tee m.txt
make install 2>&1 | tee mi.txt
put mpi binaries (e.g. mpicc, mpirun) on your PATH
add the following line to your ~/.bashrc:
export PATH=$PATH:~/mpich-install/bin
source ~/.bashrc
compile hello world:
mpicc helloworld.c -o helloworld
I get: cc: error: helloworld.c: No such file or director

Related

Not able to use npm cli in a github workflows

I want to use a npm cli utility (this one), inside a bash script and to run it via a github workflow.
This is my basic script:
folder="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
mkdir -p "$folder"/rawdata
mkdir -p "$folder"/processing
npm list -g --depth=0
rm "$folder"/rawdata/"$reg".png
capture-website --delay 5 --full-page --width 1280 --height 720 --output "$folder"/rawdata/"$reg".png "https://ondata.github.io/vaccinipertutti/?area=SIC"
I run it using this github workflow (it's Ubuntu 20.04.2 LTS), in which I set capture-website-cli installation in this way:
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
export PATH=~/.npm-global/bin:$PATH
source ~/.profile
NPM_CONFIG_PREFIX=~/.npm-global
npm install -g capture-website
But when the script runs I have this error:
./test.sh: line 13: capture-website: command not found
It seems that it has been not installed in ~/.npm-global.
If I run find /home/runner -executable -name capture-website I have
/home/runner/.npm-global/lib/node_modules/capture-website
Do you have some advice to solve my problem?
You might need to differentiate between:
capture-website
sindresorhus/capture-website-cli which provide a CLI (commannd-line interface) way to use that npm library (library means: no executable in .npm-global/bin)
You need to install the latter in your runner $PATH.
npm install --global capture-website-cli

ubuntu 16 install gstreamer but gstreamer-plugins-base-1.0.pc file is not found anywhere

(Using ubuntu 16 0n my mac pro.)
To integrate gstreamer and pocketsphinx, I need three .pc files as the offical website says:
gstreamer-1.0.pc
gstreamer-base-1.0.pc
gstreamer-plugins-base-1.0.pc
I start a new empty ubuntu 18.
install the gstreamer through
$ sudo apt-get install libgstreamer1.0-dev
But only two of the three important .pc files exist after the previous command.
If I cd to /usr/ and run :
sudo find . -print | grep -i 'gstreamer-plugins-base-1.0'
the terminal returns empty( not found).
At the same time,
sudo find . -print | grep -i 'gstreamer-base-1.0'
and
sudo find . -print | grep -i 'gstreamer-1.0'
will give me correct paths.
Where is the missing gstreamer-plugins-base-1.0.pc file? Thank you.
If there are only two but not three of the .pc files, the configuration of pocketsphinx will not work.
**sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev**
helped me generate the missing gstreamer-plugins-base-1.0.pc file.
Those two are needed.

cannot execute binary file centos?

I am using centos 6.9 and want to install xampp. But when I run the command on the terminal it showing error i.e. cannot execute binary file. So, How can I fix this problem and successfully install xampp ? Please help me.
chmod +x xampp-linux-x64-7.0.22-0-installer.run
./xampp-linux-x64-7.0.22-0-installer.run
after this command it showing
bash: ./xampp-linux-x64-7.0.22-0-installer.run: cannot execute binary file
You're probably running the install (binary) with a lesser privileged user. You'll have to use root user for modifying SELinux settings as such:
semanage fcontext -a -t httpd_sys_script_exec_t '/<install-location>(/.*)/?'
restorecon -R -v /<install-location>/

Difference between installing and using virtualenv "globally from source" and using it "locally from source"

https://pypi.python.org/pypi/virtualenv
says
To install globally from source:
$ curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-X.X.tar.gz
$ tar xvfz virtualenv-X.X.tar.gz
$ cd virtualenv-X.X
$ [sudo] python setup.py install
To use locally from source (and not be insecure as described in the warning above):
$ curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-X.X.tar.gz
$ tar xvfz virtualenv-X.X.tar.gz
$ cd virtualenv-X.X
$ python virtualenv.py myVE
Could someone please elaborate on the differences between installing and using virtualenv globally and using it locally (I am under the impression this is different than running virtualenv --no-site-packages)? Why is using it locally considered more secure?

How to set the rpmbuild destination folder

I noticed rpmbuild (-bb and --buildroot options) creates the .rpm in different locations depending of what OS are you using:
GNU/Linux Ubuntu <= 9.04: /usr/src/rpm/...
GNU/Linux Ubuntu >= 9.10: /home/rpmbuild/...
GNU/Linux Fedora: /usr/src/redhat/...
So how can I set manually the destination folder for all OS?
Replying myself, adding:
%define _rpmdir /outputdir
to .spec file.
You may want to use the command argument --define : For example, this will send the rpm files into the current directory.
rpmbuild anything.spec --bb --define "_rpmdir $(pwd)"
This will send the rpmsto output dir
rpmbuild anything.spec --bb --define "_rpmdir /outputdir"
Or perhaps something more complicated such as Custom gradle task for rpmbuild .
For me the solution was to set _topdir to a subdirectory called rpmbuild inside my project. I also set a few macros, to control the .rpm path:
rpm:
rpmbuild -bb package.spec -D "_topdir $(shell pwd)/rpmbuild" -D "SRC $(shell pwd)" -D "NAME $(NAME)" -D "ARCH $(ARCH)" -D "VERSION $(VERSION)" -D "RELEASE $(RELEASE)"
mv rpmbuild/RPMS/$(ARCH)/$(NAME)-$(VERSION)-$(RELEASE).$(ARCH).rpm ./
rm -rf rpmbuild
Then I use make to generate the .rpm file and move it. I prefer rpmbuild to operate inside its directory.
make rpm
package.spec is using these macros, e.g.
Name: %{NAME_PACKAGE}
Setting up the rpmbuild environment in /home/ http://www.linuxquestions.org/questions/linux-software-2/need-rpm-package-for-php-version-5-2-7-and-up-on-redhat-5-1-a-766486/#13
Actually it is not recommended to use /usr/src/**. I.e. by using /home/[name]/rpms/ you can work as unprivileged user. No su or sudo is required to build packages.
Just a tiny comment..
adding "%define _rpmdir /outputdir" to spec file is also support by rpmbuild in AIX OS