Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[xrotor] compilation fails: Rank mismatch #184

Open
mx212 opened this issue May 17, 2022 · 5 comments
Open

[xrotor] compilation fails: Rank mismatch #184

mx212 opened this issue May 17, 2022 · 5 comments

Comments

@mx212
Copy link
Contributor

mx212 commented May 17, 2022

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
Copy link
Owner

acxz commented May 17, 2022

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
Copy link
Contributor Author

mx212 commented May 17, 2022

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.

@mx212 mx212 closed this as completed May 17, 2022
@acxz
Copy link
Owner

acxz commented May 17, 2022

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.

@acxz acxz reopened this May 17, 2022
@mx212
Copy link
Contributor Author

mx212 commented May 17, 2022

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
Copy link
Owner

acxz commented May 18, 2022

patched with #185

@acxz acxz added the patched label May 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants