Archive for the ‘windows’ Category

Kitware Developer blog launched

Thursday, January 28th, 2010

CMake - cross-platform build systemA few minutes ago, Bill Hoffman from Kitware posted short message to the CMake project mailing list with an interesting announce:

Kitware launched its first developer blog today with contributions from Company technical and business leaders.

The CMake build system is one of the main category of topics on the Kitware blog, so I presume it may be of interest of OSGeo Community as the CMake build system is slowly winning over more and more folks here :-)

First CMake-related post is about Deploying on Windows with DLL Manifest Issue

Another interesting post on the blog is Will Schroeder’s answer to the question Why Open Source Will Rule Scientific Computing? It’s really worth reading.

Video lecture about CMake

Thursday, January 7th, 2010

Bill Hoffman from Kitware gives presentation about CMake and a pack of related tools to the happiest easygoing working nation on the Earth:

It’s worth to watch if interested in CMake.

Windows 7 in da House

Friday, October 23rd, 2009

windows7-inside-linuxThanks to the genuine deal Microsoft offered to students of developing countries – where else*** students really need cheap software than in UK and US – I purchased legal copy of Windows 7. Windows 7 Professional. Windows 7 Professional 64-bit!

Computer says no!

I like the new Windows 7 as much as a Unix-devoted user can like Windows way of use of OS. However, no joy without annoy and along with delivering modern operating system Microsoft definitely and absolutely has earned Darwin Award by providing users with easy and friendly purchase & setup process.

To make the long story short, basically you complete clean installation of Windows 7 without giving the Product Key (don’t even waste time on trying, Microsoft will reject it as invalid), next you carry out upgrading the newly installed Windows 7 to…Windows 7 and then you are able to successfully register and activate your legal copy of the system.

Ah, and don’t forget to feel the lovely pain in the arse while preparing bootable ISO. That fun is so worth those thirty quid I paid for the Windows 7, hehe.

Microsoft says yes!

On the Microsoft Answers:

Hello Everyone,

I wanted to let everyone know we are aware of this issue and we are actively working with Digital River for a resolution.

We will post back when we have a solution.
Michael
Microsoft Answers Support Engineer

Oh, gosh, I need to be quick with e-mailing Wendy with my proposal of Microsoft nomination.

After quite long and silly battle, I finally installed Windows 7 Professional 64-bit on my computer. Actually, on Virtual Machine running under control of VirtualBox (Sun, I love you!) inside Linux.

Dear Microsoft, I’m impressed. I like Windows 7.

Update 2009-10-27T22:07:44: Also ZDNet UK posted that Windows 7 upgrade poses problem for students and linked to article with statement from Microsoft.

*** Poland is a rich country. Polish are rich people. Microsoft knows that and asks ~25-30% more for their software. Not like in developing countries, UK or US, where they try to make their software affordable to help people to in studying or running small businesses. So, if you live in Poland and you don’t want to overpay for Microsoft software, buy it in US. Ask your aunt (every Polish has auntie in US) to buy a box for you and ship it to Poland. It is legal. I called Microsoft Poland and confirmed it is legal to buy their software in US, bring it to Poland and use it in Poland. Sweet.

Strongly typed enum in Visual C++?

Wednesday, August 26th, 2009

Not yet. Victor Bazarov confirmed in reply to my post that there is no official announcement nor rumours that Microsoft is going to include native implementation of scoped and strongly typed enumerations defined in C++0x in upcoming Visual C++ 10.0. That’s a pity!

Thankfully, Boost provides portable emulation of scoped enums. It is compatible with compilers that already support this feature like GCC 4.4.0 (thought it’s still buggy). Nothing is perfect :-)

Portability poem

Friday, August 7th, 2009

Meaning of PortabilityNumber of OSGeo stack software written by C/C++ camp have to run on Microsoft Windows systems. I think I wouldn’t be dead wrong if said that most of hackers from OSGeo Community work on Unix systems (Linux, Mac OS X) but there is large number of users who work on Windows.

Conclusion? Portability. Google is bursting at the seams of the essays about how to write portable code in C or C++ language. I’d add a little poem to the collection.

Principles of Portability

  • Obey the standards, because they are not just dumb rules.
  • Make a list of compilers that must be supported. Learn about their differences.
  • If possible, use GCC 4+ and Visual C++ 7.1+.
  • Using old compilers? If possible, use C89 but avoid C99.
  • Prefer GCC 4.3 and Visual C++ 8.0+, so you get C++0x support. C++0x “brings C++ more in line with the C99″ – Wikipedia, so portability is much easier.
  • Write code in C or in C++, but do not write both at the same time.
  • Avoid (direct) use of C POSIX Library.
  • Never ever disable any warnings compiler throw. Fix them.
  • Be pedantic. Compile in highest strict mode possible.
  • If possible, do not use compiler-specific features.
  • Do not make platform/architecture specific assumptions about memory addressing, memory layout, etc.
  • First understand why, then cast the hack.
  • Personal preferences are evil. Make decisions based on reasoning.
  • (Re)Use good code that already exist. Boost C++ Libraries won’t bite you!
  • KIMS (Keep it modular, stupid) and let modules to loose coupling but keep cohesion in architecture, design as well as in development cycle (releases, inter-modular dependencies).

Hi COM! How’s it going?

Saturday, May 9th, 2009

In June 2000 at PDC in Orlando Microsoft announced .NET Framework project. Shortly after that developers concentrated around products and technologies made by Microsoft started debate on what’s the future of software development. One of questions and quite obvious was: So does this mean that COM is dead?. A few months later, Don Box addressed that concern in his extensive article Is COM Dead?:

It depends on what your definition of COM is. COM is many things to many people. To me, COM is a programming model based on integrating components based on type. Period. This was COM’s primary contribution to the field of component software, and that contribution has changed the way millions of programmers build systems today.

Don is right and the answer is historically and technically correct, however this is an indirect answer that didn’t cheer up at all. Given the closing words in that article:

(…) CLR provides significant benefits to developers who are using COM today. Virtually all aspects of the COM programming model have survived (…) I look at the CLR as breathing new life into the programming model that I’ve spent the last seven years of my life working with, and I know there are other programmers out there who share this sentiment.

overall conclusion becomes more an abstruse philosophy than binary answer. What about all these cryptic terms of Component Object Model technology made by Microsoft, like OLE, ActiveX, DCOM and other? Silent.

Nearly ten years later, developers are still asking the same question (a few days ago, similar discussion took place on ACCU mailing list) about COM. Alf. P. Steinbach gave an interesting answer that, however, sounds very similar to the one given by Don Box:

COM is one of the few successful C++ component technologies, if not the only one (depending on one’s definition of “successful (…) Some reduced and slightly modified versions of COM are used in e.g. Linux user interface and in Firefox browser (XCOM). Original COM itself is however a Windows-specific technology. But while it’s necessarily used to interface to the operating system and at higher levels in e.g. scripting, it’s my impression that it’s now now not much used as a general C++ component technology, i.e., that use of COM is something forced, not something desired and freely chosen.

Even though both are similar, it’s been decade since the question was asked for the first time and now we have 10 years of experience based on observations what has changed after .NET was thrown on the marked. The managed baby seems to be winning the market of Microsoft-oriented (not only, though) developers and users. COM is widely used as components of Windows systems and other already existing software but are new COM servers and objects still being developed? Or, has it started to suffer of COM programmer species extinction?

The www.microsoft.com/COM/ website confirms that:

Microsoft recommends that developers use the .NET Framework rather than COM for new development.

In my humble opinion, Mr. COM is like an old veteran, alive, but most of his comrades-in-arms have died, so he usually goes to pub alone.

Detecting Visual C++ version in NMAKE makefile

Sunday, March 29th, 2009

Traditionally when building GDAL/OGR, GEOS or libLAS using NMAKE users specify version of Visual C++ compiler being used as value of MSVC_VER macro. This macros is not required but it’s recommended, so NMAKE can compose best possible set of compilation and linking flags for particular version of Visual C++. For instance, command specifying Visual C++ 8.0 (Visual Studio 2005) looks like this:

nmake -f makefile.vc MSVC_VER=1400

Recently, I hacked libLAS makefiles (and GEOS makefiles too), so Visual C++ version can be determined (semi-)automatically. NMAKE 1.62 or higher reports its version as value of _NMAKE_VER macro. The solution is to defined compiler version based on version of NMAKE tool:

Update 2009-04-03: Added _NMAKE_VER number 9.00.21022.08

!IF "$(_NMAKE_VER)" == ""
MSVC_VER = 4.0
!ERROR *** Prehistoric version of Visual C++
!ELSEIF "$(_NMAKE_VER)" == "162"
MSVC_VER = 5.0
!ERROR *** Prehistoric version of Visual C++
!ELSEIF "$(_NMAKE_VER)" == "6.00.8168.0"
MSVC_VER = 6.0
MSC_VER = 1200
!ERROR *** Prehistoric version of Visual C++
!ELSEIF "$(_NMAKE_VER)" == "7.00.9466"
MSVC_VER = 7.0
MSC_VER = 1300
!ELSEIF "$(_NMAKE_VER)" == "7.10.3077"
MSVC_VER = 7.1
MSC_VER = 1310
!ELSEIF "$(_NMAKE_VER)" == "8.00.50727.42"
MSVC_VER = 8.0
MSC_VER = 1400
!ELSEIF "$(_NMAKE_VER)" == "8.00.50727.762"
MSVC_VER = 8.0
MSC_VER = 1400
!ELSEIF "$(_NMAKE_VER)" == "9.00.21022.08"
MSVC_VER = 9.0
MSC_VER = 1500
!ELSEIF "$(_NMAKE_VER)" == "9.00.30729.01"
MSVC_VER = 9.0
MSC_VER = 1500
!ELSE
MSVC_VER = 0.0
MSC_VER = 0
!ENDIF

Later macros MSVC_VER and MSC_VER can be used to report Visual C++ version:

!IF "$(MSVC_VER)" == "0.0" && "$(MSC_VER)" == "0"
!MESSAGE *** Cannot determined Visual C++ version
!ERROR *** Aborting make job
!ELSE
!MESSAGE *** Using Microsoft NMAKE version $(_NMAKE_VER)
!MESSAGE *** Using Microsoft Visual C++ version $(MSVC_VER)
!MESSAGE *** Using Microsoft C/C++ version $(MSC_VER)
!ENDIF

This is not a rocket science, but it seems to work well and it frees users from manual specification of Visual C++ version. I’m not sure how the NMAKE version numbers vary across Visual Studio versions and builds. It would be good collect these version numbers to make the solution reliable. So, I’d be thankful if readers using Visual Studio 2002, 2003, 2005 and 2008 or newer :-) could report their NMAKE versions directly to me or post them as comments below.