I wanted to embark on making some visual physics software that will run on many cores and was wondering if c was good, and if so, what compilers will be best for it? Also, are there any tips that someone might be able to give me?
I'd rather use C++ since it doesn't require as much low level things to worry about and can do a lot of things for your automatically. C is better for things like device drivers.
C and C++ have no built-in graphics libraries, so you'll have to go to a third-party source for that. If you compile for more than one OS family, you'll have to have a separate library for each one, and write the graphics function calls based on which OS you're compiling for.
I want to run it solely on a Unix (or perhaps Linux) operating system. The project is mostly something for me to test my metal (and it's something I'm very interested in). My decision to do so came from advice that I received in order to avoid a "deadly embrace" when I'm allocating memory. Anyways, if anyone knows some good graphics libraries, and/or libraries to assist with parallel programming, I'd appreciate it.
If you want to run on the most different platforms, and speed isn't the most important factor, I would suggest looking into Java. You'll get to your version 1.0 a lot faster than in C, and it will run almost the same on all platforms.
Probably not a popular suggestion in a C forum, but it's pretty much true. Especially if you are asking this question, you're probably pretty early in your C learning curve. So on that too, I think Java is a better choice.
The thing is, time isn't much of an issue. I was thinking of making this into my senior design project (as an EE major), and I'm a sophomore in college. So right now, I just finished with my intro to C class (ending with my knowledge on structures) and I'm going to be starting my some CS courses that are required for electrical engineering. So I'd like to make a basic program in C and then slowly improve on it. Once I get all the techniques worked out, then I can start implementing it onto a integrated circuit. C is mostly my best choice since I haven't worked in Java, VB, or c++ in years now. That, and I can get my professors to help me since they're quite proficient in C. So I guess I should have changed the title to: "need libraries and tips" for parallel programming and graphics.
It is widely used free cross-platform C library that (besides lots of other things) also provides threading and graphics support (native 2D and opengl 3D)
For low-level parallelisation you would have to resort to assembly language - SIMD instructions (MMX,SSE...).
There are lots of C++ libraries which will do graphics on multiple platforms eg Fox, FLTK, WxWidgets. Haven't seen any in C. Websites for Fox and FLTK appear to have more questions than answers, so you may be on your own there.
For *nix, X Windows, Motif etc is in C but the books and experts to answer any questions are really difficult to get hold of. I don't know about KDE or Gnome. Qt is C++.
As for parallelism, you're depending on the vendor's API for that processor. Some are scalable, some are not. Again, there are very few experts in these areas. Most people just do it at the start of the project and that is it. If you ask them about it, they'll probably tell you they haven't seen the code since they last debugged it. It is normally the case of "if it works, don't touch it". Debugging parallelism can be quite difficult. You have to be able to tell all processors to stop or wait while you debug one of them.
Make sure you can debug before you venture into those areas.
All IDEs have their own ideosyncracies. There is no best. If you like it, it is best. If you don't like it, even though the rest of the world thinks it is best, you'll think it is crap.
I'm currently using windows xp (too lazy to get partitioning software and burning a disk to get linux). I heard that Linux is the best to run SDL on. Anyways I'm quite pleased with the SDL library (just need to learn how to use it effectively). Also thanks for the help. If an admin reads this, please close the thread.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.