I've recently downloaded and successfully compiled a small CUDA dll using NVCC (10.2). Unfortunately because I have the most recent toolkit version the distribution requires the most recent driver version too. So I was wondering if there was an NVCC flag that enabled me to effectively target an earlier driver version and then distribute with an older runtime.
Currently, I have to check the run time and driver versions in order to check for compatibility.
The CUDA toolchain, runtime API and its support libraries are versioned and if you build runtime API code with a given toolkit version, you must ship the resulting code with all the libraries from that version or have users install that toolkit version (aka the tensorflow problem).
If you use the driver API, then you can potentially target a lower compute capability with PTX which might be backward compatible with a different driver. I say might because there are still PTX version support limits which can stop it from working correctly.
If you want to support older CUDA versions, just install the older toolchain and build using that toolkit.
Here is the link to the Protocol Buffers / Protobuf Github
https://github.com/protocolbuffers/protobuf
Should I follow the C++ installation instructions?
There is no pre-built binary for Mac M1 ARM architecture.
"Protocol Compiler InstallationThe protocol compiler is written in C++. If you are using C++, please follow the C++ Installation Instructions to install protoc along with the C++ runtime. For non-C++ users, the simplest way to install the protocol compiler is to download a pre-built binary from our release page:
https://github.com/protocolbuffers/protobuf/releases
In the downloads section of each release, you can find pre-built binaries in zip packages: protoc-$VERSION-$PLATFORM.zip. It contains the protoc binary as well as a set of standard .proto files distributed along with protobuf."
As of July 2nd, the estimate delivery time for the Mac M1 ARM binary is 4 months.
For protobuf to work on Mac with the M1 chip first you will need to enable Rosseta with the following command on the terminal
softwareupdate --install-rosetta
This will allow you to run your Mac on Intel compatibility mode and then from there you can install the latest protobuf for your respective programming language.
Has anybody successful cross compiled the Xalan C++ library for armv7/armv7s arch to be used on iOS device (not simulator)?
I was able to cross compile the xerces library by setting the iOS g++/gcc compilers for armv7 but using the same procedure for Xalan gives me below error while running the make file:
iComp:c iComp$ make
Linux, Solaris, AIX, Compaq Tru64, OS/390, MacOSX, HP-UX, NETBSD, FREEBSD, CYGWIN, and MINGW are the only platforms supported.
Above error clearly states that I cannot target the iOS platform.
So was there some problem in configuring the makefiles?
UPDATE
The above issue was occurring because of incorrect usage of Xalan's runConfigure file.
The correct usage to pass additional options to Configure file via runConfigure is to use '-C' option with "--host=arm-apple-darwin --disable-shared"
This has helped to resolve the above platform detection issue and generated the cross-compile make files.
PROBLEM
But now the issue is while running the make, default MsgLoader (inmeme)executable is generated (target: armv7) and after that the make file tries to run the armv7 executable on Mac OSX obviously giving the error 'Bad CpuType in executable'
How can I either avoid the building of Xalan by creating a armv7 exe of MsgLoader or run this armv7 exe in terminal (doesn't seems possible!) so that it proceeds with the build.
Thanks in advance for any help!!!
The current issue I am experiencing is setting up CMAKE for cross-compiling for the AARCH64 environment. The C++ project does reference some other third party libraries such as boost for its compiling.
I have read the documentation, but it is not really clear on the step-by-step procedure on what needs to be done in order to cross-compile using CMAKE for aarch64 on a x86_64 environment.
I have read that I need the rootfs of the aarch64 system, others it states I dont need it and only need the c++ compiler and cross headers/libraries.
At the current moment I am trying to compile the project on a Mustang board. But it runs in to issues with referencing the installed libraries for the x86_64 system.
If there is a person or site that could detail setup by step what would need to be done to this environment in order to get the entire project to cross-compile for aarch64 on a x86_64 system. I would greatly appreciate it.
I am following a opencv installation document Installation in iOS when compile a ios framework. However, if I did not change platform/ios/build_framework.py and build the framework, I will have the following errors:
build settings from command line:
ARCHS = x86_64
IPHONEOS_DEPLOYMENT_TARGET = 6.0
SDKROOT = iphonesimulator6.1
Build Preparation
Build task concurrency set to 8 via user default IDEBuildOperationMaxNumberOfConcurrentCompileTasks
=== BUILD AGGREGATE TARGET ZERO_CHECK OF PROJECT OpenCV WITH CONFIGURATION Release ===
Check dependencies
=== BUILD NATIVE TARGET zlib OF PROJECT OpenCV WITH CONFIGURATION Release ===
=== BUILD NATIVE TARGET libjpeg OF PROJECT OpenCV WITH CONFIGURATION Release ===
** BUILD FAILED **
Build settings from command line:
ARCHS = x86_64
IPHONEOS_DEPLOYMENT_TARGET = 6.0
SDKROOT = iphonesimulator6.1
=== BUILD NATIVE TARGET zlib OF PROJECT OpenCV WITH CONFIGURATION Release ===
Check dependencies
No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=x86_64, VALID_ARCHS=i386).
** BUILD FAILED **
Then, after many tries, I found that if I only compile for architecture armv7, armv7s and i386 by changing the following scripts in platform/ios/build_framework.py the framework can be built successfully.
targets = ["iPhoneOS", "iPhoneOS", "iPhoneSimulator"] #"iPhoneOS", "iPhoneSimulator"
archs = ["armv7", "armv7s", "i386"]#"arm64", , "x86_64"
for i in range(len(targets)):
build_opencv(srcroot, os.path.join(dstroot, "build"), targets[i], archs[i])
Any ideas on how I can compile for the arm64 and x86_64 architecture? Thanks.
Take out the i386 and compile for armv7,armv7s, and arm64 - these are the architecture option for Xcode for 64 bit - iphone5s.
Do not mix intel and arm specification they will not and cannot mix. The architecture command is to inform the compiler on how the object code will be created. Because intel is a CISC processor and arm is a RISC internally their object codes are very different.
a MOVE command for example may generate an x'80'opcode (command instruction) for intel but an x'60'for ARM. far as I know an i386 is the old intel 32 bit architecture, Xcode maybe doing some magic to have universal object codes that can run on both intel and RISC if it is doing so - it will not be efficient, it will always be better to compile to specific architectures.
The 32 bit, 64 bit 128 ..... are addressing modes - they are also the size of the processor registers and determine how much memory (RAM) can be accessed by the CPU. In general, aside from the ability to have huge RAM, higher bit processors will usually reduce the number of instructions to do a particular task.
Because downward compatibility is usually built in, an app compiled for armv6 will typically run in armv7 or even arm64 in compatibility mode but it will not be able to harness the advantages of running a true 64 bit application.
The targets is a higher level specification which specifies which commands can be used for example an iPad has UIPopViewController but this is not supported in an iPhone or an iPod touch.
One last thing - only iPhone 5s works with arm64 if you set another target it will probably flag arm64 as not an option.
So if you are compiling for x86_64 architecture, that is for OS X (laptop or mac tower), NOT iOS (iPad, iPhone).
What are you using? Not Xcode I presume?
You don't need to compile to x86_64 unless you want this to run on a 64-bit mac laptop or desktop... & it doesn't seem like you are trying to do that by your question?
Also, if you have it for i386 it is probably compatible with most OS X machines -- it will just run in 32-bit not 64-bit.
As far as arm64, that is also probably 64-bit. You might not have the libraries for 64-bit? Is your machine running on 64-bit? Check the opencv libraries (dynamic or static?) & see if they are 32 or 64? If they are 32-bit then that is the problem. You'll need to build them as 64-bit libraries or find them as such. I can't give you anymore info without knowing what platform you are on.
I recently learned that OpenCV for iOS has been added to CocoaPods. You can see the podspec here and the Github repository here. With CocoaPods, you create a file named Podfile in the root of your project and paste in this line:
pod 'OpenCV'
Save the file and run pod install from the terminal (assuming that CocoaPods is installed of course).
I have this running on my iPhone 5S, which is 64 bit as well.