PRBEM / IRBEM

IRBEM-LIB provides routines to compute magnetic coordinates for any location in the Earth's magnetic field, to perform coordinate conversions, to evaluate geophysics/space-physics models, and to propagate orbits in time.
https://prbem.github.io/IRBEM/
Other
33 stars 14 forks source link

Type mismatch when installing library on Mac #15

Closed sanjaychepu closed 2 years ago

sanjaychepu commented 3 years ago

I'm a student of Allison Jaynes at Iowa trying to install on my Mac. When I run make OS=osx ENV=gnu64 all I get many (~100) Type mismatch errors from passing INTEGER(8) to INTEGER(4) (and a rank mismatch as well). I did double-check that I have a 64-bit computer that I'm trying to make a 64-bit library on and that my compiler seems to be working.

Minimal example to reproduce issue:

git clone https://github.com/PRBEM/IRBEM.git
cd IRBEM/
make OS=osx env=gnu64 all

Error message:

This first message was repeated almost identically at many different places

   15 |      &%VAL(argv(28)),%VAL(argv(29)))
      |                                    1
Error: Type mismatch in argument 'idet' at (1); passed INTEGER(8) to INTEGER(4)
   35 |        call find_bm_nalpha (xx0,1,alpha,Bposit,Bmir,xmin)
      |                                  1
Error: Rank mismatch in argument 'alpha' at (1) (rank-1 and scalar)

OS, IRBEM version, and compiler version information:

OS: Mac OS X 10.14.6 short hash: 614a227 gfortran: GNU Fortran (Homebrew GCC 10.2.0_4) 10.2.0

AntoineBrunet commented 3 years ago

Hi, Thanks for raising this issue. So this is linked to the IDL wrappers of the library, and there is a lot of issues with the wrapper implementation with gfortran (on Linux as well, albeit it only produces warnings). I am looking into this, but I think it would require significant effort to properly fix.

As you are using gfortran anyway, you could try to compile the library using OS=linux64 and ENV=gnu64, I guess it should work properly.

sanjaychepu commented 3 years ago

Thanks for your help! When I tried it with ENV=gnu64 it gave the same error, but when I used ENV=gfortran64 it worked.