I get the following error while building OpenCV on OS X 10.5 (intel):
ld: warning in .libs/_cv_la-_cv.o, file is not of required architecture
ld: warning in .libs/_cv_la-error.o, file is not of required architecture
ld: warning in .libs/_cv_la-pyhelpers.o, file is not of required architecture
ld: warning in .libs/_cv_la-cvshadow.o, file is not of required architecture
ld: warning in ../../../cv/src/.libs/libcv.dylib, file is not of required architecture
ld: warning in /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libcxcore.dylib, file is not of required architecture
Undefined symbols for architecture i386:
"_fputs$UNIX2003", referenced from:
_PySwigObject_print in _cv_la-_cv.o
_PySwigPacked_print in _cv_la-_cv.o
_PySwigPacked_print in _cv_la-_cv.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/Sr/Srq9N4R8Hr82xeFvW3o-uk+++TI/-Tmp-//cchT0WVX.out (No such file or directory)
make[4]: *** [_cv.la] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
While running ./configure --without-python everything is ok. Another strange thing is that when I used Python 2.4.5 or 2.5.1 everything has built ok, the problem occured after switching to Python Framework 2.5.2
It seems a little weird that it is warning about different architectures when looking for /Developer/SDKs/MacOSX10.4u.sdk while linking - can you give us some more detail about your build environment (version of XCode, GCC, Python, $PATH etc)
Alternatively, won't any of the OpenCV binaries available work for you?
/Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib is just a link to /usr/local/lib
after deleting files that caused the warnings I'm getting :
ld: warning in .libs/_cv_la-_cv.o, file is not of required architecture
ld: warning in .libs/_cv_la-error.o, file is not of required architecture
ld: warning in .libs/_cv_la-pyhelpers.o, file is not of required architecture
ld: warning in .libs/_cv_la-cvshadow.o, file is not of required architecture
ld: warning in ../../../cv/src/.libs/libcv.dylib, file is not of required architecture
ld: warning in /Users/Pietras/opencv/cxcore/src/.libs/libcxcore.dylib, file is not of required architecture
Undefined symbols for architecture i386: ... `
And these files are created by make.
gcc: i686-apple-darwin9-gcc-4.0.1
$PATH:
/Library/Frameworks/Python.framework/Versions/Current/bin:/Library/Frameworks/Python.framework/Versions/Current/bin:/sw/bin:/sw/sbin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/AVRMacPack/bin:/usr/X11R6/bin
XCode 3 (latest)
Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) - MacPython from python.org
(tried to downgrade and use it instead of 2.5.2, but that doesn't work anymore...)
which python
/Library/Frameworks/Python.framework/Versions/Current/bin/python
I didn't find any Python OpenCV binaries for OS X.
I've tried to make it while setting python2.4 or 2.5 from macports as default and it compiles and installs, but when I try to import there is a bus error or Fatal Python error Interpreter not initialized (version mismatch?)
and it quits.
Ok, I kind of worked it out
It needs to be compiled with python from macports or whatever. Then I need to run /System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5 (this is my previous python version) and there OpenCV just works.
Related
I am trying to develop c extensions for python, which requires me to use
#include "Python.h"
in the c source code. However, it appears that Python.h in Ubuntu systems can be obtained by downloading python-dev, but this is not an option for macOS.
I tried compiling using /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/Headers/ (which contains a Python.h file) but When I use the command
gcc test.c -I /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/Headers/
I get the following error:
Undefined symbols for architecture arm64:
"_PyObject_Size", referenced from:
_main in test-165478.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Which makes it seem that the Python.h file on my mac is incomplete somehow. Is the solution to this problem downloading the source of python-dev and then using the Python.h header file that is in that package? If so, where could I find the python-dev source code?
I want to install Quantlib from source to enable intraday support for Python. When installing QuantLib from source on Mac OSX 11.1 with M1 chip I am facing a problem during the 'make' in the tests.
Undefined symbols for architecture arm64:
"_PrimitivePolynomials", referenced from:
LowDiscrepancyTest::testPolynomialsModuloTwo() in lowdiscrepancysequences.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [quantlib-test-suite] Error 1
make: *** [all-recursive] Error 1
This looks like the linker is not finding the QuantLib libraries you have just compiled, and is instead trying to link to a version compiled for a different architecture. Try running make install or sudo make install prior to compiling the tests -- if that works, then you have something going on with your library paths.
I'm trying to install the pyarrow==0.17.1 package on my MacBook pro machine (Apple M1 chip) and I'm getting the following error
-- Found PkgConfig: /opt/homebrew/bin/pkg-config (found version "0.29.2")
-- Found Arrow: /opt/homebrew/Cellar/apache-arrow/7.0.0_3/include (found version "7.0.0")
-- Arrow version: 7.0.0 (HOME: /opt/homebrew/Cellar/apache-arrow/7.0.0_3)
-- Arrow SO and ABI version: 700
-- Arrow full SO version: 700.0.0
-- Found the Arrow core shared library: /opt/homebrew/Cellar/apache-arrow/7.0.0_3/lib/libarrow.dylib
-- Found the Arrow core import library: /opt/homebrew/Cellar/apache-arrow/7.0.0_3/lib/libarrow.dylib
-- Found the Arrow core static library: /opt/homebrew/Cellar/apache-arrow/7.0.0_3/lib/libarrow.a
-- Found ArrowPython: /opt/homebrew/Cellar/apache-arrow/7.0.0_3/include (found version "7.0.0")
-- Found the Arrow Python by HOME: /opt/homebrew/Cellar/apache-arrow/7.0.0_3
-- Found the Arrow Python shared library: /opt/homebrew/Cellar/apache-arrow/7.0.0_3/lib/libarrow_python.dylib
-- Found the Arrow Python import library: /opt/homebrew/Cellar/apache-arrow/7.0.0_3/lib/libarrow_python.dylib
-- Found the Arrow Python static library: /opt/homebrew/Cellar/apache-arrow/7.0.0_3/lib/libarrow_python.a
-- Configuring done
-- Generating done
-- Build files have been written to: /private/var/folders/6m/ychzdp6s7l390zfm77myvxzr0000gn/T/pip-install-lv5qrivl/pyarrow_12e0171ed6fa433da71d5392c3e10c3a/build/temp.macosx-12.0-arm64-3.7
-- Finished cmake for pyarrow
-- Running cmake --build for pyarrow
cmake --build . --config release --
[ 6%] Compiling Cython CXX source for lib...
[ 6%] Built target lib_pyx
[ 13%] Building CXX object CMakeFiles/lib.dir/lib.cpp.o
/private/var/folders/6m/ychzdp6s7l390zfm77myvxzr0000gn/T/pip-install-lv5qrivl/pyarrow_12e0171ed6fa433da71d5392c3e10c3a/build/temp.macosx-12.0-arm64-3.7/lib.cpp:774:10: fatal error: 'arrow/python/config.h' file not found
#include "arrow/python/config.h"
^~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/lib.dir/lib.cpp.o] Error 1
make[1]: *** [CMakeFiles/lib.dir/all] Error 2
make: *** [all] Error 2
error: command 'cmake' failed with exit status 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
I couldn't find a proven solution for this problem, the only reference I did review is the following - https://github.com/apache/arrow/issues/2281, as mentioned, no proven solution there.
Versions I'm using are:
python 3.7.12
pip 22.0.4
On my machine, I have the following installed - apache-arrow, apache-arrow-glib, cmake.
I've also tried to install the package with the --no-use-pep517 flag as the following- pip install --no-use-pep517 pyarrow==0.17.1 - no success there.
I took a peek inside arrow/python/ and config.h is obviously missing, I also look inside arrow/ which does contains a config.h, however, it's not the config.h that was required.
Does anyone have an idea how to solve this issue?
pyarrow==0.17.1 predates M1 chips (May 2020 vs November 2020).
Any particular reason you wouldn't want to use pyarrow==7.0.0? Your brew installed arrow seems to be 7.0.0 too.
I'm following this tutorial to install caffe on my OSX High Sierra.
I followed all steps but I'm stucked when installing R-CNN example at this step:
$ make -j8 && make pycaffe
LD -o .build_release/lib/libcaffe.so
clang: warning: argument unused during compilation: '-pthread' [-Wunused-command-line-argument]
ld: cannot link directly with /System/Library/Frameworks//vecLib.framework/vecLib for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [.build_release/lib/libcaffe.so] Error 1
But the library veclib is present:
$ ls /System/Library/Frameworks//vecLib.framework/vecLib
/System/Library/Frameworks//vecLib.framework/vecLib
Can you help me please to solve this issue ?
I met the same issue. I installed Xcode 9.3 Commandline tool and changed cmake/Modules/FindvecLib.cmake to something like this and it works:
find_path(vecLib_INCLUDE_DIR cblas.h
DOC "vecLib include directory"
PATHS /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Headers/
NO_DEFAULT_PATH)
For my case, NO_DEFAULT_PATH must be set or there will be still link error.
You can also refer to this.
I'm trying to install Python-Gammu on a mac running Snow Leopard. I successfully configured gammu with cmake and GCC 4, but am getting this error on install. It seems to indicate an improperly configured gcc, but i'm not sure what can be done about this.
Has anyone else run into similar problems with GCC on the mac?
[ 90%] Built target smscgid
[ 91%] Building C object python/gammu/CMakeFiles/python_gammu.dir/src/gammu.o
In file included from /Library/Frameworks/Python.framework/Headers/Python.h:57,
from /Users/jgordon/Downloads/gammu-1.27.0/python/gammu/src/gammu.c:23:
/Library/Frameworks/Python.framework/Headers/pyport.h:761:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
make[3]: *** [python/gammu/CMakeFiles/python_gammu.dir/src/gammu.o] Error 1
make[2]: *** [python/gammu/CMakeFiles/python_gammu.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [install] Error 2
Thanks
It looks like Python is somehow miscompiled (or misconfigured).
You can always try building Gammu without Python support to workaround this if you don't need it.