LFortran CLI without Jupyter integration?

Is it possible to install and use LFortran just as a command line application?

I’d like to test out LFortran, but the installation instructions only explains how to install using Conda. I don’t use Conda and I don’t really want to use the Python/Jupyter integration either at this point. If it’s possible to just download a executable that would be just perfect, but I haven’t been able to find any binary yet.

I think at the moment that is not being done. It might be a good idea to build the binaries and include them in GitHub Releases like it’s done in fpm. You could build from source, it should be relatively straight forward. Only problem is that you’ll have to take care of the dependencies yourself, LLVM, bison, re2c, etc.

I succeed in WSL2 ubuntu20.04

sudo apt-install llvm-dev bison re2c
./build0.sh
mkdir build
cd build
cmake .. -DWITH_LLVM=yes

Yes, that seems to be correct. I managed to build from their published tarball without installing any additional dependencies so that’s good enough for now.

1 Like

@plevold we used to create standalone Linux binaries for each release. When we moved to GitHub, I didn’t have time to set it up at the CI. If you have time to contribute it, that would be awesome, we would definitely want that. Update, here is the issue to track that: Publish binaries of releases · Issue #965 · lfortran/lfortran · GitHub, thanks for opening it.

I am focusing on fully compiling Minpack, it’s really close. After that I’ll work to smooth the installation out.

Thanks @kargl for trying it out. What is the code that it fails on? I tried the following:

program const_arrays
! Doesn't work yet:
!integer, parameter :: x(*) = [1, 2, 3]
! All of this works:
integer, parameter :: x(3) = [1, 2, 3]
integer :: a(3)
a = [1, 2, 3]
print *, x
print *, a
end

The uncommented code works, the commented code doesn’t yet, but I get a different error: Implement `integer, parameter :: x(*) = [1, 2, 3]` · Issue #967 · lfortran/lfortran · GitHub

Thanks @kargl, I can reproduce it also, I reported it as an issue: Implement constant string arrays · Issue #968 · lfortran/lfortran · GitHub, we probably don’t do constant character arrays yet.

1 Like

Probably you won’t want that either, but I got it from homebrew (and I think it’s bottled, even on Linux, I recall it being installed very fast, so no compilation from source). Not sure how frequently that bottle it’s updated, though.

Anyway the question is: do the official instructions miss to cite homebrew? If so maybe they should be updated / edited :slight_smile:

Similarly, I found that fpm README does not list spack in the installation options, but indeed fpm is available on spack. May we file issues for this kind of things?

2 Likes

Issues are very much welcome for incorrect documentation, PRs even more appreciated :wink:

2 Likes

As @everythingfunctional said, yes, please report all issues that you find with LFortran also, including documentation. Submitting it as a PR would be even easier for us. :slight_smile:

1 Like

Perfect, nice to hear (never know if a PR to READMEs could be perceived as intrusive). :slight_smile:

I’ll check if still the case and make a move if appropriate!

1 Like

@rgba send a PR to any file. :slight_smile: If it is not the right place, we can easily move it to the appropriate place.

1 Like