help-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-gsl] Problems with compiling Non Linear Fit Example -Solved


From: Dr. Jonny Birkhan
Subject: Re: [Help-gsl] Problems with compiling Non Linear Fit Example -Solved
Date: Thu, 17 May 2018 14:37:58 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

Dear Jerome,

my problem associated with compiling of the Non-Linear Fit Example could be solved by your hint, using the dedicated path to the libraries:

gcc -L/usr/local/lib -o fit fit.c -lm -lgsl -lgslcblas

I have used a Linux Mint 4.4.0-119-generic.

The gsl 2.4 was installed manually.

Best regards and thanks a lot for your hints!

Jonny



Am 17.02.2018 um 07:30 schrieb Dr. Jonny Birkhan:
Dear Jerome,

thanks a lot for your reply.

I have started working through your comments.

Concerning with using the standard ubuntu package I got the following:

1. I installed a completly fresh linux mint. No manual configuration.

2. Compiling the test.c (gcc -o test test.c -lm -lgsl -lgslcblas) led to the error that stdlib.h could not be found.

3. Installing libc6-dev could solve this issue.

4. But then I get the error message "fatal error: gsl/gsl_multifit_nlinear.h: file not found"

The reason seems to be that there is only a gsl_multifit_nlin.h in /usr/include/gsl. The gsl version is 2.1.

This was the reason why I installed gsl-2.4 manually for the test case I have reported on in my first mail.

If I switch to gsl_multifit_nlin.h in my source code, than a huge amount of functions like ....something_nlinear_.... cause warnings etc.

I will work further on that problem using your comments and will give additional feedback.

Thanks again and best regards,

Jonny


Am 16.02.2018 um 10:09 schrieb Jerome BENOIT:
Hi,

On 16/02/18 12:45, Dr. Jonny Birkhan wrote:
Dear all,

I have installed gsl-2.4 on a

Linux 4.4.0-103-generic #126-Ubuntu SMP Mon Dec 4 16:23:28 UTC 2017 x86_64.

The libraries are installed in /usr/local/lib.

My gcc version is: gcc (Ubuntu 5.4.0-6ubuntu1~16.04.6) 5.4.0 20160609


When I try to compile the Exponential Fitting Example I get the following messages:

gcc -LLIBDIR=/usr/local/lib -o test test.c -lm -lgsl -lgslcblas

/tmp/ccuzgEIN.o:: In function `callback':
test.c:(.text+0x2b1): undefined reference to `gsl_multifit_nlinear_residual' test.c:(.text+0x2c1): undefined reference to `gsl_multifit_nlinear_position' test.c:(.text+0x2d8): undefined reference to `gsl_multifit_nlinear_rcond'
/tmp/cclIWgcr.o: In function `main':
test.c:(.text+0x386): undefined reference to `gsl_multifit_nlinear_trust' test.c:(.text+0x399): undefined reference to `gsl_multifit_nlinear_default_parameters' test.c:(.text+0x640): undefined reference to `gsl_multifit_nlinear_alloc' test.c:(.text+0x665): undefined reference to `gsl_multifit_nlinear_winit' test.c:(.text+0x671): undefined reference to `gsl_multifit_nlinear_residual' test.c:(.text+0x6f6): undefined reference to `gsl_multifit_nlinear_driver'
test.c:(.text+0x708): undefined reference to `gsl_multifit_nlinear_jac'
test.c:(.text+0x729): undefined reference to `gsl_multifit_nlinear_covar' test.c:(.text+0x755): undefined reference to `gsl_multifit_nlinear_trs_name' test.c:(.text+0x764): undefined reference to `gsl_multifit_nlinear_name' test.c:(.text+0x78f): undefined reference to `gsl_multifit_nlinear_niter' test.c:(.text+0xa9e): undefined reference to `gsl_multifit_nlinear_free'
collect2: error: ld returned 1 exit status

I guess it's a problem with a missing library file. I couldn't find any bug report on that problem.

The source code is appended.

Can you help me?
This looks like an installation issue:
1] why do you not play with the GSL Ubuntu package instead ?
2] if you want (but you do not want) to play with a /usr/local installation, make sue it does not interfer with the /usr installation: in clear purge the libgsl-dev Ubuntu package and make sure the /usr/local/lib is taken into account ; 3] the _best_idea_, since GSL 2.4 has been packaged for Debian testing, install (or ask to your superuser to do so)
the GSL 2.4 Ubuntu package suite on your box;
4] try, $ gcc -I/usr/local/include -L/usr/local/lib -o test test.c -lgsl -lgslcblas -lm ## with relevant path .


Thanks in advance and best regards,
hth,
Jerome

Jonny Birkhan




--
#########################################

 Dr. Jonny Birkhan
 Ltg. Steuerung S-DALINAC/IT
 Strahlenschutzbeauftragter

 Technische Universität Darmstadt
 Institut für Kernpyhsik / FB 5
 AG Pietralla
 Schlossgartenstraße 9
 D-64289 Darmstadt

 Tel.: +0496151-16 21740
 Fax: +0496151-16 23305

#########################################




reply via email to

[Prev in Thread] Current Thread [Next in Thread]