Slashdot Mirror


Competitive Cross-Platform Development?

Avalonia asks: "I work for a software company in the oil and gas exploration industry with a software development team of seven. Our software and development environment is cross-platform on Solaris, Irix, Linux and Windows. Most of our customers are on Solaris and Irix 64-bit systems, but Linux and Windows are increasingly important. Our environment is based around an elaborate command-line system of Makefiles controlling four different compilers (gcc 3.1, Sun Forte, Irix MIPSpro and Visual C++ 7). Needless to say, maintaining this system and producing modern multi-threaded C++ that will go through the four build systems is time-consuming in the extreme. A large proportion of our time is spent finding C++ code that just works rather than being creative and competitive with new functionality. What tools and strategies can we use to increase our productivity and regain our competitive advantage, without going for Windows only?"

"Our recent single-platform competitors (Windows only) can seriously outrun us in terms of productivity by using a single modern IDE development environment - such as C++ builder or Visual Studio - although we can scale onto larger multiprocessor Unix systems. With Windows 64-bit imminent we may lose our 'big-iron' scalability advantage. Java is not currently an option for the high-performance numerical and immersive graphical aspect of our applications."

410 comments

  1. Might I suggest... by XaXXon · · Score: 1, Insightful

    Perl? :)

    Platform independent, it's highly creative, and damn if you can't prototype stuff quickly.

    1. Re:Might I suggest... by akookieone · · Score: 5, Insightful

      Are you kidding me? They are building a real application that performs and does multi-threaded as only C++ can do. If you can't use java, what makes you think that perl, especially interpretted, would do the trick? Yeah, fine for prototyping, but how is this going to help?

    2. Re:Might I suggest... by Anonymous Coward · · Score: 2, Interesting

      Python? :)

      Platform independent, it's highly creative, and damn if you can't prototype stuff quickly.

      P.S. And you can actually understand the code months after you wrote it. ;)

    3. Re:Might I suggest... by SirSlud · · Score: 2, Funny

      LOL! Well, you didn't suggest Javascript, so I guess that counts for something.

      --
      "Old man yells at systemd"
    4. Re:Might I suggest... by EyesWideOpen · · Score: 2

      This would seem like a good solution on the surface of it but the 'immersive graphical aspect of our applications' that was mentioned may mean Perl is out of the question.

      Of course I've never done any graphical programming in Perl (besides Perl/CGI) so I could be wrong depending on the nature of the GUI.

      --

      As with the sun's light
      My mom was magnificent
      Unquestionable
    5. Re:Might I suggest... by ArmorFiend · · Score: 1

      If they're worried about performance to the point where gcc ISN'T good enough on the various machines, then they're not going to goof around with interpreted languages, they'll be waaaaay too slow.

      Lay off half your programmers, then invest the money you save in contracting for GCC optimizations on your oddball platforms.

    6. Re:Might I suggest... by bomb_number_20 · · Score: 2, Insightful

      I think the parent is a joke, but:

      if all you have is a hammer, eventually everything begins to look like a nail.

      --
      That's ok, Jesus likes me anyway.
    7. Re:Might I suggest... by shepd · · Score: 0

      Not that it's particularly excellent, but PerlTk does 100% of basic GUI functionality, but lacks a lot of "splash" and speed.

      --
      If you could be told what you can see or read, then it follows that you could be told what to say or think - BoC
    8. Re:Might I suggest... by kberg108 · · Score: 0

      nope your right

      --
      I like things that are sweet and not things that are lame. --
    9. Re:Might I suggest... by Dan667 · · Score: 1

      I agree. I build on multiple platforms for a CAD system and use one set of perl code for all of them. Use ansi c for the heavy stuff. Works great

    10. Re:Might I suggest... by kryonD · · Score: 1, Insightful

      Take it even a step further. Web base everything and ensure that your cgi cripts only produce HTML 1.0 compliant pages. You can of course go higher than 1.0, but then you start to get into the "What browsers do I support?" question.

      Your code could indeed be written in perl, although I would recommend ANSI C or C++ for two reasons. #1 You are already familiar with the language and compilers. #2 You probably deal with large variable quantities of data that are processor intensive and would suffer from "script" style languages.

      The beauty of this is you can now switch to only one compiler since the applications are only running on the web server. My programming shop is responsible for producing software that tracks and manages supply and maintenance in the Western Pacific for the Marine Corps. You may not have alot of customers who are running your software from a tent in the middle of BFE over an 8KBit pipe. But I'm sure web basing will still reduce the number of customer support issues that involve you going to the machine the software is installed on to see what the customer is talking about when he says, "I'm getting this strange error."

      It worked wonders for our shop of 5 programmers

      --
      I've dirtied my hands writing poetry, for the sake of seduction; that is, for the sake of a useful cause. --Dostoevsky
    11. Re:Might I suggest... by voodoo1man · · Score: 2, Informative

      While we're talking about switching languages, why not Common Lisp? It compiles to native code and has all the features mentioned (fast numerical code, vendor support for multithreading (this will likely be standardized now that J13 has decided to meet again), portable graphics (CLIM), very platform-neutral, no more rat nest makefiles - hell, no more making at all). The only downside is that Allegro CL is the only compiler continuing support for SGIs (although it also supports hp-ux, aix and various flavor of DEC unix, with no extra porting effort unless you're doing tricky FFI). If the contract is large enough, it might be possible to convince Xanalys to port Lispworks to the SGI again (I'm fairly certain it ran on that platform sometime in the past).

      --

      In the great CONS chain of life, you can either be the CAR or be in the CDR.

    12. Re:Might I suggest... by kraksmoka · · Score: 1

      how bout basic, its still alive i hear. and it makes the best turtle tracks! wow. . . . .

      --
      "You never want a serious crisis to go to waste." - Rahm Emanuel
    13. Re:Might I suggest... by BurKaZoiD · · Score: 1

      Eiffel anyone? No wait, seriously...Ada....no, no, no, no...Lisp....no, wait, I got it...COBOL! FORTRAN?!?

      *Tap,tap*Is this thing on?

    14. Re:Might I suggest... by Anonymous Coward · · Score: 0

      www.wxwindows.org You should check out wxWindows, its a pretty much fully functional opensource package that lets you compile your code on Linux / BSD / *nix / Mac / Mac OS X / Win. It's one hell of a good package I have used it to create many different applications, and the documentation is really helpful as well. Cheers

    15. Re:Might I suggest... by Anonymous Coward · · Score: 0

      sig: useful

    16. Re:Might I suggest... by Anonymous Coward · · Score: 0

      This actually isn't a bad idea. CLISP is a very powerful language.

    17. Re:Might I suggest... by Bush+Pig · · Score: 0

      Actually, FORTRAN's not as silly as any of the other suggestions. Until comparatively recently, most software in the oil and gas industry was written in FORTRAN.

      --
      What a long, strange trip it's been.
    18. Re:Might I suggest... by Anonymous Coward · · Score: 0

      for c++ framework and more for
      linux,
      mac,
      windows,
      unix
      etc

      check www.wxwindows.org

    19. Re:Might I suggest... by Anonymous Coward · · Score: 0
      hey fuck-hole!

      He didn't ask what language he should use to parse web logs in only one line -- he's asking about real world applications doing real word stuff.

      I'm willing to wager he only listed linux so he could get on the slashdot front page. I bet it's sgi/irix/windows nt(2000) only.

    20. Re:Might I suggest... by larry+bagina · · Score: 1
      Until comparatively recently, most software in the oil and gas industry was written in FORTRAN.

      That's true. I know whenever I fart, I always think of Fortran.

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    21. Re:Might I suggest... by Anonymous Coward · · Score: 0

      Just because perl was mentioned, and though it would do the job, I might suggest it more as a tool than a replacement. Use perl to bring the source into line. Perl is the glue, Makefiles tend to turn into grease :)

      Of course... converting the code to be C/C++ libraries in the heavy parts, and perl to put it all together could do wonders...

    22. Re:Might I suggest... by Anonymous Coward · · Score: 0

      You must be kidding?!

      I use Perl a fair bit (mainly because on our secure development network we don't have Python).

      While Perl is great for hacking together quick scripts it shouldn't be use for anything that will ever need to be maintained.

      The more I use Perl, and more I learn about it, the more I think Larry Wall has successfully played the biggest joke on the computing world ever.

      Going all gcc with wxWindows, or using Java if it's going to be quick enough, or using Eiffel, or using Python and wxPython with the bits that need optimizing written in C++ are all worth investigating.

      Of course anyone who wants to increase their maintenance costs should definitely consider using Perl.

    23. Re:Might I suggest... by jericho4.0 · · Score: 3, Insightful
      hahahaha, you got modded troll.

      I would sugest the same thing though. Write your whole app in Python. That's your base. Port each function that needs to be ported to C++. At the end you'll have something much more maintainable.

      --
      "A language that doesn't affect the way you think about programming, is not worth knowing" - Alan Perlis
    24. Re:Might I suggest... by Anonymous Coward · · Score: 0

      "if all you have is a hammer, eventually everything begins to look like a nail."

      I think you're gay and you like looking at construction guys butt.

    25. Re:Might I suggest... by Anonymous Coward · · Score: 0

      And when you fart it sounds like whistling, because you shoved too much things up your ass.

  2. try by BigChigger · · Score: 3, Insightful

    www.eclipse.org

    I think it runs on several of the environments you mention. And I think there are C++ plugins for it.

    BC

    1. Re:try by Anonymous Coward · · Score: 0

      >www.eclipse.org

      These guys can't even do a website properly. Their top menu might be in HTML (which is good), but I can't read those 4px fonts (which is bad).

      BTW I'm using Opera 6 on WinXP (I'm at work, don't start flaming me about "choosing WinXP"...)

    2. Re:try by dup_account · · Score: 1

      Looks good in Netscape 7 & Mozilla on Win2k

    3. Re:try by Necroman · · Score: 1

      Eclipse is just an IDE, that is it. There are no compilers what so ever that go along with eclipse. And the CDT (c++) plugin for Eclipse is not the best thing in the world, but I have not used it in a while, so I can't say.

      Try again.

      --
      Its not what it is, its something else.
    4. Re:try by stevejsmith · · Score: 1

      Yeah, I'm using Opera, and the four-point font is an issue, too.




      ...on Windows ME. I'm sorry.

    5. Re:try by Anonymous Coward · · Score: 0

      Why don't you force the minimum font size in Opera? It's in the preferences somewhere; I think that the Linux and Windows preferences screen is different, but in mine it's in the Document section.

  3. gcc cross platform? by SirSlud · · Score: 5, Insightful

    why all the different compilers?

    Hrm, this seems too simple an answer, there must be something wrong with it .. but can't gcc cross compile? At least then you could dump alot of the compiler-specific scripting in your build procedures.

    --
    "Old man yells at systemd"
    1. Re:gcc cross platform? by tsetem · · Score: 2

      Along with GCC for cross-platform compatibility, look at using GLIBC to make sure the functions you expect to be there, are there for all of the platforms.

      Haven't checked recently, but is CygWin still being maintained? If it is, then you have GCC available on all four of your platforms, along with the same development libraries and headers.

      You may lose some of your "Big Iron" support since you are using GLIBC instead of the native libraries. (but I'm not an expert in this to know what kind of performance hit you may take).

    2. Re:gcc cross platform? by aridhol · · Score: 4, Informative

      You aren't necessarily using GLibC. GCC works just as well with other LibC implementations, so you can use your "Big Iron"'s own LibC and LibC++.

      --
      I can't say that I don't give a fuck. I've just run out of fuck to give.
    3. Re:gcc cross platform? by SirSlud · · Score: 1

      Yes indeedie. Go gcc!

      > He that breaks a thing to find out what it is has left the path of wisdom -- Gandalf the Grey

      [cannot resist joke]
      Like a cherry? Ahah! I always wondered why LotR fans were virgins well into life.
      [/cannot resist joke]

      Now mod me into the core of the earth; the pun was simply too juicy to ignore! :)

      --
      "Old man yells at systemd"
    4. Re:gcc cross platform? by ncw · · Score: 5, Informative

      We do exactly this in our main product (a control and monitoring system). It is about 300k lines almost evenly matched between C and C++. Portability was a major concern in its design - we've already had to port it from an obsolete platform!

      We compile using gcc for unix (linux mostly) and Windows using mingw. We cross compile everything from linux and this all works from one Makefile. Recently we even managed to get the NullSoft NSIS installer working under Wine so we can make the install package under linux too.

      Once we got all this ironed out we don't really have to worry which platform we are working on - "it all just works". Any developer can compile for every platform too.

      We split the design into a server part and a client part. The server part doesn't do anything fancy but the client part of course interfaces with the user. We had flirtations with wxWindows [*]and GTK[*] as cross platform GUIs but in the end we decided to use SDL. SDL is very simple but it really works excellently - our application looks identical down to the last pixel on Windows and Linux. Of course we had to write our own windowing system but that is what C++ is for isn't it ;-)

      [*] In our experience GTK doesn't work very well under windows, wxWindows is just too different on Windows/Unix and we couldn't (then) afford the licence fee for QT for commercial products. SDL seemed just the answer for us.

      --
      Every man for himself, all in favour say "I"
    5. Re:gcc cross platform? by bmajik · · Score: 4, Informative

      gcc is the compiler people on linux use because its available, not because its the best.

      gcc on MIPS-IRIX is just awful. gcc is the least common denominator in terms of performance and just as bad as the others w.r.t. compilerisms and peculiarties. it just so happens that if you ported your code to gcc, it would _compile_ everywhere and run in a degraded state on non-linux-x86 platforms.

      so to review:
      On Solaris - the sun compiler smokes gcc for c, c++, and fortran code

      On IRIX - the SGI C++ compiler is almost a reference for how a good C++ compiler should be done. Oh yeah, its code generation is ideal on MIPS architectures (big surprise). can gcc even emit MIPS4 code yet ?

      On Windows - well, msvc is a pretty performant compiler.

      --
      My opinions are my own, and do not necessarily represent those of my employer.
    6. Re:gcc cross platform? by __past__ · · Score: 1, Flamebait
      Along with GCC for cross-platform compatibility, look at using GLIBC to make sure the functions you expect to be there, are there for all of the platforms.
      Huh? Using buggy, bloated, embrace-and-extend libraries is now considered useful for crossplatform development?
    7. Re:gcc cross platform? by p3d0 · · Score: 2
      Have you tried gcc 3.2? Personally, I have not seen any big difference between the code quality of VC++, gcc, and Intel's compiler, though I don't have a great deal of experience comparing them.

      I can't speak for the other platforms.

      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
    8. Re:gcc cross platform? by The+Snowman · · Score: 3, Interesting

      The latest version of GLibC is standards-compliant and faster than MSVCRT, Microsoft's implementation of the standard libraries.

      Actually they use an old version of someone else's libraries, I think the Dinkam libraries.

      Anyway, I haven't run into any problems with GCC/G++ and GLibC in a while. I think version 3 of the GCC fixed a lot of the standards-related issues, and GCC compiled code is plenty fast. It runs circles around the VC++ compiler.

      --
      24 beers in a case, 24 hours in a day. Coincidence? I think not!
    9. Re:gcc cross platform? by zifnab · · Score: 1

      > Have you tried gcc 3.2?

      I didn't look at the code produced by gcc 3.2 but the compiler itself is awfully slow on MIPS systems, even on nice and shiny new Origin300 ... So using this release of gcc to compile is a real pain.

      seb.

      --
      Memory fault -- brain fried
    10. Re:gcc cross platform? by JoeBuck · · Score: 5, Informative

      This message is outdated, possibly reflecting experience with older GCC versions. GCC 3.x is in many ways closer to ISO C++ conformance than MSVC, and it has a new x86 backend that is a big improvement over what we had before.

      Sun's C++ compiler generates faster code than GCC for some cases, but slower for other cases. Sun tuned their compiler for the standard benchmarks, you will not see the gains they advertise for other platforms. In the recent pase, Sun regularly has broken binary compatibility in patch releases, leading to no end of problems for us in supporting customers.

      If you need Fortran, gcc's Fortran is not great. Also, the ia64 support is immature, you will not get fast code out of gcc for that platform.

      Sun, HP, and MSVC are all riddled with compiler bugs of various types; GCC's bugginess is now somewhere in the middle of the pack.

      Finally, differences between compilers can often be greatly reduced by simplifying the coding of inner loops. With code that has been given this treatment, we find that Intel's compiler is only about 5% better than gcc on our large codes.

      But if you do cross-platform C++, GCC can be a very good choice, as you have one set of front-end compiler bugs to work around instead of five or six.

    11. Re:gcc cross platform? by larry+bagina · · Score: 1
      Now mod me into the core of the earth; the pun was simply too juicy to ignore! :)

      It was juicy -- almost as juicy as your mom's furburger after the CLIT gang-banged her.

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    12. Re:gcc cross platform? by Anonymous Coward · · Score: 0

      GCC from GCC 3.1 and up is particularly fast.

    13. Re:gcc cross platform? by King+of+the+World · · Score: 1

      Did you also have to write your own gui toolkit that way?

    14. Re:gcc cross platform? by be-fan · · Score: 2

      Many ways better than MSVC? With regards to standards complience gcc blows MSVC away.

      1) MSVC doesn't even support partial template specialization! GCC is the only compiler to pass all the Boost library compiler tests, and is the reccomened compiler for Loki.

      2) GCC doesn't have nearly as many "magic" keywords as MSVC (you have no idea how many people think that some of thos MSVC stuff is standard C) and the stuff that it does have is being depricated. That alone makes it better :)

      --
      A deep unwavering belief is a sure sign you're missing something...
    15. Re:gcc cross platform? by be-fan · · Score: 2

      glibc is actually notoriously hard to port. Currently, only Linux and Hurd are officially supported, along with Windows support from Cygwin.

      --
      A deep unwavering belief is a sure sign you're missing something...
    16. Re:gcc cross platform? by Oestergaard · · Score: 2

      Working in a company that ships a product (server written in C++, agent in C) on anything from NetWare over NT to Solaris HP-UX and Linux, I think I should chirp in here...

      gcc-3.2 is pretty close to being C++ standards conformant. It is one *helluvalot* closer than VCPP 7 (the .net thingy) - and in my experience so far it is slightly better than Intel C++ 6.0 (the Intel compiler has Koenig lookup problems - and it suffers heavily from it's dependence on MS's poor excuse for an STL).

      I'm sure you're mostly right about the performance - gcc probably doesn't generate "fast" code compared to Sun or SGI's compilers, on their respective platforms.

      But in my oppinion you are wrong about g++ having any particularly annoying perculiarities, and you are *absolutely* wrong about msvcpp being anywhere *near* conformant to some standard resembling C++.

      Hell, I had to put
      #ifdef __MSC_VER__
      # define protected public
      #endif
      in certain header files in order to have them compile with msvcpp - how's that for a start... (and yes, the code is correct, it also compiles on g++ and intel's compiler - and the error is not something I can reproduce in a small example, it only happens in certain situations)

    17. Re:gcc cross platform? by e8johan · · Score: 2

      Qt is worth every penny you put into it. A fully working cross-platform toolkit, and so much more than just a GUI.
      Qt makes printing, sockets, fileaccess, database access, etc. so easy in a good cross-platform way. No need ever again to user #ifdef WIN32 to plant some special case non-unix platform code, simply use the appropriate class.
      As for support, they've got it, and training etc. So it will all work just great!

    18. Re:gcc cross platform? by orange7 · · Score: 1

      The disadvantage of standardizing on gcc is that it has been evolving much more quickly over the last five years than most other C++ compilers. The gcc authors are less constrained in terms of not breaking existing codebases using their compiler, compared to, say, MSVC. The code bases I've been involved with have broken more regularly under new gcc upgrades than most other compilers I can recall. (Partly because there have been more gcc upgrades, it's true.)

      Now, this isn't all bad. It means gcc tracks the C++ standard more closely than many compilers. It means the gcc team have finally addressed things like the lack of precompiled header support. But it does mean that it's not enough to standardize on gcc -- you have to guess which release will be a good one, and stick with it for a while. This can be hard to judge.

      To be honest, at this stage I'm fairly tired with upgrading code to meet the current version of standards compliance under different compilers. It's kind of satisfying the first few times, but that doesn't last. I prefer to work on functionality.

      A.

    19. Re:gcc cross platform? by Anonymous Coward · · Score: 0

      Instead of writing your own GUI toolkit, could you have improved GTK under Windows? I'm sure you did the analysis actually...

      I just wanted to note that this is always an option to consider given the benefit to the open source community.

    20. Re:gcc cross platform? by whereiswaldo · · Score: 2

      Could be that MIPS is not first on the list of platforms to start optimizing for? Remember, it's open source, so somebody on MIPS needs to take the time to make and test careful, MIPS-specific optimizations all the while making sure they aren't breaking or slowing down gcc on other platforms.
      Correct me if I'm wrong.

    21. Re:gcc cross platform? by Anonymous Coward · · Score: 0

      Herb Sutter joined Microsoft, and in interview to the legendery Danny Kalev, he mentiones that he joined because he was excited by Microsoft vision for c++.
      Being an adovcate for standard complience, I think that means that Microsoft is marching towards MSVC being ANSI.

  4. Gcc? by JanneM · · Score: 4, Insightful

    Why not just use gcc for all four platforms? The sticking point would likely be Windows, but even if you elect to stay with MFC++ for Windows, you've reduced the incompatibilities from four to two different compilers.

    --
    Trust the Computer. The Computer is your friend.
    1. Re:Gcc? by Anonymous Coward · · Score: 1, Informative

      You don't want to use GCC if you can help it because it's performance is terrible. GCC is great for xplatform stuff, but for real power, native compilers spank it every time.

      Of course, there is the extra effort of maintaining compatability, but the speed increase is definitely worth it.

      [ custom app compiled with cc on solaris/sparc and aix/xlc was around 45-65% faster than gcc 2.95.1. There was a lot of data moving around, and not a lot of I/O or calculation. YMMV ]

    2. Re:Gcc? by Mitchell+Mebane · · Score: 4, Informative

      custom app compiled with cc on solaris/sparc and aix/xlc was around 45-65% faster than gcc 2.95.1.

      GCC 3.2 performs MUCH better.

      --

      The roots of education are bitter, but the fruit is sweet.
      --Aristotle
    3. Re:Gcc? by robbo · · Score: 1

      All the same, I would at least dump VC on the windows platform and tell the client they need to move to a different os. Maintaining cross-compat between gcc, and the irix and solaris compilers shouldn't be too difficult (but to make your life easier, be sure to switch to gnu make on all three.)

      Whatever you do, (and you've already said you're not), DON'T use gcc 2.x for C++ development.

      --
      So long, and thanks for all the Phish
    4. Re:Gcc? by Dog+and+Pony · · Score: 3, Interesting

      http://www.mingw.org/ || http://www.cygwin.com/
      - using GCC on Windows is not a problem anymore. I do it often, with no problems, and then you should keep in mind that I'm not very good at this stuff on any platform. :)

    5. Re:Gcc? by The+Snowman · · Score: 1

      I agree. Version 3.2 fixed a lot of standards-related issues, and added a bunch of optimizations that improved speed dramatically.

      However, at least in the programs I write, GCC still produces large executables. Even Visual C++, when compared to G++ (both dynamically linking to the STL), produces smaller code. But GCC definitely produces faster code.

      I don't have much experience with the Sun compiler, I've only used it a couple times. It did produce fast code, but it had a LOT of compilation issues. It was very picky as to what code it wanted to compile. Some code that was well within the standard wouldn't compile. And this was with the compiler bundled with Solaris 8, the latest at the time.

      --
      24 beers in a case, 24 hours in a day. Coincidence? I think not!
    6. Re:Gcc? by mce · · Score: 1

      In terms of speed, the Sun compiler is OK. But in terms of standard compliance and absence of bugs, I found it to be lagging badly. But even so, I use it to port to Sun, because until recently the other alternatives were: g++ 2.95 (sllooowwww) and g++ 3.x for x < 2 (all versions I've tried failed to compile certain multiple inheritance constructs correctly). I believe g++ 3.2 finally fixes the latter issue, but I've also come to the conclusion that I will not change anything until doing so has become unavoidable.

      So here's what I do:

      • use the native compiler on each platform: aCC on HP-UX, CC on Sun, and g++ on Linux (note: I have to use a RedHat 6 machine, because that 2.96 nightmare also has the MI bug!);
      • use g++ (2.95) as an additional check (parsing only), since no single compiler catches everything and this is one of the things g++ -Wall is relatively good at.

      My primary development compiler is HP's aCC, even thouh I have a recent Linux desktop box that can run circles around the aging HP server that I have to use. The reason is very simple: of all C++ compilers that I have used till now, aCC is the best one by far, and g++ has given me the biggest amount of trouble over the years.

    7. Re:Gcc? by FooBarWidget · · Score: 2

      "However, at least in the programs I write, GCC still produces large executables."

      strip --strip-all foo ?

  5. GCC by captaineo · · Score: 3, Informative

    You can, with some loss of performance, use GCC on all of those platforms. That would cut out compiler quirks as a variable.

    Don't write Makefiles yourself. Instead write a script that translates simple build rules (foo.cpp -> foo.o -> foo.exe) into a custom Makefile for each platform. I went this route after battling for years with complex Makefile rules that never quite worked.

    1. Re:GCC by sjh · · Score: 1

      Some loss of performance? Are you kidding? gcc
      output is MUCH slower then Forte (I don't use
      irix, but I imagine it's the same there). gcc
      is a good IA32 compiler, but not so good on many
      other systems.

    2. Re:GCC by SirGeek · · Score: 1
      Don't write Makefiles yourself. Instead write a script that translates simple build rules (foo.cpp -> foo.o -> foo.exe) into a custom Makefile for each platform. I went this route after battling for years with complex Makefile rules that never quite worked.

      Why not use Automake and Autoconf ? Wouldn't that take care of some of the cross system problems ?

    3. Re:GCC by Sludge · · Score: 3, Informative

      Don't write Makefiles yourself. Instead write a script that translates simple build rules (foo.cpp -> foo.o -> foo.exe) into a custom Makefile for each platform. I went this route after battling for years with complex Makefile rules that never quite worked.

      I'm starting to look into using Cons for a cross-platform C/C++ makefile alternative. I haven't used it in a large project yet, but I can definitely get up and running faster than with Make.

    4. Re:GCC by captaineo · · Score: 2

      I personally don't like the auto* tools very much. They are difficult to set up and debugging them is a pain.

      A nice feature of my system is that it spits out one huge Makefile for the whole project. This avoids the speed penalty and complexity of recursive make (one Makefile per directory). If there is no work to do, 'make' returns almost instantly.

      IMHO the correct solution is to port the platform to the software, not the software to the platform. e.g. demand that the C compiler is always /usr/bin/cc and the X libraries are always in /usr/X11R6/lib (symlink them if necessary) rather than trying to figure out where they are on each system.

    5. Re:GCC by captaineo · · Score: 2

      I should add that the best part about my Makefile generator is that it contains much of the knowledge I've accumulated about portability.

      For instance, to correctly link to OpenGL on Linux you say "-lGL" whereas on Windows you say "-lopengl32". Or to use threads on Linux you must compile with "-DREENTRANT" and link with "-lpthreads", whereas on Windows nothing special is required. In my simple build rule I can just say "this executable needs OpenGL and threads", and the Makefile generator spits out the correct compiler and linker options for each platform.

      As I port my software to more platforms, I just add more intelligence to the Makefile generator. e.g. when I port to Mac OSX I'll simply add Makefile generation rules for whatever quirks OSX happens to have.

    6. Re:GCC by Anonymous Coward · · Score: 0

      Not in my experience, GCC is weaker at optimizing
      loops with straight line code, but better
      at optimizing spagetti code.

    7. Re:GCC by aminorex · · Score: 2

      All of those platforms can be easily accomodated
      with gmake, with cygwin as the windows build
      environment. There should be nearly zero
      conditional code, just a few link options, if
      it is done properly.

      --
      -I like my women like I like my tea: green-
    8. Re:GCC by be-fan · · Score: 2

      I'll testify for CONS. I used it for an OS kernel at one point. OS kernels necessarily have totally obscure build systems. One issue in particular was running a second multi-file optimization pass with Intel C++. I was able to do configuration and compilation in less than 500 lines of Perl. I actually got carried away with adding features (like doing line-counts for files) because it was just so easy!

      --
      A deep unwavering belief is a sure sign you're missing something...
    9. Re:GCC by forgoil · · Score: 2

      Don't use make at all. It is horrible and will eat up a LOT of time (and produce a bunch of errors and problems that you have to take care of along the way, and all your 7 developers won't know how to do the correct changes (because one of the others did it to begin with).

      I would recommend using a make replacement. You have a few examples in this thread, but I would like to throw in my personal favorite (because I use it myself of course;)).

      http://www.perforce.com/jam/jam.html

      It takes a little time to get into, but as soon as you have converted everything, it will be a breeze. It is WAY faster than make (does the whole dependancy on the fly), cleans up with lightning speed, and you won't need different files for different platforms. This is one of the most solid pieces of software that has ever graced a system that I have worked on. It is made by someone at perforce (one hell of a versioning system, blows sourceUnsafe et al out of the wall, and I wouldn't wanna touch CVS after using P4).

      A general note on GCC. If I understand it correctly, you have C++ code as well, and for at least four platforms. I am sure that not all your customers can upgrade to gcc 3.2 just like that. It would be very nice to have (for example on MIPS/Solaris) but first me very sure that your customers can run the software properly. I am sure that many here on Slashdot hasn't been developing software with the same kind of customers as you have, so they might be a bit too optimistical sometimes;)

      QT, as suggested, is a good idea, and you would hopefully be able to hide away as much as possible of the differences of the platforms. Just make sure that QT works (and is supported actively) on all platforms with all compilers.

      Start writing much simpler code. I know how frustrating it can be to do something simple, and have the system crap on you and then spend WAY too much time on this trifle problem while your competitor has pressed F5 and debugged it a long time ago.

      So what to do? Try to write the code as uncomplicated as possible. If needed, send your developers on some extra education. And make sure that you have what you need for finding bugs and squashing them. Get a better IDE/debugger, throw in asserts and other goodies, write down all the differences between compilers that you find, etc.

      (and yes, if you can use it, QT have already taken care of a bunch of the differences between platforms. Grab the evaluation version (or free linux version) and put one of your developers to port one of your components to QT)

    10. Re:GCC by demo · · Score: 1

      I'm starting to look into using Cons for a cross-platform C/C++ makefile alternative. [...]

      Any idea how it compares to Jam?

      (If you don't, then I'll have to see for myself.. *lazy* :)

      --
      ---
    11. Re:GCC by Electrum · · Score: 2

      This is exactly what autoconf and automake accomplish. Why reinvent the wheel?

  6. Different platforms.. different people by 1155 · · Score: 1

    Why not split the platforms, and hire a few more people? I know, I know, this doesn't seem feasible, right? But if you were able to split the code into what it would actually work on, say you have yourself and joe working windows, you guys just work on windows, and have all the code that works within that ide. Jan and Sue, with help from the janitor Steve, are all working on the irix side, etc, etc, etc. It would seem more feasible than actually working all these different platforms together at once? And what about mac, is there a demand for that as well? Would be a good time to look into it...

    1. Re:Different platforms.. different people by mxmissile · · Score: 2, Funny

      Read this.

    2. Re:Different platforms.. different people by br0ck · · Score: 1

      The Mythical Man Month says that adding people to a project won't make development go faster due to additional overhead. However, sometimes the scope and requirements of a project sometimes dictate adding additional help. In this case, having one set of people, who are highly trained in coding and optimizations on their particular platform, do all of the platform specific work would alleviate the burden on the other part of the team and allow them to begin adding new features. The architecture team could prototype and develop new pieces, while the implementation teams hammer out the details on the target machines.

    3. Re:Different platforms.. different people by Neumann · · Score: 1

      He didnt talk about adding people to the end of a project to get it done on time. He talked about expanding the developer base because there is now extra work that needs to be done on an ongoing basis.

      By your logic there should only be one programmer in the world, because adding any others would not get any more code written faster.

  7. Qt (or maybe Java) by Chuck+Messenger · · Score: 1

    Qt is a great cross-platform C++ environment. It's a highly polished GUI framework, but also general-purpose. In terms of cross-platform C++ frameworks, I don't know of anything that beats Qt.

    Another thought is Java, of course...

    1. Re:Qt (or maybe Java) by Anonymous Coward · · Score: 0

      "Java is not currently an option for the high-performance numerical and immersive graphical aspect of our applications."

      Well, it's nice to know you're staying open-minded...

    2. Re:Qt (or maybe Java) by WatertonMan · · Score: 2

      I've heard good things about QT. How good are its non-GUI classes? i.e. for numerics and more importantly for threads? We're looking at doing some crossplatform stuff and QT's support of the Mac is a major selling point.

    3. Re:Qt (or maybe Java) by Anonymous Coward · · Score: 0

      There is no support for numerical classes but threads are supported quite well ( basically very complete wrapper around posix threads on Unix and Mac and win32 native threads)

    4. Re:Qt (or maybe Java) by DrEnter · · Score: 1

      I would highly recommend Qt (from TrollTech). I have used it for several C++ cross-platform projects (across HP-UX, Linux, and Win32), and I've been very successful with using Qt and very happy with Troll's support.

      While I can see benefits for also using GCC on each platform, I have found that sticking to the commercial compiler for the system in question (ie. Visual C++ on Windows, SunPro on Solaris, etc.) generally produces faster code, since it sounds like that may be an issue for you. Qt is generally pretty flexible when it comes to this so you should be OK whatever you use.

      I would not recommend Java if performance or reliability is at all an issue. Performance because Java just isn't there yet. Reliability (and supportability) because you're going to be adding an extra layer of support issues for any problems you run into with the JRE component for each and every platform you need to support.

  8. GCC/DJGPP by maverickbna · · Score: 2, Informative

    gcc is cross-platform, can cross-compile to different platforms, and for those who feel the need to use Windows, gcc has been ported, to the ever-popular development suite called DJGPP.

    GCC
    DJGPP

    --
    You are great player! Present you with points!
    1. Re:GCC/DJGPP by tempmpi · · Score: 2

      DJGPP is gcc for DOS not for Windows. mingw or cygwin are gcc ports for Windows.

      --
      Jan
    2. Re:GCC/DJGPP by Mitchell+Mebane · · Score: 1

      DJGPP is for DOS. I suggest MinGW.

      --

      The roots of education are bitter, but the fruit is sweet.
      --Aristotle
    3. Re:GCC/DJGPP by maverickbna · · Score: 1

      Read the page for DJGPP - true, it is written for DOS, but for it works on all 32-bit versions of Windows.

      --
      You are great player! Present you with points!
    4. Re:GCC/DJGPP by tempmpi · · Score: 1

      DOS software written in DJGPP will work in the windows dos emulation, yes. But that doesn't make DJGPP a compiler for Windows. Most software needs access to some windows APIs that aren't avaible in the dos emulation like OpenGL, the TCP/IP stack or the registry.

      --
      Jan
  9. Code Objectification by Lemmeoutada+Collecti · · Score: 1

    I would imagine that you could build a collection of libraries, using a well defined interface, with precompiled object code for each platform and tie into thiose in the mainline routines using late binding. The advantage is since you control all the libraries, the binding method can be abstracted by an API specific to your industry, and 'DLL Hell' avoided by proper planning.

    This would allow smaller primary binaries, and would allow upgrading part of the project without changing the whole... also, the reusable functions can be tested using known results from other platforms.

    The less you have to recompile for each change, the easier the Makefiles etc are to maintain.

    --

    You can have it fast, accurate, or pretty. Pick any 2.
    1. Re:Code Objectification by Anonymous Coward · · Score: 0

      Thsi is the solution that I am persuing. I am developing a set of core libraries, a few that are OS specific, a set of higher level libraries, and a build utility I'm writing in Python ( it will probably end up being ant gone Python, but I can't say for certain right now.) The top level will be writen in Python. As all of the meat will be in the lower libraries, I have no speed issues. BTW, I am using C++ right now, but once I get past the prototyping stage, I will be using Ada, which I am just now learning. With Ada, platform specific issues are minimized, as is also the case with Python. The other advantage to using Python, is the ability to quickly adapt to new requirements, and the ability to easily provide versions specific to target platforms if that becomes necessary. Pls excuse the poor writing and run on sentences, but I am rather hyped about this project and the results I have produced today!!!

    2. Re:Code Objectification by Anonymous Coward · · Score: 0

      I was senior developer on system called MuSE. It was an advance 3D graphics interface that was originate on SGI Irix, then ported to SUN, MS Windows (win32), and HP, in that order, and written in C. During the first port, it was decided to use a platform abstraction layer. This made addition the ports easier and easier with each new as we refined the layer. The layer depended on Standards such as ANSI and Posix. By using the standards we were able to eliminate most of the code forks and reduce the overall layer size. The build process compiled the versions of the layer to be used with the main API code. This leads to a very benefical feature. The main API code runs on all platforms with no change to code, a unified code baseline, no #ifdef's for platform. This has the benefit of being able to debug problems using the best tools available for the platform set.

      Dave
      dahicke@datawest.net

  10. Simple soloution by Anonymous Coward · · Score: 0

    clr

  11. ...write portable code? by jukal · · Score: 5, Funny

    ...uhm...ahmmm...mmm. Dunno what to add.

    1. Re:...write portable code? by chennes · · Score: 2

      More difficult than you would like. Ever try to get something using templates to compile on those four platforms? I don't recommend it. If you are trying to get into the more complex things that you can do with C++, it's *very*, *very* difficult to write 100% portable code.

    2. Re:...write portable code? by jukal · · Score: 2
      it's *very*, *very* difficult to write 100% portable code.

      yes, but it might be *very*, *very*, impossible to get manage than non-portable code. Well, there's more experienced minds in here, but I would say atleast maximing the percentage of platform independant code is the path to go. Hehehe, giving advices is just so easy - and fun! :)

    3. Re:...write portable code? by Anonymous Coward · · Score: 0

      You will probably need some toolkits. Basic things like multi-threading are generally non-portable.

      For a GUI, FOX or wxWindows may help. For threads, you may want to consider JThreads/C++, especially if you intend to add a Java front-end to a client-server style system. Alternatively, there are packages like pth or various MPI products to fit the bill. The MPI products have slightly higher overhead/configuration, but open the door to Beowulf applications.

      Since you have a functional Makefile system, I would recommend keeping it unless you get some big bang (e.g. current system is very badly written) by ditching it. You can help by using GNU's make instead of the platform's native make. This will remove the portability issues from Makefiles and adds "if then else" constructs to better handle portability. Remember that a Makefile is a set of AI inference rules and not a procedural language (though many try to use it as such).

    4. Re:...write portable code? by Sex_On_The_Beach · · Score: 0

      GEEK humour. How sad.

    5. Re:...write portable code? by ameoba · · Score: 2

      Hrmm... maybe I'm issing something here, but if portability is the primary concern, you AVOID doing complex things that might break on one of your platforms. Not to mention the other bennefits (readability, sanity, maintainability) of avoiding the complex outer-reaches of C++.

      --
      my sig's at the bottom of the page.
  12. Drop the Solaris and IRIX compilers by Anonymous Coward · · Score: 1, Informative

    Use gcc 3.x on Solaris, IRIX, and Linux. That way, you remove two vectors of incompatibility, and you only have to test UNIX and Windows for compatibility. And if you stick to standard C++, you shouldn't have very many problems with even that.

    Of course, there are drawbacks. I doubt gcc's optimizer is as good as the native optimizers for the Solaris and IRIX compilers, for example. But you might want to try it anyway, and see if the performance hit you're taking is worth the hassle.

    If you're daring, you could even try to replace Visual C++ on Windows with cygwin or ming. But don't try that until you're happy with the Solaris and IRIX solutions first.

  13. Go client/server? by WasterDave · · Score: 5, Informative

    I assume that most of your problems are in the GUI end of the equation - why not break the application into two bits? Put the numerical stuff on a grunty 8 way box, and cook up the UI with whatever language best suits the available (and hireable) skills and platform?

    Communication between the two is probably best through SOAP, although to be honest I've not looked into this area for a long time. The GUI can still be built from Java (I believe Java has some reasonably fast OpenGL wrappers now), or look into wxWindows using the existing C++ resource.

    Dave

    --
    I write a blog now, you should be afraid.
    1. Re:Go client/server? by TheConfusedOne · · Score: 1

      Client/Server is definitely a good way to go with calculation intensive programs. You should also be able to attach and detach the GUI portion from the calculation process.

      SOAP probably isn't a great way to go for your communication. SOAP sacrifices speed and size for portability. If you're really worried about the portability at that point then maintain a Unix comm library and a Windows one.

      --
      --- I wish I could hear the soundtrack to my life. That way I'd know when to duck.
    2. Re:Go client/server? by Twylite · · Score: 2

      Ah good, someone got in before me :) It is definatly a good idea to separate out the GUI part when dealing with cross-platform applications, since a lot of portability problems reside there.

      In all honesty, I don't recommand Qt or wxWindows - they are great toolkits, but you lose out heavily on productivity compared to visual development environments with GUI builders. While both of these have associated builder tools, I don't consider them very mature of capable compared to VB or Delphi/C Builder. There is also a write-once-debug-and-tweak-everywhere concern (just getting wxWindows looking good on Windows and Solaris takes some effort).

      Java is a great choice as it is supported on many platforms, has powerful GUI classes, a couple of builder products, and has several means for client/server support, including CORBA. But for UI applications it isn't hugely productive (strangely enough).

      Some of your other options include ParaGUI and SDL, gTk, GraphApp, V, Mozilla's XPToolkit and XUL, and WideStudio.

      I have grappled with exactly this question (legacy C/C++ needing to go cross platform with GUIs), and the best answer I've come up with so far is to keep your main code in C/C++ (since you have the legacy code AND the skills), define a clear UI abstraction layer, and create the UI in a scripting language such as Tcl or Python. Use SWIG to tie the script to native C functions.

      I have more experience with Tcl/Tk, and believe it is more widely portable (especially the GUI consistency), but it is slower and arguably more difficult to program than Python. Still, this depends on what skills you can acquire, and what your UI requirements are.

      Prechelt has an empirical comparison of some languages, including C/C++, Python, Tcl and Perl, and most importantly he has productivity figures! Keith Waclena has a Language Crisis page of comparisons, and Doug Bagley hosts the Great Computer Language Shootout. There are all invaluable resources for determining a balance between portability, functionality and productivity.

      --
      i-name =twylite [http://public.xdi.org/=twylite], see idcommons.net
  14. JAVA by Anonymous Coward · · Score: 0, Funny


    Java. Java, more Java.

    www.sun.com

    Java

    1. Re:Java by Cpt_Corelli · · Score: 1

      Did you read the original post?

      "Java is not currently an option for the high-performance numerical and immersive graphical aspect of our applications"

  15. I do the same by Anonymous Coward · · Score: 0

    I have to support C++ on Windows, Solaris, Linux, HPUX, and AIX. I feel your pain :-) One thing that helps tremendously is something like tinderbox from the mozilla project. It does continous builds and integrates into the version control system so you can find out when someone broke the code quickly rather than the next day. Its also good to come up with a list of C++ features that you wont use. Mozilla.org has a list that you can adopt if you want, but its probably a little more draconian than you need. But do develop some sort of programming guidlines that say (you cant use c++ feature X).

    1. Re:I do the same by mmaster · · Score: 2, Informative

      Also, you can try the cross platform operating system facility from the same mozilla project.
      Check out
      http://www.mozilla.org/projects/nspr/about-ns pr.ht ml

  16. Might I suggest.... by mary_will_grow · · Score: 0, Flamebait

    Working for an industry that isnt helping to destroy the world?

    --
    Why stick up for big business?
    1. Re:Might I suggest.... by Anonymous Coward · · Score: 0

      >Working for an industry that isnt helping to destroy the world?

      I'm confused. Are you talking about the oil companies or Microsoft?

    2. Re:Might I suggest.... by mxmissile · · Score: 1

      Although I agree with you 110%, this is a loosing battle in the economy state we are currently in.

    3. Re:Might I suggest.... by binaryDigit · · Score: 2

      And I assume that you walked to work, have a hamster run generator that's powering the computer that you posted on, don't use anything plastic or wear nylons or spandex?

    4. Re:Might I suggest.... by Havokmon · · Score: 2
      Working for an industry that isnt helping to destroy the world?

      So can we also assume you won't help hunting the deer that have completely overwhelmed the upper midwest due to 'conservation'?

      http://datcp.state.wi.us/ah/agriculture/animals/di sease/chronic/faqs.html

      Hmm Under "Symptoms", one is said to be "depression". How many of our tax dollars went towards analysis of deer psychology?

      Damn bleeding heart liberals.

      --
      "I can't give you a brain, so I'll give you a diploma" - The Great Oz (blatently stolen sig)
    5. Re:Might I suggest.... by mary_will_grow · · Score: 1

      Those are the products that are openly available to us. Other solutions are possible. I firmly believe that if the oil supplies ran out this year, and we had known they would for the last 20, I'd still be driving to work today. Just in something a little more economically friendly than what we've got right now.
      Maybe I'm wrong, thats just what I believe. I also believe that the oil industry stifles research in oil alternatives. There are plenty of examples of the industry favoring the more profitable choice, as opposed to the choice that benefits People.
      I also believe that the oil company has such strong control of our government, they can even help lube up (get it, lube?) the process of going to a war that would profit them greatly. I also believe that the energy company Enron, who was involved in the biggest corporate scandal in recent american history, was the chief funder of our President's campaign and even allowed him exclusive use of the CEO's jet to campaign in.
      I cant tell you all of this is fact. And thats why the comment you replied to shouldnt have been written. Sorry.

      --
      Why stick up for big business?
    6. Re:Might I suggest.... by mary_will_grow · · Score: 1

      You are right, it was foolish of me to think that profit-driven oil companies couldnt come up with a better plan for managing our ecology than Mother Nature, who has been successful for the last 5 billion years.

      Why does everyone stick up for big business? it HATES YOU

      --
      Why stick up for big business?
    7. Re:Might I suggest.... by GigsVT · · Score: 1

      The end customer is more powerful than any CEO or board of directors. We are the top. If we don't spend our money on the company's good, they die. Big business doesn't hate the customer, it fears it.

      --
      I've had enough abrasive sigs. Kittens are cute and fuzzy.
    8. Re:Might I suggest.... by Havokmon · · Score: 1
      You are right, it was foolish of me to think that profit-driven oil companies couldnt come up with a better plan for managing our ecology than Mother Nature, who has been successful for the last 5 billion years.

      You're sorta right, you are foolish :)
      But you're foolish to think that Mother Nature can't cope with human tinkering. Humans are always part of the cycle. If oil companies didn't exist, we would STILL be part of the cycle.

      If there was total nuclear annihilation, Mother Nature would deal with it just fine. Picking favorites because you've been brain-washed isn't going to make Mother Nature twitch one bit.

      --
      "I can't give you a brain, so I'll give you a diploma" - The Great Oz (blatently stolen sig)
    9. Re:Might I suggest.... by Fugly · · Score: 1, Offtopic

      Working for an industry that isnt helping to destroy the world?

      In fairness, the oil industry has come a long way in the last 10 years, especially in Alaska. Plus, the computer modelling sofware has done great things to reduce the damage. They can take seismic readings and drill test wells at only the most promising locations. This has increased their hit rate from 1 in 10 test wells to like 1 in 3. At least that's what they say on the TV...

      In addition, they now use ice roads instead of plowing down to the tundra. Instead of drilling wells straight down to oil or gas deposits, they'll locate a drilling facility between several deposites and drill horizontally, lessening their footprint on the tundra. All good advances.

      Also, when it comes to depletion of fossile fuels, there are actually a few geologists who swear that fossil fuels are replenishing themselves very quickly and that we might be mistaken concerning their origin. Of course, these guys right now are largely considered to be complete nutcases but a couple of them have pretty impressive credentials so I'm reserving judgement myself.

      Oh, and of course, I still believe we need to dump this fossil fuel stuff and invest in cleaner, renewable energy sources regardless. Burning stuff for energy is so outdated.

    10. Re:Might I suggest.... by mxmissile · · Score: 1

      But you're foolish to think that Mother Nature can't cope with human tinkering. Humans are always part of the cycle.

      I'll beleive that the day I see the bottom of Glen Canyon.

    11. Re:Might I suggest.... by Anonymous Coward · · Score: 0

      >> You are right, it was foolish of me to think that profit-driven oil companies couldnt come up with a better plan for managing our ecology than Mother Nature, who has been successful for the last 5 billion years.

      When did humans get taken out of nature? We are "all-natural" already as evidenced by our evolution.

    12. Re:Might I suggest.... by Anonymous Coward · · Score: 0

      Do you realize how much pollutants went into the production of your computer? Or many acres of top soil were blown away to feed you?

      Get off your high-horse.

      The easiest solution is to provide a perfect example of lowering the human population on the planet. Find the highest bridge and let gravity do the rest.

    13. Re:Might I suggest.... by binaryDigit · · Score: 2

      Actually my comment was not aimed at the validity of your ascertation, instead it was designed to point out the hypocracy of it.

      I don't want to come off sounding mean spirited, that is not my intention, but lets be real here. You're saying that "big business" as an entity has a tendency to put it's wants and needs before others. Well that sounds like pretty much most "living" things. Of course many do take this too far, both humans and corps, no denying that. But to generalize and stereotype and accuse but yet not do the sacrifices that would not group yourself into the same category as those you blast, now that is weak.

      As to your last statement, I completely, 100% disagree. Big business LOVES me (and you), because you and I are the ones that allow it to exist and flourish. We buy the products, we vote for the "bought" politicians, what's not to love?

    14. Re:Might I suggest.... by mary_will_grow · · Score: 1

      Have you ever looked at graphs of the mean temperature of the world, or the amount of greenhouse gasses present in the atmosphere, correlated with the start of the industrial revolution?
      To say "We are natural, so anything we do is Natural" is a lazy and ignorant tactic. Look at the ozone layer. You think that hole would be there without our help? In the last 150 years we have _dramatically_ altered patterns that have been steady for hundreds of millions of years.
      Do a little research before feeling confident hiding behind such a glib argument.
      If there was total nuclear annihilation, this wouldnt be a very fun place to live, would it?
      But you are right, we are "Natural", and so that nuclear annihilation will be "Natural" too. I'm sure your permanent shadow affixed to a cement wall will be very happy eternally remembering your syntactical victory on slashdot.

      --
      Why stick up for big business?
    15. Re:Might I suggest.... by Havokmon · · Score: 1
      I never said humans didn't impact the world, I basically said the world would continue just fine with or without us.

      In the last 150 years we have _dramatically_ altered patterns that have been steady for hundreds of millions of years.

      Of course it was consistent, because there wasn't a catalyst for change. Except maybe those big rocks that fell once in a while - THEN there was a change, but since big rocks weren't falling consistently, there wasn't a consistent change, get it? Basic logic.

      You seem to think the environment needs to be static. The ozone thing cracks me up. Not that I don't believe it's happening, but humans are all to make it better for THEMSELVES. If the melting of the icecaps were to occur, there would be trillions of dollars damage to seaports and cities. Didn't you see what happened on the West Coast? Seaport workers are CONTRACTED to make minimum of $110k/year, free medical, and job security from new tech. It's all about the money. Ignore the ozone thing, unclench your ass-cheeks. Once it becomes an issue, money will be redirected properly, and the imminent 'disaster' will be averted.

      I'm sure your permanent shadow affixed to a cement wall will be very happy eternally remembering your syntactical victory on slashdot.

      Cement isn't eternal. Nature will still exist. Winds, rain, and what's left of life as we know it (and new life as we don't know it yet), would erode away any sign of our current civilization.

      If there was total nuclear annihilation, this wouldnt be a very fun place to live, would it?

      I feel no need to leave my 'mark' on the world (I've been young, but not impressionable), nor do I think that anything other than void will consume us after death. I'm just sorry you can't see the bleak reality of it all.

      --
      "I can't give you a brain, so I'll give you a diploma" - The Great Oz (blatently stolen sig)
  17. I've done this! by hajo · · Score: 5, Informative

    I've done something similar in a mixed environemnt. The way we set it up is to use java for GUI and logic development and then run a profiler against it and go native on those functions that needed it. These functions would be compiled into a library. (You'd be amazed how little of your code you need to optimize for huge performance gains!)
    If I had to do it again I would do the same thing except I would use python as the 'main, relatively slow, easy to code and maintain' language.

    Hajo

    --
    Hajo Monogamy: Belief so strong that millions of people end perfectly good relationships in order to start a new one.
    1. Re:I've done this! by WatertonMan · · Score: 2

      The problem with Python is that its GUI features are not fully cross-platform yet. We're still eagerly awaiting full OSX support. I don't know how that is going. There was a windowing manager I downloaded off of Source Forge but I couldn't get it working right.

    2. Re:I've done this! by Dr.+Smeegee · · Score: 1

      I would think tkinter would be available on all those platforms... of course, I don't love tkinter. :-)

    3. Re:I've done this! by pnatural · · Score: 2

      The problem with Python is that its GUI features are not fully cross-platform yet.

      Not true: wxPython. Sure, it doesn't come bundled with official Python distributions, but wxPython is cross-platform and quite capable, and blows the socks off Tk.

    4. Re:I've done this! by WatertonMan · · Score: 2
      Have you got wxPython to work though? (That's what I was alluding to) I don't know if it is because I installed Fink, which has its own Python disto, but I never was able to get it to work right.

      Has anyone else had these problems? I'm thinking it was due to Fink as I've had other subtle problems with Python since I installed it.

    5. Re:I've done this! by pnatural · · Score: 2

      I don't use Macs, so I can't speak to any of the Fink stuff.

      But wxPython works very well for win32-linux cross-platform development.

    6. Re:I've done this! by King+of+the+World · · Score: 1

      One big (big) advantage of WxWindows is that it uses native toolkits which although not mattering to many visual users helps greatly if you ever want disabled or government use of your software.

  18. Python, Java, wxWindows by g4dget · · Score: 4, Informative
    If you can do it at all, use something like Python: custom software is much easier to write in it than in C++, and it has good support for numerical operations. Java, too, is much easier and safer than C++.

    If you have to use C++, then wxWindows is a great environment: it works on lots of platforms and has extensive support for platform-independent I/O, threading, and networking.

    1. Re:Python, Java, wxWindows by Aron+S-T · · Score: 1

      If you want to know why Python is the superior choice for cross-platform development of complex systems, then check out this white paper.

      And you don't have to throw out all that C++ code. Python place well with legacy code.

  19. WxWindows and GCC maybe? by Dog+and+Pony · · Score: 5, Informative

    http://www.wxwindows.org/ - mature crossplatform C++ library, and not only for GUI, either.

    I don't know what you need, but WxWindows and GCC cross-compiling (see mingw32 faq, for instance) might be what you need?

    WxWindows also have good bindings to python and perl etc. for more rapid crossplatform development.

  20. Java? by Anonymous Coward · · Score: 1, Informative

    Um Java??

    No its not as stupid as it sounds.
    A few years back there was a good article on this
    in magazine that I used as the base for a system
    we developed.

    All user interactions as handled by a Java client
    (if you prefer Python, Perl, Lisp wahtever) easy to code, easy to run wherever there is a JVM.

    All your number crunching, algorithms, (back end stuff) goes into libraries that you call by
    JNI. Just make sure you do not make the JNI API
    too specific, try to keep to coarse, and the number of calls to it done. That is have high level of abstraction on the JNI API.

    1. Re:Java? by Anonymous Coward · · Score: 0

      C++ is more portable these day. ;-) We accomplished developing a product that ran on Solaris ( 32 & 64 bit), AIX, Linux, Win95 - Win200. We used Perl/gnumake for the build environment, and the ACE/TAO libraries: http://www.cs.wustl.edu/~schmidt/ACE.html

  21. Huh? by wandernotlost · · Score: 2
    What tools and strategies can we use to increase our productivity and regain our competitive advantage, without going for Windows only?

    All Windows productivity oxymoron jokes aside, how do you go from most of your users being on Solaris and Irix to thinking about going Windows only?

    Erg...I just saw the second part of the article, after the ad. That was annoying. Maybe it's time to sign up for a subscription.

    1. Re:Huh? by Anonymous Coward · · Score: 0

      AdSubtract

      Kills all ads. On a per-site basis. Rocks. :)

  22. Use boost by yugami · · Score: 1

    http://www.boost.org

    besides, do you really think it's the IDE that makes your competitors more competitive? I do crossplatform day in day out, its NOT THAT HARD

    1. Re:Use boost by robbo · · Score: 1

      Woah, back up. Writing cross-compatible STL code is hard enough. I've never used boost, but I can only imagine that it would be a nightmare to use across four different compilers.

      --
      So long, and thanks for all the Phish
  23. Primary platform? by binaryDigit · · Score: 4, Insightful

    Why not do what a great many other people do (though I have a feeling that you may be doing this already), and target a specific platform for initial release, and then release on the others afterward? This allows you to focus on the platform that gives you the most bang for the buck, but still keep your scaling advantage. If you already have an established product/development environment, then you should already know enough to keep from doing any of the "big mistakes" when it comes to writing portable code. Plus this allows you to divvie up your engineers into functionality vs porting.

    Another thing would be to standardize on say, gcc. since the source is available, you can do whatever tweaks you need to to get around any performance issues (I know, easier said than done). Then standardize on things like configure.

  24. Own make tool? by Anonymous Coward · · Score: 0

    Have you thought about writing a simple make like tool that either generates nmake/gnu make/ant makefiles or build commands? It takes hardly any time if you use something like Spirit to handle the parsing.

    Presumably you're already using something like boost? I found it sped things up no end once you get used to it.

  25. Without joining any holy wars about language... by buysse · · Score: 4, Interesting
    It sounds like your biggest problem isn't the cross-platform code as much as the Makefiles and the compiler differences.

    I would suggest first using gcc on all UN*X platforms, and also trying out something like ant instead of the various forms of make you're dealing with now.

    Also, have you considered using a library like Qt to handle most of the porting details? It's not free, but it is good if you can deal with it's oddities (I personally consider preprocessing to be evil).

    Good luck.

    --
    -30-
    1. Re:Without joining any holy wars about language... by tpv · · Score: 2
      also trying out something like ant instead of the various forms of make

      I'll avoid my anti-ant rant here, but will suggest that you don't need to throw out make to go cross-platform. GNU make will run on *nix and Windows (cygwin).

      You can have cross platform makefiles.
      Especially if you have control over all the platform.

      --
      Read more of this story at Slashdot.Read more of this story at Slashdot.Read more of this story at Slashdot.
    2. Re:Without joining any holy wars about language... by Anonymous Coward · · Score: 0

      The only problem with gcc is use it with OpenGL which it sounds like your doing. It use to be that the libraries provided with gcc for OpenGL were very slow. This may not be the case now, however I suggest testing them on each of your platforms before fully commiting to it.

      Dave
      dahicke@datawest.net

  26. Re:Gcc? Speed. by for(;;); · · Score: 5, Informative

    gcc is built for portability, not speed. VC++'s code is faster, but has zero portability and its own magical, lsd-inspired "innovations." [" for(int i=0;in;i++); for(int i=0;in;i++); ? Why would anybody ever want to compile code like that?"] That intel compiler mentioned on /. a while back sounded fast; but the gcc-for-everything approach may not be best, if they find compiled java too slow.

    --

    "Whatever happened to fair use?"
    -- Duff-Man
  27. Look several topics down. Design Patterns covers by dameatrius · · Score: 2, Insightful

    this topic (if you haven't read it already). The basic idea is to break out all parts that don't work across the different platforms into their own sections of code (classes/interfaces) assuming you aren't doing that already. Then when you do updates (that will hopefully work platform independantly) you can just right those sections once. Pretty obvious but I have seen so many places with this same issue who actually have completely seperate code bases rather then breaking parts out.

    Unfortunately if you are already doing this then you are probably screwed unless someone releases .NET CLR's for all those platforms.

  28. So many compilers - so little time. by MicklePickle · · Score: 2, Insightful

    controlling four different compilers (gcc 3.1, Sun Forte, Irix MIPSpro and Visual C++ 7)

    Couldn't you just use gcc across all systems? There are also plenty of opensource IDEs around. We use
    Eclipse along with ClearCase. Very good for cross platform.

    --
    -- main(s){printf(s="main(s){printf(s=%c%s%c,34,s,34) ;}",34,s,34);} $p='$p=%c%s%
    1. Re:So many compilers - so little time. by WatertonMan · · Score: 2

      Using GCC across all platforms doesn't guarantee no problems. (Although clearly it will simplify problems) I remember spending over a day tracking down a problem that was due to differences between GCC on OSX and GCC on Linux.

    2. Re:So many compilers - so little time. by (startx) · · Score: 2

      aah yes, and I've spent many nights over the last few years fighting the differences between g++ for linux on x86 and g++ for solaris on sparc

    3. Re:So many compilers - so little time. by Mr+Rohan · · Score: 1

      There are also plenty of opensource IDEs around

      The IDE doesn't really make that much difference, it's the reusable components & VB style guis that make windows development quick.

    4. Re:So many compilers - so little time. by sql*kitten · · Score: 2

      Couldn't you just use gcc across all systems?

      Not if you care about performance. Code compiled with a vendor-written compiler like Forte or MIPSpro can be over twice as fast as gcc's. At present, for example, gcc cannot optimize for the MIPS processor family, but SGI's compiler is finely tuned (remember SGI's bread-and-butter is fast compilation).

      Remember, gcc is the lowest common denominator. It'll compile you code sure, but that's all it will do, even with -O2. It might do a little better on Linux/x86 because it is the primary compiler on that platform, but I'd be very surprised if VC++ generated code doesn't outperform it, even allowing for the additional overhead of Win32.

      This isn't a criticism of gcc, since performance wasn't its design objective, but it does ably illustrate that Open Source isn't always the solution, and commercial software is often better.

  29. Qt from Trolltech by the_danielsan · · Score: 1

    Qt from Trolltech gives you a cross-platform GUI library, that creates applications looking natively on each OS (Windows, Mac OSX and GNU/Linux).

  30. ant instead of make? by mrjive · · Score: 2, Informative

    Ant is an excellent alternative to Makefiles. It might not solve all your problems, but you should at least be able to simplify your build process quite a bit.

    Apache Ant

    --
    If you can't beat them, arrange to have them beaten. -George Carlin
    1. Re:ant instead of make? by tpv · · Score: 2
      No No No!

      Ant is kind of nice for Java work, but if you're writing a C++ app then using Ant is bordering on the insane.

      Ant does not simplify a build process unless you're running a fairly standard Java project, or you don't have anyone who knows how to use make properly (writing simple things in Ant is easier than writing simple things in make, but Ant doesn't scale)

      If you want cross platform, just use GNU make on all your platforms, and put wrappers around the compilers so they accepts the same commandlines.

      The solution to your issue seems to be:

      1. Use cygwin on Windows so that all your platforms have similar tools.
      2. Install bash and GNU make on all your *nix boxes. (You could use cons or jam, but it doesn't appear that you need to)
      3. Use the native compilers for speed.
      4. Write a compile.sh shell script that takes the same commandline syntax on all platforms, and converts that into the correct syntax for the native tool. That way you don't have to worry about putting all that logic into the makefile.
      5. Do the same for linking, dependancy generation, etc. etc.
      That should clean up your build process. If you need to hire a build engineer, then do it. Get a professional in for a month to pull everything in to place.

      As for the code...
      If you've been doing this for so long then why is it an issue any more?
      Surely you have established patterns to solve common problems.

      Abstract!
      Don't solve threading problems more than once, put a common abstraction layer into your code.

      If one compiler doesn't support templates properly, then document it, and tell the team not to use templates in that way.
      You have a fixed set of compilers to work with - it shouldn't take that much work to learn where they differ and document ways to work around the differences.

      --
      Read more of this story at Slashdot.Read more of this story at Slashdot.Read more of this story at Slashdot.
    2. Re:ant instead of make? by mrjive · · Score: 1

      I don't think it'd be that difficult to migrate their existing makefiles into ant-usable xml build files.

      I do agree that ant is more java-friendly than anything else but that shouldn't discount it as a viable build environment solution.

      --
      If you can't beat them, arrange to have them beaten. -George Carlin
    3. Re:ant instead of make? by tpv · · Score: 2
      I don't think it'd be that difficult to migrate their existing makefiles into ant-usable xml build files.
      Doing a very rudimentary conversion wouldn't be too hard, but Ant doesn't natively support a lot of stuff that make gives you out of the box. Converting that is not going to be easy.

      The biggest issues with using Ant on such a project would be:

      • Lack of good C/C++ tasks. Various people have proposed tasks, but I've not yet seen one that is well tested and well supported.
      • Poor dependancy analysis. Ant just simply doesn't do dependancies that way make does. You can do your own dependancy analysis if you want, but Ant's premise is completely different to make.
        Ant works on the idea that you build a system by going through a series of tasks. Compile the code, package it up, ... That's fine for java, but for large C/C++ systems it isn't so useful.
      • Ant build scripts get very compliacted very quickly. I don't believe that Ant scales well to large projects. Make struggles, but it has features that make it a better solution.
      Ant and Make a fundamentally different concepts. Converting from one to the other is not easy, and trying to use the ant method on non-java code is (IMHO) a bad idea.

      I don't see what benefit Ant would give a C/C++ developer.

      --
      Read more of this story at Slashdot.Read more of this story at Slashdot.Read more of this story at Slashdot.
  31. Single compiler _interface_ by Ed+Avis · · Score: 2

    Instead of different makefiles for each compiler, why not write wrappers for the various compilers to give them all the same interface? Then at least for compiler invocation you could have the same makefile for all four platforms, just set CC=cc_wrapper which is a shell script (or .cmd script on Windows, or Perl or whatever) which mangles its command-line options into whatever weird syntax this platform's compiler expects.

    With more fundamental issues like differences in the code accepted by different compilers, you can use #ifdefs in the code, which is not elegant but probably much better than makefile hacking.

    Some suggested switching to gcc on all platforms, but then others said it might produce slower code. Well, you won't know until you benchmark. It's possible (just) that you might decide to compile most of your object files with gcc, to eliminate most of the compiler-specific hackery, and just compile those parts of the program that are speed-critical using the native compiler. This assumes that the object formats used by gcc and the native compiler are compatible, but in principle there's no reason they shouldn't be. (Perhaps not in practice, but give it a try.)

    --
    -- Ed Avis ed@membled.com
    1. Re:Single compiler _interface_ by Anonymous Coward · · Score: 0

      I've faced this problem before.

      1) There are good reasons not to go with gcc on all platforms. It is about 50% slower.

      2) We used to have one makefile for all flavors of UNIX, and another makefile for Windows. Because we used ClearCase, we didn't worry about having to encode explicit dependency checking on underlying source files in our makefiles, making them _much_ smaller, and allowing us to focus on coding up the 'how to build' part.

      3) Cross platform guis are still hard. Client-server is probably the way to go.

    2. Re:Single compiler _interface_ by Anonymous Coward · · Score: 0

      On most cases, C++ name mangling issues will not let you share object files.

    3. Re:Single compiler _interface_ by Ed+Avis · · Score: 1

      Your mention of dependencies made me think of ccache which is memoization for the C compiler (based on the older 'compilercache'). It means you can just recompile all the files, all the time, and while the performance won't be as good as having a makefile which only does the minimum compilations necessary, it will be almost as fast and a lot less hassle to maintain.

      Another AC pointed out that name mangling stops you mixing C++ object files from different compilers. I just echo that here because nobody has so far moderated up his post.

      --
      -- Ed Avis ed@membled.com
  32. Mod parent up!!! by FortKnox · · Score: 1

    Mod this up!

    Maintain the server that does the complexities, and all you need is a Java client that talks to it. The Java client handles the multiplatforms, and the C++ backend does everything efficiently on a server.

    --
    Good quote, too many chars. Seriously, the slashdot 120 char limit sucks!
  33. Numerics in Fortran, Front-end in Java by PseudononymousCoward · · Score: 2, Interesting

    Check out the latest edition of OilIT. Applications like this are why Fortran is still a very popular language among those who use computers for numerically-intensive work. Fortran9x is so easily portable, its not even funny. Bindings exist for all of the major threading standards (OMP, MPI, etc) and it is FAST. Further, is there any language with a better selection of libraries available for number-crunching? I doubt it. Develop your 'work' code in Fortran, and your front-end in Java. Both highly portable. The interface between the two will be platform specific, but this will only be a small portion of the total project & much easier to maintain than the large #ifdef heavy project you now have. $0.02

  34. Re:Might I *STILL* suggest... by XaXXon · · Score: 5, Interesting

    In defense of my previous post:

    As for graphics, there is a QT binding for perl that will allow you to do cross platform GUI work (and it looks nice, too)

    As for speed, making C/C++ plugins for perl is not hard, and if you can break out your high-speed numerical pieces into small bits of code, it's relatively easy to call them from perl.

    That said, perl isn't that slow. After you break out a few critical routines into their own XSUB modules, I bet you'd be surprised how fast perl is.

    Also, perl 5.8 has very good threading support, and it isn't a global mutex around the interpreter like it is with some other interpreted languages.

  35. Put platform dependant stuff in libraries by Procyon101 · · Score: 1

    What you need to do to work with the multithreading issues, etc with the multiple systems is create your own primitives that you need, instead of using the vendor supplied ones. For instance, MSVC uses CRITICAL_SECTION whereas cc will use a mutex. The behavior of these are significantly different, but similar in function. What you need to do is create a class that acts as a Mutex, and implement this class differently on the different platforms. Then, in the code where rapid development counts, your Mutex can be used with no regard to platform differences. Do this for all platform dependent things suchas interlocked integer functions, thread creation/destruction, network functions, etc. Use the std lib to wrap some differences, such as file access.

  36. It's very simple. by eddy · · Score: 3, Funny

    Just add more people to your team! Double! Tripple! GO WILD WITH NEW RECRUITS!

    Sheeesh, some people never learn...

    --
    Belief is the currency of delusion.
  37. What we use here by Anonymous Coward · · Score: 0

    I work on remote sensing GIS software.

    Our software compiles and works under Linux (gcc), Windows (VC++ 6) and Solaris (gcc). The code base in the past has also worked on IRIX (???).

    We've had good success using Qt for cross platform libs and GUI and jam (http://www.perforce.com/jam/jam.html) for cross platform builds. I do all my development under Linux and very occasionally cross compile on Windows (couple of times a month).

    I'd also suggest getting Purify for one of the platforms or HeapAgent (www.microquill.com) for Windows. I've looked at some of the linux based checkers but they are dog slow when matched with Qt. HeapAgent just flies for checking....

  38. Qt is the obvious answer by g8oz · · Score: 1

    Take a hard look at Qt, I think you'll see that its the solution with the least overhead.

    They even have a case about a company like yours that had a similar problem. Take a look.

    http://www.trolltech.com/products/success/pgs.ht ml

  39. Smalltalk by Anonymous Coward · · Score: 0
  40. C++ = Object Orientation? by pVoid · · Score: 2, Informative

    Why not isolate threads and files, and IPC into light-weight objects?

    Sure you are going to have incompatible concepts across platforms (e.g. Windows doesn't support just unlinking an inode), but I'm sure you can find a happy subset without making too much compromise.

    I know Alias|Wavefront uses a very similar concept for their Studio and Maya products. (studio looks and behaves identically on all platforms - so it *is* possible).

  41. Windows Only by GWOSKB · · Score: 1

    Windows Only, perish the thought. Not that Id condone it....but one must assume certain falacies when one assume windows only.......

    --
    Bill Weber Linux Admin/General IT contractor 735 Dover Street Marietta GA 30067
  42. Start with a strong cross-platform framework by Anonymous Coward · · Score: 0

    I've heard good things about the ACE/TAO cross platform library. From what I've heard, it has a learning curve, but it adds a very strong layer of abstraction over top of the operating system services (network, threading, syncronization).

    ACE/TAO are open source and will build on a number of platforms with a number of compilers.
    Overview:
    http://deuce.doc.wustl.edu/doc/RandD/TAO/Overview/

  43. A-A-P by tjw · · Score: 1

    Consider migrating your Makefiles to .aap files.

    A-A-P may not be ready for the task yet, but as it matures, it has the potential to replace Makefiles entirely. See the multiplatform example.

    A-A-P Homepage

    --

    XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UB E-TEST-EMAIL*C.34X
  44. I'd be interested in knowning... by AKAImBatman · · Score: 5, Insightful

    ...why you think you can't use Java.For all the bad press Java gets about being "slow", it is mostly old, outdated FUD. Newer virtual machines are often faster than C/C++ applications, especially in the number crunching arena. Intensive graphics are no big issue since Java now has a fullscreen API (page flipping, double buffering, and all that), a very fast implementation of Java3D, and (if you prefer) OpenGL wrappers.

    Even if you feel that Java doesn't cut it for everything, apply the 80/20 rule. 80% of your non-performance critical code in Java, and the later 10& in C/C++. This solution would at least *reduce* your multi-platform woes. You might try posting this on JavaGaming. The guys over there are wizards at making Java perform with intensive graphics. (No surprise considering that some of the industries greatest performance experts hang out there.) They can also help you find the APIs you need. I'd really take a second look before you toss Java out as an option.

    1. Re:I'd be interested in knowning... by Dog+and+Pony · · Score: 2

      Yes, I know, I know, it is probably FUD, but how come I never ever find any java applications that are this fast as they say? I mean, I have this 1.8GHz computer with (only) 256 MB of ram and the rest average stuff. I have the hotspots and the JITs people talk about from different vendors. Why does no java apps actually perform?

      I like coding in java, you might even say "I want to believe" (in my best X-files voice) but how? People point to stuff like JBuilder, or other commercially built applications by big businesses. Nada. And no, I am not talking about my own applications either, although they be slow, they too... :)

      So give me one good example and tell me how to run it, and I will believe. Noone has, yet.

    2. Re:I'd be interested in knowning... by tpv · · Score: 2, Funny

      80% of your non-performance critical code in Java, and the later 10& in C/C++
      And throw the remaining 10% out?

      --
      Read more of this story at Slashdot.Read more of this story at Slashdot.Read more of this story at Slashdot.
    3. Re:I'd be interested in knowning... by ProfessorPuke · · Score: 2

      The fullscreen API and 3D features don't help if you just want quick response in a traditional, windowed productivity app.

      The performance of Swing still lags behind native code. We have some Java tools for in house use, I can't bear to make them greater than 30% of the screen size because the refresh rate is too painful.

      Maybe there's some aggressive coding techniques that would accelerate things, but if you're not a game developer, your boss won't consider GUI optimization time well spent. The Qt or wx libraries (or even Microsoft Visual Basic(tm)) will give you a snappy feeling application after a few minutes of assisted layout.

    4. Re:I'd be interested in knowning... by mlk · · Score: 1

      Nah, thats in Prolog Muhahahahhahahahahah!

      --
      Wow, I should not post when knackered.
    5. Re:I'd be interested in knowning... by Nynaeve · · Score: 1
      Maybe there's some aggressive coding techniques that would accelerate things ...

      From the Oct 2002 issue of Java Developer's Journal, "Swing Is Swinging Java out of the Desktop"
      Thinlet and the The Standard Widget Toolkit

      This is good stuff. I use thinlets myself.

    6. Re:I'd be interested in knowning... by Anonymous Coward · · Score: 0
      We have some Java tools for in house use, I can't bear to make them greater than 30% of the screen size because the refresh rate is too painful.


      This tells me that your team didn't spend much (any?)time trying to improve the performance of their swing applications.

    7. Re:I'd be interested in knowning... by Pseudonym · · Score: 2

      Are you volunteering to do the port of the ~300kloc mentioned while still supporting older versions?

      Unfortunately, in the real world, rewriting 80% of the whole system is almost never an option.

      The product I am paid to hack on is about 1.5Mloc. While this is bigger than the original poster's system, we've only ported to four platforms (32-bit Solaris, 64-bit Solaris, 32-bit Windows 2000 and IA64 Linux), so I suspect the headache level turns out to be about the same.

      --
      sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
    8. Re:I'd be interested in knowning... by ProfessorPuke · · Score: 2

      Maybe so. I tried a day or two to increase its performance, then gave up and in an additional day re-wrote it in C++. It was immediately faster than we'd ever need. So you're correct, we don't spend time optimizing Swing, especially when I've seen no examples to suggest its even possible.

      Look at Eclipse and Microsoft Visual Studio(tm) side by side. The widgets may look equivalent, but watch them redraw a buffer and you can tell which one is native.

    9. Re:I'd be interested in knowning... by Coppertone · · Score: 1

      Well, I work in a company that builds JVM (no names, no packdrill as my high school teacher said, but here is the URL reversed: avaj/moc.mbi.www) and I have to agree that Java is not as horrible as you think. We spend millions on having one of the best JIT compiler around and our JVM is used in pretty much anything you can imagine! It does scale well with MP machines, and I think certain vendor's VM aren't as optimising as it should be ;-p

      I agree that Swing is SLOWWWWW because it draws each component in Java instead of natively, but why don't you give SWT (www.eclipse.org) a try? It use native components and work on quite a few platform...

    10. Re:I'd be interested in knowning... by sacrilicious · · Score: 2
      For all the bad press Java gets about being "slow", it is mostly old, outdated FUD. Newer virtual machines are often faster than C/C++ applications.

      I have not experienced this. I've ported a large graphics-processing application from C++ to Java, and was unhappy to encounter an overall 6x performance degredation despite my best attempts to use memory efficiently. When I last looked on the web six months ago, performance tests comparing java and C++ uniformly indicated a similar performance penalty for java.

      .

      --
      - First they ignore you, then they laugh at you, then ???, then profit.
  45. JNI is your friend by Tim+Macinta · · Score: 5, Insightful
    Java is not currently an option for the high-performance numerical and immersive graphical aspect of our applications.

    Java isn't an all or nothing deal. You could write your app in Java and then convert the parts that really need performance into C and call it via JNI. Then you only have to deal with keeping a much smaller C library portable.

    1. Re:JNI is your friend by kberg108 · · Score: 0

      here here... I agree completly

      --
      I like things that are sweet and not things that are lame. --
    2. Re:JNI is your friend by truth_revealed · · Score: 1

      I found that JNI (java to C to java) runtime type conversion overhead was so prohibitive that it was much better/faster just to write all the code in java. It depends on how fine-grained your work is. I had to call native functions repeatedly in tight loops. JNI performance sucked at this. Coarse-grained APIs where you do a lot of work in the C native method are much better suited to JNI. Benchmark small samples programs before you invest a lot of time/money in this approach.

    3. Re:JNI is your friend by CmdrWass · · Score: 2, Insightful

      Absolutely!

      Not only that, there may be some merit for the "graphical aspect" of his argument, BUT the "high-performance numerical" part of his argument doesn't hold water.

      Java gets a bad rap for being "inefficient". The problem with java, isn't that it is slow, it is that it is so easy to learn that you have people programming in the language that have no business writing computer programs. I have proven time and time again to my peers that I can write code that is AS efficient or in some cases more efficient than comparative C++ programs. The thing is, I'm a java expert, and I know how to tweak things for performance. Any language can be inefficient if the person writing the code doesn't know what they are doing. And quite frankly, very few programmers I've met are at that level.

    4. Re:JNI is your friend by ealar+dlanvuli · · Score: 2

      I had to call native functions repeatedly in tight loops.

      Hint: Your supposed to factor the entire loop out, not just the function calls.

      --
      I live in a giant bucket.
    5. Re:JNI is your friend by abdulla · · Score: 1

      In that case, why use Java? You could use another interpreted or scripting language that has all what you want and make the critical components in C/C++, Java's JNI isn't the nicest looking interface around, I'd prefer using something like Python, or going even simpler to Lua which has a small footprint and a clean binding interface, also giving you greater runtime control/interactivity, examples of scientific uses of this can be found at there website.

    6. Re:JNI is your friend by AKAImBatman · · Score: 2

      In that case, why use Java? You could use another interpreted or scripting language...

      Simple. Because Java isn't slow and it's better supported under Windows than most Unix scripting languages. Most scripting languages ARE quite slow when it comes down to it. That's fine when we're talking non-performance critical web-apps, but if you are actually talking real-time systems, Java will keep your non-critical code from eating up all the CPU that the critical code needs.

      Besides, I'm betting that any project done in Java will end using very little JNI to improve performance.

    7. Re:JNI is your friend by truth_revealed · · Score: 2

      Hint: Unique Java Strings were constructed and returned by the JNI native function which was in part based on the loop index as a parameter. Factor that out your asshole.

      Hint: "Your" is actually spelled "You're" - short for "You are", jackass.

    8. Re:JNI is your friend by mlk · · Score: 1

      Personally, I'd keep it 99% pure java (only using JNI to do plateform inderpended nicetys, like a task bar icon, or registry access) then compile the hole bloody thing to native.

      While the VM thing of java is very nice but Java is also a language with not only a very clear standard syntax, but also a very good (if maybe a little bloated) standard API set.

      You don't have to worry about having multiply langauges (which is a bitch to support) or the system slowing down due to a VM.

      --
      Wow, I should not post when knackered.
    9. Re:JNI is your friend by Anonymous Coward · · Score: 0

      boy what a loser you are, he was only making a suggestion

    10. Re:JNI is your friend by Anonymous Coward · · Score: 0

      the "hint" part indicates he was clearly trolling. How can you make a suggestion without knowing all the pertinent facts anyway? he had no idea what was being built

    11. Re:JNI is your friend by DraconPern · · Score: 1

      Please don't rehash Sun's marketing material until you have actually tried it out. And believe me, it wasn't worth the effort. You should try Qt or wxWindows.

    12. Re:JNI is your friend by Anonymous Coward · · Score: 0

      I've seen an article dealing with the problem of numerical calculations in 3D games. The solution to speed up the code was to convert a naive implementation using 3D Vectors as java object, to a version passing doubles around (e.g.: ax, ay, az).

      I don't like this approach; is there a better way? In C++ I can use high-level classes, define operators and have code that is fast and clean...

      My point of view on the matter is that you can do numerical computation in Java; performance would be fine, but the C++ version would be better.

  46. Use ACE by TheGreatAvatar · · Score: 3, Informative

    I've developed several multi-threaded mulit-plateformed applications using ACE. This is a very well thought out package using various patterns to abstract the vulgarities of the different OS / compilers. ADAPTIVE Communication Environment

    --
    Three things are certain: Death, taxes, and lost data. Guess which has occurred.
    1. Re:Use ACE by Anonymous Coward · · Score: 0

      I stopped using ACE/TAO several years ago. It was producing monstrous 30 meg binaries due to template overuse. Maybe it got better in the years since. I don't know. I find OmniORB has more bang for the buck. Admittedly, OmniORB does not offer the OS abstraction that ACE offers. I just wrote my own as needed.

    2. Re:Use ACE by cK-Gunslinger · · Score: 2, Informative

      I whole-heartedly agree with this. Many large corporations and projects are using ACE with lots of success. I find that multi-threaded and/or multi-process application development is simple and straightforward. We are only using the wrapper-functionality of ACE for the most part, but when combined with the pattern-abstractions and implementation, you can really achieve some well-designed, well-performing, cross-platform code.

    3. Re:Use ACE by Fudge · · Score: 1

      Hear, hear.

      Using ACE we developed a half-million line c++ multithreaded, networked transaction server a few years ago that ran on Linux, Solaris and Windows. The only native code we had was a single file (100 lines or so) which handles running as a windows service or application. ACE might even have something for that too now.

      The application server was the core of our business, and performance was critical (we needed to handle hundreds of requests/second each of which hit a remote db). ACE's synchronization mechanisms were rock solid and flexible enough to meet our performance needs.

      Go ACE!

    4. Re:Use ACE by ProfessorPuke · · Score: 2

      I've seen a pair of large corporations use ACE with no success. I wasn't directly involved in the code, so maybe the individual implementors were idiots.

      But ACE sure can produce some bloated messes of hyper-nested templates providing little real additional functionality beyond the POSIX standard library. It can get big, and it can get slow, and when you complain about the speed the developer will tell me "Oh, ACE takes care of all that. I can't touch it. Sure, its open source, but there's no way I could go in there and fix that! Just look at all the templates!".

      Regarding ACE in multi-process applications, the last time I looked there was a serious bug (14 months ago, it might've been fixed since then). ACE's IPC has a race condition that can deadlock, freezing your big distributed application. Thousands of runs would succeed before this bug popped up, but it did happen (usually long after the product was deployed to customers)

    5. Re:Use ACE by cK-Gunslinger · · Score: 1

      Just like most anything, it doesn't cure everything automatically. It takes study, planning and good-judgement to determine the design and use of the necessary feature-set. Any code/library/middleware touted as "helpful" can't just be slapped together and expected to perform miracles.

      As far as bugs go, yeah, ACE is still under development and still has some quirks and some features that just plain don't work, but they are publicly acknowledged and there are always workarounds. New versions are appearing somewhat regularly.

      I use ACE for some personal programming, but our company is using ACE on a large OO project and I can say that things would take 2x as long if I had to use POSIX or System5 message queues, semaphores, shared memory, UDP, etc... Plus you get the added benefits of *mostly* platform independent code. (Those bug-workarounds _always_ break interoperability.)

  47. I think... not that it matters by kberg108 · · Score: 0

    that your Java excuses are bull shit propaganda. My company has built an application that has to proccess numerical values at incredible speeds and in real time and we were advised that C++ would be the only solution. Well we decided to use java and have not had any preformance problems what so ever. But in answer to the your general problem. It sounds to me like your lack of initial architecture is what is killing you. You need to rethink the architecture of your app and put code into the appropraite layers of that architecture. Every time I hear about a problem proting to multiple systems or tweaking code because of compilers, it just screams architecture redesign.

    --
    I like things that are sweet and not things that are lame. --
  48. Use OpenOffice.org SDK to build on MultiPlatforms by Anonymous Coward · · Score: 0

    Hi,

    The OpenOffice.org project builds from one source tree on Windows, Linux (ppc and x86), Solaris (Sparc and x86), and has FreeBSD, NetBSD, Irix, MacOSX coming
    soon and the codebase in question uses C++, threads, STL, component technology, etc.

    Kevin

  49. Red Hat will sell you gcc for all 4 platforms by Anonymous Coward · · Score: 0

    The problem you're facing is exactly what Cygnus
    Solutions was created to solve. They were bought by Red Hat 3 years ago, but the same people are still there doing the same thing. Go to the Red Hat website and search for "gnupro".

  50. Adaptive Computing Environment by Anonymous Coward · · Score: 0

    A virtue in programmers is laziness well applied.
    The easiest way to be lazy is to make use of
    someone else's work. Best of all is if it's free.

    The Adaptive Computing Environment
    has already done most of the heavy lifting in terms of cross-platform stuff. Free as in beer, free as in liberty.

  51. Re:Dear Slashdot, by Jamesie · · Score: 1

    mmmmm, turbo pascal....

  52. Easy by Anonymous Coward · · Score: 0

    What tools and strategies can we use to increase our productivity and regain our competitive advantage, without going for Windows only?"

    Java.

    Whomever said Perl earlier is an idiot.

  53. Select another language by SLOGEN · · Score: 1

    If you are not experiencing performance-constraints, why not use another language?

    Personally, I would think that if rapid development and market response is very important, you should probably select an interpreted runtime-typed language... which gives you minimum hazzle when changing desgin, arkitecture and most importantly: implementaion.

    One language that would spring to mind is python :)

    --
    SLOGEN [ http://ungdomshus.nu : Sebastian cover music]
    1. Re:Select another language by SLOGEN · · Score: 2, Informative

      Obviously, you would leave the numeric and "immersive graphics" in C++, and link the python code to it....

      Leaving you to do interesting stuff _with_ the C++ components, but without having to formulate everything in C++.

      Just preempting the "you did not read the post"-posts :)

      --
      SLOGEN [ http://ungdomshus.nu : Sebastian cover music]
    2. Re:Select another language by Anonymous Coward · · Score: 0

      Why not Ada95, a very good OO languaje, with type safe templates (generics), multi-threading (tasking) and distributed programming. And all is defined on the languaje, no external libraries for portable threads, etc.... and no makefiles!!!
      I've done my diploma thesis in GNU Ada95 and GtkAda+OpenGL for the 3D results display, and it compiles in Linux and Windows with the same source!!!

  54. ACE by Anonymous Coward · · Score: 0

    It sounds like you could make use of ACE the Adaptive Communication Environment. C++ wrappers for portability and cross platform developement of high-performance distributed real-time multi-threaded concurrent yadayada applications.

    1. Re:ACE by pp · · Score: 1

      I just modded the parent up, and want to second the recommendation about ACE. For threaded/networked
      cross-platform applications it's great.

      Won't do _everything_ of course, and if you want to do something outside the models it offers, might even make life a bit more difficult, but you can
      always fall back to native approaches if that happens.

    2. Re:ACE by Graspee_Leemoor · · Score: 1

      " I just modded the parent up, and want ..."

      Erm, you do realize your mods are reversed if you post, don't you ?

      graspee

  55. Learn how to JAM my friend! make jam; rm make by bm_underscore · · Score: 1

    Why make when you can JAM! Jam will take care of all of this for you. You spend time creating your rulesets for all your different platforms/compilers and all anybody has to do is type jam to build, regardless of what they are on. I use (and have used) Jam for this purpose and currently use it to build .net C# apps and assemblies using MS command line tools. Previously we used it intensively to support C++ on both GCC 2.95 & MSVC 6.0 on Windows, Linux, and Solaris.

  56. ACE (or Rogue Wave) and gmake by demiurg · · Score: 2, Interesting

    Just rewrite all your makefiles for gmake - which is cross platform and can use any compiler and use one of these libraries (ACE or Rogue Wave) along witg STL - and you are set.

    I've done this... it works...

  57. Bridge pattern by yellowstone · · Score: 2
    Have you looked at using the Bridge pattern (c.f. the GOF Design Patterns book).

    The GOF book gives an example of using the Bridge pattern to provide a platform-independent interface to a GUI api.

    Disclaimer: I don't have any real-world experience with the Bridge pattern, so I can't say how easy it is to make work, or how it performs in performance critical situations.

    --
    150 Opening BINARY mode data connection for slashdot.sig (129323052 bytes).
  58. Cross Platform tools by Anonymous Coward · · Score: 0

    I can't believe I'm providing free advice to a proprietary-software company, but here it goes.

    If your advantage is "big-iron" scalability, stick with it. Often it takes a lot of effort to make little effort, so changing your toolset will require substantial effort. The result of the change will be a substantial reduction in effort. If your needs change to Windows, you will nonetheless have a Windows port.

    Here's the direction I recommend.
    1) wxWindows (uses per-platform native graphic libs)
    2) automake/autoconf (very nice for dependencies)
    3) gcc/cygwin on all platforms (change to higher-performance compiler as an experimental afterthought only)
    4) IDE - find one, no suggestions available.

    Torsten

  59. Hmm... by Fugly · · Score: 3, Interesting

    I've seen a few shows on TV recently that featured some really wicked looking oil and gas exploration software. Stuff that let geologists view layers of terrain collected by seismic data in 3d, moving around in realtime... If that's the kind of stuff you're into, I can understand why java isn't an option for display right now.

    However, java is exactly what you need. You can scale it across processors on the big iron or run it on the desktop without recompiling.

    Have you considered only writing your display logic in C++ and using java for the backend number crunching? For raw floating point math, I've read that java is barely slower than native code at this point. It's my understanding that talking to the OS so you can get to the hardware is where you take the major performance hits using java. If you could do your raw crunching in multi-threaded java code, you could then deliver the data through one of many different mechanisms to your display logic and have that be the only code that you need to port from OS to OS...

    Another thing you could possibly look at is licensing 3rd party libraries made for cross-platform development. From your post, the only thing I know you're definitely having trouble porting is thread-related code. I'm sure there are multi-platform threading libraries for C++ out there somewhere.

    1. Re:Hmm... by dolmen.fr · · Score: 1

      With java you will avoid compile time problems because you will use only one compiler with one set of libraries.

      But you won't avoid run-time problems if you are using vitual machines from different vendors. And of course, the native VM from the OS vendor is usually the one that performs the best.

  60. Qt by neonstz · · Score: 5, Interesting

    Have you looked at Qt? It supports all the platforms you are developing for. It is primarily a platform independent GUI toolkit, but it also got a lot of other stuff like container classes (if you for some reason won't use stl), thread support, sql classes, xml classes and socket classes, all which are platform independent. It is not only just a portable GUI toolkit, I think it is the best GUI toolkit there is. I recommend it even if you're writing for Windows only. If you think of Qt more as a platform than a GUI toolkit, writing applications that run on multiple platforms (with native speed) may be easier than you think. (I'm not an employee of trolltech, although I am wearing a Qt t-shirt as I write this :)

    1. Re:Qt by RAMMS+EIN · · Score: 1

      This is not meant as flamebait, I just want to mention it for completeness. GTK+ 2.0 should also run on all those platforms, and using GLib solves a lot of cross-platform issues. Of course, these use plain C, which can be a pain to code, but there are C++ wrappers (gtkmm comes to mind).

      --
      Please correct me if I got my facts wrong.
    2. Re:Qt by ProfessorPuke · · Score: 2

      One thing that blocks the use of Gtk for some projects is its internal use of CORBA. If your code also needs to use CORBA for some reason, then you can run into linking conflicts where each library tries to bring in its own version of the ORB.

      (I've seen this specifically with Gtk vs ACE/TAO. But then again, ACE isn't something you should ever use if it can be avoided.)

    3. Re:Qt by slyckshoes · · Score: 1

      I can attest to benefit of using QT. I worked at a place where we were writing simulation software that had to run on Solaris, NT, SGI, and Linux. We were able to write code that was graphics and math intensive, had a nice graphical interface, and ran on all these platforms.

    4. Re:Qt by Anonymous Coward · · Score: 0

      No.

      The GTK toolkit does not use CORBA internally in any way, shape or form.

      The GNOME desktop is built on top of the GTK tookit, and it has the Bonobo component system, which *does* use CORBA. However, we aren't talking about GNOME (which doesn't run under Windows - it's a unix desktop), but rather GTK, which does run under Windows... and in its 2.x form, rather well too.

  61. Regular automated builds? by Isomer · · Score: 1

    How about having a process running somewhere on each of the platforms that checks out your source, compiles it and runs some tests against it. As soon as it finishes it checks out a new tree, compiles it, and checks it again.

    The advantage of doing this is you have near instant feedback if something you did broke on one of the platforms. This means that fixing problems becomes much faster. And, if your scripts email everyone who checked in since the last automated build then only the people who "caused" the problem get bothered.

    You can also use this to track various metrics, such as performance, and produce pretty graphs. You can easily see which commits caused your program to start taking twice as long.

    I've seen this used successfully in many software companies to keep their outstanding bug counts down and to keep people moving toward their goals instead of being bogged down fixing integratration issues.

    You might want to look at the rest of the ideals in Extreme Programming, such as Pair Programming, Project Velocity, User Stories....

  62. java and opengl by Anonymous Coward · · Score: 0

    checkout java bindings using jni to native code to opengl. it's fast and portable and lgpl:

    http://www.jausoft.com/gl4java.html

    In terms of backend development, if Java isn't fast enough for you then look at how some popular open source projects manage cross-compiling.. Look at their ideas and learn.

  63. autoXXXX not recommended (was: Re:GCC) by Brainchild · · Score: 1
    Why not use Automake and Autoconf ? Wouldn't that take care of some of the cross system problems ?

    Automake and autoconf can, as you imply, improve portability. Unfortunately, they can also completely destroy build reproducibility: add something to a PATH or install an additional library, and watch as your software gets built with completely different requirements than the previous build.

    I'd stay away from autoXXXX for software that's not distributed as source.

    --

    :: "I am non-refutable." --Enik the Altrusian ::

    1. Re:autoXXXX not recommended (was: Re:GCC) by Znork · · Score: 2

      That's why you have a build environment and strangle anyone who plays around with it. As long as the build environment is identical with the target platform you dont get that sort of trouble.

      Autoconf and automake are a bit troublesome to set up, and they wont give you an immediate benefit until you migrate your checks over to use them, but there's a reason that so many portable opensource products use them. As long as you use them the way they're meant to be used they solve a whole range of portability problems, and will cut down the time spent on portability by a lot.

  64. WHAT FUCKWAD MODDED THIS DOWN? by Anonymous Coward · · Score: 0

    PARENT IS SERIOUSLY ON TOPIC!

    L4M3Rs

    L4M3Rs

    L4M3Rs

    L4M3Rs

    L4M3Rs

    L4M3Rs

  65. gcc by mrcparker · · Score: 0, Redundant

    Yea, I know that everyone here has said it, but use gcc. We do here and the ease of just having everything work more than makes up for any speed loss. We use Windows/Linux/HPUX.

    Libraries are written in C so that, if we have to, we can easily compile them with native compilers for special cases and not have to worry about a specific platform's C++ quirks.

  66. Irix and Linux by Anonymous Coward · · Score: 0

    Most code between the two of these are compilable in both, unless you are using older 5.x Irix machines that dont have pthreads. Only a few ifdefs are needed, mostly around things like devices.

    Few key things, all comunications between the two of them use xdr functions to maintain correct values between components. For example, we have a lot of udp traphic between 3 programs which can be compile in Irix or Linux. The send/reception routines have all the values go though xdr so I dont have to worry about the big/little endian problem. Use of ifdefs that are based on which operating system you are using can catch the very few big differences between the pre 3.2 Linux gcc and the CC Irix compiler.

  67. Used to work for someone who did this by redbaron7 · · Score: 1
    Same industry too, although their development was for in-house use only.

    For graphical, geological, and geographical displays, have you tried INT? They sell various libraries/toolkits to do all this display stuff for you (graphs, seismic, contours, well logs, etc), and specialise in the oil industry, but also sell to other industries. Cross platform C++ (most Unices & Windows, even WinCE), and Java.

    http://www.int.com

    If you're staying with C++ cross-platform GUIs, X-Designer isn't bad. Not a patch on Visual Studio, but then Visual Studio isn't very cross platform.

    For source management, there are lots of tools. I've only used the SourceSafe family and Perforce. Perforce was the better IMHO.

    RB

  68. GCC by Montreal+Geek · · Score: 2
    Simply moving over to GCC for all four platforms does seem to be the obvious choice; you can also flatten GUI differences by using a portable multiplatform library.

    I've had some experience doing just that. To date, Qt is the most mature of those and will give you uniform access to GUI, networking, threading and even database access for Win32, Unices (including Linux) and MacOS.

    If you aren't so worried about GUIs but need to output multimedia contents portably, SDL is a viable alternative. The portability of some of the more esoteric components is dubious but SDL has the distinct advantage of being completely free.

    As for performance concerns some people have raised about archaic versions of GCC, don't let that stop you-- even if you don't use GCC 3.2 (which produces very good code) the subtle improvement is speed is very rarely worth the greatly increased complexity in development and maintenance.

    Besides, with recent GCCs I'm hard-pressed to actually find any significant difference between code generated by it and other compilers (for IA32, anyways, and with all relevant optimizations turned on).

    -- MG

  69. Two tips by JohnZed · · Score: 2

    - First, Qt (www.trolltech.com) is awesome. High performance, excellent portability (including all the UNIX platforms you mentioned, plus Linux/Windows/MacOS X), legacy integration (with Motif, etc.), multithreading, etc. There are also third party toolkits to integrate more advanced visualization into Qt (http://www.trolltech.com/company/announce.html?Ac tion=Show&AID=108).
    Nowadays, Qt doesn't just handle GUIs. It also includes networking and threading abstractions, with really nice object oriented interfaces to them.

    - Second, think about what IDE features you're looking for. If it's a GUI builder (which seems doubtful, considering that you probably spend a lot more time writing visualization algorithms than dialog boxes), then you could use Qt Designer.
    But, if you're more generally interested in project management, integrated debugging, and source browsing, I'd suggest you take a look at Visual SlickEdit (http://www.slickedit.com), which integrates all those features into an amazing, cross-platform IDE/editor.

    Good luck!
    --JRZ

  70. Combine C++ with Scripting by the_great_pumpkin · · Score: 1
    Write the compute-intensive numeric routines in C++. Then use a scripting language (Tcl/Tk, Python, Perl) to glue the pieces together into a application. Contrary to what you may have heard, it is possible (and not very difficult) to combine Script code with C++ into a single standalone executable that is easy to deploy.

    Advantages:

    • Using C++ for compute-intensive operations makes it go fast.
    • Using a scripting language for the framework makes it easy to program
    • The scripting language can also serve as a portability layer.
    • If you choose Tcl as the scripting language, then you can use Tk to write impressive GUIs.
    1. Re:Combine C++ with Scripting by Anonymous Coward · · Score: 0

      I don't get it: when you can do the really tough stuff in C++ you are also competent enough to write the few calls to glue the whole thing together in C++. Why then the need for the extra layer of scripting on top of the whole thing?

      I have several colleagues working on projects that use similar ideas, and all I hear is bitching about the various difficulties they run into (including: not being able to debug properly since no debugger understands the combination of code you are using; not being able to handle errors properly across language barriers; and not being able to use exceptions to their full power).

      Not trolling, but the commonly heared advice of "mix as many languages as you can" seems to fly in the face of wisdom.

  71. QT & GCC (C++) --- excellent!!! by jay_in_pa · · Score: 1

    Try QT from Trolltech . It is a C++ based applications framework. It has a visual form/screen design tool, and then you build your app using makefiles and the C++ compiler of your choice (G++ works best). It is open source, but you need ot buy a comercial license if you want to sell the result.

    Supported platforms:
    Any X11/Unix system (Linux, BSD, Solaris, etc).
    Win32
    MacOS X (Aqua -- you can do X11 development under OSX with the unix package)

    I use it a lot, it is a very good package. KDE is based upon QT, and it is also the underpinnings for Borland's Kylix , which is basically C++ Builder for Linux, and also the newest versions of C++ Builder and Delphi.

    If you just need Windows and Linux targets, then Kylix/C++ Builder is a good choice, I'm sure that being based on QT, Borland will be offering Kylix for other Unix platforms too.

  72. Re:Gcc? Speed. by WatertonMan · · Score: 2
    If you regularly compile your code on multiple platforms this is less of an issue. For instance we compile our crossplatform code on Visual Studio, Borland, GCC on Linux, GCC on OSX, GCC on Solaris, and Codewarior on OSX/OS9.

    It's amazing how many things you find this way. It actually a good way to find many bugs as well. Since we've been doing this a while we also decided to avoid a lot of the "newer" C++ features and that really helped both speed and portability. (Since not all compilers did STL well for some time)

  73. Qmake by SuperHighImpact · · Score: 1

    Trolltech's (Qt) Qmake is a verypowerful meta-make system that does this very well for all platforms/compilers mentioned and many, many more. I couldn't imagine doing a crossplatform C++ project without qmake.

    --
    sHi
  74. STL by truth_revealed · · Score: 1

    Cross platform STL/string/iostream is quite easy, actually: STLPort
    I don't trust compiler vendors' implementations being threadsafe.
    Just curious - is GCC's std::string threadsafe across all platforms yet? It used to have some serious problems.

    1. Re:STL by robbo · · Score: 1

      Don't quote me on this, but I'm pretty sure the gcc 3 libstdc++ is thread safe, not to mention finally ansi conformant. I have a lot of c++ code I wrote on gcc 2.95 and moving to gcc 3 felt *so* good.

      --
      So long, and thanks for all the Phish
  75. Java for GUI, C++ for profiled code by eyefish · · Score: 2

    If you definitelly need speed AND flexibility, I'd write the main application logic and GUI in full Java, then profile the application to find out those parts that really need to be accelerated, and write those as C++ code (you'd be VERY surprised at how easy it is to do this with Java; your Java code wouldn't even know that it is calling C++ code).

    Give it a try, that way you can use only one IDE for all of your code (NetBeans, Forte, JBuilder, Visual Age, are all good tools).

    1. Re:Java for GUI, C++ for profiled code by soul_on_fire2001 · · Score: 1

      How do u make c++ and jave interact ?

  76. Sounds like NCBI core libraries (c & c++) by sshir · · Score: 1

    Portable to all kinds of unixes, windows, mac, etc. Supported to some extent.
    Very widely used in biotechnology community.
    All the stuff is open source and is a "public property"
    Makefiles management included.
    http://www.ncbi.nlm.nih.gov/IEB/ToolBox/index.cgi

  77. Wow! by Flu · · Score: 1
    You seem to have a small problem at your hands...

    My initial reaction when reading your posting was of course Java - but of course - that would require a complete rewrite, which is out of the question. A decent rule-of-thumb is that a rewrite takes as long time as it took to get where you are now, despite the initial thought that "this time we make it right from the start".

    The second alternative is to minimize the number of compiler versions used. Standardize on one that is available on all platforms (gcc comes to mind, since it can be run on most platforms, including windows). The platform-specific code probably needs a specific compiler, though.

    However, if you manage to standardize more code than is currently being done on one compiler, it is also an indication that it really isn't platform-specific.

    Thirdly, new applications might be written in Java, utilizing the JNI to get access to already written libraries. However, this would add one more configuration to test the libraries against as well, so it might even turn out to be counter-productive.

    The fourth step is the step your customers don't want you to take; drop your support for the least used platform - or make sure you charge enough money to pay for the additional cost of supporting that platform - or the platform which is hardest to support, with "dedicated" engineers that provides "fixes" for that platform only, letting the main engineers focus on the main platforms.

    /FLu

  78. An Architect's Perspective by tizzyD · · Score: 1
    It is interesting that everyone is talking about UI code tools this, and compilers that... Now, not having seen the code base, or understanding the business requirements, I'm going to take a wild stab at an idea...

    Why not take a chance and refactor the entire process, not just the code? How on earth can you justify that many platforms with a common code base? If you calculated out all the additional costs and quality issues with supporting such a monstrocity, would it just be more cost-effective and improve the customer experience to change the product and make it only on 64-bit platforms? Just *nix? Is anyone asking these real business issues? They are the most important to ask first. Then, we get into the code parts.

    IMHO, if you still had to support all the platforms, I'd take the opportunity to radically change the concepts. Use a common C++ code set for any core objects that you use in the business. Make sure that the abstractions sit around any errant issues you really have with 64-bit code (data size requirements?) Also, just be honest with people. Be willing to sunset platforms. Don't try and be all things to all people. You need to position such a change as for quality and form improved stability.

    I'd then take the entire set of UI functions and write them tailored to each platform. Again, and IMHO, cross-platform UI never makes anyone happy. The dev's complain about the complexity, the users complain because it's not quite right, etc. etc. So just don't do it (I like QT, but QT on Win hurts.)

    Lastly, I'd create a client/server construct so that you can optimize the back-end and front-end operations. That way, should you want, you can run on one system, or run a client/server set. That's what web dev's do all day testing out on their local systems.

    (Now, if I can just find the time to get my website done...)

    --
    ...tizzyd
  79. X-Platform Strategy C++ by 4of12 · · Score: 2

    I'm guessing you'll get plenty of suggestions to change your language, which is certainly something to consider if you have that option.

    But if you're like me, you don't have that option. You've got a load of C++ that's not simply going to magically transform into Python or Java overnight.

    I would suggest the hard road. Boil down supported standard features in the compilers that you can use and tell people to stick to that list unless they can make a case that all of the compilers now support the new feature that they want to use.

    Although I feel it is dated now, Netscape used to publish such a guide for their developers.

    For example, in our early days, we would not permit namespaces or RTTI.

    Now, as compilers have gotten more supportive of the ISO C++ standard, we permit those features in our codebase.

    But we haven't yet decided to open the floodgates on exception handling, although it's supported pretty broadly.

    Finally, you really need an automated build system that runs the latest repository snapshots through the compilers on all the platforms and throws the results up on a web page, like Tinderbox.

    That will tend to enforce good standards as developers will see that their check-in attempts fly through with green and no warnings, or get dirty yellow about warnings, or red with downright errors during the build.

    --
    "Provided by the management for your protection."
  80. Cross platform C++ is hard by rreyelts · · Score: 1

    I developed and maintain a cross-platform C++ project (http://jace.reyelts.com/jace) which has roughly 10,000 lines of code and supports Windows, Linux, Solaris, HP-UX, AIX, and MacOSX.

    My experience is that writing any sort of complex C++ code (especially that which involves templates) is nightmarish due to different levels of standards conformance, support, and interpretation - not to mention plain old bugs. For example, Jace has to jump through hoops to get around bugs with virtual inheritance in some compilers, and differences with respect to template specializations and the ODR. Every time I make a change to Jace, I immediately have to rebuild on several platforms, for fear that the compiler I was using was lax and let non-standard code compile or for fear that one of the many other compilers won't correctly compile the code.

    I think that if you were to take the time to profile your application, you'd find that the old 90-10 axiom applies. I would suggest that you write that 90% of your application in a highly cross-platform language like Java, and the other 10% in C++. With Java, it's virtually impossible to write code that is rejected/accepted differently on different compilers, and you have access to an excellent cross-platform build tool - http://jakarta.apache.org/ant/index.html (Not that you would need to build on more than one platform). You'll also find that the Java compilers are essentially bug free. A task that is much easier to achieve with Java, considering the language is so much simpler than C++.

  81. Visual C++ Everett by The+Axe · · Score: 1

    The next version of Visual C++, Everett, due out in 2003 and is supposed to offer increased ANSI/ISO standards compliance and UNIX/Linux compatability. The enhancements over Visual C++ .NET (7) seem very attractive and might be able to aid you. You can check it all out at: MS Developer Tools Roadmap

    1. Re:Visual C++ Everett by Tony+Hoyle · · Score: 3, Interesting

      It doesn't mention Linux compatibility, only that it has been 'designed to appeal to the Unix and Linux communities' - basically they're pushing the standards compliance a lot.

      There will always be compatibility issues... VC.NET is a lot better than VC6 but there are holes, like MS' continued habit of putting underscores in front of 'unix compatible' names (snprintf for example), and calling other things completely differntly (eg. strcasecmp).

  82. Ask the experts! by joeytsai · · Score: 2, Informative

    Why not see what others who are facing the same issue have done? In particular, I'm thinking of mozilla, which is another C++ application which has builds for Linux x86, Windows, OS X, OS/2, HPUX, AIX and Solaris.

    Yeah, they had to make their own toolkit (XUL), but I don't know if you need one (it wasn't totally clear from the question).

    In particular, check out this helpful document the mozilla team made about writing portable C++ code.

    --
    http://www.talknerdy.org
  83. qmake by SuperHighImpact · · Score: 1

    I said this somewhere else in this message tree, but I want to say it near the top where you will definately see it. If switching to gcc on all platforms isn't feasible for any reason, then qmake is definately the answer to your building nightmares. qmake is a meta-make system that creates makefiles for many-many platform/compiler combinations (including all the ones you mentioned).

    qmake allows you to write one project (.pro) file for all platforms. qmake then creates makefiles for any of its supported platforms for you. It takes some getting used to, but it is very powerful and I couldn't imagine working on a cross-platform project without it.

    qmake comes with Qt, so you'll have to pay to use if for commercial use, but developer liscenses are reasonable (probably less than $20k for all seven of you). Actually, you may be able to use qmake for free, but other portions of Qt would definately come in handy for you as well -- especially if your application has a large GUI component.

    --
    sHi
  84. It's the ++ by Duncan3 · · Score: 1

    I write code that works perfectly on Win32, UNIX, OSX, and everything else every day. Just stick to C, and you will have no issues at all. The SECOND you touch C++, you will have problems. It really

    --
    - Adam L. Beberg - The Cosm Project - http://www.mithral.com/
  85. We have this problem too. by JohnFred · · Score: 1

    We are a games shop moving from single platform development (PS2) to multiplatform (PS2, XBox, PC, GameCube).

    We have one codebase and are using gcc on the PS2, msvc6 on the PS, msvc7 on the XBox and CodeWarrior on the GameCube.

    It makes things..interesting.

    The approach we have gone for us to use a multiplatform kernel that handles the filesystem threading, memory allocation, various resource handling, error handling and user input. Not having to support as much in the way of user interaction as the average GUI app probably helps.

    We can plug machine specific renderers into the framework by creating them as singleton objects.

    Basically we try leverage the 80%/20% rule and make the 80% rule multiplatform and the 20% single platform - one for each platform. It's a lot of work, but it's the only way to get the speed needed.

    The 20% bit is implemented via interfaces. For each major function (rendering, physics, sound) a singleton is created that implements the interface for the specific platform.

    Ninja source control also helps. CVS sucks. Source Safe sucks. Actually, nearly all source control software I've seen sucks for this kind of thing in one way or another. It's just too easy for a coder on one platform to check in code that breaks on another.

    For instance, CodeWarrior complains if you have a ";" after the closing brace of a namespace, none of the other compilers do. And Codewarrior is following the standard! Arrgh!

    Compile with warnings at the maximum level, enforce warnings as errors, which makes compilers ultra picky and a pain to work with, but often causes them to pick up non-standard code that's going to be a problem for the other compilers.

    We are trying to get to grips with NxN Alien Brain, a source control package where almost everything is scriptable. This may help. It may not even suck, but it's geared to games which have huge non - code related assets to deal with as well as code. Hmm. Maybe you have a similar problem with survey data. I know AB is being applied outside of games in the simulation field, so it may be worth a look.

    --
    /usr/games/fortune > ~/.signature
  86. autoconf by siloflow · · Score: 1

    using autoconf might help you out

  87. We don' need no stinkin' tools by seniorcoder · · Score: 2, Interesting

    I have written many cross-platform projects in C++ without a problem. All I did was identify low-level platform dependent issues and encapsulate them within subroutines, typedefs & #defines etc. Then write software using regular C++ code and use portability library. Example: typedef unsigned long PORTA_PID; // This function returns the current process ID. PORTA_PID getProcessID(void); As a previous respondent said, GUIs are a different matter. I would suggest to standardize on one GUI environment such as Java (or even MFC) and split the functionality so the GUI was a thin shell that communicates with the main business logic that exists in other C++ processes. You don' need no stinkin' tools, the amount of code required in the portability library is very small. That's my 2$. I'm worth more than 2c (just).

  88. Try Python and PyQT by vivek7006 · · Score: 1

    I am graduate student, and as a part of my masters thesis, I am involved in the development of a behaviral modeling environment . We are using the programing language python, and the GUI toolkit QT and PyQT. The choice of these technologies has made our tool fairly generic as it runs without a glitch on Linux, Solaris and win2k. We have not tested it on other platforms but it should work on all the platforms which run python. Python is a really cool programing language and PyQT makes cross-platform GUI development really easy. We have developed fairly involved GUIs using PyQT, like a Topology Editor, Schematic Editor (to capture the design and topology of circuits) etc. I would strongly recommend python and PyQt to someone interested in developing cross-platform applications (with GUIs)

  89. Program with Java, build with Ant. by AugstWest · · Score: 3, Interesting

    I don't understand why people even look at Makefiles anymore now that Ant exists. We've completely automated all of our builds and deploys across NT, Linux and Solaris with it, across different architectures and different locations.

    I'm not going to expound on using Java, since it is fairly ubiquitous these days and if it would work for you, I'm sure you would have already considered it.

  90. Borland tools by Gheesh · · Score: 1

    Delphi, C++ Builder and Kylix, together with open-sourced Interbase/Firebird database, make a perfect suite for cross-platform RAD development.

  91. Java by xagon7 · · Score: 1

    It fits everyting you need to do. Multi threaded, stable, and most of your clients are on solaris anyway.

    It is quite suprising that you even have to ask.. or you simply already know the answer and jsut don't want to.

  92. Good to use multiple compilers by Anonymous Coward · · Score: 1, Insightful


    Here we have to develop a big tool for multiple platforms (lukily all Unix). It would be possible for us to use only gcc, but we decided to use two different compilers (gcc, IRIX) so that we can find compiler specific errors more easily.

    We found that this is a good policy to decrease complexity (even though it may look counter intuitive)

  93. Kylix/Delphi combo? Comments please by Anonymous Coward · · Score: 0

    I have basically the same question and have been thinking about Kylix/Delphi solution. Anyone with experience here please post some thoughts. No troll, just haven't had time to explore it yet. TIA. RAD is very important and Linux/Win are the most important OS's to me.

    1. Re:Kylix/Delphi combo? Comments please by WetCat · · Score: 1

      With some effort (VCL to CLX porting)...
      may be a wise solution....

  94. Re:Gcc? Speed. by norwoodites · · Score: 2

    `for(int i=0;in;i++); for(int i=0;in;i++);' is the right way accounding to the c++ standard, the wrong way is `for(int i=0;in;i++); for(i=0;in;i++);'

  95. Re:Gcc? Speed. by Anonymous Coward · · Score: 0

    Interesting. It makes sense that gcc is optimized for portability, but how much slower is it than VC++?

    If the user chooses to go the VC++ route because the code compiled is faster than gcc then he will need to spend about $800 for each Visual Studio workstation. Alternatively he could save $800 bucks per developer and invest that money in faster hardware. Plus save programming time because he is able to target only one compiler's syntax.

  96. Intra/Extranet? by Anonymous Coward · · Score: 0

    Without seeing your app, I can't really tell how feasable it is, but more and more stuff is going the direction of 'thin-client'. If you rewrite as a web-based app, you could move to two platforms (Windows and "RedHat" Linux).

    Sell a preconfigured server for an extra 5 grand.

    And for those sites that refuse to install either one of the platforms internally, charge them to access an 'extranet' farm of servers working of https.

  97. Your answer lies here... by Anonymous Coward · · Score: 0

    Check out ACE (adaptive communication environment)... C++ libraries which are cross-platform (ACE support WIN32, *NIX, Os X, BeOS, many RTOSs, etc), it is fast, the american military uses it... etc, etc, etc... do a search on google - it pops right up... Have fun....

  98. Re:Gcc? Speed. by gillbates · · Score: 4, Interesting
    gcc is built for portability, not speed. VC++'s code is faster

    You're joking, right? Perhaps I'm a little behind the times, but I was under the impression that GCC used a register based architecture where VC++ uses a stack based architecture. While GCC might spit out some average performing code with the default options, using -O3 will produce very fast running code. I've compared the performance of code compiled with GCC vs. the same program written in assembler, and at its best, GCC is only 50% slower than hand coded assembly, which is very good considering that some very well respected compilers will produce code that is 10 times slower than hand coded assembly.

    I've also looked at the assembly language output of VC++, and it's a joke. VC++ often inserts large sections of extraneous instructions into the code. I've managed to follow function calls in VC++, and it is not uncommon for a function call to have prolog and epilog code of several dozen instructions. Interestingly, GCC uses a register based schema, and I can actually follow the code pretty easily, in spite of the fact that it uses the AT&T syntax. GCC just produces cleaner code.

    --
    The society for a thought-free internet welcomes you.
  99. Mozilla by Anonymous Coward · · Score: 0

    You could use Mozilla as your application framework for the front end as they have already worked on the cross platform issues. Then, link to your own specialty libraries or use the NSPR libraries to handle your datatypes.

  100. Re:Gcc? Speed. by mindstrm · · Score: 1

    What is wrong with the second example? i would have to be declared previously of course.... but what's wrong with it?

  101. Re:Gcc? Speed. by akihabara · · Score: 1

    VC++'s code is faster I believe the contrary. Evidence?

  102. Hi Rob by MSBob · · Score: 2
    How are you, mate? How is everything at m*e?

    Have you considered java? Sounds insane, I know but Java3D seems to be coming of age and I've seen some pretty impressive large data visualisation demos written in it. It saves you a lot of headaches with cross platform development issues.

    I realise that most people think of Java only as a server side technology but Sun has been putting a lot of effort into making it more appealing to the scientific programming community. You should really give it another chance.

    Yours truly,

    You know who, eh? :-)

    --
    Your pizza just the way you ought to have it.
  103. Doing much the same thing... by Anonymous Coward · · Score: 0

    ...although maybe on a smaller scale. I am building a monitoring / control application for the space industry. It currently stands at 160,000 lines of C++ (and only C++ - there is no trace of C or of any scripting involved), and works just fine under HP-UX (with aCC), Linux (with gcc), and Windows (with Visual C++).

    One thing that has hit me was the differences in the various STL versions (the one with aCC is rather old and differs significantly from the others). A solution is to use your 'own' STL - just standardize on one and use it on all the platforms you support.

    Another difference is graphical output between X and win32. This I worked around by having a sufficiently powerful abstraction layer; writing it was actually surprisingly easy. The major advantage is having applications that are 99% identical no matter what platform they run on. The major disadvantage is having to write all of my own controls, and occasionally running into differences in the event model.

    As a rule I try to keep my #ifdef as deep down as I can. I will only allow #ifdef in libraries; never in applications. This limits the damage done by different platforms to the library code - still a significant chunk of code, but already far less than the entire project.

    I have one file that attempts to compensate for all compiler quirks. It contains most platform-specific #includes, defines types available in some runtimes but not in others, contains required pragma's for each compiler, and #defines commonly supported (but differently named) functionality (for instance, strnicmp ()) into a fixed, essentially project-specific naming system.

    I will just about never call _any_ OS or libc function directly. Instead I will always use an indirection layer in one of the libraries. This gives me three advantages: I can subtly modify the interface to the function (for example, to allow better type checking); I can use exceptions for error handling instead of returning error codes; and I can compensate for platform differences.

    On the whole I found developing for three platforms at the same time challenging, but not impossible. It certainly helped keep my code clean of platform-specific unpleasantness, and by extension simply clean. Obviously more care is required than if you are supporting a single platform but a competent programmer will have no trouble doing it.

    Someone else suggested having a person per platform. I strongly suggest you do not do that, since this will tend to increase divergence between platforms. Instead, appoint someone who is responsible for the entire abstraction layer across all the platforms. Make him the only person who can call OS and libc functions, and have him write proper and useful C++ interfaces to whatever you need. Then write everything to run on that layer.

    It is not necessary to first have the entire layer up and running before you can use it. If you are starting with existing code, just make sure you have some idea of what your abstraction layer is going to look like and then simply add code whenever you need it.

    Whenever you abstract some function, be sure to take the time to replace _all_ occurrences of that function, and one day you will come into the office and realize you have become 100% platform independent.

    One final tip: Visual C++ actually supports the forward slash as a directory separator in #include directives. It sure helped me clean *my* code when that was pointed out to me ;-)

  104. some suggestions... by taco1991 · · Score: 1

    While I'm not officially responsible for the build process at my workplace, I've taken that responsibility as we've been porting our code to a new operating system. Here are some things we've learned that may help you.

    We recently switched from Make as our build tool to Jam which has worked great. Like you, we didn't have the option of using GCC on every platform, and Jam made it easy to configure all the operating systems we're interested in using with the fewest headaches. After using Jam for quite a while now, I think all of the developers and I are very happy with the decision to axe Make. Honestly, I can sympathize with your effort to use Make to do all your compiling since we gave it some effort before switching to Jam. Try Jam - you'll be amazed at how much simpler your build process becomes.

    Whether or not you use Jam (though we use Jam to do this), setting up nightly builds, capturing the output, and sending status emails with the results makes bug finding much simpler, especially on multiple platforms. Part of the nightly builds include built in testing. If any of the tests fail, we know we've broken something in our code.

    Another suggestion... Look for a threading wrapper package like CommonC++ or ZThreads. Both are fairly well developed now and make programming multithreaded applications for multiple platforms pretty easy. For multiplatform GUI tools, try FLTK. It's tiny compared to WxWindows or other bloated GUI wrappers, plus it's easy to use.

    --
    "Corrupting our youth one mind at a time"
    1. Re:some suggestions... by DancingSword · · Score: 1

      PLEASE - MOD THAT UP!

      http://www.freetype.org/jam/

      --
      Messages to/for me ( in me journal )
  105. ZooLib C++ Cross-Platform Application Framework by MichaelCrawford · · Score: 1
    My friend Andy Green spent nearly ten years developing the ZooLib cross-platform application framework before placing it into Open Source under the MIT License.

    I've worked with it quite a bit and I must say it is wonderful.

    Presently it supports Windows, Mac OS, Linux, and BeOS. A little work would be required for Solaris and Irix - it has a small amount of assembly to do atomic arithmetic, that's used by the reference counted smart pointers, but that should not be hard to do.

    I have started writing a tutorial called The ZooLib Cookbook.

    --
    Request your free CD of my piano music.
  106. Re:Gcc? Speed. by Osty · · Score: 1

    What is wrong with the second example? i would have to be declared previously of course.... but what's wrong with it?

    The problem is that i is declared within the scope of the for loop, which means it shouldn't be available outside of the loop. With the second example, even though i is declared in the for loop, it's declared outside of the scope of the loop, which is not what C++ says should happen. (IIRC, that's how the standard used to be a long time ago, and then the standard changed. It's hard for a compiler written before the standard change to support the new changes in the standard ...)

  107. You may be surprised... by merlin_jim · · Score: 2

    I do not know why noone considers Java as performant.

    I have a few words / acronyms...

    1. JIT. As in Just-In-Time compilation. Meaning Java software approaches native speed as time goes on.

    2. JNI. As in Java Native Interface. Ok, so you have a couple C++ libraries that really have to be as fast as they possibly can be, without necessarily incurring the wrath of the platform demon by being written in assembly. That doesn't mean that the 90% of your code that doesn't vastly effect the performance of your system ALSO has to be written in C++.

    3. Silicon. As in what chips are made of. Including chips that run Java. Though these are really targetted at the embedded market, to have your coffee machine run Java or whatever, a high-performance version is available. It plugs into your PCI bus. And runs Java there instead of in the main processor.

    Oh, not exactly on-topic, but insert obligatory note of how .NET is language-independent, supposedly platform-independent, being an open standard and all, and performant, as its compiled and not runtimed.

    --
    I am disrespectful to dirt! Can you see that I am serious?!
  108. Smalltalk by scode · · Score: 1

    I don't know if the original poster meant managing their current codebase of C++ or going for something new.

    But if productivity is a factor, one should seriously look into Smalltalk.

    A few URL:s to have a look at:

    www.whysmalltalk.org
    www.cincom.com (VisualWorks Smalltalk)
    www.squeak.org
    www.exept.de (Smalltalk/X)

    Squeak is certainly cross-platform... it's difficult to find something it doesn't run on :)

    VW is less portable but fater and commercially supported. Also more expensive.

    (There are other not-so-cross-platform dialects.)

    --
    / Peter Schuller
    --
    peter.schuller@infidyne.com
    http://www.scode.org
  109. It's all about discipline by Anonymous Coward · · Score: 0
    We're a development team of 8. 7 of them use Windows. I am the unix guy who has to keep things running on 12 different unix configurations (1 Linux, 4 Solaris, 3 Irix, 2 AIX, 2 HPUX). We use Qt and limit ourselves in the number of C++ features that we use. Keepthing things compiling on those platforms requires only a small amount of time for one developer, if the members of the team have discipline and can be educated about that to avoid.

    Use GNU make on all platforms. Don't try to write makefiles that work with whatever make incarnation is available on each platform. And make sure you read the documentation on GNU make till you really know what a powerful tool you have at your disposal!

  110. Have you tried Java? by Big+Man+on+Campy · · Score: 2, Interesting
    A colleague of mine is in the same boat as you. He asked me to implement some of his numerical calculations in java. We then benchmarked both. Java was the clear winner for us. You should consider trying the same.

    Go out and download and install Java's sdk. Also, take a look at jama.

  111. Mod parent up by Hecatonchires · · Score: 1

    All this talk of gcc for cross platform. If he's writing code that requires all that big iron, he's using c++ [or c - arguably faster, but nastier] because he needs that speed. Thats why he is using native compilers, and not compiling in compatability mode.

    To help with the complexity of building, try ant. Ant is great.

    Dont even mention using assembler for speed.

    --

    Yay me!

  112. QT, FORTRAN, GCC, MSVC, KDEVELOP by klondike · · Score: 1

    You need five essential tools.

    Qt is all you need to build your UI. It is also all you need for a decent, dropin STL replacement.

    Fortran is your language to make things fast. Unfortunately, this is a weak point on Linux. But I would give Intel's compiler a try.

    Gcc is the only C++ compiler you need on all your Unix platforms.

    MSVC6 or MSVC not.yet is your choice on Windows. It is not as good as KDevelop but it works.

    KDevelop is your IDE on all Unix platforms.

    Add Cervisia and WinCVS for you source code management and you are in business.

    Now go code.

  113. The problem is not the compiler. It's the language by Anonymous Coward · · Score: 0

    Drop C++, or use GCC to precompile it to C.
    Then feed that C through whatever. Or switch to Objective-C.

    Visual C++ is supposedly also a pretty bad compiler, and MS as usual screws the standards.

    Try looking at compiler alternatives. Metrowerks follows the standard quite strictly.

  114. competitive cross platform development by Anonymous Coward · · Score: 0

    Well, first and formost, if you're looking to speed things up then why don't you hire more staff?

    Secondly, why not hire more staff?

    Thirdly, I think that hiring more staff would help.

  115. Think About java and ANT by Anonymous Coward · · Score: 0

    Our project is quite big, uses intesively AI algorithms, DD.BB., caches, etc. and the performance is great.... and if it doesn't run enough always can use JNI...:-)

    To get cross-platform compiling can use ant, no am not kidding go and take a look and will see all things it can do for you :-)

  116. Dump C++ by Anonymous Coward · · Score: 0
    A large proportion of our time is spent finding C++ code that just works rather than being creative and competitive with new functionality.

    That is what I found in my last job where we had a bunch of C++ heads, and we were primarily windows with ports to solaris. C++ was so full of trapdoors it's no wonder our company went under.

  117. an alternative by erocha · · Score: 1

    I was faced with the multi-platform development problem a few years back. I utilized some tools from a company called Codefast. There was/is a book from O'Reilly where the process is described and an arcane set of the tools was included.

    I found these tools and framework very useful. You can have automated builds, makefiles can be generated for "thousands" of different os/compiler environments, etc. Check them out at codefast.com

  118. Java is not currently an option by swagr · · Score: 3, Insightful

    Java is not currently an option for the high-performance numerical and immersive graphical aspect of our applications.

    So what you're saying is:
    You've coded it in Java, used native methods where applicable, optimized it, ran it, and it was too slow on every single hardware configuration known to man.

    Or are you just guessing?

    If you posted on Slashdot hoping we'd help you, give us the details. How "not an option" is it?

    --

    -... --- .-. . -.. ..--..
  119. My 2 cents by WetCat · · Score: 2

    I still prefer Tcl (with Itcl for object-oriented programming). It's the easiest software environment to work with for me. I also use websh and dtcl extension for apache (tcl.apache.org).
    Using TCL you'll have a very compact and clean code.

  120. Re:Dear Slashdot, by Graspee_Leemoor · · Score: 1

    I prefer turbo prolog. Not many people know about that one.

    And the turbo c++ ide was a classic!

    graspee

  121. No problem by AKAImBatman · · Score: 5, Insightful

    Step 1. Go to http://java.sun.com and download the JRE 1.4.1.

    Step 2. Visit http://www.datadino.com and click on "Webstart Now!".

    Step 3. Right click and save Meat Fighter. Find where you saved the JAR file and double click.

    Step 4. Right click and save Duke Nukes Stuff. Double click on the JAR.

    Step 5. Visit jGoodies and try their wide variety of products.

    If you are under Linux, I'm afraid the games probably won't perform well. (Little issue with getting X to be configured to handle high speed direct-framebuffer graphics). However, DataDino should work, although you may need to get the installer instead of using the super-cool WebStart link (Mozilla problem only!). If you don't have a database to use, visit the "Supported Databases" page and download the test HSQLDB database.

    The plain and simple fact is that Java is fighting two issues:

    1. Poorly written apps that give all Java apps a bad name. (For example, "genius" A decides to load a table before releasing the event thread. Table takes 5 minutes to load and user gets annoyed. The solution would have been to load the table in a separate thread so that the user can see and interact with the table items as they are being loaded.)

    2. Perceived performance vs. actual performance. People see Swing and the default look and feel and instantly "feel" that the app is slower than windows. Nothing could be farther from the truth. In all reality, it is probably running faster than the Windows app, it just doesn't seem right. This is caused by the Java L&F being way too "flat". Your brain doesn't quite connect the buttons and other objects as being solid objects to be manipulated.

    1. Re:No problem by Dog+and+Pony · · Score: 2

      Thank you, I will.

      But I will tell you beforehand, I am not totally buying that explanation (#2)- it would mean that almost every java developer, including old professionals would suck, since I've seen quite a few java apps.

      And your point 1. is nothing I recognize at all... but maybe I am just lucky.

    2. Re:No problem by Foresto · · Score: 1

      "People see Swing and the default look and feel and instantly "feel" that the app is slower than windows. Nothing could be farther from the truth. In all reality, it is probably running faster than the Windows app"

      Really? Are you sure? Last time I checked, which wasn't more than a couple months ago, Swing apps devoured memory at a ridiculous rate. If that "faster" Swing app of yours was running on the average memory-starved desktop system, it would probably slow to a crawl as the OS started paging memory to disk. I realize that RAM is cheaper than it has been in past years, but I'm not about to ask users to upgrade their systems in order to run my software.
    3. Re:No problem by Anonymous Coward · · Score: 0

      Uhhh... if there are issues with X on Linux, wouldn't that sort of defeat the purpose of switching to Java?

  122. Commercial support: Qt, MKS by msobkow · · Score: 2

    MKS Toolkit does a terrific job of integrating a Unix ksh-based CLI with WinNT/2K/XP, and couples closely with IBM DB/2 so that you can run DB/2 UDB scripts as you can under AIX. It is expensive, but worth it if you can afford it.

    Qt is a very, very nice cross-platform development library. Another option you could look at used to be Neuron Data's Elements Environment, but they renamed the company (www.blazesoft.com) and I don't know if they still sell EE as a seperate product (Advisor is a repackaging of their rule-base software, which was built on EE.)

    There are also the ever-present Rogue Wave class libraries, but I don't think they'll address your GUI requirements. However, if you use it to split out the core application functionality from the presentation (GUI), it might be helpful.

    A solid set of macros with compiler/platform detection directives can help a great deal for porting code, though many people prefer to use sed or perl scripts instead (ala config.) Macros have the advantage of dealing with portability more consistently, and localize the changes for platforms to the headers and migration binding code (usually done as a base library.)

    Using cross-platform libraries such as xml.apache.org libraries, IBM's ICU (Unicode support), et. al. can also make your code much more portable without requiring extra work after the initial coding.

    There are also various open source projects that provide portable thread libraries, portable GUI toolkits, etc.

    --
    I do not fail; I succeed at finding out what does not work.
  123. Java is *so* hard! by fishdan · · Score: 2, Funny

    Java is not currently an option for the high-performance numerical and immersive graphical aspect of our applications. Read: "We don't want to learn Java" No Java programmer who read that believes you. The answer is that what you can learn to do in Java in 5 DAYS won't be fast enough, but if you're willing to either hire a good contractor (for gods sake ask to SEE something he's built though), or take 8 weeks or so to get GOOD, you can EASILY do this in Java...Unless of course you are doing special effects for ILM, in which case I humbly apologize, and I've got some questions about the next movie.

    --
    Nothing great was ever achieved without enthusiasm
    1. Re:Java is *so* hard! by DanielDittmar · · Score: 2, Funny

      No Java programmer who read that believes you.

      Why not? They seem pretty gullible otherwise.

  124. Cross-Platform tools by inode_buddha · · Score: 1

    for some odd reason, Borland's Kylix 3 comes to mind... I just got a copy installed here a few days ago and want to find out if the claims made for it are true. If so, it would seem to fit your situation

    --
    C|N>K
  125. How we solved this problem by Anonymous Coward · · Score: 1, Insightful

    Hi. I'm not usually much of a poster to this site, but since I spent the last
    three years of my life doing exactly what the original poster asked
    about, I'm going to make an exception.

    First my credentials. What we do is write design software for
    engineers. Much of the code is intensive numerics, where performance
    is critical. There is also a fair bit of Gui work where we don't care
    nearly so much. Our target platforms are Windows, Linux and five
    flavours of Unix. We had no restrictions as to language, except that
    it had to be something we had a reasonable change of finding
    developers to work in, (so no Prolog or Haskell). The project is
    question was intended to go to a big installed user base.

    First, PERL. We investigated PERL and ended up using it extensively
    for scripting, but frankly it won't do the job for intensive
    numerics, when there are a million dot products to calculate.

    Second Java. We initially thought Java was our best bet for UI, and
    possibly the rst. Unfortunately it turned out that Java's performance
    is not up to it either. It may look fine on Windows and Sun, but some
    platforms were ten times as slow as the Windows implementation. That
    was the sort of performance hit we could not take. Admittedly this was
    three or so years ago. It took us only a fews hours to run a simple
    numeric Java program on all platforms, and there were several where it
    couldn't cut it. (Are you listening IBM?).

    We toyed with a split between Java and C++ for the numerics, but it
    would have taken a lot of work. A class can practically be only one
    language, and the application didn't split nicely into 'numeric' and
    'non-numeric' classes.

    We finally settled on C++ and like several posters went for GCC in
    order to get maximum portability. Obviously this is not possible on
    Windows, and we went with VC6 on that. In practice the number of times
    we found code that would run on one but not the other was very rare,
    with a big exception I'll come to later. This has worked pretty well,
    but GCC is not built for speed. We recently tried porting to the HP
    native compiler, and got a better than double speedup. However that is
    the sort of hit can can afford to take if it gives us full portability.

    There are some restrictions on GCC. Using shared libraries with C++ is
    very tough on some Unix platforms. And the native STL on VC6 has some
    incompatibilities with the GNU STL, which we fixed by going to STLPort
    on Windows.

    When we discarded Java, we picked up on Qt as an alternative GUI kit, and have
    never looked back. It's powerful, truly portable and very cheap. We
    have a few issues, and we don't use the really cutting edge features,
    but on the whole it probably saved us man years of effort. In my
    opinion its easier to use then Swing, but that's just an opinion.

    We also considered writing two separate versions, one for
    Windows and one for Unix. Unfortunately that would have essentially
    doubled the amount for work necessary, and have done it for ever,
    since we were pretty certain the codes would never have converged. We
    needed to have exactly the same look and feel across all platforms,
    and no-one wanted to settle the hundreds of disputes over whether the
    'Windows' or the 'Unix' way was the right UI.

    I mentioned a big exception a while back. Early on in the project we
    took a strategic decision not to permit multi-threading. We did split
    the GUI and the numerics into separate processes, so effectively this
    gives us two threads. We've never had a problem doing this, and it
    simplifies the code a lot. If you can do this too I'd recommend it.
    I suspect that it reduces the differences between GCC and VC6
    enormously. We wrote our own classes to isolate the differences in
    socket programming between GCC and VC6.

    Makefiles? Don't know. We have a hulking great set of Makefiles, hand
    coded, driven by hand coded Perl scripts, and both are a nightmare to
    maintain. Anyone with better ideas, please let us know.

    If you need to reply, call me "Engineer".

  126. Re:Gcc? Speed. by jjohnson · · Score: 1

    The second example was coded for a flaw in the implementation of the standard in VC6: variable declaration in for loops was not limited to the scope of the for block (as the standard specifies). If you tried to compile the first example in VC6, you got a compile error claiming i was declared twice.

    VC.NET implements the standard correctly.

    --
    Anyone who loves or hates any language, platform, or manufacturer, doesn't know what they're talking about.
  127. cmake and cygwin by cant_get_a_good_nick · · Score: 3, Interesting

    As far as makefiles go, cmake looks promising. It seems to be a generalized Imake replacement. I haven't used it, but looks interesting. It is now part of the cygwin toolchain.

    as far as tools go, look at cygwin. My company uses gnumakefiles on NT and UNIX, with generalized Makefiles for each project, and platform specific build rules in universal gmake include heeaders. We use ACE for a lot of the cross platform C++ stuff, a lot of our things are servers so we avoid the cross platform GUI stuff.

  128. Develop for Unix, Tweak for Windows by Duderstadt · · Score: 1
    Here are a few tips to Developing for Unix while getting the most out of your Windows code (C++ only):

    Caveat Emptor (Let the buyer beware)

    1: Use the Visual C Runtime as much as possible for your Windows code.
    The MSVCRT contains many calls that can be substituted for Win32 calls. The beauty of the library is that the MSVCRT was designed to look as much like unadorned C++ code as possible. For example most functions return longs istead of HANDLEs. This can be most helpful for cross-platform code.

    2: Use FIBERS instead of threads for Windows.
    Fibers were included in Win32/Win64 to make porting UNIX apps to Windows NT easier. They are basically lightweight threads that manage their own scheduling, memory, and concurrency. While this may seem like an insane suggestion, this is the method used by the SQL Server team at MS to get maximum performance.

    This may be a good way to approach your problem because using fibers allows you to write your multithreaded routines specifically for *NIX, avoiding Win32 specific code.

    3: Use the development utilities included with Visual Studio to get insane performance boosts on the NT platform (30-40%) without changing a single line of code.
    Specifically, you want to look at rebase and bind.

    By default all DLL's are loaded at memory address 0x1000000. If this actually happens, Windows will have top calculate the offset of every function call contained within any DLL at load time - a huge performance hit. Rebase.exe recalcuates the DLL memory address during development.

    Bind serves a similar funtion, nailing down the addresses of each function in your code. Good for a 10-15% performance gain.

    4: For Windows, pay most attention to DLL loading, startup, shutdown, and unloading.
    Perfecting your code in this area can save you some serious CPU cycles at runtime, and, best of all, most of this code can be isolated from your other, cross-platform code.

    For some Win32 tricks that will improve performance on the NT platform, check out Developing Apllications for Windows, 3rd Edition by Jeffery Richter (MS Press). Has some great stuff on tuning and perfecting.

  129. What about ICC? by arw · · Score: 0

    Intel has a great compiler which is a lot faster than GCC or VC++ on x86 and ia64. It's even faster on my Athlon ;)

  130. Probatus Spectra SDK by magi · · Score: 2

    Would a cross-platform SDK with a C API do, instead of C++? C is more efficient than C++ for many purposes and much nicer for integration.

    You might want to take a look at Probatus Spectra SDK. It provides many standard and advanced functionalities, as well as many helpful high-level frameworks for networking, globalization, and so on. A comprehensive cross-platform compatibility layer is an integral feature of the SDK.

    You mentioned that you need especially threading. Probatus Spectra SDK provides a very nice cross-platform API for threading. For example, it cross-implements the conditional variables in Unix threads and thread events in Windows.

    It also has an excellent build system based on a framework of makefiles that hides all platform-dependent issues.

    The currently supported platforms are Linux, Solaris (Forte compiler), HP-UX, IBM AIX, Tru-64 and MS Windows (VC++ and Borland C++ Builder compilers). Both 32- and 64-bit platforms are supported for Solaris,

  131. FLTK and Boost by printman · · Score: 2

    Definitely check out:

    FLTK - http://www.fltk.org/ - light-weight
    cross-platform C++ GUI toolkit with
    OpenGL support, etc.

    Boost - Portable, peer-reviewed C++ libraries
    including threading support, etc.

    --
    I print, therefore I am.
  132. Apparently you aren't up on recent news by complexmath · · Score: 1

    Microsoft hired Herb Sutter a while back and has become quite committed to producing a fully compliant C++ compiler. VC7 is a huge step in the right direction and VC7.1 (due out probably within the next 6 months, and approximately $30 to upgrade from VC7) will iron out almost every remaining issue, including partial template specialization. I haven't been watching gcc as closely but when VC7.1 comes out it will probably surpass gcc in terms of standards conformance.

    It's not VC++'s code that isn't portable, it's some of the language extensions MS added for Windows-specific stuff like COM. Since any cross-platform project has to encapsulate platform-specific code anyway, this isn't much of an issue in the grand scheme of things.

    1. Re:Apparently you aren't up on recent news by Garen · · Score: 1
      • "when VC7.1 comes out it will probably surpass gcc in terms of standards conformance."
      Given that they've already said there are a number of things that won't be supported in 7.1 that gcc has supported for years now, I somehow doubt that.

      However, they do say they're now using some really important libraries like Loki and BOOST as test cases for the next release, it looks promising.
  133. Java Then Compile To Native? by mlk · · Score: 1

    If speed of execution in Java is the problem, compile it to native, it still will not be as fast as well written C (overhead such as the GC and OO).

    --
    Wow, I should not post when knackered.
  134. Same boat here by pixel_bc · · Score: 1

    All the posts recomending you change languages aside, we're in the same boat as you. Multiple compilers over multiple platforms. Rewriting code is simply not an option.

    We're actually moving from a complex system of Makefiles to tool very similar to Ant.

  135. That's easy... by Anonymous Coward · · Score: 0

    You grab Eclipse and starting writing Java. (Eclipse is also written in Java ;)

  136. Better compiler... by sfe_software · · Score: 2

    Honestly, I would use Visual Studio only as a deveopment environment -- but NOT rely on it. The other platforms will be easy enough to just use whatever text-editor the developers are comfortable with.

    I tried Intel's compiler for the first time today on Windows, and it's far superior to the one that comes with VC 6.0... it integrates nicely with the IDE (remember, the IDE is just an IDE, the compiler is a command-line utility) and -- in my case (fourier transforms, MP3 decoding) it produces code that is a LOT faster (though compile time is slower, output is larger...)

    Point being, there is no reason (ever) to tie yourself to visual studio. It's a glorified text editor, really, and as long as you keep it that way (stay away from MFC et al) then it won't introduce any problems with cross-platform programming. I personally run a couple of (private) cross-platform projects, and the best advice is to treat code as code. Don't rely on any of VS's magic, just use it as an environment that lets you edit text and compile with the push of the F7 key.

    --
    NGWave - Fast Sound Editor for Windows
  137. So does java scale by complexmath · · Score: 1

    to run on massively parallel machines? It does have threads, but that's only part of the solution. This would also mean throwing out all their existing code unless they wanted to use that terrifying Java-Native C integration. I don't think the problem was ever an issue of language so much as addressing their compilation problems.

  138. My tools by Anonymous Coward · · Score: 0

    Hi!

    I have good experience with:

    Qt/qmake - GUI Makefile Builder
    ACE+TAO - CORBA

    I use VC6 under Windows, gcc 2.95 - 3.2 under Linux and Irix C++ 7.3 under Linux.

    Best regards

    Erik

  139. RogueWave by HapNstance · · Score: 2, Informative

    We have very similar needs in the medical software industry and we find RogueWave to be a pretty good solution for our cross platform C++ needs. They have various libraries (database abstraction, STL, math, etc.) which are all cross platform and provide decent performance. There is still some tweaking to be done to get all platforms to compile clean but it is much less than what we had before we moved to RogueWave.

  140. Re:Gcc? Speed. by bmwm3nut · · Score: 1
    actually, i think mindstrm was being picky. as long as 'i' is defined before

    for (int i=0;i<n;i++); for (i=0;i<n;i++);

    then it's perfectly fine. notice there's a semicolon between the for loops, the second one is not in the scope of the first one. i think the original poster mean to give as an example:

    for (int i=0;i<n;i++) for (int i=0;i<n;i++);

    without the semicolon, it's a nested loop.
  141. WxWindows and Dev-C++ on NT for a gui-builder by cdn-programmer · · Score: 1

    Check out WxWindows. http://www.wxWindows.org

    I have Borland C++ professional builder and looked at the Kylix solution. IMHO it is not cross platform and we all know that MSFC and IBM's Visual Age libraries are intended to lock you in before you start.

    So far WxWindows looks good. It gives good Windows/Unix/Max cross platform support.

    Check out DEV-C++ for a Windows Gui builder. Unfortunatly DEV-C++ is written in Delphi. It needs to be ported to C++ and WxWindows then it too will be a cross platform development gui-builder.

    Good luck.

  142. Erm.... No, sorry. by Anonymous+Brave+Guy · · Score: 2
    I do crossplatform day in day out, its NOT THAT HARD

    I seriously question whether your claim is true.

    I work on a serious cross-platform app at present. We build on something like 15 different platforms, from the latest Metrowerks CodeWarrior on the Mac and VS.NET on Windoze to antiquated HP-UX things and God knows how many Solaris builds.

    Today, I wrote a singly linked list class. I wanted it to be generic, so I defined it all using macros. Am I insane? Not at all. Several of our compilers don't support even basic templates properly, and if you look up STL in the help, you'll find no match. You can't get more modern compilers on some of these platforms, and even if we could, we're supplying to other development companies and are constrained to make our code work on whatever compilers they develop with.

    I could have written everything much more cleanly using templates, in much less time, or even faster still just used std::list, but then it wouldn't have built on something like half of our compilers. These things get confused when you combine overloading and overriding sometimes (what's the using keyword, anyway?) so more advanced techniques are right out of the Window.

    Boost is a fabulous thing. I sincerely hope that several parts of it make the next C++ standard, and fix up some of the glaring gaps in the current one. But while it's intended to be written in standard C++, and as time goes by it will become more widely useful, you could never call the sort of code they use "portable" in an industrial engineering sense at present. Portable amongst recent compilers on popular platforms, yes, but outside that scope, it's an academic toy that is of no practical use.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  143. Re:Gcc? Speed. by ProfessorPuke · · Score: 2

    Like he said , if i is declared previously, then there's nothing wrong. If you have

    int i;
    for(int i=0;in;i++); for(i=0;in;i++);


    Then you're fine. The compile might warn you that the second declaration of i shadows an existing variable, but that's all.

    (Me, I can't get over how ";in;" is supposed to be valid...)

  144. Explaination by AKAImBatman · · Score: 3, Insightful

    Think about Point #2 in this context. How many programs have you tried that you are surprised to learn are Java? If you said none, you probably aren't looking hard enough. (Hint: Look for the java.exe file in the installation directory.) You tend to recognize Java apps by their distinctive look. The distinctive look has problems with perceived performance. As such, many good programmers change it to use a non-standard look.

    After you visit jGoodies, you should understand more of what I mean.

    As for Point #1. I don't know enough about MFC to be 100% sure, but I believe that Windows automatically handles repainting when you are populating complex objects such as tables. (e.g. You'll tend to notice large tables in SQL Server Enterprise Manager paint nothing in the table as you scroll. Instead, you can watch the text filled in after the fact.) Swing (the Java GUI toolkit) requires the programmer to make these optimizations. Why? Because that's who *should* be doing it.

    What if for some reason, I want to design a scrollable table that is fast enough when pulling data over dial-up connections? Under Java, I might design it so that the data doesn't display until the user stops scrolling, or I might display partial data. Under MFC, do I have much choice? Not without jumping through a great deal of hoops.

    Notice how Microsoft writes new components every time they have a new piece of software (e.g. Office toolbars, Outlook shortcut bar, etc.). They do this to improve performance in their programs. Java programmers shouldn't have to rewrite GUI components, just data models. However, few and far between is the programmer who actually does this.

    BTW, another spot you might want to visit is
    Swing Sightings. You can find links to all kinds of well written Java programs.

    If you'd like to try a Java program that uses native components instead of Java Swing, try Eclipse. While I personally don't like it, it should help you understand the perceived problem a little more.

  145. Cross platform development tools by WillSchroeder · · Score: 1

    We use the following tools in our VTK (vtk.org) and ITK (itk.org) projects. Both these systems are cross-platform and are used by some pretty heavy hitters like the National Labs and National Library of Medicine. The systems are also quite large and complex.

    + CMake (www.cmake.org) manages the build process in a cross-platform manner. Using simple configuration files, it produces a native build environment (e.g., Makefiles, workspaces, etc.) on Unix, Linux, Windows, Mac. That way you can use native development tools on each platform. CMake is becoming pretty popular; it's available from cygwin, Debian, etc.

    + The testing process is managed by DART (http://public.kitware.com/Dart/HTML/Index.shtml) and an example Dartboard can be found here http://www.vtk.org/Testing/Dashboard/MostRecentRes ults-Nightly/Dashboard.html. Notice that we test nightly (actually continuously) on many different platforms and compiler combinations.

    + We use CVS for source code control

    + VTK provides cross-platform 3D graphics, image processing and visualization. ITK provides image processing, segmentation and registration.

    + We have created a C++ class that encapsulates threading details and use it in a general fashion. Both ITK and VTK use this. (VTK also encapsulates distributed parallel processing such as MPI. We have used it on a 1024 processor National Lab Machine to process nearly a petabyte of data.)

    + Tk (Tcl/Tk, Python/Tk, C++/Tk) work okay for the GUI. Qt, FLTK, and wxWindows are also candidates.

    + We like to create hybrid compiled/interpreted environments. That is a C++ core, which is automatically "wrapped" into language bindings for Tcl, Python, Java, etc. We now have a tool called CABLE that can wrap arbitrarily complex C++ code into Tcl (soon Python). See http://www.kitware.com/Cable for more information. Applications built with the wrappers are pretty portable.

    -W

  146. Make File Alternatives by jaaron · · Score: 2

    Don't write Makefiles yourself. Instead write a script that translates simple build rules (foo.cpp -> foo.o -> foo.exe) into a custom Makefile for each platform. I went this route after battling for years with complex Makefile rules that never quite worked.

    A wonderful alternative to make is Jakarta Ant. It's java based, but there are ways to get it to work with C/C++ files and compilers. You can create an entire build/test/deploy process with Ant.

    --
    Who said Freedom was Fair?
    1. Re:Make File Alternatives by lient · · Score: 1

      Boost is a very professional set of c++ libraries meant to extends the standard library. It contains a modified version of the Jam build system that works very well as a cross-platform Makefile alternative. Check it out

  147. CMake is your answer by legoandy · · Score: 1

    I would suggest you look at CMake: http://www.cmake.org. It does exactly that. You type simple CMakeLists.txt files, which contain your build process and then CMake will generate your native build process. Currently it supports Linux, SGI, HPUX, Free BSD, Solaris, OSF... unix like operating systems, it supports gcc on just about any platform, Mac OSX with make and gcc (CodeWorrior on the way), Windows supports Borland c++ 5 makefiles, Visual Studio 6 and 7 project files and nmake. So, as you see it supports a variety of different build systems. And you do not have to really change the project too much. At least not the source code. Some project built with CMake include VTK, ITK, ParaView. CMake is also being considered for several other open source projects.

  148. cross platform libs by cdc179 · · Score: 1

    Using cross platfrom libs can save you lots of time. For GUI you can use QT, GTK, or fltk.

    threads, file I/O, etc.. Common c++
    http://www.gnu.org/directory/libs/cpp/commonc pp.ht ml

    Common C++ manages threads, synchronization, and network sockets by offering portable C++ classes that abstract these services, as well as supporting "serial" I/O, daemon specific event logging, object serialization (persistence), block/record/page/ oriented file I/O, and configuration file parsing.

  149. www.paulgraham.com by Anonymous Coward · · Score: 0

    Check out http://www.paulgraham.com who has some very good articles about choosing a language. He makes a good argument that python/java are slowly reinventing LISP...

    1. Re:www.paulgraham.com by 21mhz · · Score: 1, Flamebait

      He makes a good argument that python/java are slowly reinventing LISP...

      Why is it that Lisp fans label every new language/runtime as reinventing Lisp and thus somehow inferior? Even if that language is actually easy to write and read and maintain, has standardized and powerful libraries and the runtime sports features that no Lisp interpreter comes anywhere near? No, that's just fluff, and list evaluation is the be-all & end-all of programming.

      --
      My exception safety is -fno-exceptions.
    2. Re:www.paulgraham.com by __past__ · · Score: 3, Informative
      No, that's just fluff, and list evaluation is the be-all & end-all of programming.
      Yawn. No, list processing is not the be-all and end-all in programming. That's why Lisp, for example, has arrays, hashtables, structs and a powerful object system.

      I don't care so much about Java, but with Python, it's just that a lot of its cool features are also in Lisp, like functions-as-data, classes with metaclasses and the ability to define and change them at runtime, dynamic typing, docstrings, the REPL/interactive prompt, keyword and "rest" arguments to functions, ability to fix bugs without having to stop the running program, ... However, it lacks, for example, macros (don't even try to compare the power and beauty of Lisp macros to the C preprocessor!) and good native code compilers, optional type checking and a variety of free and proprietary implementations all adhering to the same standard.

      As for syntax: Both Lisp and Python have the problem that people, esp. newbies, hate their syntax (the parentheses in Lisp and the significant whitespace in Python). Most people eventually get over it and even get to like it. Just because a language doesn't look like C doesn't make it bad.

      You are right about the lack of easy-to-find, ready-to-use libraries for common tasks, however (not about the "standardized" part, however. Last I looked there was no Python standard.) There are some projects to change that, for example CLOCC, but there's still a long way to go.

      IMHO, the single greatest problem Lisp has is non-technical. It is the (wrong) perception that the only data type in Lisp are lists, that there is no OO, or even iteration, that it is interpreted and slow, and generally dead. I'm not interested in forcing anyone to use Lisp, but I for one do like it, and if you are looking for a cool language to learn next, I'd say you definitely should have a look at it.

  150. Re:Might I *STILL* suggest... by Doctor+Memory · · Score: 1

    if you can break out your high-speed numerical pieces into small bits of code, it's relatively easy to call them from perl.

    s/perl/Java/g

    --
    Just junk food for thought...
  151. Use Java & C++ native libraries by Crazen · · Score: 2, Interesting

    For the hevily computational stuff use C++ native libraries if the java "prototype" doesn't work for you everything else (persistance, interface, brokering) use Java.

  152. Intrinsic Alchemy by Grady+H · · Score: 1

    Hi there, I work at a company called Intrinsic Graphics in Mountain View, CA. We have a cross-platform C++ API that can be ported to any OS. We are currently focused on the video game industry, but if you're interested in potentially using Alchemy for oil and gas we can discuss how that would work. Alchemy's roots come from SGI's Performer Visualization software, and can most likely be tailored to work for your needs. Cheers, Grady

  153. XWT? by tzanger · · Score: 1

    You might want to give XWT a shot. You write all your business logic in whatever you need (C++, Java, Perl, Fortran, whatever), exporting the functions you need to use as XMLRPC or SOAP connections. Then you write your user interfaces in XWT. Native clients for Linux and Win32, with everything else supported by a Java 1.2 RE. It's fast, scalable, configurable and truly multiplatform.

  154. Java for the front-end or even the whole thing by Atomic+Frog · · Score: 1

    Use Java. That's what it's for.
    There were teething troubles early on, but most of that has been ironed out. Things run really, really, well, even large applications.

    (Look, "Art Of Illusion" is a 3D modelling program written entirely in Java. It runs fine on my PII-300MHz _laptop_).

    You get access, not only to SGI, Windows, Linux, AIX, Solaris, but just about any other platform with a JVM. And, Java is really nice to program in to boot.

    If you really must use C, use C/C++ for the "back end" (so you can use gcc for everything, even Windows), and just use Java for the GUI.

  155. Re:Gcc? Speed. by Anonymous Coward · · Score: 0

    It is not a "flaw" in VC6. The current C++ spec itself allows for either implementation though the non VC6 version is preferred. And the reason for THAT is that the older specs all did it the VC6 way and the final 3.0 spec breaks old code! There is an appendix in the 3.0 spec covering this issue. I suggest that if you care, you check it out.

  156. Abstractions, abstractions, abstractions. by AxelTorvalds · · Score: 4, Interesting
    Bummer, when you ask about this stuff, it's usually pretty late and there are often legacy decision that have been made that are hard to break free from. Or your young and naive and don't like something at work..

    This stuff is done for real. At IBM I worked on a very large project that compiled on AIX (several distinct versions that we were sensitive to) Solaris, Windows NT, Linux, HPUX, and supposedly OS/400 although I never actually built the OS/400 piece nor have I seen it operate. First things first, you need good coding conventions, don't let some punk break them either. Secondly you have to design some abstractions and build some foundation classes; or buy a really good set or downlaod some good free ones, I've heard positive things about ACE. This is mostly a problem with windows any more, back a few years you might support win16, win32, PM, and UNIX now it's pretty much just POSIX and Windows. You need to abstract the machine stuff out. Threads, possibly strings and such (Unicode vs. non-unicode..) possibly basic types (big endian vs. little) networking code.. A rule of thumb is that on this kind of project you should never talk to the OS directly without something in between, it's a huge effort to make that OS abstraction layer or learn the ins and outs of an off the shelf one but it's worth it, even if you pay with a little performance. Nothing sucks more than coding away on AIX building some cool classes and adding some cool new stuff, then checking it in and finding that it doesn't compile on any other platforms.. and you've got to figure that crap out ASAP to make a deadline. If you build one from scratch, as IBM usually does or did, you can tune some things for your application; your OS abstraction layer can be a great "helper" or "utility" layer.

    Typically well coded C and C++ can go from compiler to compiler pretty easily. Then you can use Pro64 on Mips, ACC on sparc, Intel C on Windows for performance critical portions of code. You have to be smart about it though and use some good conventions. The biggest rule would be avoid MS Visual Studio which is by far the most non-standard setup out there and if you do use it don't use their projects unless you have to. Some good make files with some good rules can help make this pretty easy. I don't know why more people don't do it but look at the Linux kernel's rules file. I have a Rules.make that I've built up and it includes things like different options for debug builds, profiled builds, and optimized builds, sets up some common rules for compiling C++ code and C code and what have you. My makefile include that file and then they are usually pretty short, generally not much more than a list of .cxx files and a library name. Then it's easy to make sweeping changes too. I think a good build system, one that will last should usually take a day or two to kind of put together pretty early on in a project, unless you can carp some good stuff from another project. The goal is a flexable and reliable build system that you don't have to worry about. Far too often people start cobbeling a build system together and then after 6-9 months it's broken and britle and hard to change because so many things have been changed and added through out the project. Put some effort in up front, consolidate your rules in to one place, use some environment variables to control some build switches. Use some shell scripts to figure out various things, not hundreds of lines of Bourne shell code, just little bits. Do this until AAP is ready and rocking and then use that. Also, if it needs to be said, use GNU Make; it runs damn near everywhere and it's pretty good at what it does the 15 minutes it takes to learn it will save you hours and even days worth of time in the long run.

    I'm a huge advocate of a solid and strong build. Mozilla is a project that festered for weeks or maybe even months becuase you couldn't build the damn thing when it went open source. Building code is something that can be done so well by tools that if you're worried about it then you need to fix the build. Building software is hardwork so take the pieces you can out of the equation, the build is the first one.

    Next, I assume you've abstracted out the GUI from the meat. If not, make this job one if you wish to have any chance in hell against your one platform competitors or even your mulitplatform competitors when you get down to it. View/Data Model and client/server: learn it, live it, love it. Or switch to a web based interface, lot's of people do it.

    While we're on abstraction. If you guys are really serious then you're probably going to have machine specific components. Look at /usr/src/linux/include and /usr/src/linux/arch for a starting point of reference. I would envision a project like this have a set of small Mips, Wintel, Linux-x86, etc. directories. Everything else can probably be compiled with GCC and then in those directories you'd have your assembly and machine specific compiled code.

    Lastly, you want to have a staged check in process. People hate not being able to commit code but at the same time you don't want them to commit code for real until it compiles on all of your platforms. Honestly, I don't know of a really good way to do this. Set up a build lab, do nightlies against the real code. Do nightlies against the "staged" code. Then have some kind of weekly merge meeting. That's how I've seen it, it's time consuming and somewhat painful. You bite off too much and you're spending a shitload of time merging stuff.

    1. Re:Abstractions, abstractions, abstractions. by Anonymous Coward · · Score: 0

      There is still an issue pending, which is, IMHO, the real issue. Their competitors are delivering code faster using an IDE.

    2. Re:Abstractions, abstractions, abstractions. by chrestomanci · · Score: 2

      Mod parent up (...Oh it is +5 already)

      Seriously, this is very good advice. I have worked in a company that produced a multi platform product for embedded devices, and that is exactly what we did.

      (6 CPU architectures, 5 operating systems, and every available permutation of the two, about 20 in total, It was especially hard in our case, because as our product was for embedded systems, we could not use any complex client-server architectures, or make use of cross platform interpreted languages like Java.)

      The other thing I would say is that if the product is for visualisation, it may not be possible to separate the GUI from the back-end, as the main work will be in rendering and visualisation.

      Another company I worked for sold visualisation software for medical data (CAT or MRI scans, ultrasound images etc). Most of the work the software did was in rendering a huge 3D dataset for the screen, It would not have been possible to put than in a Java back end, as the performance would not have been available. The software had to use every (non portable) trick available to get the performance needed. If this is your situation, you will probably end up writing the same inner loop optimised for each of the targets you are using. The trick is to use a build system that means that is all you have to re-write for each platform.

    3. Re:Abstractions, abstractions, abstractions. by kristjansson · · Score: 1

      The competitors that are building faster using IDE's probably either:

      a) only target one platform

      or

      b) have already created the above mentioned abstraction layers, consolidated on a single MAKE utility, and tweaked their IDEs and environment to utilize both properly.

      In all honesty, the guy screaming about abstracting data/view, client/server, OS/homebrewed wrappers makes a lot more sense from where I'm sitting (with my virtually nonexistant experience as a paid coder) than the people suggesting that the entire development team stop and learn from 1 to 3 new languages and/or libraries to the proficiency necessary for the type of app they're working on.

  157. elisp by Anonymous Coward · · Score: 0

    try elisp as emacs has been ported to almost all platforms

  158. Re:Gcc? Speed. by aminorex · · Score: 3, Interesting

    gcc 3.2 is generally superior to VC++ emitted code,
    in my experience.

    Mingw32 is the target of choice if you don't want
    to license Cygwin.

    --
    -I like my women like I like my tea: green-
  159. Some suggestions by Anonymous Coward · · Score: 1, Insightful

    On portable programming: remember the adage "only the paranoid survive". Assume that language-defined libraries will pobably not behave exactly the same on different platforms (e.g., threading). Rather than using such a library directly, write your own library around it, and code your application in terms of your library. Then, when you port it to the next platform, the only platform-specific changes should be in your library, not everywhere you used the library.

    On choice of language: C is probably the ultimate in terms of portability. You might code difficult sections in C. C++ can probably be written just as portably, but I would suggest that you restrict developers to a known-portable subset of the language features, especially with regards to class inhertitance and the "standard" library (whatever the old STL is called now). If one of your programmers creates something that "surprisingly works", expect it not to work on any other platform.

    As for RAD: that is a tough one. I've had good success with wxPython (Python is fantastically easy and powerful, and wxWindows provides a very nice set of widgets). There is also a wxDesigner tool for creating dialog boxes (and interestingly, it emits perl, python or C++, your choice). I haven't used it, but I would expect it to be well worth it (it's non-free). The rest of the common GUI development stuff (connecting buttons and menus to action functions) is trivial to code by hand in wxPython.

  160. ADA by Anonymous Coward · · Score: 1, Informative

    Real-Time
    Multithreaded
    OO
    Decent type checking.

    Used by dod for safety critical/mission critical so fits well in your oil and gas exploration.

    see www.gnuada.org and
    www.gnat.com

  161. Re:Gcc? Speed. by DevNull+Ogre · · Score: 1

    The identifier in was previously declared. Because it was initialized as nonzero, the first loop is still going. (And going, and going,...)

    Actually, it's not like anybody on Slashdot has ever figured out how to write a less than sign. As you know, what he meant almost certainly was:

    for (int i = 0; i < n; i++); for (int i = 0; i < n; i++);
    (For the record, you have to use &lt;. Even if you choose "Plain Old Text". Don't let them fool you--it isn't all that "Plain Old".)
  162. One word, four letters, 40 years proven... by Anonymous Coward · · Score: 0

    lisp.

    ac

  163. Seems you need a threading abstraction layer by TheLastUser · · Score: 2, Insightful

    You might use Java for the interface and use JNI (Java Native Interface) to attach computation and rendering modules onto the VM.

    I know of several games that use Java interfaces and then run a real time simulation written in C++.

    Maybe you could build on a third-party threading lib?

  164. Cmake (and some other observations) by CFN · · Score: 2

    It seems you have two issues: having a managable build environment, and finding different compilers that agree on what c++ is.

    There is an utility, CMake (do a search), which is a CrossPlatform make tool. You set up some high level specifications (which files belong to which object, etc.) and it generates the platform specific make files (or VisualStudio projects) automatically. I have used it a little bit, to develop the software for linux and windows, but don't know if it would meet all your needs.

    As far as getting all your compilers (and headers, and libraries, etc.) to agree, the easiest solution would be to use the same compiler on each platform (gcc). To address some comments others have posted: for numerical applications running on Windows (at least the ones I compile), gcc by far outperforms VC7. It is a much more agressive optimizer, and has optimizations for P4 that VC does not yet have.

  165. Re:Gcc? Speed. by The+Dark · · Score: 1

    Of course you could add the line:

    #define for if(0);else for

    inside a test for VC6 in your standard crossplatform header, then you can define those loop variables wherever you want.

    --
    sig's not here
  166. Yes by AKAImBatman · · Score: 2

    Go to java.sun.com and you'll find the 64 bit VMs designed for Sun's big iron. These VMs are the ones that take ultra busy J2EE servers to task.

  167. Turn off optimizations by EvilAndrew · · Score: 1
    The biggest cause of compiler problems is from the optimizer.

    Turn it off.

    If you have some very time critical sections of code, try turning on the optimizer for just those routines - but otherwise you're just asking for trouble.

  168. Python... by pyman · · Score: 1
    Python is fantastic for this sort of thing. It's very quick to get applications up and running...

    It has binding for many GUI libs, including wxWindows. There is also bindings for SDL and OpenGL :-)

    If your worried about speed, write an extension module, or try inline C (weave) or use Psyco to genererate optimised code specifically for your data...

    --
    a ^= b; b ^= a; a ^= b;
  169. Try the Apache Portable Runtime Project by Anonymous Coward · · Score: 1, Interesting
  170. Hang in there by Anonymous Coward · · Score: 1, Insightful

    I work work for an oil and gas exploration company. We are starting on a project to take all of the windows geophysical systems off of windows and go with a Linux solution. Even last year we were trying to move all of our applications off of unix to Windows. Now were are considering the opposite.

  171. LabVIEW by Dunwich · · Score: 1
    I'd strongly suggest looking into LabVIEW (www.ni.com/labview). Productivity is listed as 10 times better than C and it runs on Windows & Linux (& Solaris?) - same source code with a recompile.

    I've been doing this graphical dataflow programming for a few years and there really isn't anything like it.

    1. Re:LabVIEW by korgull · · Score: 1

      I can advice this too.
      I've been using labview a long time already and it's very effective.
      I've also been using this for a long time (8 years now) and very happy with this choice.
      Runs on Linux,Windows,MacOS, HP-UX, Solaris 2 as far as I can tell.

  172. C++ Virtual Machine by Anonymous Coward · · Score: 0

    You can resurrect a dead open source project named the Internet Virtual Machine.

  173. Thanks. by mindstrm · · Score: 1

    That's what I was after.

  174. Re:Gcc? Speed. by mindstrm · · Score: 1

    As someone else pointed out, the problem being demonstrated was that in the original (with semicolons included, and both statmenets the same, ie: i initialized within the statement), vc++ would complain about i being reinitialized on the second one... when it shound't, as i is already out of scope.

  175. JRE wtf is that? by T-Ranger · · Score: 1

    I consiter myself resonably well tuned into the computer/IT/geek sceen, but I have to admin to for a long time conciously filteing out any news of Java - probabaly since 1.1. About 8 months ago I tried and after a week was margionaly sucuessfull (not all either Suns or my fault..) installing a "enterprise" class Java application. A major part of the problem was getting the right (out of date) JRE. So could someone please explain to me the magic word that I apparently need to know to get what I would have though would be a "Get Java Here" button click away to download the right JRE? Neither "jre" or "jre" exist on the front of java.sun.com

    1. Re:JRE wtf is that? by leo_fischer · · Score: 1

      To get just a JVM (the java runtime environment or jre) you can click on the gif that says "get java technology for your desktop", the link on the left called "Downloads", the "Standard edition J2SE" gif, links to j2SE followed by the "J2SE Downloads" tab.. The description of the download links reads "The links below will take you to the download sites for the versions of the J2SE platform that are currently available. At each of the sites, you can download the Java 2 SDK, Java 2 Runtime Environment , documentation, and other products related to the J2SE platform. "
      On all the download pages, for all versions, you have the option of downloading JRE or an SDK.
      Doesnt seem so hard to me..

  176. Java awt/swing versus QT by linuxislandsucks · · Score: 1

    Java's gui code is free from heavy licensing fees..

    Qt on the other hand..

    --
    Don't Tread on OpenSource
  177. Uh.... not quite by devphil · · Score: 2


    You're confusing C and C++ libraries.

    glibc is the GNU C library, and the system library for most Linux platforms. The C++ library is libstdc++-v3, which is completely separate.

    The MS 6.0 compiler used the most recent version of Dinkumware's C++ library at the time. I don't know what they used for 7.0, but Dinkumware has continued to update and improve their libraries. They even had bugfixes for their headers that MS hasn't included with 6.0, so you could patch them yourself.

    --
    You cannot apply a technological solution to a sociological problem. (Edwards' Law)
    1. Re:Uh.... not quite by The+Snowman · · Score: 1

      You're confusing C and C++ libraries.

      I'm not confusing them, I'm just being lazy and sloppy. When I say "glibc" I also mean "libstdc++". I probably shouldn't do that, sorry for the confusion.

      Part of my problem with Visual C++'s C++ library is that it is horribly out of date. Microsoft chose to use the most recent version when it was released, which was good. But then for each service pack, they failed to replace the libraries. Dinkum had a compliant library as of Visual C++ 6.0 sp3. Microsoft probably didn't want to include it because it would help programmers write cross-platform programs, threatening their monopoly.

      Thanks to MinGW, I can cross-compile in Windows and Linux just fine. About the only thing I think Visual C++ (the IDE, not the compiler) is good for is creating graphical resources such as icons and menus.

      --
      24 beers in a case, 24 hours in a day. Coincidence? I think not!
    2. Re:Uh.... not quite by Andrej+Marjan · · Score: 1

      Dinkumware was actually in an ownership lawsuit with a former distributor which prevented MS from bundling a newer version with VC 6. There were claims that VC 7 would include an updated library, but I never cared to investigate.

      --
      Change is inevitable.
      Progress is not.
  178. Re:Might I *STILL* suggest... by jericho4.0 · · Score: 2
    You're right about all that, but , IMHO, perl is the wrong choice for any large project.

    I love perl, for one page, quick-n-dirtys. But it's 'more than one way to do it' aproach leads to confusion and strife in larger projects.

    May I suggest a look at Python?

    --
    "A language that doesn't affect the way you think about programming, is not worth knowing" - Alan Perlis
  179. Mac OS X is the best for programming by afantee · · Score: 2, Interesting

    I have been programming C++ professionally for over 10 years on many Unix and Windows platforms (Sun Forte, MS Visual Studio, etc), and I can tell you that nothing comes close to ProjectBuilder, InterfaceBuilder, and dozens of other tools on OS X. The good news (for those who always think everything Apple must be expensive) is that they are absolutely free, so save that $2500 for Visual Studio.NET and buy yourself a decent G4 TiBook with a real OS and all those free tools.

    With GCC 3.1, you can programming in mixed C / C++ and Objective C / C++ in the same file or project. ProjectBuilder provides the best IDE and CLI for building multiple projects with dependency and multi-targets and multi-phases, apart from editing source files, icons, graphics, sound, document, etc.

    InterfaceBuilder is the only tool on earth that actually allows you to design and test professional UI with virtually no user code.

    1. Re:Mac OS X is the best for programming by afantee · · Score: 1

      And of course it also comes with latest Perl, Python, Ruby, Tcl, tcsh, bash, ...

    2. Re:Mac OS X is the best for programming by Trillan · · Score: 2, Interesting

      I admit I have a Mac bias, but even so I found this part ridiculous "InterfaceBuilder is the only tool on earth that actually allows you to design and test professional UI with virtually no user code." Off the top of my head... Visual Basic, Delphi, Prograph, RealBasic, C++ Builder...

    3. Re:Mac OS X is the best for programming by afantee · · Score: 1

      Firstly, I wouldn't use Visual Basic to build multi-platform enterprise software; and secondly, we are talking about live UI that actually works with the C++ code, not just UI prototyping. I guess you don't really know what I mean unless you try IB.

    4. Re:Mac OS X is the best for programming by Trillan · · Score: 1

      I've used IB. I've also used every other tool I mentioned. They all provide equivalent functionality, although I'll grant that VB has the reputation of being the weakest. Please don't try to FUD me.

  180. Kylix 3 by Trillan · · Score: 1

    Kylix 3 supports C++ code as well as Pascal. I haven't tried it yet but it should work.

    http://borland.com/kylix/index.html

    Of course, you'll have to port any C++ Builder VCL code to CLX.

  181. Tyr perl/ ACE by Anonymous Coward · · Score: 0

    We accomplished this by employing perl/gnumake for the build environment and relying on the ACE library for portablity: http://www.cs.wustl.edu/~schmidt/ACE.html

    Our product ran on Solaris (32 & 64 bit), Win200, WinNT, Win95, Win98, Linux and AIX.

  182. Re:Use OpenOffice.org SDK to build on MultiPlatfor by Anonymous Coward · · Score: 0
    Pity the GUI toolkit sucks. Move to WxWindows... chop! chop!

    ps. I like OO. But I hate the toolkit. It's just weird!

  183. Stay with Standard C++ but... by CodeArt · · Score: 1

    "What tools and strategies can we use to increase our productivity and regain our competitive advantage, without going for Windows only?" Support for threads and network programming are not yet part of Standard C++ Library but does not mean that these libraries cannot be used right now. I recommend first to check www.boost.org. Also, to maintain maximum reusability of C++ code across different platform I suggest checking following General-purpose third-party libraries: - Rogue Wave Threads - Objectspace Thread Classes - Ace Thread Classes - John Harrington Thread Classes - Allan Kelly's Class Templates - Bio-Rad's Thread Classes

  184. Re:Java awt/swing versus QT by gregfortune · · Score: 2

    And Qt is soooo much easier to use :) The heavy licensing fee is something I'm willing to pay when do commercial development with a toolkit that makes my task substantially easier.

  185. GINet & ArcIMS ? by Bazouel · · Score: 1

    If you are doing geographical stuff, maybe ArcIMS (GIS software in Java),
    ArcPad (for handheld PC) and all that is related to GI Networks would save you a LOT of work ...

    Esri new product line is very young (ArcGIS 8.0, ArcIMS 4.0, etc.), has still many bugs and sometimes, the object model make you hit your head on the wall, but despite all this, I think it is the best and most complete GIS software suite available right now).

    ESRI
    ArcGIS
    ArcPad
    ArcIMS
    ArcObjects online

    --
    Intelligence shared is intelligence squared.
  186. Automake and Autoconf by techentin · · Score: 1

    Try the solution that has been successful for most of the GNU projects. Take a careful look at GNU's automake and autoconf packages. You'll find them at the Program Build Automation section of the GNU software directory. In addition to the reference manuals from GNU, you'll want to read through the book Autoconf, Automake, and Libtool
    which is the only book I've found on the subject.

    I've just started using these tools in the last couple of months, replacing a complex and brittle hand-coded multi-platform makefile system. To be perfectly honest, there isn't enough tutorial information for setting up a new project. But once you figure out the magic incantations that your software needs, autoconf seems to do a nice job of detecting incompatibilities and passing them through the make system to your code. Automake generates the thousand-line makefiles replete with targets for all, clean, install, etc. All I have to do is list the source code files for a given module or library. These tools will do the rest.

    That isn't to say that my code became instantly portable. After we got a small application working on HP-UX, we just configure/make'd on Windows. Everything compiled under mingw, but the Windows crtl has different ideas about little posixy things like user names. So we had to add some portability code based on the checks that configure performs for us.

    Overall, I'm looking forward to not messing around with makefile systems much any more, and concentrating on the more interesting bits of software development.

  187. Cross Platform RAD tool by chippcom · · Score: 1

    Check out Runtime Revolution, a cross-platform JIT compiled smalltalk-like programming environment based on 10-year old engine technology from MetaCard. It compiles to very small standalones and works on just about every platform(from website):

    68K and PPC Macintosh systems running MacOS 7.1 through 9.X, with a separate Carbon engine for use with Mac OS X. The Win32 engine runs on Windows 95, 98 and NT and Windows 3.1 systems with the Win32s library Nine popular UNIX/X11 platforms are also supported: Solaris SPARC, Solaris x86, DEC Alpha, SGI IRIS, HP-9000/700, IBM RS/6000, SCO ODT, BSD UNIX, Linux Intel, and LinuxPPC.

    One of the best things about it is the robust IDE which looks and acts the same on *all* platforms. You can build and debug on any platform you wish!

    I used it to build ButtonGadget in only a couple of weeks. Would've taken me months using C++ or VB --and would be most difficult to make cross platform.

    It also has a great and supportful user community. Check it out.

  188. Maybe I just don't understand something.. by Anonymous Coward · · Score: 0

    .. but isn't that what's autotools are for?
    Produce Makefiles with automake, and configure them with autoconf.IMO that would work great on a huge pile of different platforms with different compilers...

  189. Python by tebeka · · Score: 1

    Hello, I suggest Python (http://www.python.org). It's cross platform, has good UI support (I recommend wxPython, http://www.wxpython.org/) and is easily extendable with c/c++ modules. (See http://www.boost.org/libs/python/doc/index.html for example). Pluse it has a very good mathematical library (http://numpy.sourceforge.net/) which is cross platform as well. Write most of the logic in Python and only the time critical section in c/c++ (ANSI C will be best cross platform solution for this). HTH. Miki

    --
    -- Miki Tebeka The only difference between children and adults is the price of the toys.
  190. Re:Gcc? Speed. by Florian+Weimer · · Score: 2

    gcc is built for portability, not speed. VC++'s code is faster

    This is no longer true, vanilla Microsoft Visual C++ is not faster than GCC anymore. There are compilers which can do much better than GCC on certain platforms, but Visual C++ isn't one of the, usually.

    In addition, unless you've got some real-time applications which scratches at the limits of the currently available hardware, machine code quality doesn't matter a lot. If you use a compiler, you've already made a compromise in terms of effort vs. speed, and maybe you can shift the balance even further and concentrate on features which directly benefit your customers instead of dealing with cross-vendor compatibility issues.

  191. I recommend looking at ICU4C by Anonymous Coward · · Score: 1, Interesting

    I recommend looking at the ICU4C (International Components for Unicode for C) libraries, which are available at http://oss.software.ibm.com/icu/. ICU is a set of thread-safe cross-platform open source Unicode libraries. The project has some examples of how it builds and tests on multiple platforms.

    It's being used by many other projects and companies. For example, it works very well with the Xerces C++ project. The ICU readme.html has the list of platforms that can build ICU.

  192. Java is not an option by jsse · · Score: 1

    Java is not currently an option for the high-performance numerical and immersive graphical aspect of our applications.

    I think hundreds others has already answered to that particular claim. I'm not a defender of Java, but I'd recommened you to try writing some persistent Java object and rate its performance, rather than judging its performance by some run-and-exit programs.

    You'll see the difference.

  193. Java Runtime Environment by Anonymous Coward · · Score: 0

    I hope you're joking... Pick the version of your choice, then download the appropriate JRE.

  194. How about cygwin on Windows? by zby · · Score: 1

    Then you could use standard gcc on all platforms.

    1. Re:How about cygwin on Windows? by dolmen.fr · · Score: 1

      MinGW that ncw uses is another port of gcc for/to Win32 platforms, but more integrated and lighter because there is no unix-like features. It can be used either natively on Win32 platforms or as a cross-compiler from others.

  195. Use Lisp by Anonymous Coward · · Score: 0

    http://www.paulgraham.com/avg.html

  196. Project Management is the problem by megaralf · · Score: 1

    Hi,
    I have some experience with larger codebases and I don't think that the tools are the problem.
    I think most likely the problem is with the project management.
    The politic would be simmilar to the one used in my firm: "Change only to fix bugs. Change only your parts."
    This leads to a codebase that works. But it also leads to a maintenance nightmare as only code is added but older code cannot be reviewed.
    Keep in mind: in a code review you change working code to make it simpler, more understandable and easier to handle.
    The only solution to this is a BIG change where every developer has to touch every file. In this way he can change all the little things he always wanted to change but never was allowed to.
    In the end every change will lead to a multitude of new bugs, but I think re-implementing a big chunk of your system would be worse as it will lead to a big chunk of untested code.
    For references look at other re-implementations and then think about the time it took. Windows NT (4 years?) Netscape (3 years) Mac OS (how long?)... So again. You need the rights to change old code and then start doing it.

  197. Have a look at tmk by Anonymous Coward · · Score: 0

    From the website
    "tmk is a Swiss Army Knife for automating all kinds of tasks, e.g. in software development and systems administration. Like the traditional make utility, it is based on checking whether certain tasks have to be performed because files have been modified. This way, you can automatically recompile all programs that depend on a certain file, or distribute data onto machines that are not yet up to date. In addition, tmk has a lot of features that make has not. Most importantly, it provides higher levels of abstractions than make does. This is achieved through platform-independent commands and modules, and via the powerful configuration subsystem that allows to set up tmk for different platforms and sites."

  198. Try out Ace by sculpepper · · Score: 1

    Douglas Schmidt's Adaptive Communication Environment (ACE) is a fantastic pattern based os abstraction library. You can get a copy of it at cs.wustl.edu. It will provide you with abstractions for threads, IO, configuration, etc and it runs on every platform imaginable. It also support many compilers. You can use the built in make system as well to do cross platform compiling. Another good cross platform build system can be found in the mozilla source code. You can grab a copy of it at mozilla.org and see how they handled cross platform compiling. It uses nspr, another pretty good os abstraction library.

  199. Multiplatform Support Tools in C++ by MrWizard510 · · Score: 2, Interesting

    We use the 'understand C++' tool (www.SCITools.com) to provide a window into 1.5 million lines of C and C++ code. You configure this tool by telling it the subdirectory trees of your source code, and this tool builds a database of every file, object, line of source. It then provides both textual and graphical navigation tools for your code, including dependency trees.

    It has an integrated editor with syntax highlighting, and shows what code is #ifdef'ed out.

    I don't work for the company, but I've found the tool very useful. For your purposes, it should help locate where mods should be done, and what mods to do differently based on your different compilers and platforms. There are versions that run on Windows and Unix -- I use the Windows version, and 'point' it at my Windows and DEC VMS code.

  200. Changing of language answers by skinny23 · · Score: 1

    I interpret this guys question to be "How can we make our existing C/C++ code easier to deal with across platforms". It's easy to suggest a change of language to be the answer to all problems, but the fact that most of you are missing is that this guy's company has spent a lot of money to develop, test, and debug the code that they have now. Throwing it all out to change to another language is not the smart thing to do, and will set them back at least a year or more.

  201. Been there by Anonymous Coward · · Score: 0

    Hi

    If you are R Smallwood as identified in the link
    at the top of the post, I'd love to give you more info.

    I've been working on systems exactly like this for the last four years, and while ours isn't the only system that works, it does work. You can at least learn from some of it.

    First Credentials. We also write engineering applications for Windows, Linux and Unix, deliver to hundreds of clients who pay us millions of dollars. Our systems work exactly the same on all our platforms, give or take.

    Java: When we tested Java the problem was speed. On some platforms it was OK, but on others it was ten times slower. Maybe Java can be fast, but on our applications it wasn't. Splitting the code between Java and C++ would have made it two complex, and most of the non-GUI would have had to be C++.

    We do use Qt, and have had great success.

    We use GCC on all platforms except Windows, (where
    we use VC6) and it works fine. There are some issues if you want to use shared libraries. We test-compiled the code on the native HP compiler and the speed doubled, but we can live with that.

    We took a stretegic decision not to allow multithreading. We split to GUI and numerics into two processes which effectively gives us two threads. If you can do the same it might be helpful.

    The actual cases where we have code that worked on one platform but not another were tiny. We have macros to handle the few extra directives that VC6 needs. The exceptions to this were sockets, where we wrote classes to isolate the differences. You could probably do the same with threads.

    Thinking about Design Patterns is helpful, but saying 'use Facade' or whatever doesn't solve the main problems. Design Patterns solves problems at approximately the class level, not the application.

    Writing two separate codes is only going to work if you can afford to double your resources, remembering that you will have to double your maintenence effor too, and then either accept that the user interface wil be different for both versions or endlessly arbitrate between the 'Unix' and 'Windows' way of doing things.

  202. cross platform mostrosities by Samarian+Hillbilly · · Score: 1

    I have a similar problem. I'm the lead architect for an industrial computer-vision system for a company large enough that we haven't been able to choose a single environment. As a result our system has to compile and run with Windows XP, Linux and Solaris. The first thing is to create a build system that can simplify the build process. This we did using GNU make on Cygwin. For those that like the Visual development tools, we have a make option that generates dsp and dsw files for Visual. We also have a cross platform i/o threading library that gives a common interface fro the application, that hurts a bit, Windows is clearly the LCD, although it does have some performance perks in certain cases. But what really hurts is the lack of ansi c++ capability in visual. My solution? I'm waiting for the ansi compatible version of the intel compiler to come out in the 1st quarter of 2003 and then we'll use it on both Linux and Windows. We'll jettison the use of the Solaris native compiler and use GNU g++ instead. That should solve the worst of our problems. There is also a large, growing and amazingly successful (at least in terms of convincing the suits) movement to just go with Linux here. That's all I can suggest for now.

  203. A bit of a benchmark by w4z4bee · · Score: 1

    I just discovered MinGW thanks to some earlier posts on this thread and decided to install it on my work machine to compare VC++ compiler and g++.

    My most intensive calculation is a home made implementation of AES (raijndal?) so here goes:

    (g++ is compiling with -O3 and VC++ is set to "Maximise Speed")
    VC++
    encrypt 2.50 MB/s decrypt 2.12 MB/s
    g++3.2
    encrypt 2.17 MB/s decrypt 1.77 MB/s

    close but not there yet. keep in mind gcc3.2 from my tests on the same algorithm on GNU/Linux is ~10% slower than 3.0, but i don't know how to install 3.0 on MinGW yet.
    IMHO gcc3.0 kicks ass in portability and is pretty damn good in speed, just as long as they fix the regression from 3.0 to 3.2

    .sigs are for woosies

  204. More of a bit of a benchmark by w4z4bee · · Score: 1

    and i almost forgot:

    executable size:
    VC++: 1138688 Bytes
    g++3.2: 994705 Bytes

    compile time:
    VC++: 21s
    g++3.2: 76s

    So there you go, gcc is SLOW but is pretty damn good and FREE whereas VC++ is faster but EXPENSIVE for a poor broke lad like me.
    Also i checked out VC++7 but due to its reliance on .net framework, the fact that it eats more ram than mozilla and its SLOWWWWW performance on my machine, I had to throw it out.
    As a last note, i did try out icc from intel and was not too impressed with it, it basically had the same performances as gcc-3.0, costs much more and was the worst pain to install on debian (it's distributed in .rpm format).

    .sigs are for woosies

  205. Platform by DopeRider · · Score: 1

    Mozilla is a platform. It's possible to write all the GUI stuff with XUL and encapsulate C++ code in components that would be called from the GUI.

  206. Java by /^Neil/ · · Score: 0

    Get by with what you have for one more year then switch to Java, opimize your code, and throw more hardware at it.

    Neil

  207. Try CodeWarrior by msoori · · Score: 1

    If you are developing cross-platform, give CodeWarrior a try http://www.metrowerks.com Its available for Windos, Mac, Unix, and embedded systems. If you get used to it, very hard to give it up. Comes with a built in class hierarch browser, a class browser to view class/method/field level code, numorous ways to navigate (for instance control-clicking a class or method anme brings up a menu listing all methods that match the method name or to view the class herarchy, etc), custom color coding, etc... their website dosent give justice to it. I've been using it for about 10 years and wouldnt give it up for anything. Even bought my own personal copy when I was forced to use other IDEs (not without trying), so I can work without having to think about the mundane issues like file management, or what file I saved a class, etc. They also have a very impressive C++ framework (PowerPlant) which I used many years back, and its now availbale for doing cross platform development, but that needs a site licence. CW can compile C/C++/Java and objective C. For cross-platform code, have you given Java a try? Java Swing is pretty good and easy to make GUI applications. http://www.metrowerks.com/MW/Develop/Desktop/defau lt.htm Mahesh.

  208. Java by hackus · · Score: 2

    Sounds like Java too me, with browsers as a front end. You can do some really wonderful stuff, and it won't take a long time to build with Java IDE's that are around for free.

    Java also is fairly easy to add multiple machines (spread out your Virtual Machines) to get more processing power out of commodity PC's. There isw simply no way your competitors could scale thier code on an equivalent Windows .Net implementation, it would cost way too much.

    I gurantee you if you proceed along those lines your competitors investment in .Net tools alone will save you the cost over the long run they will have to endure to maintain thier systems.

    Java 1.4 compiler technology (Virtual Machines) is very very good. If you are using numerical processing and large array types the effort you pour into C++ is simple not worth it.

    I am skeptical of your claims that Java is too slow. I suspect you haven't really used it for much of anything lately, because the slow excuse is an old one.

    You can go into any Barnes and Nobles book store and literally get a small stack on numerical procedures in Java and how to build distributed processing systems with Java, right off the shelf.

    If you don't know how to do it, let me know (reply), my company does these seemingly impossible things with Java everyday.

    -Hack

    --
    Got Geometrodynamics? Awe, too hard to figure out? Too bad.