i am doing the google assistant on a raspberry pi and i keep getting _atomic_exchange_8 - raspberry-pi3

i keep getting
ImportError: /home/pi/env/lib/python3.7/site-packages/grpc/_cython/cygrpc.cpython-37m-arm-linux-gnueabihf.so: undefined symbol: __atomic_exchange_8

You should give more details about your system, your Python exact version, context about your problem, what you have already tried, etc.
However I'd try that:
First run:
sudo find / -type f -name '*atom*.so*'
You should find the lib you are looking for on the system, let's say it is:
/usr/lib/arm-linux-gnueabihf/libatomic.so.1.2.0
Now, just add LD_PRELOAD variable definition before running your python3 program:
LD_PRELOAD=/usr/lib/arm-linux-gnueabihf/libatomic.so.1.2.0 your-command
This should solve your problem.

LD_PRELOAD=/usr/lib/arm-linux-gnueabihf/libatomic.so.1.2.0 your-command
bash: your-command: comando non trovato

Related

How to use `shell find` on Make for windows?

I've got a Makefile that contains a statements like this:
GO_SOURCES += $(shell find $(GO_DIRS) -type f -name "*.go" -not -path modules/options/bindata.go -not -path modules/public/bindata.go -not -path modules/templates/bindata.go)
I'm trying to use it on windows and I know using this particular file wouldn't be a problem if I just used cygwin, msys2, vagrant, wsl or any other similar terminal. That said, I'd like to know how to use that Makefile with plain cmd.exe terminal (got my own reasons to do so, so please don't suggest using those ;)).
Right now my env var PATH has appended the Git for windows usr\bin path
that contains a nice toolset of ~437 unix commands and find
is amongst them.
So for instance, if I run find on my terminal... D:\software\PortableGit\usr\bin\find.exe will be used instead C:\Windows\System32\find.exe as expected, so far so good up to this point.
Problem is when I run the makefile for some reason I haven't understood yet C:\Windows\System32\find.exe is trying to be used instead on the statement $(shell find ...) so I'll get the error FIND: Parameter format not correct when doing make.
So basically my question would be, how can I instruct make to use the proper unix find that has higher priority on PATH? But if this wouldn't be possible to achieve easily... would it be possible to make that statement to become more cross-platform maybe using wildcards?
I've already checked the make docs:
https://www.gnu.org/software/make/manual/html_node/Wildcard-Function.html
https://www.gnu.org/software/make/manual/make.html#Choosing-the-Shell
but I didn't find anything that could help me out.
Also, the version of make I'm using can be downloaded from http://gnuwin32.sourceforge.net/packages/make.htm, at the moment of asking this question version I'm using is GNU Make 3.81

Delete files from 00012 to 00441 using Terminal

This is my Bash version:
3.2.57(1)-release
I found that this MIGHT possible using terminal rm code, but it doesn't work for me
Here is a picture of the first files:
Picture of a bunch of Files
Typing rm _{00012..00441} I get this error:
Terminal Error
Seems like the code us unable to use the leading zeros since is trying to find the files like 12,13,14,15, instead of 00012,00013,00014,00015
To make things more difficult, the last file in the range has a different amount of leading zeros, so using rm _000{ wont work
In trying to use AppleScript to run this as
do shell script ("rm _{" & STARTrange & ".." & ENDrange & "}.psd")
Try this command.
find ./ -name "_0*.psd" -type f -delete;
Thanks to Cyrus I made this work. The answer in OSX is to install the latest version of Bash using homebrew.
Using this guide I was able to change the default Bash from terminal to the one Homebre installs: https://apple.stackexchange.com/questions/193411/update-bash-to-version-4-0-on-osx
Thanks
For versions of bash older than v4.0 either of these should work:
rm _000{12..99} _00{100..441}
rm $(printf '_%.5i ' {12..441})

rdmd Command Not Recognized

I am a first-timer at D, so maybe I am missing something obvious here. I am trying to compile some D code using the rdmd command.
$ rdmd dfile.d input.txt
No command 'rdmd' found, did you mean:
Command 'wdmd' from package 'sanlock' (universe)
Command 'rdsd' from package 'rdsserver' (universe)
Command 'gdmd' from package 'gdc' (universe)
rdmd: command not found
Is there something I need to install before my D code will compile? There is very limited resources on the internet for D. I apologize for such a weak question, but I am a bit stuck!
I am using Linux Mint 16.
Is there something I need to install before my D code will compile?
Yes, you need to install a D compiler - see here for a list of downloads.
There is very limited resources on the internet for D.
Try searching for "Dlang" or "D programming" if your search results appear irrelevant.

-bash: otool: command not found, Can you teach bash a default location to look for a command?

I can find the tool command in my filesystem under:
/Applications/Xcode.app/Contents/Developer/usr/bin/otool
If I specify that entire path, otool will work.
/Applications/Xcode.app/Contents/Developer/usr/bin/otool -tV hello -p _main
However, since I have to be inside the folder of the hello.c file I'm referencing, bash won't find otool automatically if I just type
otool -tV hello -p _main
I've had this same problem with a number of commands. Is there any way to set up bash so it automatically finds otool (and similar commands), without me having to writing out the entire path name each time? Thanks!
Note: If it matters, I'm using a Mac.
Note 2: I've read through a ton of the "Command not found" threads but none seem to answer the question of teaching bash where to look for a command by default. I feel like this question should have been answered somewhere, but haven't come across it yet. Since the only programs I'll be working with any time soon will be iOS/Xcode related, this is worthwhile shortcut.
PATH=$PATH:/Applications/Xcode.app/Contents/Developer/usr/bin
Put this in your ~/.bashrc to have it persist.
You can also Try using alias to do this. e.g.
$ alias otool='/Applications/Xcode.app/Contents/Developer/usr/bin/otool'
You can also add this in your bashrc/profile file.

How can I make the "find" Command on OS X default to the current directory?

I am a heavy command line user and use the find command extensively in my build system scripts. However on Mac OS X when I am not concentrating I often get output like this:
$ find -name \*.plist
find: illegal option -- n
find: illegal option -- a
find: illegal option -- m
find: illegal option -- e
find: *.plist: No such file or directory
Basically, I forgot to add the little dot:
$ find . -name \*.plist
Because BSD find requires the path and GNU find doesn't (it assumes the current directory if you don't specify one). I use Linux, Mac OS X and Cygwin often all at the same time, so it's of great benefit to me to have all my tools behave the same. I tried writing a bash find function that added "./" if I forgot, but I failed. Thanks for your help. :)
Install GNU find instead.
$ brew install findutils
$ alias find=gfind
Yay, it works!
If you can't discipline yourself to use find 'correctly', then why not install GNU find (from findutils) in a directory on your PATH ahead of the system find command.
I used to have my own private variant of cp that would copy files to the current directory if the last item in the list was not a directory. I kept that in my personal bin directory for many years - but eventually removed it because I no longer used the functionality. (My 'cp.sh' was written in 1987 and edited twice, in 1990 and 1997, as part of changes to version control system notations. I think I removed it around 1998. The primary problem with the script is that cp file1 file2 is ambiguous between copying a file over another and copying two files to the current directory.)
Consider writing your own wrapper to find:
#!/bin/sh
[ ! -d "$1" ] && set -- . "$#"
exec /usr/bin/find "$#"
The second line says "if argument 1 is not a directory, then adjust the command line arguments to include dot ahead of the rest of the command. That will be confusing if you ever type:
~/bin/find /non-existent/directory -name '*.plist' -print
because the non-existent directory isn't a directory and the script will add dot to the command line -- the sort of reason that I stopped using my private cp command.
If you must call it 'find', then you want:
alias find=/usr/bin/find\ .
in your .profile or .bash_profile or …. Substitute the real path (if not /usr/bin/find) on your Mac OSX. Enter the full path to avoid cycles (bash normally would interpret alias find=find without issues, but better be sure).
But you better not name the alias find (findl, myfind etc), because it will become a habit and trouble for you if you try it on another system.
find ./ -name "*.plist"
edit: hmm, i may have misunderstood the question! if you were crazy, how about emulating it via a shell script? i routinely keep random utility scripts in ~/.bin, and that's the first thing in my PATH. if you had a similar setup perhaps you could do something like: (untested!)
#!/bin/sh
# remapping find!
CMD=`echo $1 | cut -c 1`
if [ $CMD = '-' ]
then
# pwd search
/usr/bin/find ./ $*
else
# regular find
/usr/bin/find $*
fi
I would suggest that if you're writing scripts (which are more likely to be migrated from one system to another sometime in the future) that you should try to use the more specific form of the command, that is specifying the "." instead of relying on a default. For the same reason, I might even suggest writing sh scripts instead of relying on bash which might not be installed everywhere.
This is probably not what you want but how about: alias find="find ."
or choose a new name (findl for find local?)
You may want to run the commands found in this link: https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/
It is a bit outdated, for example I found I did not have to add many commands to my path at all.
This covers your problem by having your system use the Non-BSD find utility from the findutils package, while also installing other tools you may want as well.

Resources