OSX Catalina - GCC/PIP compilation issue - python

I'm trying to install a tool on my computer via pip on my Mac and have been having issues.
I've seen suggestions on StackOveflow to install the Command Line Tools, to run variants of xcode-select --install, and export CPATH and CPATH. This resolved the header error. I'm now getting the error
ld: library not found for -lSystem
collect2: error: ld returned 1 exit status
and
psutil/_psutil_osx.c:36:43: fatal error: CoreFoundation/CoreFoundation.h: No such file or directory
#include <CoreFoundation/CoreFoundation.h>
^
compilation terminated.
error: command 'gcc' failed with exit status 1
Has anyone come across anything similar?

I encountered the same problem after updating to Catalina macOS 10.15 and installing xcode 12 beta 6. My golang code failed compiling with error
share/go/src/crypto/x509/root_cgo_darwin.go:16:10: fatal error: 'CoreFoundation/CoreFoundation.h' file not found
#include <CoreFoundation/CoreFoundation.h>
Tried xcode-select --install, and other suggestions, none worked.
The final fix I found was to manually link directories that were messed up by the update.
Steps
1: turn off rootless/System Integrity Protection on Mac: Disable SIPe
This setup is needed to make change to system configuration.
reboot your mac and hold-on command + R to enter recovery mode.
Once in Recovery mode, open a Terminal window from the Utilities drop-down menu at the top of the screen. Type the following into the Terminal window:
csrutil disable
2: reboot into normal mode
3: open terminal, make the root folder writable
sudo mount -uw
4: fix the links
cd /System/Library/Frameworks/CoreFoundation.framework
ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers Headers
ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Modules Modules
cd /System/Library/Frameworks/Security.framework
ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers Headers
ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Modules Modules

Related

error while loading shared libraries: libpython3.8.so.1.0: cannot open shared object file: no such file or directory (ubuntu)

I am trying to use the GDB debugger using OpenOCD (Ubuntu) for a RISC-V processor running on hardware. I have successfully connected to the RISC-V core with OpenOCD. When I try to run GDB I get the following error message:
riscv32-unknown-elf-gdb: error while loading shared libraries: libpython3.8.so.1.0: cannot open shared object file: No such file or directory***
I don't know why Python is needed to run this command but I do have Python 3.10 installed on Ubuntu. Do I need Python 3.8 or what is wrong here?
I have checked the GDB toolchain and it is installed correctly.
EDIT
I am not very experienced with software involving compilers etc and Ubuntu so I will try add whatever I think may be useful. Or if anyone can advise any way of checking decencies or have any tests I could do to check, let me know.
Below shows trying to run the RISC-V GDB command on Ubuntu, and showing the error message:
david#DESKTOP-3UBE0P7:/mnt/c/Users/David/.Xilinx/Neorv32_basys3_test_setup_on_chip_debugger/neorv32-main/sw/example/demo_blink_led$ export PATH=$PATH:/opt/riscv/bin
david#DESKTOP-3UBE0P7:/mnt/c/Users/David/.Xilinx/Neorv32_basys3_test_setup_on_chip_debugger/neorv32-main/sw/example/demo_blink_led$ riscv32-unknown-elf-gdb
riscv32-unknown-elf-gdb: error while loading shared libraries: libpython3.8.so.1.0: cannot open shared object file: No such file or directory
IN RESPONSE TO CHARLES DUFFY'S COMMENT
I think I am in the correct place you are talking about but it seems like it is not there.
david#DESKTOP-3UBE0P7:/$ ls
bin etc lib libx32 mnt riscv-openocd run srv usr
boot home lib32 lost+found opt riscv32-unknown-elf.gcc-12.1.0.tar.gz sbin sys var
dev init lib64 media proc root snap tmp
david#DESKTOP-3UBE0P7:/$ cd opt
david#DESKTOP-3UBE0P7:/opt$ ls
riscv
david#DESKTOP-3UBE0P7:/opt$ cd riscv/
david#DESKTOP-3UBE0P7:/opt/riscv$ ls
bin include lib libexec riscv32-unknown-elf share
david#DESKTOP-3UBE0P7:/opt/riscv$ cd lib
david#DESKTOP-3UBE0P7:/opt/riscv/lib$ ls
bfd-plugins gcc libcc1.la libcc1.so libcc1.so.0 libcc1.so.0.0.0 libriscv32-unknown-elf-sim.a

libGL error: MESA-LOADER: failed to open iris

when executing a python script, I get this after generating a figure:
libGL error: MESA-LOADER: failed to open iris: /usr/lib/dri/iris_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:$${ORIGIN}/dri:/usr/lib/dri, suffix _dri) libGL error: failed to load driver: iris libGL error: MESA-LOADER: failed to open iris: /usr/lib/dri/iris_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:$${ORIGIN}/dri:/usr/lib/dri, suffix _dri) libGL error: failed to load driver: iris libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:$${ORIGIN}/dri:/usr/lib/dri, suffix _dri) libGL error: failed to load driver: swrast
I dont know how to fix it, i have searched for information but have found nothing to help me
Here are two possible solutions. Try them both and see what works.
Solution 1
Follow the instructions in this answer.
Solution 2
If you are using Anaconda to run this Python script, Anaconda may be the reason. This solution was taken from here (update 3), which in turn was taken from here.
From the latter link:
According to online information, there is a problem with the libstdc++.so file in Anaconda (I use this commercial python distribution). It cannot be associated with the driver of the system, so we removed it and used the libstdc++ that comes with Linux. so creates a soft link there.
To solve this problem, run this in bash:
$ cd /home/$USER/miniconda/lib
$ mkdir backup # Create a new folder to keep the original libstdc++
$ mv libstd* backup # Put all libstdc++ files into the folder, including soft links
$ cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6 ./ # Copy the c++ dynamic link library of the system here
$ ln -s libstdc++.so.6 libstdc++.so
$ ln -s libstdc++.so.6 libstdc++.so.6.0.19
where $USER should be your own username.
This worked for me:
mv ~/anaconda3/lib/libstdc++.so.6 ~/libstdc++.so.6
i resolved this issue with spyder 5.3.3 python 3.10.9 using this answer
https://stackoverflow.com/a/71421355/9153119
conda install -c conda-forge libstdcxx-ng

How to avoid the make command triggers Xcode

I have a python project that has a makefile which has
test: clean lint
#pytest app/tests/ --cov ./app -s
I usually type make test in the terminal to trigger this pytest. However, recently it stopped working. Instead, I get an error
make: error: sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk '' -find make 2> /dev/null' failed with exit code 256: (null) (errno=No such file or directory)
And MacOS pops up a message window saying it needs to download software (without details other than a progress bar). It takes ~10 min to finish installing. But it doesn't change anything. I have installed XCode although I never used it. Pytest still works if I directly type the pytest commands.
My machine is a Macbook Pro with BigSur Intel CPU. I'm not a iOS/MacOS app developer and I don't use Xcode. I don't understand why would make triggers it. How to avoid it?
More info following #MadScientist suggestion:
> type -a make
make is /usr/bin/make
> make --version
OR
> make -d test
xcrun: error: invalid active developer path (/Applications/Xcode.app/Contents/Developer), missing xcrun at: /Applications/Xcode.app/Contents/Developer/usr/bin/xcrun
> /usr/bin/make
xcrun: error: invalid active developer path (/Applications/Xcode.app/Contents/Developer), missing xcrun at: /Applications/Xcode.app/Contents/Developer/usr/bin/xcrun

NS-3 build fails due to g++ compiler error

I am trying to build NS3 on Raspbian (Jessie) and ran into this error:
...
[1507/1924] Compiling src/internet/model/ripng-header.cc
[1508/1924] Compiling src/internet/helper/ripng-helper.cc
[1509/1924] Compiling src/internet/helper/rip-helper.cc
[1510/1924] Compiling build/src/internet/bindings/ns3module.cc
g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.9/README.Bugs> for instructions.
Waf: Leaving directory `/home/pi/tarballs/ns-allinone-3.26/ns-3.26/build'
Build failed
-> task in 'ns3module_internet' failed (exit status 4):
{task 3056100368L: cxx ns3module.cc -> ns3module.cc.8.o}
['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-std=c++11', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-fPIC', '-fno-strict-aliasing', '-fstack-protector-strong', '-fwrapv', '-fvisibility=hidden', '-Wno-array-bounds', '-pthread', '-pthread', '-I.', '-I..', '-Isrc/internet/bindings', '-I../src/internet/bindings', '-I/usr/include/python2.7', '-I/usr/include/arm-linux-gnueabihf/python2.7', '-I/usr/include/gtk-2.0', '-I/usr/lib/arm-linux-gnueabihf/gtk-2.0/include', '-I/usr/include/gio-unix-2.0', '-I/usr/include/cairo', '-I/usr/include/pango-1.0', '-I/usr/include/atk-1.0', '-I/usr/include/pixman-1', '-I/usr/include/libpng12', '-I/usr/include/gdk-pixbuf-2.0', '-I/usr/include/harfbuzz', '-I/usr/include/glib-2.0', '-I/usr/lib/arm-linux-gnueabihf/glib-2.0/include', '-I/usr/include/freetype2', '-I/usr/include/libxml2', '-DNS3_BUILD_PROFILE_DEBUG', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SYS_IOCTL_H=1', '-DHAVE_IF_NETS_H=1', '-DHAVE_NET_ETHERNET_H=1', '-DHAVE_PACKET_H=1', '-DHAVE_IF_TUN_H=1', '-DNS_DEPRECATED=', '-DNS3_DEPRECATED_H', '-DHAVE_PYEXT=1', '-D_FORTIFY_SOURCE=2', '-DNDEBUG', '-DHAVE_GSL=1', '-DHAVE_SQLITE3=1', '-DHAVE_GTK2=1', '-DHAVE_LIBXML2=1', 'src/internet/bindings/ns3module.cc', '-c', '-o', '/home/pi/tarballs/ns-allinone-3.26/ns-3.26/build/src/internet/bindings/ns3module.cc.8.o']
Waf died. Not running tests
I have searched SO and none of the existing questions seem to be relevant. There definitely seems to be something wrong in general because it takes many hours just to get to this point, when I think(?) it should take < 1 hour to build NS-3.
Not sure if you're still looking for a solution, however the problem seems to be related to memory constraints. I solved the issue by enabling/configuring a swapfile.
sudo dd if=/dev/zero of=/swapfile bs=64M count=16
sudo mkswap /swapfile
sudo swapon /swapfile
After you build the project, you have the option to disable the swapfile (only if you want). To do this type this in your terminal:
sudo swapoff /swapfile
sudo rm /swapfile
Hope this helps!
I had a similar problem.
It seems to be either a problem with the ns3 version in combination with python, gcc versions, or, a problem with the RAM or GPU memory.
So, I set up a new Ubuntu VM with double the RAM and did not use the latest ns3 version (ns3 3.33)
Since ns3 version 2.xx are based on python2, I would recommend versions 3.xx.

error: cannot locate an Oracle software installation

I'm working on Plone.
PRELUDE
I've installed:
oracle-instantclient12.1-basic-12.1.0.1.0-1.x86_64.rpm
oracle-instantclient12.1-devel-12.1.0.1.0-1.x86_64.rpm
oracle-instantclient12.1-sqlplus-12.1.0.1.0-1.x86_64.rpm
and also cx_Oracle.
I've tested the installations and it's all ok: db connection successfully.
echo $ORACLE_HOME
/usr/lib/oracle/12.1/client64
echo $TNS_ADMIN
/usr/lib/oracle/12.1/client64/admin
echo $LD_LIBRARY_PATH
/usr/lib/oracle/12.1/client64/lib
THE PROBLEM
I've edited buildout.cfg as follows:
[...]
eggs =
Plone
Pillow
collective.documentviewer
Products.OpenXml
Products.AROfficeTransforms
tus
wildcard.foldercontents==2.0a7
**cx_Oracle**
[...]
I receive this error:
Unused options for buildout: 'environment-vars'.
Installing instance.
Getting distribution for 'cx-Oracle'.
error: cannot locate an Oracle software installation
An error occurred when trying to install cx-Oracle 5.1.3. Look above this message for any errors that were output by easy_install.
While:
Installing instance.
Getting distribution for 'cx-Oracle'.
Error: Couldn't install: cx-Oracle 5.1.3
I have no idea how to solve this.
"cannot locate an Oracle software installation" How to fix this?
Got the same problem, background is:
echo $ORACLE_HOME
/usr/lib/oracle/12.1/client64
But:
sudo env | grep ORACLE_HOME
yields nothing.
The solution:
sudo visudo
Then add the line :
Defaults env_keep += "ORACLE_HOME"
As found here
You must be sure that the right envvars are setted for the user that run the Plone instance.
The best way is to add those vars in the buildout configuration::
[buildout]
...
[instance]
...
environment-vars =
...
LD_LIBRARY_PATH /usr/lib/oracle/10.2.0.3/client64/lib
ORACLE_HOME /usr/lib/oracle/10.2.0.3/client64
(This is what I have on a CentOS installation)

Categories

Resources