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

Error building with gfortran on 32 bit ABI machine #254

Open
danrosen25 opened this issue May 30, 2024 Discussed in #251 · 7 comments
Open

Error building with gfortran on 32 bit ABI machine #254

danrosen25 opened this issue May 30, 2024 Discussed in #251 · 7 comments
Assignees
Labels
bug Something isn't working source: discussions

Comments

@danrosen25
Copy link
Member

Discussed in https://github.com/orgs/esmf-org/discussions/251

Originally posted by GrigorisLionis May 28, 2024

ESMF Version

v.8.6.1.

Issue

I am trying to build latest stable version from source (a.k.a. 8.6.1.)
I have encountered a problem compiling the sources, due to a type mismatch error
The output of the error is as following:
gfortran -c -fallow-argument-mismatch -fallow-invalid-boz -O -fPIC -pthread -ffree-line-length-none -fopenmp -I/home/user/esmf/esmf-8.6.1/src/Infrastructure/Util/src -I/home/user/esmf/esmf-8.6.1/build_config/Linux.gfortran.default -I/home/user/esmf/esmf-8.6.1/src/Infrastructure -I/home/user/esmf/esmf-8.6.1/src/Superstructure -I/home/user/esmf/esmf-8.6.1/mod/modO/Linux.gfortran.32.mpiuni.default -I/home/user/esmf/esmf-8.6.1/src/include -DESMF_NO_INTEGER_1_BYTE -DESMF_NO_INTEGER_2_BYTE -DESMF_MPIUNI -I/home/user/esmf/esmf-8.6.1/src/Infrastructure/stubs/mpiuni -DESMF_LOWERCASE_SINGLEUNDERSCORE -DESMF_MOAB=1 -DESMF_LAPACK=1 -DESMF_LAPACK_INTERNAL=1 -DESMF_NO_ACC_SOFTWARE_STACK=1 -DESMF_YAMLCPP=1 -DESMF_YAML=1 -DESMF_NO_OPENACC -DESMF_BOPT_O -DESMF_TESTCOMPTUNNEL -DS32=1 -DESMF_OS_Linux=1 -DESMF_COMM=mpiuni -DESMF_DIR=/home/user/esmf/esmf-8.6.1 /home/user/esmf/esmf-8.6.1/src/Infrastructure/Util/src/ESMF_FortranWordsize.F90 -o /home/user/esmf/esmf-8.6.1/obj/objO/Linux.gfortran.32.mpiuni.default/ESMF_FortranWordsize.o
/home/user/esmf/esmf-8.6.1/src/Infrastructure/Util/src/ESMF_FortranWordsize.F90:425:77:

425 | call ESMF_PointerDifference(C_SIZEOF (c_ptrvar), varTK(1), varTK(2), wsize)
| 1
Error: Type mismatch in argument ‘n’ at (1); passed INTEGER(4) to INTEGER(8)
/home/user/esmf/esmf-8.6.1/src/Infrastructure/Util/src/ESMF_FortranWordsize.F90:380:77:

380 | call ESMF_PointerDifference(C_SIZEOF (c_ptrvar), varTK(1), varTK(2), wsize)
| 1
Error: Type mismatch in argument ‘n’ at (1); passed INTEGER(4) to INTEGER(8)
/home/user/esmf/esmf-8.6.1/src/Infrastructure/Util/src/ESMF_FortranWordsize.F90:335:77:

335 | call ESMF_PointerDifference(C_SIZEOF (c_ptrvar), varTK(1), varTK(2), wsize)
| 1
Error: Type mismatch in argument ‘n’ at (1); passed INTEGER(4) to INTEGER(8)
/home/user/esmf/esmf-8.6.1/src/Infrastructure/Util/src/ESMF_FortranWordsize.F90:290:77:

290 | call ESMF_PointerDifference(C_SIZEOF (c_ptrvar), varTK(1), varTK(2), wsize)
| 1
Error: Type mismatch in argument ‘n’ at (1); passed INTEGER(4) to INTEGER(8)
/home/user/esmf/esmf-8.6.1/src/Infrastructure/Util/src/ESMF_FortranWordsize.F90:113:79:

113 | call ESMF_PointerDifference(C_SIZEOF (c_ptrvar), udt_ptr1, udt_ptr2, psize)
| 1
Error: Type mismatch in argument ‘n’ at (1); passed INTEGER(4) to INTEGER(8)
/home/user/esmf/esmf-8.6.1/src/Infrastructure/Util/src/ESMF_FortranWordsize.F90:442:7:

442 | use ESMF_FortranWordsizeMod
| 1
Fatal Error: Cannot open module file ‘esmf_fortranwordsizemod.mod’ for reading at (1): Δεν υπάρχει τέτοιο αρχείο ή κατάλογος
compilation terminated.

I have used a number of different fortran compilers with the same result.

@danrosen25 danrosen25 added bug Something isn't working source: discussions labels May 30, 2024
@theurich theurich self-assigned this May 30, 2024
@theurich
Copy link
Member

@GrigorisLionis at your convenience please give https://github.com/esmf-org/esmf/tree/patch/8.6.2 a try on your 32-bit system. Let us know how it goes. Thanks!

@theurich
Copy link
Member

theurich commented Jun 5, 2024

@GrigorisLionis - I just pushed another set of changes to https://github.com/esmf-org/esmf/tree/patch/8.6.2. Please test under your 32-bit system at your convenience. Thank you!

@GrigorisLionis
Copy link

Στιγμιότυπο οθόνης_2024-06-05_13-07-51

This version compiles ok!!

make test resulted in some errors
Στιγμιότυπο οθόνης_2024-06-05_13-48-08

I am sending you the results of the test
Linux.gfortran.32.mpiuni.default.tar.gz

@theurich
Copy link
Member

theurich commented Jun 5, 2024

Well, we are making progress. Thank you for testing! Two requests: (1) Please set ESMF_BOPT=g in your build environment, (2) unset ESMF_F90COMPILEOPTS (to confirm it is no longer needed). Then rebuild from a fresh clone and run the tests. I hope we get more info in the back traces with debug enabled. Thanks.

@GrigorisLionis
Copy link

We sure are. Testing the least I can do!
-compiled ok with seettings with fresh copy from git)
make.info.txt
-I am sending you all the results of the test
testg.tar.gz

@theurich
Copy link
Member

theurich commented Jun 7, 2024

@GrigorisLionis - Thanks again. I looked over the more complete back traces from your debug run. It is going to be touch to figure out what exactly is causing those crashes especially not having a 32-bit environment myself. You might be better off using a 64-bit system after all for now.
Alternatively you could try using this build in your ESMPy project and see if it holds up. A lot seems to function correctly, except something mostly around XGrid, which might not be an issue in your case. But of course it's a bit shaky not knowing exactly what those crashes are due.

@danrosen25 and @uturuncoglu - is it possible to set up a 32-bit runner for our own testing of ESMF? We probably need that anyway if we want to reliably support this build option again forward going.

@danrosen25
Copy link
Member Author

@theurich
GitHub doesn't provide 32 bit runners. We can try to build a i386 image for Docker and emulate it through the Docker VM. I think you can force emulation with docker run --rm -it --platform linux/386 esmf/esmf-build-stack bash -l then we can maybe run this image through the GitHub actions to try to build ESMF.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working source: discussions
Projects
None yet
Development

No branches or pull requests

3 participants