Please note: Due to a large number of requests, I cannot provide individual assistance. This page is a free gift to the ARPACK lovers of this world!I spent a few days trying to make this work, and I eventually succeeded, so I'd like to share the solution with others. The solution was developed with MSVC .NET 2003 and Windows XP. ARPACK is such a great package (robust, powerful, fast) that it is a shame not to use it just because of cross-platform issues.
I used MinGW, a very nice free port of many Unix utilities to the Windows platform. Please see the MinGW webpage for more accurate descriptions of this software.
The same solution was first described here (many thanks to David Gleich, the author of that page). The purpose of my page is to explain the whole process in more detail. Some related information is also available on this MinGW page.
You can also download ARPACK++, a collection of Fortran-to-C++ wrappers which allow you to call ARPACK routines using an easy C++ interface.
Step 2: Install MINGW and MSYS
Install MinGW (I installed most packages) and then MSYS. MSYS is a Unix-like shell for Windows (similar to Cygwin, but more unrestricted in terms of licensing). It is available on the MinGW webpage. After you install MSYS, there will be a VERY IMPORTANT post-installation step (a script) where it will sycnhronize MinGW and MSYS. I got confused the first time around and it did not get done properly... This resulted in my gcc.exe compiler (and make utility) not working in a very strange way, complaining about not receiving input files where in reality input files were specified. I lost two days trying to fix it, until I realized I simply needed to reinstall.
Also: on the MinGW download page, there is talk about a package that combines most of MinGW for new users, but it was not directly obvious to me that MSYS is this package (I am still not 100% sure). Just giving feedback, I think MinGW & MSYS are great tools.
Step 3: Compile ARPACK using MinGW's Fortran, in the MSYS shell
In this step, we will compile ARPACK and create a Windows DLL. You can then link against this DLL from MSVC.
Start a MSYS shell, go into your code directory (in this case your ARPACK directory) and compile the Fortran source files (such as using "make" which will call g77, the MinGW's Fortran compiler). Next, wrap the *.o files into a DLL:
Finally, you need to create an import library for arpack_win32.dll:
Note: I ran all commands in this Step 3 from the MSYS shell.
Note: "lib.exe" is a part of MS Visual Studio. It is usually located in the MS Visual Studio binary directory, in the same directory that also contains the MSVC compiler executable and linker (on my system, the path is C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin). You need to add this directory to the path, or else you will have to type the full path to lib.exe each time you call it in MSYS.
Note: In my case, "lib.exe" at first didn't want to run due to some missing MSVC DLL, which I then found in a MSVC directory and copied it over to the local directory. I am sure there are better solutions too.
Step 4 (optional): Compile ARPACK++
Step 5: Link against ARPACK from MSVC
You simply need to specify arpack_win32.lib on the list of libraries in MSVC (either on the library list specific to a particular MSVC project, or on the global MSVC library ... Lire la suite de l'article

