CUDA with C++ Builder - c++

How can I use CUDA with C++ builder? Do I have to use a wrapper to do a basic CUDA computation? I searched and there is no info how to set the CUDA SDK for C++ builder.

NVIDIA's API is C-compatible, and C++ builder compiles to native, they also happen to support conventional calling conventions for C.
CUDA has a kernel compiler that allows you to mix C/C++ code with CUDA code in the same file... but I think they sort of embed a gcc version in the toolkit. I had a project where I was mixing code produced by another gcc version, and the easiest thing was to isolate CUDA coda in a library that I compiled with their nvcc, and then linked with the code produced by my gcc version. In my case, I had it easy: the C++ compilers had in common calling and name-mangling convention.
So, you basically have three choices:
Use CUDA's nvcc and gcc to generate C libraries that you can link with from C++ builder.
Trick nvcc to generate C code and try to compile it with C++ builder. I didn't succeed on this however.
Ditch C++ builder, you can still get nice multi-platform graphical user-interfaces using QT-creator with gcc/visual-studio

Related

Integration of Rcpp in c++ with bcc compiler

Hi I`m looking for a library in c++ which i compile with the borland compiler bcc32.
Before I tried to take the benefits of RInside but unfortunately it´s only working with gcc-compiler and can´t be used in my programming environment, wich is Embarcadero.
Is it possible to use Rcpp with a bcc32 compiler?
Are there compatitible librarys on the market doing statistical calculations in c++
I hope you can help me. Thanks.
Part 1: no. From the Rcpp FAQ:
1.3. What compiler can I use. On almost all platforms, the GNU
Compiler Collection (or gcc, which is also the name of its
C language compiler) has to be used along with the corresponding
g++ compiler for the
C++ language. ...
The
clang
and
clang++
compilers from the LLVM project can
also be used ...
The Intel
icc
family has also been used successfully as its output
files can also be combined with those from
gcc
.
If it's not on that list, it's not supported.
Part 2: off topic for StackOverflow.

Does Armadillo run well with Embarcadero C++ Builder XE*?

I plan to purchase Embarcadero C++Builder XE* and later install Armadillo C++ linear algebra library , so I can work on the sparse matrix type of projects. Before I purchase C++ Builder XE* from Embarcadero, I just wonder if Armadillo works well with Embarcadero C++ Builder XE*. I think lots of you run Armadillo, do some of you run Armadillo in Embarcadero C++BuilderXE2~4? Does Armadillo run well there?
Thanks for feedback.
Eddy
Armadillo requires a C++ compiler that can properly handle template meta-programming: the compiler has to properly support the C++ standard.
Is there a particular reason you need the Embarcadero C++ Builder ?
These days we have the luxury of very high quality C++ compilers that are both free (no-cost) and open-source. You may wish to look into compilers such as GCC and Clang, which can be used in conjunction with Eclipse.
All Linux distributions come with GCC pre-compiled. You can get GCC for Windows from the MinGW project.
C++Builder's 32-bit compiler has several issues with more complicated C++ constructs, so it's not unusual for me to have to do some porting work to get C++ libraries to build in it. All other things being equal, I'd recommend another compiler.
I have no experience with Armadillo in particular, but Embarcadero has a free trial available, so you should be able to try it yourself.

Using Visual C++ with a different C++ compiler?

I like the Visual Studio IDE. I'm used to it and find it is the best IDE I've ever tried. We also find increasing use of C#/.NET here.
However, after the underwhelming announcement regarding C++11 features in VS11 I'm looking into replacing the compiler.
It seems that the Intel compiler fully integrates with VS but that doesn't mean it will compile our Windows code. I don't know how I'd fare with a try of g++ or clang
Can VS actually be productively used with a different C++ compiler to compile Windows code, that is legacy code using all kinds of Win32 / MFC / COM stuff?
Depends on how much use you made of the Microsoft-proprietary extensions. Things like #pragma once tend to be supported by all the major compilers, but the weirder COM things (e.g., #import and anything C++/CLI) probably won't be. No idea if MFC will build under the new compiler, but you'll probably have to link it statically or ship your own DLL; G++ definitely uses a different mangling scheme than MSVC.
I'm not sure how easy it is to replace cl.exe and keep your vcproj files intact (though some compilers actually do it), but there are always Makefile projects.
I have never actually worked with the Intel C++ compiler, but I see no reason why it wouldn't compile the code that VC++ does. Here is official Intel documentation.
I use Visual Studio 2008 with a Makefile project to cross-compile; no reason you couldn't do the same with a different Windows compiler.

visual c++ and C++ builder

Can C++builder compile any c++ source files.
I don't have a good knowledge in c++. but i have some experience in delphi.
I like to use c++ but confused which one to use
I know that cbuilder has vcl , easy to develop ,easy for delphi developer
But my problem is can it compile any c++ files (vc++ and other source files).
is it compatible with vc++ (excluding MFC and VCL). Can i use any APIs with c++builder
You'll find C++ Builder very comfy coming from Delphi if you don't care about MFC or .NET via C++/CLI etc and just want native C++ then either will work for you. Visual Studio 2010 supports a lot of the new C++0x features which is pretty nice, although they don't have variadic templates yet. I'm not sure how much of C++0x is in C++ Builder as yet but that could be worth looking into as a deciding factor.
It should be able to compile any standards conforming code. If the code uses extensions that another compiler provides, it will more than likely have problems. VC++ has quite a few extensions that are on by default and so someone using that compiler might use them with out realizing what is going on(the same applies to G++ the other major C++ compiler out there.)
In my experience, C++Builder's support for more advanced C++ code is limited. For example, many of Boost's libraries are unsupported in C++Builder, and I've often had to modify other open source libraries to get them to build properly in C++Builder (due to various bugs or limitations in C++Builder's compiler). Simpler C++ code can work without any problems.
So, depending on what C++ libraries / source files / APIs you're wanting to use, getting them to work in C++Builder may be very straightforward, or it may take significant work.
You can download a free version of C++ Builder at www.embarcadero.com. With that, you can test your libraries for compatibility.

how do i compile a C++program to work in the windows operating system using g++ for linux?

I am new to writing programs in c++ and i want to know if there is a way to export it to a windows format. Also what is a good way to learn objective-c, is it very different from c++? Thank you in advance.
Using mingw32 you can cross compile for windows. See http://www.mingw.org/wiki/LinuxCrossMinGW
Objective C is very different from C++. It's mainstream use (that I know of) is for Apple platforms. I'm sure there are others, but this is the most common that I have seen.
MinGw32 is the way that you would cross compile on a Linux platform to target Windows.
If you want to compile using gcc on the Windows platform, and be compatible with Linux libraries, you can use mingw32/MSys or Cygwin.
If you simply want to develop using gcc on Windows, ignoring any Posix(/Linux standard libraries) compatibility, then there are many options available to you. A popular method would be to download and install Eclipse for C++/CDT. It might use one of Cygwin or Mingw32 under the covers - not sure.
The Objective-C language is a simple computer language designed to enable sophisticated object-oriented programming. Objective-C is defined as a small but powerful set of extensions to the standard ANSI C language. Its additions to C are mostly based on Smalltalk, one of the first object-oriented programming languages. Objective-C is designed to give C full object-oriented programming capabilities, and to do so in a simple and straightforward way.
For reference
You can use Cygwin to code/compile the same code on a windows environment
If you are new to programming I would just try to write something working on both *nix and windows, and compile it directly on Windows if needed.