fivemack: (Default)
[personal profile] fivemack
I have three large programs on my computer, two of which cost Nottingham University fair sums of money, and all of which claim to be C++ compilers.

What I want is to do some fairly straightforward linear algebra (possibly later to be replaced by some vaguely-sophisticated sparse linear algebra), and display the results on the screen. If Python knew how to talk to DirectX, I would write it all in Python and I'd be finished by now.

But Python can't talk to DirectX, so I have to do it all in C++. And, whilst Python has good linear algebra libraries, C++ doesn't seem to; there's something called TNT from NIST which is incredibly primitive, and something called GMM++ from the University of Toulouse which looks as if it does everything I might want.

But it's written to compile under gcc-3.2. Whilst I have gcc-3.2, it doesn't know how to talk to DirectX either; and gcc-3.2, icc-7.1 and Visual Studio.NET (the three C++ compilers I have) clearly view the C++ standard in different ways, so a program that compiles under gcc needn't compile under any of the other compilers.

So I have spent the evening re-inventing the wheel (re-writing my perfectly good python code in C++), only to find that the wheel is incompatible with the track. It may just be that I'm a poor workman, to blame my tools at this length; I do have the reference books to build my own linear-algebra routines, but that would be a case of re-inventing the rock, let alone the wheel.

The lovely thing about Python was that its routines tended to work without vast expenditures of cursing; maybe it's unrealistic to expect other software to be that pleasant, but I can't convince myself, given that I've seen more than one reasonably happy professional programmer, that this level of unpleasantness is routinely endured by professional programmers. What am I doing wrong?

Date: 2003-11-26 06:21 pm (UTC)
From: [identity profile] randwolf.livejournal.com
The license MS ships its headers under is incompatible with the GPL which gcc uses. I commend to your attention the -ansi option of g++ or better yet, std=c++98--that will probably restrict g++ to a compatible dialect. Would SDL (http://linux.oreillynet.com/pub/a/linux/2001/09/21/sdl.html) or OpenGL work for you? Does it have to be DirectX?

licence

Date: 2003-11-27 01:35 am (UTC)
ext_8103: (Default)
From: [identity profile] ewx.livejournal.com
GCC output is not covered by the GPL, just the compiler itself

Re: licence

Date: 2003-11-27 03:12 pm (UTC)
From: [identity profile] randwolf.livejournal.com
But the FSF cannot ship headers for DirectX, because, on the one hand, MS owns the rights and would not allow it and, on the other hand, all software the FSF ships is under the GPL. The FSF cannot even devise an alternate set of DirectX headers; they would be sued and would probably not win.

Re: licence

Date: 2003-11-27 03:15 pm (UTC)
ext_8103: (Default)
From: [identity profile] ewx.livejournal.com
Why would they need to ship headers? Compare the situation with e.g. Gnu C running on Solaris, where the native headers are used.

Re: licence

Date: 2003-12-01 10:49 pm (UTC)
From: [identity profile] randwolf.livejournal.com
[old business]

The DirectX headers aren't shipped with Windows; they're part of the DirectX SDK, which has to be licenced from MS.

Re: licence

Date: 2003-12-02 02:09 am (UTC)
ext_8103: (Default)
From: [identity profile] ewx.livejournal.com
I'm having trouble seeing the relevance of this.

Re: licence

Date: 2003-12-02 12:25 pm (UTC)
From: [identity profile] randwolf.livejournal.com
Oh, I see. No, there are also incompatibilities between the MS headers & libraries and gcc--it might be possible, but I sure wouldn't want to try it for a quick project. Search for "DirectX" here (http://www.mingw.org/), for more details.

March 2024

S M T W T F S
     12
3456789
10111213141516
17181920212223
24 252627282930
31      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 31st, 2026 10:06 am
Powered by Dreamwidth Studios