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

It could be helpful to have improved instructions for installation #14

Open
mavavilj opened this issue Feb 2, 2022 · 4 comments
Open

Comments

@mavavilj
Copy link

mavavilj commented Feb 2, 2022

I'm trying to install futhark, but I run into the issue of fulfilling these instructions:

https://github.com/PMunch/futhark#installation

There is no information about where libclang.lib should be located with default Ubuntu installation.

@PMunch
Copy link
Owner

PMunch commented Feb 2, 2022

Oh, that section is indeed a bit poorly worded. When installing on Linux through your package manager you shouldn't need to give that passL flag at all. Simply install libclang and run nimble install futhark and you should be good.

@mavavilj
Copy link
Author

mavavilj commented Feb 3, 2022

I got it installed on Ubuntu 20.04, but I had to use the choosenim installation (not the snap one, which is older version of nim) from:

https://nim-lang.org/install_unix.html

Then

nimble install futhark

which failed to:

   Building futhark/opir using c backend
/usr/bin/ld: cannot find -lclang

This is fixed by adding a link to clang.

First find where it is:

locate libclang.so

Which returns something like:

/usr/lib/llvm-10/lib/libclang.so
/usr/lib/llvm-10/lib/libclang.so.1

Then we create a symlink:

sudo ln -s /usr/lib/llvm-10/lib/libclang.so /usr/lib/libclang.so

Now the build should succeed.

@PMunch
Copy link
Owner

PMunch commented Feb 3, 2022

You could've also done LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/llvm-10/lib/ nimble install futhark I believe. This would essentially tell the C compiler that it should also search in that folder for dynamic libraries to load.

And yes, Futhark has only been tested on 1.4.8 and above. In addition it is generally not recommended to use system-installed Nim because of how slow most package managers are at updating their packages. Nim also tends to require things to be put in certain places, and some projects might require the Nim sources which is sometimes not included in the system-built versions. So the general advice is definitely to use choosenim or install it manually instead of getting it from your package manager.

@ringabout
Copy link

I encountered the same problem in wsl2 (ubuntu 20.04) and @mavavilj 's solution works like a charm!

Nim Compiler Version 1.7.1 [Linux: amd64]
Compiled at 2022-02-26

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

No branches or pull requests

3 participants