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

Add LFortran Compiler Support #57

Merged
merged 12 commits into from
Mar 27, 2024
Merged

Add LFortran Compiler Support #57

merged 12 commits into from
Mar 27, 2024

Conversation

gha3mi
Copy link
Contributor

@gha3mi gha3mi commented Jan 17, 2024

Hi,

This PR references issue #11 and adds LFortran support on Linux and macOS by installing LFortran using Miniconda.

The installation of LFortran on Windows using Miniconda is completed in the last commit. However, as I am not a Windows user, I couldn't set the paths. Perhaps someone else can perform the final steps for Windows.

Best,
Ali

[Edited]:

  • I excluded CC/CCX for LFortran.
  • The executable for LFortran on Windows is located at C:/ProgramData/Miniconda3/envs/lf/Library/bin/lfortran.exe. You can check it with cd C:/ProgramData/Miniconda3/envs/lf/Library/bin and then dir. However, -h results in an error.
  • Some work on setting paths on Windows using set and setx with /m doesn't work properly. After setting paths, it may be necessary to restart the current shell. I tried with cmd /c and powershell.exe -Command, but it doesn't work.

@gha3mi gha3mi marked this pull request as ready for review January 17, 2024 11:24
@wpbonelli
Copy link
Contributor

Thanks very much @gha3mi. A few notes

  • I think CC/CXX outputs and env vars should be set to preinstalled gcc/g++ for lfortran and other standalone fortran compilers, as anticipated in the readme, maybe others disagree
  • Not sure about installing via conda. Using brew, choco, and APT as done for other toolchains would be ideal — looks like this is possible for brew but not yet for APT or choco. Note miniconda is preinstalled on Ubuntu and Windows and may also have been setup via e.g. setup-miniconda or setup-micromamba. An lf env may already exist too, seems like this could cause collisions.

@gha3mi
Copy link
Contributor Author

gha3mi commented Jan 17, 2024

  • I think CC/CXX outputs and env vars should be set to preinstalled gcc/g++ for lfortran and other standalone fortran compilers, as anticipated in the readme, maybe others disagree

I considered this as well, but I was uncertain about which compiler should be set in this scenario. Since all the other compilers are available, it should be easy to figure out.

  • Not sure about installing via conda. Using brew, choco, and APT as done for other toolchains would be ideal

Personally, I'm not a fan of Conda. The issue is that LFortran consistently suggests using Miniconda.

By the way, I won't be able to work on it soon, maybe later. Someone else might find the time to do it. Feel free to make changes to this PR.

@wpbonelli
Copy link
Contributor

there was a brief thread in the lfortran mailing list last month, suggesting it will soon be available on APT as well

gha3mi and others added 9 commits March 26, 2024 11:20
* use preinstalled conda on linux and windows
* install/use micromamba on mac
* install lfortran to base env
* update fortran test action
* restore c/c++ test actions
* simplify env var setting
* remove dupe function
@wpbonelli wpbonelli mentioned this pull request Mar 26, 2024
@wpbonelli
Copy link
Contributor

wpbonelli commented Mar 26, 2024

copying from #78

I think we can just use the builtin conda on linux/windows and install/use micromamba on mac, and move ahead with this, rather than wait for it on other package managers as I was thinking before. Some more things:

  • this now installs lfortran to the base environment, not a custom one
  • lfortran seems to pair better with MSVC on Windows — install MSVC toolchain with it and set cl as the C/C++ env vars and outputs, still use preinstalled gcc/g++ on linux and mac though
  • tweaked the testing conditions, there is some issue with lfortran executable discovery on powershell and command prompt, so windows support is limited to bash for now unless it's invoked by abs path
  • updated the test matrix and compatibility files

@wpbonelli wpbonelli merged commit b4cbf37 into fortran-lang:main Mar 27, 2024
177 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants