Flomat install under linux: can not find libfortran

hello,

on a fresh linux install i can not install flomat package (sci) , as it was a new linux install i installed gcc, libfortran, ffi-dev but i still have the same error:

any idea?

regards,

Damien

Which linux distribution are you using?

Where is libgfortran installed?

Which version?

it is ubuntu latest release 24.04

mattei@acer:~$ uname -a
Linux acer 6.8.0-40-generic #40-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul  5 10:34:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
mattei@acer:~$ cat /proc/version
Linux version 6.8.0-40-generic (buildd@lcy02-amd64-075) (x86_64-linux-gnu-gcc-13 (Ubuntu 13.2.0-23ubuntu4) 13.2.0, GNU ld (GNU Binutils for Ubuntu) 2.42) #40-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul  5 10:34:03 UTC 2024

find / -name 'libgfortran*' 

/usr/lib/x86_64-linux-gnu/libgfortran.so.5
/usr/lib/x86_64-linux-gnu/libgfortran.so.5.0.0
/usr/share/doc/libgfortran5

libgfortran version 5

Flomat is looking for version 5.3 of libgfortran.
Try updating libgfortran5.

i update all the system with no success.

i did not find a way to upgrade libgfortran5 ,seems the latest version available

Sorry - turns out I misread the source.
Flomat is not looking for 5.3, but for libgfortran version 5 or 3.

Next thing to check is the whether libgfortran5 is in the path used by Racket to find
shared libraries.

Try (get-lib-search-dirs) in the Racket repl and see the paths.
What do you see?

> (require setup/dirs)
> (get-lib-search-dirs)
'(#<path:/home/mattei/snap/racket/21/.local/share/racket/8.13/lib> #<path:/snap/racket/current/usr/lib/racket>)
> 

not in the path,how can i set it? to

/usr/lib/x86_64-linux-gnu/

got the same problem under windows with OpenBLAS:

raco setup: 6 running: <pkgs>/racket-index/scribblings/main/user/start.scrbl
ffi-lib: could not load foreign library
  path: libopenblas.dll

i find the right DLL but not sure how to install them on the windows 11 box

ok ,got a solution.

The problem was with the Ubuntu package provided by apt installer of racket 8.13.

I remove it and install from racket web site and it worked.

For windows i do not know and almost never use this system.

1 Like

It's probably the same issue on Windows.

Use (get-lib-search-dirs) to find the search path.
Double check that libopenblas is in the search path.

Currently, we aren't looking for a particular version on Windows,
so the problem is most likely related to the search path:

i can not test on windows, i barely use the system, i did not try to put the openblas .dll in the good directory, if you know where? i can try...

Under linux there is a problem with the package provided by apt.

The binary from the racket site works well.

i can not test on windows, i barely use the system, i did not try to put the openblas .dll in the good directory, if you know where? i can try...

Use (get-lib-search-dirs) in the Racket repl to find the paths where Racket looks for DLLs.

yes i finally succeeded with OpenBLAS-0.3.10-x64 in the bin directory there is :

PS C:\Users\damie\Downloads\OpenBLAS-0.3.10-x64> copy .\bin\libopenblas.dll 'C:\Program Files\Racket\lib\'

thanks

1 Like

These parts are as expected: (get-lib-search-dirs) gets the Racket-specific path for shared foreign libraries, typically for foreign libraries installed by Racket packages via copy-foreign-libs. These are rare on systems other than Windows and Mac OS. It is not useless on other Unix-like systems (for example, you can configure extra directories to get Racket find libraries you've installed in non-default locations), but it should not be needed for normally-installed system libraries. If ffi-lib does not find a requested library in one of the Racket-specific locations, it then uses dlopen to look in the default system locations.

You write that the problem is with Racket as installed by APT, but the paths you gave above say snap in them. Do you know if it was an APT or Snap package that had this problem?

If you used Snap, this problem would not be surprising, because Snap sandboxes installed applications from seeing the rest of the system. I believe there are ways to configure a Snap to have access to more system paths, but I don't know what they are: I didn't keep Snap installed on my systems even before I moved from Ubuntu back to Debian.

If you used APT, that would be much more surprising—but I suspect you didn't, because AFAICT there is no APT package of Racket 8.13 for Ubuntu. The package for 24.10 "Oracular Oriole", which will not be released for two more months, only has Racket 8.12, and the PPA has not been updated recently. (For Debian, you can get 8.13 for testing and unstable and 8.12 from bookworm-backports.) If you did have a problem with an APT package of Racket, though, that would be a good bug to know about.

yes your are right it is not from apt (used instead for gcc and gfortran) but with a GUI Application Center provided with Ubuntu, i think this application use snapcraft or something like that, i just installed racket and emacs from here, i removed racket and reinstalled it from racket-lang site, perheaps i will do the same for emacs if it cause problem this way of install.

sorry for the mistake.