Compiling Under Wine
now3djp writes "Interesting article over on CodingStyle that demonstrates how I successfully eliminated wasted time maintaining an MS-Windows computer when I could build natively from my GNU computer! /. has followed other cross compilers in the past. This article is different because I used MS's own compiler! This allowed me to get on with real games porting; with only a proportional increase in compile time. Wine has really come a long way in supporting simple apps, let us hope it reaches a 1.0 soon."
You know (shaking the finger of logic and wisdom), if they (MS) sold such a product for the GNU environment for a couple hundred bucks...I would buy it. And I know a few other developers who would to. Providing, of course, it didn't totally suck!
"Other bands play, but Manowar KILLS"
Wine has really come a long way to facilitate running major applications such as Visual C++. Features that "just work" often do not get mentioned because there is nothing to say. Wine has many excellent features like this. However, I have expressed the problems with Wine currently and I expect that in a potential follow up article many of these will be resolved. Wine has been in development for over a decade now. As it is finally nearing a 1.0 release, I see how much better it was than the 1.0 release of MS Windows.
Using Visual C++ on GNU/Wine gives me all the benefits of being able to develop a 100% compatible MS-Windows version of the game, while saving me the time of maintaining another Win2k machine version of the source and moving to that machine to compile. It has been a great time saver for me and I strongly expect this information will be very useful to myself and others in the future.
Okay, so you can use Visual C++ compiler under WINE. Is that terribly surprising when WINE can run MS-Office for the most part? The compiler takes the source files and libraries and produces an executable or library. I don't know for sure, but I wouldn't think that too much of this would involve heavy usage of the Win32API, much less the lesser-used and less-tested-under-WINE parts. For the most part, the compiler would be doing tokenising, parsing, translation and optimisation, which would in all likelihood use no external libraries or anything.
I don't mean to rubbish this article, I'm just saying that I don't see it as being terribly surprising. On the other hand, I think this is a great use of WINE and is definitely more innovative that anythin I would use WINE for. And as he says in the article, there was a lot of fiddling around with command line arguments and environment variables. But if you're compiling from the command-line under Windows, it's just as bad (no, really).
A much greater "victory" for WINE would be to have the whole VisualStudio ensemble running. But I'm not sure if this is feasible, especially in the short-term. By "victory" I don't mean something along the lines of "Linux now allows you to run a quality IDE", because KDevelop and Eclipse are great IDEs. Instead, VisualStudio and Office are probably the most complicated pieces of software written by MS (excluding Windows itself) and for WINE to be able to run them both as if they were running under Windows would be truly a fantastic achievement.
This sig intentionally left bla... dammit!
Who's got the whiteout?
You know what? It's got a new meaning now, and it doesn't matter what the older correct version is. The meaning has changed, and this is the common usage. That's the evolution of language.
Not exactly the same, but it would be much better to have native apps, as opposed to having to emulate/VM that other OS.
I'm a programmer for a Supplier of Software to the US Government and we are actively looking to port our products to Linux do to the strong interest from our clients. Specific Offices decide what products they want to implement and how to do it. We are investigating Emulating Windows as an one solution.
I look forward to the days when any program that is Windows Compliant runs on any platform that supports the Windows API.
That being said, the real problem I have is DRIVERS for my hardware working under Linux. If someone could emulate Windows enough to use standard Windows Drivers, there would be no more reason to use Windows at all. I truly commend those braves souls and companies who write drivers for Linux.
Now if there was a Proxy that accepted Microsoft SQL requests and sent them to a PostgreSQL backend transparently we would be free of the beast and save the Tax Payers lots of money paying my paycheck, plus blow our competiters out of the water. :o)
The author describes the problem he originally solves as being the pain of moving code between Linux and Windows, losing attributes, case problems, etc. The approach I take is to keep all code in CVS on my file server. I do compiling and editing on my personal computer; both Linux and Windows can handle CVS. This way you have to reboot into Windows for the Windows compile, but never have to worry about copying files or case changes.
I'm curious, what exactly will the "milestone" of version 1.0 of Wine actually mean ? I would doubt that it'll ever be 100% compatible with Windows 98/XP. So what feature list is the development team trying to complete before calling it 1.0 ?
I think that pretty much any other product would have been deemed a failure if it had endured a 10 year development life and not reached version 1.0. Unless of course we're talking about Duke Nukem Forever...
My experience of Wine is common to most people's I think; it looks like a great idea, but as soon as you try to run any non-trivial program, it simply locks up/doesn't work. I've looked at their website and looked at all the "passed" indicators on their test cases. That doesn't help me run my apps much though... do they need more test cases ? Are they simply too abstract ??
Just my $0.02 worth
Never, ever lose a file again. Ever.
Otherwise their products wont run on old machines. There are still many win98 boxes out there.
And MS still offers IE6 for win98.
And the fact that their software runs fine in wine could aswell attract them to not use the newest apis in near future.
Yes but you actually need a windows copy. This might scare vendors from shipping desktop boxes with linux preinstalled.
"Oh sure, you can run Windows apps, just buy it for $300" -> WineX? They already have one and it works. (WineX has got a better one tho) Oh well, right now I'm down and uploading some stuff with eMule without any native dlls
And this "slowly" is a myth.
Right now it might be a lil bit slower due to not optimized implementations but after all - Wine Is not aN Emulator.
I think you are refering to IBM's Developer Connection, which was a bit like MSDN. This was fee-based but may have been free if you met certain criteria. It seems like they also had a developer partner program, though I can't remember for sure.
However, there were certainly compilers and development kits just anyone could buy and use (no application to fill out, just buy the box).
Exmamples: IBM's own excellent C-Set/2 (C/C++ compiler) (later Visual Age C++); Watcom's excellent C/C++ compiler; Borland's C++ for OS/2; Two (yes two!) distributions of gcc (gcc2 and emx). There were also two "Turboish" Pascal compilers and three "Visual" Rexx packages (somewhat Visual Basic like but using the Rexx language).
Still, I do agree that IBM could have been more friendly to developers, and IBM certainly did enough things wrong with the marketing.
I'm not a lawyer, but I play one on Slashdot.
Next you will have some moron compiling under vmware or bochs or plex86. If you don't care about the abstraction or the 60% degradation in performance, and the fact that you have to rewrite all your make files to use vc++ nmake, this is for you. Its a convoluted mess IMHO. Using cross gcc for win32 on linux is a much cleaner way of doing this.
Oh please. Yeah, let's all cower in fear of Microsoft. Let's stop what we're doing because Microsoft might not like it. Let's always worry about being sued.
It might be a very real possibility, but it's one you should never worry about, just be aware of. It's as bad as terrorism, it only works if the target becomes terrified.
The Texas Instruments Code Composer Studio for the TMS 6701 DSP is only available for windows. For this project everything else is compiled for Linux-386 as well as embedded Linux-PPC.
Running the command line tools under wine works fine, and now I am able to have one intel linux box compile all the DSP and PPC firmware as well as the Linux GUI code in a cron job from the daily cvs snapshots.
Doing this has made things SO much nicer. I would prefer if TI had a linux version of their DSP compiler, and will continue to pester them for one, but in the meantime WINE saves the day and allows me to NOT run windows for weeks on end!
My Win2000 anti-uptime is around 3 weeks now. I am weaning myself off windows!
Running command line tools like compilers is one of the EASIEST things for WINE to do - All they have to do is read and write files and allocate memory.
Biggest hassle for me: having to make special sed scripts to deal with mixed case file names in the auto-generated makefile dependency list that are incorrect since the compiler assumes case insensitive filesystems.
--jeff++
ipv6 is my vpn
they handed him, on the spot, a development kit
You mean his development kit didn't come with the operating system itself?
I think your argument is flawed...
IBM restricts development kits of OS/2, OS/2 dies. MS readily gives anybody a copy of the development kit for Win95, and Win95 takes off. But the development kits for linux come with linux, nevermind "being given the development kit upon request".
So why hasn't Linux taken off yet?
Oddly enough, BSD still lives despite the Linux binary compatibility.
If I have been able to see further than others, it is because I bought a pair of binoculars.
Not neccessarily the most fair test. First the test were ran on an athlon system. Intel compilers optimized mostly based on the Intel architecture.
:) ). In fact on the P4's with multi-threaded floating point operations we saw well over 300%, none of the tests were worse than 100% faster. On the athlon Gcc was slightly better except in one case were it was signifigantly faster. Eventually we found that gcc 2.x or 3.x does not have good p4 optimization yet (we asked on the devel lists trying to get better numbers as we didn't want to pay for the intel compilers). Of course this was about 6-10 months ago so they could have gotten optimizations in by now.
For example, we ran several benchmarks at work on three computers with gcc 3.1 and the intel compilers. Basically gcc and intel were fairly equal on the pIII xeons (intel had the edge). Gcc was somewhat faster on the athlon 700, and the intel compilers blew gcc away on our p4 2.4 ghz.
So what conclusions can you make? neither intel or gcc are better than the other. As we expected it depends on several factors - one of the main is hardware (wow, who woulda thunk hardware affects optimization
If I had to choose one or the other as "generally producing faster code" I would ask "what hardware are we talking about". And that GREATLY influences the answer.
------- Sorry about the spelling, I suffer from two problems. Dyslexia makes it difficult to spell well, lazy makes it
Back in '84, I was the first person at the University of Georgia to get a Mac (I was one of the two campus-wide "microcomputer resources" at the time). For the two weeks that I had it (before a big-wig commandeered it) I BEGGED Apple for a development kit, compiler or *anything*.
"3000 smackers please" was the only comment I got out of Cuppertino.
So I kept playing on the PC with my $49 copy of Turbo Pascal, and my ~$200 copy of Lattice C. When MS dropped their Windows SDK from $900 to $300 in '88, I bit and basically never looked back.
I paid for lots of operating systems too. I have 2 versions of OS/2, 2 versions of DOS, windows 95 and 98, 3 copies of NT 4.0 and a copy of 3.51 and a copy of w2k that I got stuck with because it didn't work and I had to refund the client's money. Microsoft would not refund what I paid them. Microsoft would not allow me to either return or exchange the unopened copies of Windows NT 4.0 either. I was a Microsoft dealer at the time and bought a 3 pack - which was about a month before w2k was announced. So I got stuck... then stuck again with w2k.
I have only one computer that runs windows NT so only one of these operating systems is in use.
I have red hat linux 6.1 server edition, OpenBSD 3.0 and Mandrake 8.1. I paid for all these too even though they are free.
Now, my desktop runs Debian and it is just great and I did a net install. Guess what, I don't know how to upgrade that RH 6.1 machine. Sure I can reformat the hard drive - but it contains a LOT of my work and I don't want to lose it. With Debian, an upgrade is easy.
In addition to this I bought 2 copies of Brief and I can't use it even though it is my favorite editor. I did a trial d/l of CRiSP and it is a wonderful editor, fully Brief compatible. I contacted them about licencing. I run 8 machines in my home and am a member of the local Unix users group and do consulting work. The CRiSP people told me I would need a "Licence Manager"! I decided to learn Emacs. It has a CRiSP mode and is looking better every day.
I bought 3 versions of M$ FTN and copies of M$ C as well. The last version of M$ FTN was such a botch that I could not use it. I have the Borland OS/2 C/C++ compiler. It was so broken I didn't use it.... but I paid for it. I have Borland C++ professional builder 4. I want to do C/C++ cross platform development.
I phoned Borland. I think they told me that I can buy Delphi for Linux. I think they told me that the language is supported on both platforms but that the API is different. The person on the other end of the phone didn't seem too knowledgable. So I am going into wxWIndows or gtk because these people actually SAY they are cross platform. Thus, I do not have any C++ builder code and didn't get my money's worth.
I have 4 versions of Oracle - paid for by the taxpayer (because I am one of their developers). The DOS versions were so bad we couldn't use them on that platform. The OS/2 versions were better but still not good enouf. It is not possible to install 8i for red hat 6.1 (even though that is the version oracle says 8I is for) unless you CAN STAND ON YOUR HEAD and read the paper What you need to knwo before you even THINK of installing oracle 8i . Imagine having to backdate the glibC and install an old version of Java from blackstrap just so you can get the installer to work. Why couldn't Oracle have put their developers into a room with 2 cd sets. One set - an off the shelf shrink wrapped copy of Red Hat 6.1, and the other set - a copy of the 8i source tree. And then make sure they don't have INTERNET access so they can't cheat and create a version that you can't install. Leave them there until they solve the problem or rot to death trying!!! Damit. I have lost MONTHS of my life solving other people's problems.
Guess what, I am porting the client's apps over to PostgreSQL. See ya Oracle!!! Goodbye!
So, of all the software I bought most of it did the job for a precious short time or didn't do the job at all - with the exception of Brief - which was just excellent. And what happened to Brief? Borland bought the rights, put it on the shelf and AFAIK I can't buy it any more.
So frankly I really don't care if that copy of VB ++ was paid for. Even if it wasn't, I do not feel M$ was ripped off . I feel I was ripped off.
I have been ripped off Over and Over and Over because I bought these products in good faith and paid for them with my hard earned money. Now I can't use them. Some never did what they were advertised to do. Others were discontinued and I lost out.
Let me tell you about the 2nd last copy of M$ FTN that I purchased. I found a bug where the conpiler just eliminated an "IF" statement. No errors, no warnings, and no machine instructions either. I filed a bug report with M$ with sample code. Months went by. I re-filed the bug. Months went by. Finally I phoned them and sat on wait for like an hour - and paid for this too. The rep told me the bug was fixed in the new version. So I bought it.
When the new version arrived I tried out the sample code from the bug report. The problem was still there. Oh, and the last version I bought couldn't be used it was so bad. The client dropped PC development ideas and switched to SUN.
What the Open Source movment has done is a refreshing breath of fresh air and IMHO it is the ONLY way that the programmers of the future are going to stand any chance of avoiding the endentured servant trap that closed source software creates. Anyone questioning this should realise that in order to use closed source software they have to agree to the licence terms and these are arbitrary and non-negotiable. If you find the terms unacceptable then you can't be a programmer. That is unless you can find the tools and the infrastructure you need elsewhere.
Well, we programmers are being attacked another way now.... patent law. If this gets too well established we won't be allowed to be independant. We'll have to work for a big company that has managed to negotiate cross licensing. Either that or pay the piper each time we want to go to the can.
Water flows down hill and the infrasructure required to build some of the closed source tools, like Windows NT/2K/XP, or Oracle or JAVA or say a compiler suite like Visual C++ or Borland Professional Builder is so great that it looks like an ocean. Oceans are hard to move. Oceans are also hard to re-create. There is no way that any company could recreate from scratch an operating system like XP. The environment that XP grew out of no longer exists. IBM tried and failed.
Over the years all computer companies with the exception of perhaps IBM,HP,M$ have failed. Who here thinks Microsoft will survive into the year 2050? Gates won't be in charge then. Who here thinks that another company is going to loom up that can invest the BILLIONS in infrastructure required to create an alternative?
The future of software has to be opensource because that is the only way for us programmers to ensure that we will have the tools we need and the right to use them.
If I add up the THOUSANDS I have spent on software over the years it illustrates to me that I should have been looking for better solutions a long time ago.
no, the safest bet is to optimize around intel. A large portion of machines are intel. The numbers show that a programed optimised for an intel run pretty good in athlon, athlon optimized run crappy on intel. Gcc will only optimize for PIII's and below well. P4 optimizations also run pretty good (that is close to the optimized veriosn for them) on pIII's and below and athlons. Thus the safest "bet" would be to optimize around the P4 (as pIII vs p4 optimizations may make only 5-10% on a pIII/athlon but 100-300% on a p4 this is even more true).
Should the gcc people optimize well for the p4 (and they will) then I will say the bet goes back with them. Of course this is assuming that the only thing to worry about is speed of generated code (which in many cases is not the most important).
------- Sorry about the spelling, I suffer from two problems. Dyslexia makes it difficult to spell well, lazy makes it
The GCC developers are on it already.
Now, is it really surprising that a third party compiler is not as upto date as a compiler from the CPU manufacturer?
I'm not going to argue with you about whether it really means what you say or not, because those above have done that already, but I will say that he CAN NOT be using it incorrectly, for the following reason: your usage is idiomatic, while his is not. Translation -- your meaning is not the sum of the parts, while beg (ask for) a question, certainly holds to the literal meaning. Whatever the idiom means or has come to mean, it can not displace the literal meaning. A good example would be "give a hoot," (my girlfriend recommends it), as in "I don't give a hoot what you think." It can certainly mean to literally shout, if I care to make it that. Fantastically, unbelievably, and amazingly, while not idioms, can be used in the literal meanings of those words, despite the fact that common usage dictates otherwise.
Regarding the use of loose and lose referred to above, they are not a common American problem, and mispellings such as these almost certainly spring from a lack of daily reading.
Put identity in the browser.
Now this is impressive. Things like this are what WINE should be all about. Amazing.
I disagree, it's depressing not impressive:
In summary, while the article probably accurately describes the author's actions, there is nothing in his account that others should be emulating. More experienced developers should be consulted in the search for best practices.
I write this as someone who has done software development for almost 20 years; more than 20 if you count my high school years as a computer hobbiest.