Install arm64 packages on A amd64 machine - c++

I have A Raspberry Pi 3 device, the arch is arm64. And I have a ubuntu computer, the arch is amd64. I am doing the cross compile. I want to do the cross compile my code on the ubuntu and then copy the executables to the Raspberry to execute. My software depends opencv, ffmpeg...etc. I Have tried the MultiArch solution. When I try to download ffmpeg:arm64, the apt show me this error.
So I tried to download the first dependency libavcodec58, but the result is:
and When I tried to install the dependency glibc, the result is here:
The Apt will remove all the libraries from my current system.
So could anyone can help me about this?

Related

What is the right package that should be added to cross compile for Linux when installing cygwin?

I am trying to compile Linux binaries on Windows with Cygwin. I found this topic about the issue and best answer to the topic says that linux-*-gcc-* packages under Devel category (Cygwin Ports repository) should be added. However, I am not able to find such packages under Devel category.
How can I get the right packages for Cygwin to cross compile Linux binaries on Windows? Or, is there any other recommendations about cross compiling for Linux on Windows?

Homebrew OS X OpenCV - looking for dylib when running on another Mac

I have a cross platform (Windows + Mac) application, built with QT and C++ libraries, which uses OpenCV. I had previously used an OpenCV version downloaded and compiled on the Mac, but decided to try to use the homebrew version to simplify installation on dev machines.
I did brew install opencv --with-contrib and brew link opencv, and managed to get the program to link and run with the libraries from /usr/local/lib.
Problem is, when I install it on another Mac, the program crashes when I try to run it, saying: Library not loaded: /usr/local/Cellar/ilmbase/2.2.1/lib/libIex-2_2.23.dylib.
I'm not sure what to do. I'm not a Mac expert, and certainly no Homebrew expert. Should I go back to compiling OpenCV myself, or can this be solved?
Thanks.
I faced same issue, but I solved it. homebrew installed latest opencv and dependencies. openexr and ilmbase also installed latest version. but opencv.jar refered specific version of library.(ex libIex-2_2.23.dylib)
So, you'd install ilmbase version 2.2.X. and than solve library issue.
https://github.com/Homebrew/homebrew-core/blob/master/Formula/ilmbase.rb
This link is ilmbase install Formula. You can ckeckout v.2.2 Formula commit.
And than uninstall & re-install ilmbase v.2.2.

Compiling code on Jetson TK1

I am compiling an application using the gcc arm cross compiler(arm-eabi-g++). I want to execute the code on the jetson tk1 target. When I copy the executable and run it on the target. I get an error saying -bash: ./Proj: No such file or directory
Should I include any extra conditions while building, inorder to run it on the target?
Can anyone suggest any other cross compiler that works?
It might be differing of system architecture and program architecture.
Look for the architecture of TX1 with command
uname -p
From JetPack v2.2 Jetson TX1 can be installed with aarch64 or armhf architecture
Simpliest way to cross compile is to use arm-linux-gnueabihf-g++ for armhf and aarch64-linux-gnu-g++ for aarch64. You can run armhf programs on aarch64 but you need to install armhf versions of all necessary libraries like libc or libstdc++:
sudo apt-get install libc6-dev:armhf

32-bit OpenCV on OS X Lion? Possible?

I've been googling and trying for days now, trying to figure out how to get 32-bit OpenCV working on OS X Lion, but can just find 64-bit version.
So i have the following questions:
OpenCV libraries come in 32-bit or 64-bit arch, is that correct?
How do I get 32-bit OpenCV working on Lion? I've trying the following ways:
- Install OpenCV via MacPorts: nope, MacPorts installs a 64-bit version.BI removed OpenCV and MacPorts.
Install OpenCV 2.4.1 via Homebrew, using the following command:
brew install opencv --build32
but looks like they are 64-bit too. Removed OpenCV and Homebrew.
Install OpenCV 2.4.1 by myself using standard unix makefiles. Nope, they still look like 64-bit.
I've written "they look like 64-bit" because i have to replace OpenC in a Xcode project made under OS X Snow Leopard, targeted for 32-bit Mac, and I always get tons of errors like:
ld: warning: ignoring file /usr/local/Cellar/opencv/2.4.1/lib/libopencv_calib3d.2.4.1.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
so i suppose that the OpenCV stuff is 64-bit. If i force the project to run in 64-bit, it rubs but doesn't work properly and gets stuck.
Is there a standard way to check if my OpenCV libraries are 64-bit or 32-bit?
Where can i get 32-bit OpenCV?
Solved the problem.
Recap: it is possible to have 32-bit OpenCV libraries on 64-bit Mac OSX Lion.
How?
Step 1: Download OpenCV 2.4.0
Step 2: Download and install CMake.
Step 3: Untar the OpenCV package.
Step 4: Make a separate directory inside the OpenCV package for building
mkdir build
cd build
cmake -G "Unix Makefiles" -D CMAKE_OSX_ARCHITECTURES=i386 -D CMAKE_C_FLAGS=-m32 -D CMAKE_CXX_FLAGS=-m32 ..
(this will force the 32-bit compile)
make -j8
sudo make install
Step 5: Enjoy!
For forther reference please visit Mac OS X OpenCV Port Page
Thanks all for putting me on the right track:
#karlphilip: I tried to do as you suggested, but without the make options the compile phase fails, because the architectures are incoherent.
#hamstergene: MacPorts got stuck after the new installation, maybe I have some remains of the older install :( (strange, i followed the official instrusctions to remove it).
#Adrien: That's what I've done, but i had to merge 2 approaches :)
I ve had a hard time configuring OpenCv libraries on a number od different OSs. Turns out that the thing is auto-generating a sample project and then bulding business logic inside it.
See the installation instructions here
The web site of the OpenCV project has been significantly upgraded in the last year.
A new tutorial section is avaiable, i was able to install OpenCV on my 32-bit core Mac OS Lion.
A very cool tutorial is also available at Sadeep's Tech Blog, covering an interesting range of details.
Hope this helps!
Here's something you can try: download OpenCV 2.4 sources and edit the CMakeLists.txt in the root directory. Around line 242 you will see:
# ----------------------------------------------------------------------------
# Path for build/platform -specific headers
# ----------------------------------------------------------------------------
set(OPENCV_CONFIG_FILE_INCLUDE_DIR "${CMAKE_BINARY_DIR}/" CACHE PATH "Where to create the platform-dependant cvconfig.h")
add_definitions(-DHAVE_CVCONFIG_H)
ocv_include_directories(${OPENCV_CONFIG_FILE_INCLUDE_DIR})
below the add_definitions() call, add this one:
add_definitions(-m32)

XCode 4 & OpenCV Libraries

I've been googling and trying for days to solve my problem I had n luck, so I'm asking my first question here.
I have a MacBook with Lion (1.7.4), Xcode 4.
I need to work on a C++ application made with Leopard and Xcode 3.
The application comes with its own OpenCV.framework and is made for 32-bit Architecture (as u can see in Fig. 1)
I've tried to get it working on Xcode 3, and it works just fine, no need to install OpenCV or stuff (that is because the OpenCV.framework is included in the project, right?).
On Xcode 4 it's not working. That's what I've tried:
Run it "as is": even thought the OpenCV.framework is in the application directory, i get the following error:
dyld: Library not loaded:
#executable_path/../Frameworks/OpenCV.framework/Versions/A/OpenCV
Referenced from:
/Users/fabrizioborgia/Library/Developer/Xcode/DerivedData/suiviGUI-awhilvjpoqatfdansnpqcexpnxaw/Build/Products/Debug/suiviGUI.app/Contents/MacOS/suiviGUI
Reason: image not found
Remove the OpenCV.framework, install OpenCV via MacPorts and link the libraries. Nope, the libraries are 64-bit, and my program is 32. Removed OpenCV AND MacPorts.
Remove the OpenCV.framework, install 32-bit OpenCV via Homebrew (brew install opencv --build32) and link the libraries. Nope, i get the following error, so I assume that the libraries are STILL 64-bit. Right? Removed OpenCV AND Homebrew.
ld: warning: ignoring file
/usr/local/Cellar/opencv/2.4.1/lib/libopencv_calib3d.2.4.1.dylib, file
was built for unsupported file format which is not the architecture
being linked (i386)
Remove the OpenCV.framework, install OpenCV 2.4.1 by myself (with make and stuff) and link the libraries in the project. Nope, if i run the program on 32-bit arch it tells me that the libraries are not for 32-bit arch.
In any case, if I try to run it on 64-bit the compilation is successful but the program doesn't work properly.
Guys, really, I'm out of ideas, maybe I'm on the wrong direction, maybe I just have to find another OpenCV.framework or there is some linking setting that I'm missing, and the program doesn't see the framwork.
Anyone can help?
Solved the problem.
I applied some sort fo "divide et impera approach" and I asked a new question here on SO, you can find it here: 32-bit OpenCV on OS X Lion? Possible? and I found out that MacPorts AND Homebrew AND the Cmake Approach install by default the native architecture (64-bit in my case) OpenCV libraries, I needed the 32-bit, so i followed those steps:
Step 1: Download OpenCV 2.4.0
Step 2: Download and install CMake.
Step 3: Untar the OpenCV package.
Step 4: Make a separate directory inside the OpenCV package for building
mkdir build
cd build
cmake -G "Unix Makefiles" -D CMAKE_OSX_ARCHITECTURES=i386 -D CMAKE_C_FLAGS=-m32 -D CMAKE_CXX_FLAGS=-m32 ..
(this will force the 32-bit compile)
make -j8
sudo make install
Step 5: Link the brand-new libraries in the Xcode project using the "Link Binary to Libraries" build phase.
Step 6: Hit "Run" :)
I would suggest that you get OpenCV working (if not already) in Lion with XCode 4 (tutorial). Test it with the example in the linked tutorial. Once that works, then copy over the classes you need from the project that you can't get working.
In other words, abandon the older project and rebuild it from a working project base.