1

How to install FGSL in Ubuntu 20.04?

I tried the following :

  1. Add key
    sudo apt install curl
    curl http://lvserver.ugent.be/apt/xmi.packages.key | sudo apt-key add -
  1. Add repo
    deb [arch=amd64] http://lvserver.ugent.be/apt/ubuntu focal stable
    deb-src http://lvserver.ugent.be/apt/ubuntu focal stable

to /etc/apt/sources.list file.

  1. Update & install FGSL
    sudo apt-get update
    sudo apt-get install libfgsl0 libfgsl0-dev libfgsl0-doc

But, it says Unable to locate package.

Thuliyan
  • 39
  • 5

1 Answers1

2

(I'm not sure about whether I should write this as an answer to my own question or add this as an edit to the question. Yet, I'm chosing to write this as an answer because I feel it's little bit bigger to be added as an edit to the question.)

I found an easier way to install FGSL using Synaptic Package Manager.

Add the key.

Add the repo deb [arch=amd64] http://lvserver.ugent.be/apt/ubuntu focal stable. (I also found an easier way to add new repo: Open Software & Updates application; select 'Other Softwares'; and then add the repo location.)

Open Ubuntu Software. Search for Synaptic Package Manager and install it.

Now, open Synaptic Package Manager and search 'libfgsl'. Mark the libfgsl packages for installation. (If you haven't installed GSL, then search 'libgsl' and mark the relevant gsl packages also for installation.) Then select 'Apply'.

That's it.

For using FGSL and compiling with gfortran, I found helpful instructions in this post. I used the example program (testintegral.f90, but I saved it as fgsl_test.f90) provided in that post. In my case, the fgsl.mod file was in the location: /usr/include/fgsl/ and I used this command to compile my program

gfortran -I/usr/include/fgsl fgsl_test.f90 -lfgsl

I'm not sure whether it is necessary to add -lgsl and -lgslcblas but it worked fine without them.

Thuliyan
  • 39
  • 5