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

Intel Fortran Compiler can not be detected on linux #1893

Closed
PucklaJ opened this issue Dec 7, 2021 · 5 comments
Closed

Intel Fortran Compiler can not be detected on linux #1893

PucklaJ opened this issue Dec 7, 2021 · 5 comments

Comments

@PucklaJ
Copy link
Contributor

PucklaJ commented Dec 7, 2021

Describe the bug

When I switch to the ifort toolchain using set_toolchains("ifort"), the compiler is not found. There is a workaround (see Additional Context) though it would be nice if it could be detected automatically. I installed the compiler from the official Intel website using the online installer.

Expected behavior

The Compiler and all related paths should be detected automatically by xmake.

Error output

Well, it just says toolchain("ifort"): not found!.

Related Environment

  • ifort version: 2021.1.2
  • xmake version: 2.5.9
  • os: Garuda Linux
  • target platform: Linux x86_64

Additional context

The workaround goes as follows:

  1. Add the compiler executable to PATH
    For me I had to add ~/intel/oneapi/compiler/latest/linux/bin/intel64. Change intel64 to ia32 for x86.
export PATH="~/intel/oneapi/compiler/latest/linux/bin/intel64:$PATH"
  1. Add the library folder to LD_LIBRARY_PATH
    For me I had to add ~/intel/oneapi/compiler/latest/linux/compiler/lib/intel64. Change intel64 to ia32 for x86.
export LD_LIBRARY_PATH="~/intel/oneapi/compiler/latest/linux/compiler/lib/intel64:$LD_LIBRARY_PATH"

This should be everything and now you can use ifort with xmake.

@PucklaJ PucklaJ added the bug label Dec 7, 2021
@waruqi
Copy link
Member

waruqi commented Dec 7, 2021

I have improved it but I have not environment to test it. You can try it. If it does not work, you can open a pr later. 0944d5a

@PucklaJ
Copy link
Contributor Author

PucklaJ commented Dec 8, 2021

Now it is able to find ifort, but when linking it can not find libimf.so. This file is inside the folder added to LD_LIBRARY_PATH, but it seems that the environment variable isn't actually accessed.

@waruqi waruqi mentioned this issue Dec 8, 2021
@waruqi
Copy link
Member

waruqi commented Dec 8, 2021

I have improved it on ifort branch, can you try it again.

xmake update -s github:xmake-io/xmake#ifort

https://github.com/xmake-io/xmake/pull/1898/files

But I have not tested it. if it dose not work, you can debug this patch and open pr to this branch.

@waruqi waruqi added this to the v2.6.2 milestone Dec 8, 2021
@waruqi
Copy link
Member

waruqi commented Dec 9, 2021

I have improved to detect icc/ifort toolchains again on dev, you can try it.

xmake update -s dev

@PucklaJ
Copy link
Contributor Author

PucklaJ commented Dec 9, 2021

It's still the same libimf.so is not found. xmake does find ifort completely fine, but somehow LD_LIBRARY_PATH is not getting applied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants