0

Let me start by saying I am not a superuser and somewhat of a noob here, but I have a basic understanding of what I'm doing.

I have installed MSYS2 and MinGW-w64 following the directions here. I am working on 64-bit Windows 10, and I want to ultimately utilize the ARPACK library in my Fortran 90 code. I am currently using Microsoft Visual Studio 2017 and the Intel Fortran ifort compiler and MKL libraries. So,

1. Should I compile ARPACK with gfortran or ifort, or does it not matter?

Addendum: compiling with ifort seems be creating a lot of headaches, in particular because the commands referenced in the ARmake.inc file are unix commands, so I would need to replace them with Windows equivalents which I am not that familiar with (e.g. ln -s -> mklink)

I have extracted the ARPACK source files to /c/ARPACK, and I have updated the ARmake.inc file, changing the following:

home = /c/ARPACK
PLAT = x64
FC = gfortran

I also went into the /UTIL/second.f file and removed the line EXTERNAL ETIME().

2. should I set PLAT = x86_64? I don't understand exactly how make works, so I don't know what exactly this setting is going to affect. I am running make from within the mingw64 shell (run from the /msys64 folder).

Next, I run make lib. I get a number of warnings, in particular while compiling snrm2.f and dnrm2.f, I get the same errors:

snrm2.f:56:72:

    10 assign 30 to next
                                                                        1
Warning: Deleted feature: ASSIGN statement at (1)
snrm2.f:62:19:

    20    go to next,(30, 50, 70, 110)
                   1
Warning: Deleted feature: Assigned GOTO statement at (1)
snrm2.f:64:72:

       assign 50 to next
                                                                        1
Warning: Deleted feature: ASSIGN statement at (1)
snrm2.f:73:72:

       assign 70 to next
                                                                        1
Warning: Deleted feature: ASSIGN statement at (1)
snrm2.f:79:72:

       assign 110 to next
                                                                        1
Warning: Deleted feature: ASSIGN statement at (1)

3. Are these warnings important? My Fortran 77 knowledge is pretty minimal and I haven't tried very hard to understand them.

Further, every time it enters a new folder I get (for example)

make[1]: Leaving directory '/c/ARPACK/BLAS'
Making lib in /c/ARPACK/LAPACK
make[1]: Entering directory '/c/ARPACK/LAPACK'
Makefile:91: warning: overriding recipe for target '.f.o'
../ARmake.inc:95: warning: ignoring old recipe for target '.f.o'
gfortran -O  -c sgeqr2.f
gfortran -O  -c slabad.f
gfortran -O  -c slacon.f
.....

where the ARmake.inc file has

90   # %-------------------------------------------%
91   # |  Command to build .o files from .f files. |
92   # %-------------------------------------------%
93   #
94   .f.o:
95       @$(ECHO) Making $@ from $<
96       @$(FC) -c $(FFLAGS) $<

4. Is this warning/error message important? My understanding is this should print for example

    Making sgeqr2.o from sgeqr2.f
    gfortran -O  -c sgeqr2.f

but make isn't liking that there are two commands here, and is overwriting the first with the second.

Finally to wrap it all up, before I go any further I noticed that not every one of the source .f files have been compiled. For example, in /BLAS, I have cgemm.f, ctbsv.f, ctrsm.f, dgemm.f, and a number of others which do not have associated .o files. Why have these been left out? I know that dgemm for example is a pretty basic matrix multiplication routine which I think is essential, so I am assuming there has been an error somewhere along the line, but I never saw any error messages during the make process. Any and all help appreciated, after many many hours of trying to get this to work I feel that the end is (hopefully) in sight. So my final and most important question

5. Why did some of the source files not compile, and is this going to prevent the resulting library from being usable? If so what could I have done differently or what do I need to do to finish building the library?

I realize that the individual Makefile's mention that these files are not required by ARPACK but are required for ARPACK examples. They can be included by using make all instead of make lib.

Kai
  • 213
  • 1
  • 12
  • Please use tag [tag:fortran] for all Fortran questions. Much more people will see your question. You can choose a different choice of tags than I chose but keep the fortran tag. – Vladimir F Героям слава Apr 11 '18 at 13:49
  • 1
    What you show in 2. are *warnings*, NOT *errors*. Warnings do not cause compilation failure unless you use special options. We may have questions about those, did you try to search? I don't think they are important now. – Vladimir F Героям слава Apr 11 '18 at 13:51
  • I used arpack-ng before and worked fine for me (in contrast to the original Rice one) https://github.com/opencollab/arpack-ng Also I think prebuilt arpack is often available via various routes(homebrew/linuxbrew/Ubuntu/...), which may be easier to try (also for windows this may be related https://github.com/Alexpux/MINGW-packages/blob/master/mingw-w64-arpack/PKGBUILD ) – roygvib Apr 11 '18 at 16:24
  • @roygvib, this looks promising, but I can't figure out how to build it due to lack of BLAS and LAPACK libraries, do you have any pointers to how I could perhaps link it to the Intel MKL libraries? Or an alternative? – Kai Apr 11 '18 at 17:26
  • MKL has its own BLAS and LAPACK internally, so I think it should be sufficient to just link MKL (in the case of Linux + ifort, -mkl option). I guess a similar option for Windows + MKL. In the case of gfortran, we need a bit more options... https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor (Also many distros have their builtin BLAS/LAPACK very often, so just -lblas -llapack -L/usr/some/where ...) – roygvib Apr 11 '18 at 17:40
  • I tried using -lblas and -llapack with gfortran, it compiles but on execution gives an error. I posted a separate question [here](https://stackoverflow.com/questions/49783733/using-blas-lapack-and-arpack-with-msys2) – Kai Apr 12 '18 at 00:15

0 Answers0