class_public icon indicating copy to clipboard operation
class_public copied to clipboard

Python wrapper including GSL functions

Open wilmarcardonac opened this issue 5 years ago • 3 comments

Dear developers,

Quick question.

I implemented a model including a few special functions in 'background.c'. I use GSL library to implement these special functions; the code works fine and gives the expected output. However, I just noticed that these special functions are not recognized by the classy. I know I should modify classy.pyx, but I am not sure what exactly I should add and where I should include my modifications.

Any ideas ?

Many thanks in advance,

wilmarcardonac avatar Oct 18 '19 21:10 wilmarcardonac

Did you solve it? I encounter the same problem

stefanmarinus avatar Nov 03 '21 14:11 stefanmarinus

My guess is that you will have to tell the python/setup.py script to link against the gsl library. To this end you will probably have to add -lgsl to extra-link_args and the path to the gsl library to library_dirs within classy_ext = Extension(......) stating around line 40 of python/setup.py.

  • Patrick

pstoecker avatar Nov 03 '21 16:11 pstoecker

Hi Patric, Can you just tell me how to add the path of the GSL library to the "library_dirs" of the file "python/setup.py" ??

Actually I have to use the GSL library functions in order to add a numerical integrations in the file "background.c". But after the doing the modifications, when the I run the command "from classy import Class"; it shows the following error:--

ImportError: /home/aurindam/.local/lib/python3.8/site-packages/classy.cpython-38-x86_64-linux-gnu.so: undefined symbol: gsl_integration_qags

Can you give me any suggestion such that I can overcome this error??

Physics-16 avatar Nov 20 '23 07:11 Physics-16