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

compiling SNAP #3951

Open
Pranavchiku opened this issue May 3, 2024 · 7 comments
Open

compiling SNAP #3951

Pranavchiku opened this issue May 3, 2024 · 7 comments
Labels
Code to be Compiled Projects to be compiled using LFortran compiler SNAP Issue or pull request related to compiling lanl/snap tracking issue tracking issue

Comments

@Pranavchiku
Copy link
Contributor

Pranavchiku commented May 3, 2024

Branch: https://github.com/Pranavchiku/SNAP/tree/lf2

Thanks to previous work done by @certik, it was easy to setup.

Steps to compile, change directory to src

cd src/
git clean -dfx
make

default compiler is lfortran, to make it work with gfortran do:

git clean -dfx
make FORTRAN=gfortran

Compilation status

 % make
lfortran  -c global.f90
lfortran  -c sn.f90
lfortran  -c data.f90
lfortran  -c geom.f90
ASR verify pass error: ASR::ttype_t in ASR::FunctionType cannot be tied to a scope.
   --> geom.f90:242:3 - 303:32
    |
242 |      SUBROUTINE geom_param_calc ( nang, ichunk, mu, eta, xi, cs, vd, d )
    |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...
...
    |
303 |      END SUBROUTINE geom_param_calc
    | ...^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ failed here


Note: Please report unclear, confusing or incorrect messages as bugs at
https://github.com/lfortran/lfortran/issues.
make: *** [Makefile:176: geom.o] Error 1

Edit: Update link to point to the branch.

@Pranavchiku Pranavchiku added Code to be Compiled Projects to be compiled using LFortran compiler SNAP Issue or pull request related to compiling lanl/snap labels May 3, 2024
This was referenced May 3, 2024
@Pranavchiku Pranavchiku added the tracking issue tracking issue label May 3, 2024
@certik certik pinned this issue May 3, 2024
@certik
Copy link
Contributor

certik commented May 7, 2024

Now it fails with #3977.

@Pranavchiku
Copy link
Contributor Author

The branch link above had previously pointed to the list of commits on the lf2 branch: https://github.com/Pranavchiku/SNAP/commits/lf2. I have updated it to point to the branch instead. @certik @Pranavchiku is the change correct?

A general practice to edit comments will be to use “Edit: “ and then add changes. The changes done above is fine, thanks for pointing it! Also, it was intentional to put branch redirecting to list of commits as most often we need that, but this is fine as well.

@kmr-srbh
Copy link
Contributor

A general practice to edit comments will be to use “Edit: “ and then add changes.

Thank you very much for the guidance @Pranavchiku! I will keep this in mind. I am sorry for deleting my quoted comment! I had done so to keep this thread clean because I thought I was reemphasizing the changes made.

@kmr-srbh
Copy link
Contributor

kmr-srbh commented May 12, 2024

I am facing an issue related to the lfortran version.

(lf) saurabh-kumar@Awadh:~/Projects/Packages/SNAP/src$ make
cpp -P  time.0.F90 >time.f90
lfortran  -c time.f90
Internal Compiler Error: Unhandled exception
Traceback (most recent call last):
.
.
.
LCompilersException: Incompatible format: LFortran Modfile was generated using version '0.1.0-dirty', but current LFortran version is '0.1.0-7-g430c8a917-dirty'
make: *** [Makefile:173: time.o] Error 1

I had faced this same issue when compiling lfortran. I had fixed it by creating the version tag stated in the above stacktrace by executing git tag v0.1.0. Looking through past conversations on Zulip, I see that this is a common issue. I think this issue cannot be fixed the way I did by manually creating the version tag. @certik @Pranavchiku please guide me.

Trying to compile the package using GFortran throws the following error.

(base) saurabh-kumar@Awadh:~/Projects/Packages/SNAP/src$ make FORTRAN=gfortran
cpp -P  time.0.F90 >time.f90
gfortran  -c time.f90
f951: Fatal Error: Reading module ‘global_module.mod’ at line 1 column 1: Unexpected EOF
compilation terminated.
make: *** [Makefile:173: time.o] Error 1

@certik
Copy link
Contributor

certik commented May 12, 2024

@kmr-srbh ask on zulip for further help. You need to clean the old modules, you are using modules from older version of LFortran.

@kmr-srbh
Copy link
Contributor

kmr-srbh commented May 12, 2024

@kmr-srbh ask on zulip for further help. You need to clean the old modules, you are using modules from older version of LFortran.

I am sorry for bothering you @certik. A clean build has fixed the issue. I am able to move forward with compiling SNAP now :)

Thank you for the quick reply!

I have a small question though. Do we need to periodically do a clean build after fetching the latest main due to the version problem?

@certik
Copy link
Contributor

certik commented May 12, 2024

I recommend that every time you update LFortran, always do a clean build of SNAP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code to be Compiled Projects to be compiled using LFortran compiler SNAP Issue or pull request related to compiling lanl/snap tracking issue tracking issue
Projects
None yet
Development

No branches or pull requests

3 participants