acxz / pkgbuilds

PKGBUILDs for Arch Linux
25 stars 44 forks source link

[xrotor] compilation fails: Rank mismatch #184

Open mx212 opened 2 years ago

mx212 commented 2 years ago

The compilation of xrotor fails for me. I tried to install it with an AUR helper using: trizen -S xrotor. I tried manually compiling the source with different Makefile tweaks from https://stackoverflow.com/questions/69772266/compiling-and-running-xrotor-on-ubuntu-20-04, but this didn't change anything for me. Here is the relevant error message:

gfortran -c -I../src -O ../src/xnoise.f
../src/xnoise.f:1154:21:

 1154 |       CALL SCALIT(NT,PRES,0.0,PFAC)
      |                     1
......
 1500 |       CALL SCALIT(1,XMAX,XMIN,XSF)
      |                    2
Error: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)
../src/xnoise.f:270:21:

  227 |       CALL READI(2,NDBSIZ,ERROR)?
      |                   2
......
  270 |         CALL READI(1,NT,ERROR)
      |                     1
Error: Rank mismatch between actual argument at (1) and actual argument at (2) (rank-1 and scalar)
make: *** [Makefile:118: xnoise.o] Error 1
acxz commented 2 years ago

I encountered this a while back and haven't yet rolled a fix out. Basically need to edit the makefile to add a flag which will disable the rank mismatch check:

This is what I had in my notes:

sed the makefile with -fallow-argument-mismatch
mx212 commented 2 years ago

Thank you for the quick awnser. I added a sed command in the build() function of your PKGBUILD file as follows:

build() {

  cd Xrotor/plotlib
  cp config.make.gfortran config.make
  make libPlt_gfortran.a

  cd ../bin
  sed -i '/FFLAGS/ s|$| -fallow-argument-mismatch|' Makefile.gfortran
  sed -i '/FFLOPT/ s|$| -fallow-argument-mismatch|' Makefile.gfortran
  cp Makefile.gfortran Makefile
  make xrotor
  make jplot
}

This is probably overkill, but it worked for me. I guess only FFLAGS is required, but I didn't check.

acxz commented 2 years ago

Glad that you were able to find a solution. We actually keep issues open until they are fixed, so I'll reopen this.

I would be ecstatic if you could make a PR with your fix so that we can properly close this issue.

mx212 commented 2 years ago

My bad. This is my first fix on github. It turns out that, indeed, only FFLAGS is required. I created a corresponding pull request.

acxz commented 2 years ago

patched with #185