Daily Archives: November 27, 2007

Qt for VS c++ 2005 EE

Qt 4.3.2 已经支持 Visual Studio C++ 2005 Express Edition了,但不提供Integration,要使用的话,大概使用makefile project再加一点定制,比如使用qmake .pro来生成makefile,通过一些配置,Qt就可以使用VS这个稳定和强大的平台了(比如Intellisense, Debug等都比其它如Eclipse出色,毕竟是商业的)

To install it, download Qt 4.3.2 open source from its ftp at ftp.trolltech.com, configure it using a -platform win32-msvc2005, then compile/link by running nmake.

One thing to be noted is we have to install Windows Core SDK, IE SDK (If no IE SDK, prompting by missing shlwapi.h), and optionally MDAC SDK if you are going to install ODBC, prior to configure Qt. VC++ 2005 Express Edition does not come with SDK. We should install SDK seperately. One way is to install this package by appropriate customing.  

After installation, configure vcvar32.bat under "C:Program FilesMicrosoft Visual Studio 8Common7Tools" by adding "C:Program FilesMicrosoft Platform SDK for Windows Server 2003 R2Bin", "C:Program FilesMicrosoft Platform SDK for Windows Server 2003 R2Include",  and  "C:Program FilesMicrosoft Platform SDK for Windows Server 2003 R2Lib" to #path, #include and #lib respectively. Otherwise the compilation will complain it cannot find necessary header files.

完成了一个雷达数据到水文模型时间序列的转换程序包

这边的一个韩国同事前面写了一个Python版本的,在Linux下可以运行。我在Windows下对它进行了改进,并做了一些优化。结果在正式计算的时候,发现Ohio流域的一个子流域(2560个HRAP网格)10年逐小时估计要花上233天以上,同时需要空间也达100G以上。所以尽管该Python可用,但基本上对于大流域属于不实用的。为了完成工作,与梁讨论了以后,决定结合GIS和自己写代码,大概Coding了两周吧,现在终于完成了好几个小工具。在性能上进行了大量的优化(前一版本在转换到一半的时候出现内存不够,所以调试要花十分多的时间)。
我写了一个Instruction,大概从原始下载过来的XMRG二进制文件到可用的水文模型(如VIC)的时间序列大概要经过近10个步骤。不过实现了一个有意思的内插方法(与前Python算法相同),从HRAP网格到1/8度的转换时,由于每个1/8度网格覆盖多个HRAP格子,这个算法使用了面积加权来计算1/8度网格的平均降水。
现在完成上述任务大概需要2天。大家就可以在自己的桌面机器上用了,而不必一定要使用服务器(有大内存)。
没有时间做多线程或者并行优化,估计那样异步或并行处理性能会得到更好的提升。