libm.so.6: cannot open shared object file: No such file or directory - centos6

I've install a program in Centos 6.8, While running the program, I receive error
"error while loading shared libraries: libm.so.6: cannot open shared object file: No such file or directory"
when I checked the linked library to the program using ldd command, I can see libm.so.6 with correct 64bit
"libm.so.6 => /lib64/libm.so.6 (0x0000003a19000000)"
That means, library is installed and already added in environment variable, LD_LIBRARY_PATH
Another program, which uses libm.so.6, works fine.
Can anyone help to solve this problem ?
Thanks

In programming, details matter.
Lets say, The program which I am trying to run is ABC and install
This is not details, this is a hypothetical. If you want useful answers, you should supply actual details that you are asked for. In particular, edit your question (instead of commenting on a different useless answer), and do this: "show the ldd command you actually ran, and its actual output."
That said, if ldd /usr/local/ABC/bin/ABC really does show libm.so.6 => /lib64/libm.so.6, then there is no way for ABC to not find libm.so.6.
Therefore we must conclude that ABC invokes some other program, and that program fails to find libm.so.6. You can confirm this guess by running:
LD_DEBUG=files,libs /usr/local/ABC/bin/ABC
This will show that ABC does find libm.so.6, what other program it invokes, and where that other program looks for libm.so.6.
It is likely that the other program is 32-bit, and looks for /lib/libm.so.6, and that you don't have 32-bit runtime libraries installed.
You can install them with yum install glibc.i686 or some such.

Related

Cannot Run GNATStudio - WSL

I've checked the other questions and this case doesn't seem to be covered. I'm running Ubuntu in WSL on my windows machine and I'm trying to run GNATStudio, any time I attempt to run the program either via Alire or by calling it I receive the following error.
error while loading shared libraries: libxcb-shm.so.0: cannot open shared object file: No such file or directory
I've already done the basics, and verified I have the correct file installed. Calling apt-file find produces the following.
root#DESKTOP-F319G5G:/opt# apt-file find libxcb-shm.so.0
libxcb-shm0: /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0
libxcb-shm0: /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0.0.0
I've confirmed the location is in my path, as well and have restarted a few times. I'm really not too sure what my next steps should be. Any help is much appreciated!
The comment by #Bib solves this question: "install the libxcb-shm0-dev package."

Can I change the location of Homebrew FFTW install? R can't seem to read FFTW3.h file located in Cellar folder

I'm trying to install wholebrain by Daniel Fürth, following the instructions on the macosX install page (available here). I am running MacOS Big Sur 11.5.2, R 4.1.2, and RStudio 2021.09.1.
Unfortunately, the program is not straight-forward to install and requires significant developer tools to work correctly. I'm not a programmer and have almost no experience with coding, so I've been mucking through the instructions for two days now trying to get the install to work correctly and I'm firmly stuck on the final step.
In RS, when I run, devtools::install_github("tractatus/wholebrain", INSTALL_opts=c("--no-multiarch")) I get the following error message:
/bin/sh: pkg-config: command not found filter.cpp:9:10: fatal error: 'fftw3.h' file not found #include "fftw3.h" ^~~~~~~~~ 1 error generated. make: *** [filter.o] Error 1 ERROR: compilation failed for package ‘wholebrain’
I have been trying to figure out what this means for quite awhile now and I think I've narrowed it down to R is not reading the location of the fftw header file from where it was installed by Homebrew. (I could be totally wrong, again- not a programmer)
From what I understand, Homebrew always installs under opt/homebrew/cellar. And, in fact, in there is the compiled fftw program with the needed "fftw3.h" file. But for some reason, RStudio is not able to find and read the file in that location.
From random googling and reading of other posted issues, I think that RStudio may expect the file to be under usr/local/include. Can I just copy and paste the header file into that folder? Or will I be screwing something up if I do that? I am totally intimidated by fftw's description of manual compilation so I don't really want to attempt that. Is there a way to change where R is looking for that header file? I already set my wd to "/" so shouldn't R be able to access any folder on my computer?
I want to post an answer here for anyone who comes after me with the same issue. It came down to RStudio not recognizing the programs Homebrew had installed because it wasn't reading the file location where Homebrew saves them. Homebrew always installs programs in /opt/homebrew/... Here is what I had to do:
In RStudio, open your Renviron file using this command: usethis::edit_r_environ()
In the file that opens (which for me was totally blank), type: PATH=/opt/homebrew/bin:${PATH}, or whatever your particular path you want prepended to the Renviron path is.
Quit RStudio and, when prompted, save. Re-open RStudio and run Sys.getenv("PATH") to check. Your new path (in the example above, '/opt/homebrew/bin') should now be prepended to the list of paths that RStudio will use when looking for programs/files. For me this now looks like /opt/homebrew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/Library/Apple/usr/bin:/Applications/RStudio.app/Contents/MacOS/postback
Finally, I want to say thank you very much to Mark Setchell who really helped point me in the correct direction!

Executable not linking to the my desired dynamic library

I have built and installed mpich from source (mpich-3.4.1.tar.gz), using the steps given in 'https://www.mpich.org/static/downloads/3.4.1/mpich-3.4.1-README.txt'. I want the resultant executables to be dynamically linked to libraries specified in the path '/home/myname/mylibs'. So, before calling ./configure, I have set my LD_LIBRARY_PATH as:
setenv LD_LIBRARY_PATH /home/myname/mylibs:$LD_LIBRARY_PATH
Inside the directory '/home/myname/mylibs' I have soft linked 'libc.so.6' and 'libstdc++.so.6' to my desired libraries, as I do not want the resultant executables to link to dynamic libraries from path /lib64/. I was able to build and install mpich in my machine. However, when I call 'ldd' on one of the executables (hydra_pmi_proxy) that were generated, I see the following:
$ ldd /home/myname/mpich-3.4.1_install/bin/hydra_pmi_proxy
libc.so.6 => /lib64/libc.so.6 (0x00007f32f9eef000)
libstdc++.so.6 => /home/myname/mylibs/libstdc++.so.6 (0x00007f32f9542000)
The rpath seems to be set to my desired path '/home/myname/mylibs' as shown below:
$ readelf -d /home/myname/mpich-3.4.1_install/bin/hydra_pmi_proxy | egrep "RPATH|RUNPATH"
0x000000000000000f (RPATH) Library rpath: [/home/myname/mylibs]
As shown above, libstdc++.so.6 is pointing to my desired library, but libc.so.6 is still pointing to /lib64/libc.so.6. I want libc.so.6 to point to /home/myname/mylibs/libc.so.6
Is there anything I can do to make this possible?
I do not want my exe to be dynamically linked to libraries in /lib64/ because when I launch my MPI program on multiple machines it seems 'hydra_pmi_proxy' is trying to dynamically link to the /lib64/libc.so.6 of the machine on which a certain process is running. (Most likely, it spawns a child process on the new machine which in turn dynamically links to /lib64/libc.so.6 of that machine). I have seen that I am getting an error when one of the mpi processes tries to run on any machine in which /lib64/libc.so.6 is pointing to an older version. The error is:
/home/myname/mpich-3.4.1_install/bin/hydra_pmi_proxy: /lib64/libc.so.6: version `GLIBC_2.17' not found (required by /home/myname/mpich-3.4.1_install/bin/hydra_pmi_proxy).
When I login to this machine, in which it is failing, and do strings /lib64/libc.so.6 | grep GLIBC_2, I do not see GLIBC_2.17 listed. Whereas, on all other machines, on which the mpi processes are running successfully, I see GLIBC_2.17 listed on running 'strings'. So, my intention is to make all executables to dynamically link to only libraries at "/home/myname/mylibs/". Is this the right way?
I do not want the resultant executables to link to dynamic libraries from path /lib64/
libc.so.6 is a special case. See this answer to understand why.
If you really want to isolate your binaries from libraries in /lib64/..., you must:
configure build and install into /home/myname/mylibs/ a new version of GLIBC (symlinking isn't sufficient) and
set your --dynamic-linker and --rpath to point into mylibs.
That said, you didn't explain why you don't want to link libraries from /lib64. http://xyproblem.info might be relevant here.

Installing Python modules

I am trying to install the pyperclip module for Python 3.6 on Windows (32 bit). I have looked at various documentations (Python documentation, pypi.python.org and online courses) and they all said the same thing.
1) Install and update pip
I downloaded get-pip.py from python.org and it ran immediately, so pip should be updated.
2) Use the command python -m pip install SomePackage
Okay here is where I'm having issues. Everywhere says to run this in the command line, or doesn't specify a place to run it.
I ran this in the command prompt: python -m pip install pyperclip. But I got the error message "'python' is not recognized as an internal or external command, operable program or batch file.
If I run it in Python 3.6, it says pip is an invalid syntax. Running it in IDLE gives me the same message.
I have no idea where else to run it. I have the pyperclip module in my python folder. It looks like a really simple problem, but I have been stuck on this for ages!
You need to add the location of the python.exe to your $PATH variable. This depends on your installation location. In my case it is C:\Anaconda3. The default is C:\Python as far as I know.
To edit your path variable you can do the following thing. Go to your Control Panel then search for system. You should see something like: "Edit the system environment variables". Click on this and then click on environment variables in the panel that opened. There you have a list of system variables. You should now look for the Path variable. Now click edit and add the Python path at the end. Make sure that you added a semicolon before adding the path to not mess with your previous configuration.

Cygwin error message -- binary file not executable

So I am trying to install a program on my windows machine that required me to install Cygwin to install it. So I am working from a README file and assueme I have compiled the code previously correctly (its one line sh build.sh) and when actually trying to use the program I get the following error:
BabakP#Babak /cygdrive/c/Users/BabakP/Desktop/test
$ ./Runlock input.tst output.tst 1
./Ostrich: Exec format error. Binary file not executable.
I guess I am trying to figure out why I am getting this error so any suggestions on how to troubleshoot it would be great!
./Ostrich is a Mac executable. It can't be executed under Cygwin. (A MacOS emulator that runs under Windows or Cygwin is theoretically possible, but I don't know of any such thing.)
Without knowing the details of the software you're trying to install, it's hard to say how or whether you can fix it.
You may be able to rebuild Ostrich from source (if you have the source, and if it's not MacOS-specfic).

Resources