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

Docs: Added a step-by-step documentation for installing and building LPython #2537

Merged
merged 2 commits into from
Feb 16, 2024

Conversation

kmr-srbh
Copy link
Contributor

This PR adds the step-by-step installation instructions for setting up and building LPython on Linux, Windows, macOS and Windows with WSL. It overrides all of the dummy LFortran data previously present.

The steps for setting up the project on Windows with WSL are taken from #1501, courtesy of @faze-geek.

Copy link
Contributor

@certik certik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks good. Thank you for improving the installation instructions!

@certik certik merged commit 49f7b73 into lcompilers:main Feb 16, 2024
13 checks passed
@Shaikh-Ubaid
Copy link
Collaborator

Shaikh-Ubaid commented Feb 17, 2024

Last time when I was setting up LFortran on Linux, I noted the extra-dependencies that were needed to be installed after setting up the conda environment:

  1. build-essential (for gcc, g++ and make)
  2. binutils-dev (for error: Could not find BFD and also for stacktraces support)
  3. zstd-static=1.5.5 (for zstd-static not found during link)
  4. zlib1g-dev (to fix ld error -lz not found)
  5. clang (as it is used by lfortran for linking when compiling user source code)

I installed 1, 2, 4, and 5 using sudo apt-get install.
3 should be installed via conda.

Please note the above are for LFortran while setting up in Ubuntu/Linux operation system.

@certik
Copy link
Contributor

certik commented Feb 17, 2024

Yes. For everything else we should use the conda environment. Especially important for Bison, which only works with version 3.4 and often fails with newer versions.

@Shaikh-Ubaid
Copy link
Collaborator

Also from https://lfortran.zulipchat.com/#narrow/stream/197339-general/topic/Building.20Lfortran/near/420682935, it seems zlib1g-dev should be installed via conda. So, summarizing the above, I think the steps to setup an LCompiler on Linux can be:

  • Step 0 (Prerequisite): Download and install conda if not already installed.
  • Step 1: Create the conda environment as per the appropriate environment file in the project
  • Step2: sudo apt-get install build-essentials binutils-dev clang

So, seems like just two steps.

Notes:

  • we should update this environment files to also include zstd-static and zlib1g-dev
  • we might be able to eliminate installing clang, but I think for now clang has been hard coded to be used for linking in LFortran. I think LFortran should ideally use the compiler specified by LFortran_CC for linking when compiling user source code.

@kmr-srbh
Copy link
Contributor Author

Also from https://lfortran.zulipchat.com/#narrow/stream/197339-general/topic/Building.20Lfortran/near/420682935, it seems zlib1g-dev should be installed via conda. So, summarizing the above, I think the steps to setup an LCompiler on Linux can be:

* Step 0 (Prerequisite): Download and install conda if not already installed.

* Step 1: Create the conda environment as per the appropriate environment file in the project

* Step2: `sudo apt-get install build-essentials binutils-dev clang`

So, seems like just two steps.

Notes:

* we should update this environment files to also include `zstd-static` and `zlib1g-dev`

* we might be able to eliminate installing clang, but I think for now clang has been hard coded to be used for linking in LFortran. I think LFortran should ideally use the compiler specified by `LFortran_CC` for linking when compiling user source code.

I am making the changes. 👍 Thank you very much for the help!🙂

@Shaikh-Ubaid
Copy link
Collaborator

we should update this environment files to also include zstd-static and zlib1g-dev

It seems like zlib1g-dev is not present on conda-forge. So we need to be careful here.

@certik do you have any suggestions for installing zlib1g-dev. It seems it is used only for c/c++ zlib header files.

@kmr-srbh
Copy link
Contributor Author

* we should update this environment files to also include `zstd-static` and `zlib1g-dev`

I am adding the packages. As @Shaikh-Ubaid pointed out, zlib1g-dev is not present on conda-forge. A global installation works. Is it fine?

kmr-srbh added a commit to kmr-srbh/lpython that referenced this pull request Feb 17, 2024
Moved global package installations to conda environment.
@Shaikh-Ubaid
Copy link
Collaborator

Is it fine?

Seem fine to me for now. We can update later as we figure out better approaches.

kmr-srbh added a commit to kmr-srbh/lpython that referenced this pull request Feb 17, 2024
@Shaikh-Ubaid
Copy link
Collaborator

Also, I noticed that you are working in main branch directly (for example this PR or the commit above). It is usually suggested to use separate branches to submit developmental code. You use main branch to pull in latest changes from the remote repository. You use other branches to work on developmental/experimental code and later submit as a PR when ready.

@kmr-srbh
Copy link
Contributor Author

You are right @Shaikh-Ubaid. To get started quickly, I had started work on the default branch. I have created new work-specific branches and am working on them now. 🙂

Shaikh-Ubaid pushed a commit to kmr-srbh/lpython that referenced this pull request Feb 18, 2024
Moved global package installations to conda environment.
Shaikh-Ubaid pushed a commit to kmr-srbh/lpython that referenced this pull request Feb 18, 2024
Shaikh-Ubaid pushed a commit that referenced this pull request Feb 18, 2024
…les. (#2540)

* Added `flex` and `zstd-static=1.5.5` packages.

* Added `flex` and `zstd-static=1.5.5` packages.

* Incorporated suggestions from #2537

Moved global package installations to conda environment.

* Updated README.md to reflect changes suggested in #2537

* Remove `flex`

* Remove `flex`
Agent-Hellboy pushed a commit to Agent-Hellboy/lpython that referenced this pull request Mar 5, 2024
…les. (lcompilers#2540)

* Added `flex` and `zstd-static=1.5.5` packages.

* Added `flex` and `zstd-static=1.5.5` packages.

* Incorporated suggestions from lcompilers#2537

Moved global package installations to conda environment.

* Updated README.md to reflect changes suggested in lcompilers#2537

* Remove `flex`

* Remove `flex`
hankluo6 pushed a commit to hankluo6/lpython that referenced this pull request Mar 8, 2024
…les. (lcompilers#2540)

* Added `flex` and `zstd-static=1.5.5` packages.

* Added `flex` and `zstd-static=1.5.5` packages.

* Incorporated suggestions from lcompilers#2537

Moved global package installations to conda environment.

* Updated README.md to reflect changes suggested in lcompilers#2537

* Remove `flex`

* Remove `flex`
@kmr-srbh kmr-srbh changed the title Added a step-by-step documentation for installing and building LPython. Docs: Added a step-by-step documentation for installing and building LPython. Mar 13, 2024
@kmr-srbh kmr-srbh changed the title Docs: Added a step-by-step documentation for installing and building LPython. Docs: Added a step-by-step documentation for installing and building LPython Mar 13, 2024
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.

3 participants