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

Adding documentation on how to build and run on top of EESSI without EB #175

Merged
merged 21 commits into from
Dec 12, 2024
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
c0a8f40
adding documentation on how to build and run on top of EESSI without EB
Apr 30, 2024
0b5b8d0
Update docs/using_eessi/building_on_eessi.md
hvelab May 27, 2024
b4819b8
Update docs/using_eessi/building_on_eessi.md
hvelab May 27, 2024
c99b797
Update docs/using_eessi/building_on_eessi.md
hvelab May 27, 2024
820c2d4
Update docs/using_eessi/building_on_eessi.md
hvelab May 27, 2024
1a66170
Update docs/using_eessi/building_on_eessi.md
hvelab May 27, 2024
d7edeaa
Update docs/using_eessi/building_on_eessi.md
hvelab May 27, 2024
99ba875
Update docs/using_eessi/building_on_eessi.md
hvelab May 27, 2024
dcb8508
Update docs/using_eessi/building_on_eessi.md
hvelab May 27, 2024
b06e3d5
Update docs/using_eessi/building_on_eessi.md
hvelab May 27, 2024
bd83794
Update docs/using_eessi/building_on_eessi.md
hvelab May 27, 2024
ed0c5dd
updating on LD_RUN_PATH
Jun 17, 2024
f1fd341
tab indent fix
hvelab Sep 30, 2024
f70fff4
Update docs/using_eessi/building_on_eessi.md
hvelab Oct 10, 2024
1b7f1eb
Update docs/using_eessi/building_on_eessi.md
hvelab Oct 10, 2024
6523acc
Update docs/using_eessi/building_on_eessi.md
hvelab Oct 10, 2024
6a98870
Update docs/using_eessi/building_on_eessi.md
hvelab Oct 10, 2024
08d9aa5
Update docs/using_eessi/building_on_eessi.md
hvelab Oct 10, 2024
3db1ac6
Update docs/using_eessi/building_on_eessi.md
hvelab Oct 10, 2024
d862469
Update docs/using_eessi/building_on_eessi.md
ocaisa Dec 12, 2024
fb8ef09
Merge branch 'main' into issue_48_build_without_eb
ocaisa Dec 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions docs/using_eessi/building_on_eessi.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,32 @@ Finally, you should be able to load our newly build module:
module load netCDF/4.9.0-gompi-2022a
```

## Manually building software op top of EESSI
Building software on top of EESSI would require your linker to use the same system-dependencies as the software in EESSI does. In other words: it requires you to link against libraries from the compatibility layer, instead of from your host OS.
## Manually building software op top of EESSI (without EasyBuild)

hvelab marked this conversation as resolved.
Show resolved Hide resolved
Building and running software on top of EESSI without EasyBuild is not as straightforward and requires some considerations to take care of.
hvelab marked this conversation as resolved.
Show resolved Hide resolved

Build time is trivial as long as EESSI toolchains are loaded, so the runtime linker from the compat-layer is used. The safest way to make sure all libraries will point to the required locations is starting an EESSI shell before building. Steps would be:
hvelab marked this conversation as resolved.
Show resolved Hide resolved

* First of all, load the environment by starting an EESSI shell as described [here](https://www.eessi.io/docs/using_eessi/setting_up_environment).
ocaisa marked this conversation as resolved.
Show resolved Hide resolved
* Load all dependencies you need to build your software. You must use at least a toolchain from EESSI to compile it.
hvelab marked this conversation as resolved.
Show resolved Hide resolved
* Compile and make sure the library resolution points to the EESSI stack. For this, `ldd` from compatibility layer and **not** `/usr/bin/ldd` should be used when checking the binary.
Copy link
Member

Choose a reason for hiding this comment

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

Probably best to provide a running example here so people have a clearer idea of what you are talking about

Copy link
Member

Choose a reason for hiding this comment

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

How about an MPI "Hello world" example?

* Once done, exit prefix shell or use another terminal to run your software.
hvelab marked this conversation as resolved.
Show resolved Hide resolved

For runtime, as EESSI does not set `LD_LIBRARY_PATH`, the executable will need help finding the proper libraries. The easiest approach is to set this variable manually before running. Thus, assuming a new terminal with no EESSI shell loaded, you will need to:
hvelab marked this conversation as resolved.
Show resolved Hide resolved

* Load dependencies for your software to run
* Set manually `LD_LIBRARY_PATH` to resolve libraries at runtime
```sh
export LD_LIBRARY_PATH=$LIBRARY_PATH:$EBROOTGCCcore/lib64
```
Copy link
Member

Choose a reason for hiding this comment

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

This should indented to align with Set

* Run!
hvelab marked this conversation as resolved.
Show resolved Hide resolved

Note how this has to be done every time you want to run your software. A long term approach is to set add any library used by your software to the RPATH in your executable. This is also more reliable as your executable won't pick unexpected libraries from LD_LIBRARY_PATH.
hvelab marked this conversation as resolved.
Show resolved Hide resolved

!!! Note No RPATH should point to a compatibility layer directory, only to software layer ones, as all resolving is done via `ld-linux*.so`.
hvelab marked this conversation as resolved.
Show resolved Hide resolved

The biggest downside of this approach is that your executable becomes bound to the architecture you linked your libraries for. I. e, if you add to your executable RPATH a `libhdf5.so`compiled for `intel_avx512`, you will not be able to run that binary in a machine with a different architecture.
hvelab marked this conversation as resolved.
Show resolved Hide resolved

!!! Note This documentation is intended for experts in runtime linker/runtime linker behaviour and most cases are untested. Any feedback on this topic is highly appreciated.

hvelab marked this conversation as resolved.
Show resolved Hide resolved

While we plan to support this in the future, manually building on top of EESSI is currently not supported yet in a trivial way.
Loading