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

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.

Related

CUDA with C++ Builder

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

TDateTime data type

I have been using C++ Builder to develop some classes. I have been using the TDateTime data type by including the 'vcl.h'. Is this only unique to C++ Builder?
I ask this because I am now using Microsoft Visual Studio C++ and am getting a 'TDateTime is undefined error'.
How can I use this type in Visual Studio?
Thanks
I would suggest having a look at boost.datetime and, if you have access to C++11 support, the standard C++ time and time duration utilities available in the <chrono> header. One advantage of using either of these is that they are portable, so you are not bound to a given compiler or development environment.
Most of Borland's Visual Component Library is built around it's own compiler-specific extensions and delphi code. I very much doubt you will have an easy time getting it to work under any other compiler.
LUckily there are plenty of alternatives. If you're using Visual C++, then you can use Microsoft's Date/Time libraries:
http://msdn.microsoft.com/en-us/library/6ahxxcsz%28v=vs.100%29.aspx
There are also portable libraries from Boost and QT which should run under any modern C++ compiler
http://www.boost.org/doc/libs/1_51_0/doc/html/date_time.html
http://doc.qt.digia.com/4.5/qdatetime.html

OS X Lion C++11, Boost and other questions

I am an experienced Mac/iOS developer, but I initially started to program in C++. I haven't touched C++ for years, and now, it's time to do so, because I want to have multi platform support for a new kind of file type I am trying to create.
C++ has evolved over the years, to what I find is a very bloated mess of 3rd party libraries and an effort by the C++ standards committee to control the evolution of the language. Hence, my questions.
I want to have as much advanced tools at my disposal as possible, and at the same time conform to standards as possible. My main development platform is OS X Lion, and I have access to a fedora 16 installation. I want to target Lion and above, Windows XP and above, and the latest Linux kernels, so backwards compatibility is not an issue here.
One choice is to install the Boost libraries to my machine, but to what I have experienced a long time ago it is a very painful process, with compile-time errors and quirks that have to be done to OS X. I don't know if that experience will be the same if I try that now. The other choice is to stick with TR1 which Lion currently offers. However, TR1 is not a standard as I understand, it is a de facto popular implementation of things that were scheduled to be done in C++11. That way I lose a lot of advanced features that Boost offers.
With these two options in hand, what is the recommended way to have advanced C++ features at your disposal and conform to standards as much as possible? If it's Boost, is it recommended to compile Boost as static libraries in order to avoid installing Boost on end-user machines?
What is the current support of Xcode 4.3 for C++11 features?
I would appreciate any comments on the above questions as well as any other thoughts on the matter. I am trying to get in sync with the current version and features of C++ and I begin to realize that this may not be so easy as I initially thought.
Thanks.
First of all, there are two very distinct parts in Boost:
those which are header-only
those which require compiled libraries
If you stick to header-only, it will definitely be much easier. Note that some libraries, like Asio, have two compilation modes (header-only and library). A number of useful libraries, however, such a boost::regex, do require a compiled library.
Second, C++11 support is moving fast. GCC 4.7 and the upcoming Clang 3.1 support all major features of the Standard, except from atomics (discussions are still ongoing on the best implementation strategies), so on Linux and Mac, things are great... however Visual Studio is lagging behind, and Microsoft is not really interested in moving fast, so on Windows support is minimal still (and advertised supported features are based on older versions of the Standard and not 100% compatible with the last version). It does not mean you cannot compile for Windows, merely that you should use Mingw or equivalent and thus forgo interaction with existing Windows DLLs.
Based on those two observations, I would recommend:
try to avoid C++11 for now if you want to interact with Windows DLL, otherwise I would recommend Clang (for its integration in XCode)
try to avoid Boost libraries and stick to the header-only parts (there is still much goodness)
if you want libraries, you can use DLL as long as you distribute them alongside the executable or use a package system or whatever, but it does present a greater difficulty (for the installation) than just static linking.
Note I'm not a Mac developer but I'd prefer Boost. Many C++11 standards are taken from it and you can expect more Boost features will be ported to C++ standards.
And as a Qt enthusiast: take a look at QtCore. It's very powerful and cross-platform.

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.