possible missing library when running cmake - linux

I am trying to install a program on my machine (running Linux), but I get the following error when I run make:
Starting build...
Working Directory : /home/laptop/mplabs_test
Build Type :
Generating OMP binary...
/bin/sh: 1: Syntax error: "&" unexpected
make: *** [lbs3d] Error 2
What is wrong, am I missing a library?

You can control the shell that make uses for executing recipes by setting the SHELL variable in the makefile.
If that makefile uses bash-specific features then it should be setting SHELL=/bin/bash already. Since it appears it isn't doing that you get to do that yourself instead.
Either modify the makefile in question or use
make SHELL=/bin/bash
instead of just running make.

The problem is that the Makefile uses bash specific syntax (|&) but the commands are executed by /bin/sh, which does not point to /bin/bash.
On my computer (Ubuntu 14.04):
ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Sep 16 2014 /bin/sh -> dash
A solution could be to let the symbolic link /bin/sh point to /bin/bash:
sudo rm /bin/sh
sudo ln -s /bin/bash /bin/sh

Related

Windows Linux Bash bad variable name when running /bin/sh -c "$(curl -fsS https://install.airshipcms.io)"

everything was working until I changed my mobo/cpu and I'm not sure what the error message means.
After running the install command
/bin/sh -c "$(curl -fsS https://install.airshipcms.io)"
my windows ubuntu bash shell returns
Starting Airship Launcher installation for ubuntu Linux64
Will install version 2.1.1
Downloading https://install.airshipcms.io/Linux64/airship-2.1.1.tar.bz2
To /tmp/AirshipLauncher.65/airship-2.1.1.tar.bz2
Added ~/.airship-bin to $PATH in ~/.profile
/bin/sh: 504: export: (x86)/Intel/iCLS: bad variable name
My guess was that because I already had it installed pre-upgrade of the mobo/cpu the variable name is already taken in the ~/.profile ? I'm not sure how to edit it, when I ran cat ~/.profile it rendered a bunch of unreadable characters.
thank you.
edit: I've tried reinstalling my linux shell, to no avail.
Okay so the fix is to replace sh with bash so the working command was
/bin/bash -c "$(curl -fsS https://install.airshipcms.io)"
credit goes to this guy https://github.com/probonopd/PowerShell/commit/2441d99a7405b488dc9289789edb636dc2cdcdfc

Using `chroot`: Why do I get error from running `sudo chroot /bin /bash`?

Using chroot: Why do I get error from running sudo chroot /bin /bash ?
I understand from documentation that chroot should execute /bin/bash and that /bin is the new root directory for this command.
Why do I get an error ?
Here is the terminal output:
nlykkei#nlykkei-ThinkPad-X200s ~ $ sudo chroot /bin /bash
[sudo] password for nlykkei:
chroot: failed to run command ‘/bash’: No such file or directory
I am running Linux Mint 17 64-bit.
You probably meant sudo chroot /bin/bash without the space. If you have the space in, linux will interpret your command as 1 program with 2 arguments, while the chroot command is only expecting 1 argument.

Installation of Cron in cygwin

When I run the following command in cygwin,
$ cygrunsrv -I cron -p C:\cygwin64\bin --args -n
I get the following error
cygrunsrv: Given path doesn't point to a valid executable
Why am I getting this error?
You only gave a folder and not a path to the executable. Besides this I wouldn't recommend to use windows paths in cygwin, this can cause errors. You should write /cygdrive/c/cygwin64/bin/something instead of C:\cygwin64\bin\something.exe
Perhaps you are looking for an
installation guide, and you would like to do something like this:
Install cron as a windows service, using cygrunsrv:
cygrunsrv -I cron -p /usr/sbin/cron -a -D
net start cron

Permission denied when running without bash

I have a script which calls some other bash, python, and ruby scripts. The script is similar to the following:
#!/bin/bash
set -x
./aux1.py
./aux2.sh
When I run the script from the command line, it runs but it gives me the following output:
./script.sh: line 5: ./aux1.py: Permission denied
The aux.py script has #!/usr/bin/env python at the top; when I call it from the command line with ./aux.py it is fine, however when called from this script in the exact same way I get this error. The strange part is that this only happens when I run the script with ./script.sh; when I run the script with bash script.sh the auxilliary scripts work perfectly.
I'm using Linux, why does this happen?
Update, 3 March 2014
There's nothing conflicting in the PATH, and all of the scripts are chmod +rx. uname -srvmo gives
Linux 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Dec 13 06:58:20 EST 2013 x86_64 GNU/Linux
and there's no more information available in uname -a. SELinux is enabled, but I'm not an administrator so I can't access that information.
Before launching the main script you must be sure that all the subscripts have got the right permissions. In particular you are interested in the permission for you (your user and owner of the files) to execute the file. This is a short tutorial on permissions.
http://blog.pluralsight.com/linux-file-permissions
http://www.linux.com/learn/tutorials/309527-understanding-linux-file-permissions
If this is the problem (and it look so), the simpler solution is to run the following commands
chmod u+x script.sh aux1.py aux2.sh
To check whether you have permission to execute simply run
ls -l
You should see something like
-rwxr--r-- 1 youruser youruser 26 Feb 28 21:44 script.sh
-rwxr--r-- 1 youruser youruser 32 Feb 28 21:44 aux1.py
where you should see a "x" in the 4th column corresponding to the file.
Maybe type sudo su before running your script so that you are the root user. When the script completes simply type exit to get out of root. Type exit again to close the shell.
:D

Make: Command not found, but command exists?

So I have a make file which uses arm-eabi-none-xxx commands, but when I run make I get a "Command not Found" error:
bash-4.2$ make
arm-none-eabi-as -I source/ source/mailbox.s -o build/mailbox.o
make: arm-none-eabi-as: Command not found
make: *** [build/mailbox.o] Error 127
Weird bit, is the command exists and is in my path (the following is in the same directory as the makefile):
bash-4.2$ arm-none-eabi-as --version
GNU assembler (Sourcery G++ Lite 2008q3-66) 2.18.50.20080215
This assembler was configured for a target of `arm-none-eabi'.
And I can run the command that make is running:
bash-4.2$ arm-none-eabi-as -I source/ source/mailbox.s -o build/mailbox.o
bash-4.2$ ls build/
README mailbox.o
So. I read that make uses the shell to execute commands if ./ is in the current path, so I've tried that but no good. Originally I couldn't run arm-none-eabi-as at all as it's a 32-bit binary and I'm running on a 64 bit system (Slackware 14.0) but I followed the instructions here to install the 32-bit libraries etc..
So the question... what stupid schoolboy mistake am I making?
Did you run 'make' as sudo, or root? In that case, it doesn't work for me.
What I had to do was mkdir a 'build' folder, and simply run 'make'. It worked.

Resources