Ld build/Release-iphoneos/Demo.app/Demo normal arm64
cd /Users/meitu/Desktop/Demo3
export IPHONEO _ DEPLOYMENT _ TARGET=11.0
you have to install the debug version of OpenCV 3.3.
If you use cmake follow the instruction given by
https://docs.opencv.org/2.4/doc/tutorials/introduction/linux_gcc_cmake/linux_gcc_cmake.html
For integration into a makefile under linux you can use the useful commands
pkg-config --cflags opencv
pkg-config --libs opencv
in your Makefile.
Maybe you must compile openCV by yourself setting the debug option.
I am trying to run NVCC to compile a CUDA program on my Mac.
When I try to run NVCC, I am receiving the following error: "nvcc fatal : The version ('70300') of the host compiler ('Apple clang') is not supported".
I recently updated my XCode version to 7.3, and my Mac to 10.11.4.
Is there any way to revert my Clang Version?
Go to https://developer.apple.com/downloads/, log in and then download http://adcdownload.apple.com/Developer_Tools/Command_Line_Tools_OS_X_10.11_for_Xcode_7.2/Command_Line_Tools_OS_X_10.11_for_Xcode_7.2.dmg, and install, as was suggested by fabregaszy.
Run the following command to switch to the old version:
sudo xcode-select --switch /Library/Developer/CommandLineTools
Run the following command to quickly check clang version:
clang --version
The accepted answer says to download the next-to-latest command line tools and install them, then select them by typing in the console
sudo xcode-select --switch /Library/Developer/CommandLineTools
Its been asked how to revert to the original version of the tools. This is achieved by
sudo xcode-select --switch /Applications/Xcode.app
I just had the same issue after upgrading to XCode 7.3 on 10.11. Reinstalling the previous (7.2) command line tools didn't downgrade the default clang compiler. To fix this I used a previous XCode.app package to rename and copy the XcodeDefault.xctoolchain directory into the Toolchains director in the current /Applications/Xcode.app. You have to right click on Xcode.app to "Show package contents" then browse to the Toolchains dir.
Then (re)start Xcode, hit command-, for preferences, then go to locations. You will see the dropdown for Command Line Tools. Change this to the version of the toolchain you copied over.
You can check the default version of clang in Terminal:
clang -v OR llvm-gcc -v
Now nvcc should work
I came into the same issue.
I think the old command-line tools which can be downloaded from
https://developer.apple.com/downloads/
may solve this issue.
Updated:
I downloaded from the link below and installed, the clang version was successfully reverted to Apple LLVM version 7.0.2 clang-700. But please keep an eye on your OS X version.
http://adcdownload.apple.com/Developer_Tools/Command_Line_Tools_OS_X_10.11_for_Xcode_7.2/Command_Line_Tools_OS_X_10.11_for_Xcode_7.2.dmg
I would try homebrew's version of llvm, it works for me.
brew install llvm37
Then, set your compiler to homebrew's clang:
/usr/local/bin/clang++-3.7 or whatever respondes to
which clang++-3.7
That way you can leave your OS X dev environment defaults as they are.
Unfortunately, installing Command Line Tools from X-code version 7.2. currently is not solving this.
Trying to compile results in:
nvcc fatal : GNU C/C++ compiler is no longer supported as a host compiler on Mac OS X.
What did the trick for me, was to uninstall Xcode 7.3 and install Xcode 6.2 from the Apple developer site.
Rename Xcode exists in your mac as Xcode-7.app in /Applications folder.
Then download Xcode6.4 from https://developer.apple.com/download/more/ and install it.
80100 can work with some nvcc programs
I used "80100" and nvcc work for some of my other programs.
... but not sample
`
...
nvcc fatal : The version ('80100') of the host compiler ('Apple clang') is not supported
...
`
install CLT 8.2 (Command line tool from Apple) it is sort of ok with message about "command line tools instance"
I google and see a discussion about this (https://github.com/arrayfire/arrayfire/issues/1384) about array fire nvcc issue and thanks to the hint to switch to CLT 8.2, the last version not current one. It is sort of ok with warning message about "command line tools instance"
Need to use "sudo make" to compile sample code:
`
...
$ sudo make
Password:
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
expr: syntax error
/Developer/NVIDIA/CUDA-8.0/bin/nvcc -ccbin g++ -I../../common/inc -m64 -Xcompiler -arch -Xcompiler x86_64 -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_60,code=compute_60 -o deviceQuery.o -c deviceQuery.cpp
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
/Developer/NVIDIA/CUDA-8.0/bin/nvcc -ccbin g++ -m64 -Xcompiler -arch -Xcompiler x86_64 -Xlinker -rpath -Xlinker /Developer/NVIDIA/CUDA-8.0/lib -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_60,code=compute_60 -o deviceQuery deviceQuery.o
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
mkdir -p ../../bin/x86_64/darwin/release
cp deviceQuery ../../bin/x86_64/darwin/release
$ ./deviceQuery
./deviceQuery Starting...
CUDA Device Query (Runtime API) version (CUDART static linking)
Detected 1 CUDA Capable device(s)
...
`
I had the same problem!
Looked in my Time Machine Backups and copied Xcode.app (7.2.1) in my /Application folder. You could also download it from the Apple Developer Page and move it into your /Application folder.
After it's done, you can change the Xcode Command Line Version in your Preferences of Xcode to 7.2.1
Then nvcc will work again (even with pycuda-2016.1).
clang --version
gives me:
Apple LLVM version 7.0.2 (clang-700.1.81)
I'm trying to compile OpenCV version 2.3.1 on an Ubuntu 11.10 following instructions described here. I'm getting following error. Can't understand what is happening... /usr/local/lib/libavcodec.a exists but linker can't link against it, or something else?
error:
[ 20%] Built target pch_Generate_opencv_highgui
Linking CXX shared library ../../lib/libopencv_highgui.so
/usr/bin/ld: /usr/local/lib/libavcodec.a(avpacket.o): relocation R_X86_64_32S against `av_destruct_packet'
can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libavcodec.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
The problem is that you are attempting to link libopencv_highgui.so with libavcodec.a. The latter is built from code compiled without -fPIC (which is quite usual), and such code can not be linked into shared libraries on x86_64.
Your choices are:
Obtain libavcodec.so and arrange to link against it, or
Remove libavcodec or -lavcodec from the link line completely.
For the first, you most likely just need to install libavcodec-dev package.
If you do the second, you will still have to arrange for symbols that libopencv_highgui.so needs from libavcodec to be available at runtime. You can achieve that by linking the main executable with libavcodec (either archive or shared variant).
my take would be that, first run sudo apt-get remove libavcodec , then re-install with sudo apt-get install libopencv-dev
I once had similar issue, and the above resolved it
Running a 64-bit version of Ubuntu you have to configure and build ffmpeg with
./configure --enable-shared --enable-pic
as it is described in step 7b and 8b
I have multiple versions of openCV (2.0,2.1) on my mac. Is there a way to erase these multiple versions and all its files so that i can make a fresh install of openCV 2.3.0
The most obvious command
sudo port uninstall opencv
may not work, at least in my case it complained that it needs a particular version. I run then
sudo port uninstall opencv 4.2
All opencv libraries in /opt/local/lib were gone after that command. After that I re-installed openCV with
sudo port install opencv
(If there is a problem with ffmpeg just uninstlal it with sudo port uninstall ffmpeg)
Reinstalling opencv, by the way, fixed my problems with compilation and linking that I had after switching from Mountain Lion to Maverick (10.9.2). In particular, I had a linker problem in Eclipse:
Invoking: GCC C++ Linker
g++ -L/opt/local/lib -o "deltetit" ./src/deltetit.o -lopencv_core -lopencv_highgui -lopencv_imgproc
Undefined symbols for architecture x86_64:
"cv::imshow(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, cv::_InputArray const&)", referenced from:
_main in deltetit.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [deltetit] Error 1
Just delete the install folder.
And make sure to point to the correct install path when compiling your proj
having this problem on installing several things on my mac,
i think this problem is coming from upgrading my leopard to snow leopard. Also this problem also is linked with macports i think.
/usr/local/lib/libz.1.dylib, file was built for i386 which is not the architecture being linked (x86_64)
Any ideas?
Update
To be more specific this happens on installing nokogiri gem
and the log looks like:
xslt_stylesheet.c:127: warning: passing argument 1 of ‘Nokogiri_wrap_xml_document’ with different width due to prototype
cc -dynamic -bundle -undefined suppress -flat_namespace -o nokogiri.bundle
html_document.o html_element_description.o html_entity_lookup.o html_sax_parser_context.o nokogiri.o xml_attr.o xml_attribute_decl.o xml_cdata.o xml_comment.o xml_document.o xml_document_fragment.o xml_dtd.o xml_element_content.o xml_element_decl.o xml_encoding_handler.o xml_entity_decl.o xml_entity_reference.o xml_io.o xml_libxml2_hacks.o xml_namespace.o xml_node.o xml_node_set.o xml_processing_instruction.o xml_reader.o xml_relax_ng.o xml_sax_parser.o xml_sax_parser_context.o xml_sax_push_parser.o xml_schema.o xml_syntax_error.o xml_text.o xml_xpath_context.o xslt_stylesheet.o -L. -L/usr/local/lib -L/opt/local/lib -L/usr/local/lib -L/usr/lib -L. -lruby -lexslt -lxslt -lxml2 -lpthread -ldl -lobjc
ld: in /usr/local/lib/libz.1.dylib, file was built for i386 which is not the architecture being linked (x86_64)
collect2: ld returned 1 exit status
make: *** [nokogiri.bundle] Error 1
This is not about MacPorts:
zlib is installed as i386, so you have to build it for x86-64. Here's how to do it:
Update: As Nick says in his comment, you first have to remove old zlib files: sudo rm /opt/local/lib/libz*
Download zlib source code from its webpage
Extract the source, and open a terminal in source location
./configure, make and sudo make install
If it still doesn't work, remove ruby and install it again (you can do it with RVM)
Hope it helped you.
You might have x86_64 compiled zlib installed in
/usr/local/opt/zlib/ or alternatively do a brew install zlib
this will install zlib in /usr/local/Cellar/.
Temporary remove libz.* from /usr/local/lib/ into a backup folder.
Do gem install nokogiri -v '<version>' --with-zlib-dir=<zlib directory path from step 1>
Nokogiri must be installed by now. Restore the backup libz again.
It is a macport migration to snow leopard issue, sadly you have to reinstall macports and all the ports to have the right architecture. Read the wiki here: https://trac.macports.org/wiki/Migration