help-gsl
[Top][All Lists]
Advanced

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

GSL Installation Procedure - Re: Help-gsl Digest, Vol 192, Issue 9


From: Simone Landini
Subject: GSL Installation Procedure - Re: Help-gsl Digest, Vol 192, Issue 9
Date: Mon, 30 Mar 2020 10:57:47 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0

Good Morning everyone, and thank you Francesco for your indications.

This is the procedure I used, even if it worked for me I would appreciate your opinion and check:

1. Download VSC2019: you may be linked to a page to download your native-language version, for me it was the Italian language version.

2. Install VSC2019 and close.

3. Open VSC2019: if you have a non-English language version you may need to change the language of your version into English, this how I did it:

    [Tools>Get Tools and Features] then [Language Pack] and select [English] so modify and close.

    In my case this was important for the following step.

4. Then I followed these instructions (for Windows) https://solarianprogrammer.com/2020/01/26/getting-started-gsl-gnu-scientific-library-windows-macos-linux/

    to install a pre-compiled GSL with "vcpkg" for Windows: if you have an non-English language pack in VSC2019 at the end of the process "vcpkg" may give some warning and an error:

    so GSL may not be ready for use, at least this is what happened to me.

5. I created a simple project (named: ConsoleApplication14) copy&paste from https://www.gnu.org/software/gsl/doc/html/usage.html#an-example-program

6. CRTL+F5 and it worked, here is the log

1>------ Build started: Project: ConsoleApplication14, Configuration: Debug Win32 ------
1>ConsoleApplication14.cpp
1>ConsoleApplication14.vcxproj -> C:\Users\[user]\Documents\Z_VisualStudioProjects\ConsoleApplication14\Debug\ConsoleApplication14.exe
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

I didn't check if you may now switch back to your native-language VSC2019 version.

I hope this may help someone else.

Best wishes

Simone


Il 29/03/2020 18:00, address@hidden ha scritto:
Send Help-gsl mailing list submissions to
        address@hidden

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.gnu.org/mailman/listinfo/help-gsl
or, via email, send a message with subject or body 'help' to
        address@hidden

You can reach the person managing the list at
        address@hidden

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Help-gsl digest..."


Today's Topics:

    1. GSL installation procdure and linker related problems
       (Simone Landini)
    2. Re: GSL installation procdure and linker related problems
       (Francesco Abbate)


----------------------------------------------------------------------

Message: 1
Date: Sat, 28 Mar 2020 20:42:25 +0100
From: Simone Landini <address@hidden>
To: address@hidden
Subject: GSL installation procdure and linker related problems
Message-ID: <address@hidden>
Content-Type: text/plain; charset=utf-8; format=flowed

Hi evereyone, I try to be more precise wrt my previous help request.

I am using Microsoft Visual Studio Community 2019 (VSC2019).

I installed GSL using the vcpkg tool but I also copy&paste a gsl folder
"C:\gsl" containing the latest gsl-2.6 files and folders: is this an
appropriated procedure?

Here is the code

#include <stdio.h>
// the path to the gsl folder is in "C:\gsl"
#include <C:\gsl\specfunc\gsl_sf_bessel.h>
// the example
int main (void){
    double x = 5.0;
    double y = gsl_sf_bessel_J0 (x);
    printf ("J0(%g) = %.18e\n", x, y);
    return 0;
}

The VSC2019 editor does not highlight the "#include
<C:\gsl\specfunc\gsl_sf_bessel.h>", so the library should be visible.

Then CTRL+F5 and I have 3 errors: this is what I get (I have an Italian
version of VSC2019: I translate below)

Codice Descrizione Progetto
File                                                     Riga
E1696    impossibile aprire il codice errore "gsl/gsl_mode.h" del file
origine    ConsoleApplication5 C:\gsl\specfunc\gsl_sf_bessel.h    26

Code     Description Project
File                                                     Row
E1696    impossible to open "gsl/gsl_mode.h" of the origin file
                 ConsoleApplication5 C:\gsl\specfunc\gsl_sf_bessel.h    26

The same errors for "gsl/gsl_precison.h" and "gsl/gsl_sf_result.h"

Are these linker related errors?

How can I specify library name and path to the linker?

Thank you

Simone




------------------------------

Message: 2
Date: Sat, 28 Mar 2020 23:02:55 +0100
From: Francesco Abbate <address@hidden>
To: Simone Landini <address@hidden>
Cc: address@hidden
Subject: Re: GSL installation procdure and linker related problems
Message-ID:
        <CAABEgWoZwmFC+2gObdv-hQRkaWeSoJBV5zUsRu=address@hidden>
Content-Type: text/plain; charset="UTF-8"

Hi Simone,

the errors that you are getting are compile errors, not linking
errors. What happens is that Visual Studio needs to locate the header
files like "gsl/gsl_mode.h" but apparently it cannot found them.

Normally you should make sure that you have actually installed these
files and take note of where they are stored. These files are all
provided by the GSL library. Once you are sure about where the header
files are located you should go in the visual studio project and
instruct application about the directory where to find them.

You may follow the instructions here:

https://stackoverflow.com/questions/4445418/how-to-add-additional-libraries-to-visual-studio-project

I am reporting here the instructions:

------------ extract
For Visual Studio you'll want to right click on your project in the
solution explorer and then click on Properties.

Next open Configuration Properties and then Linker.

Now you want to add the folder you have the Allegro libraries in to
Additional Library Directories,

Linker -> Input you'll add the actual library files under Additional
Dependencies.

For the Header Files you'll also want to include their directories
under C/C++ -> Additional Include Directories.

If there is a dll have a copy of it in your main project folder, and done.
----------- end of the extract

In your case it is the GSL library instead of "Allegro" but the same
instructions applies. So you basically have to instruct the visual
studio project (solution)

- where the header files are located (gsl/gsl_mode.h etc, all the
files terminating in .h). This is required for the compilation step.
- where the library is located (.dll or .lib) so that it can be linked
for the final step.

For the GSL library you may have actually two libraries, libgsl.dll
and libgslcblas.dll.

Make sure that you have the libraries, where they are located and
their names and add them into the project as explained above.

Please note that if you downloaded the source code of the GSL library
you will *not* have the libraries to link with. For this purpose you
need to download the pre-compiled libraries for visual studio, for
example using vcpkg.

I hope this will be enough to get you started but I will be glad to
assist you further!

Kinds regards
Francesco



------------------------------

Subject: Digest Footer

_______________________________________________
Help-gsl mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-gsl


------------------------------

End of Help-gsl Digest, Vol 192, Issue 9
****************************************


reply via email to

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