public inbox for gsl-discuss@sourceware.org
 help / color / mirror / Atom feed
* Problem with Cygwin installation: FAQ?
  2001-12-19 13:20 Problem with Cygwin installation: FAQ? Adam Kleczkowski
@ 2001-11-19  0:05 ` Adam Kleczkowski
  2001-12-19 13:20 ` Brian Gough
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 12+ messages in thread
From: Adam Kleczkowski @ 2001-11-19  0:05 UTC (permalink / raw)
  To: Gsl-Discuss

[-- Attachment #1: Type: text/plain, Size: 1525 bytes --]

I am trying to install/compile/run GSL v. 1.0 in the Cygwin environment
(most up-to-date version), gcc 2.95.3-5. This has created a series of
various problems and I have not been successful so far.

Cygwin is installed in c:\cygwin

GSL libraries, include files etc in c:\cygwin\usr\bin etc, binaries in
c:\cygwin\bin

Testing by using example programs from the manual (pages referring to PDF
format):

Page 40:        poly.c (finding roots of the polynomial)
Page 162:       random.c (testing a random number generator)
Page 266:       vanderpol.c (Vanderpol oscilator)

Using the mingw installation.
All programs compile well, but:
a. poly.c executes with no problem
b. random.c and vanderpol.c crash giving the message:

      0 [main] A 86798653 handle_exceptions: Exception:
STATUS_ACCESS_VIOLATION
   1647 [main] A 86798653 open_stackdumpfile: Dumping stack trace to
RANDOM.EXE.stack
dump

I compile using simply
gcc -o random.exe -c random.c -lgsl -lm

I attach the programs. Any clues? In fact, I want to use random number
generators and ODE solver in my project, and these two have not compiled
well...
Thanks for a response in advance. If there is a reasonable FAQ that covers
the Cygwin installation, I would love to know where to find it. I tried to
compile GSL from the source under Cygwin (./configure, make, make install)
but run into horrific problems.
--
Adam Kleczkowski
Dept. Plant Sciences, University of Cambridge
e-mail: adam@kleczkowski.net
http://mathbio.com/ (work) http://kleczkowski.net/ (private)

[-- Attachment #2: vanderp.c --]
[-- Type: application/octet-stream, Size: 1354 bytes --]

#include <stdio.h>
#include <gsl/gsl_errno.h>
#include <gsl/gsl_matrix.h>
#include <gsl/gsl_odeiv.h>
int
func (double t, const double y[], double f[], void *params)
{
double mu = *(double *)params;
f[0] = y[1];
f[1] = -y[0] - mu*y[1]*(y[0]*y[0] - 1);
return GSL_SUCCESS;
}
int
jac (double t, const double y[], double *dfdy, double dfdt[],
void *params)
{
double mu = *(double *)params;
gsl_matrix_view dfdy_mat = gsl_matrix_view_array (dfdy, 2, 2);
gsl_matrix_set (&dfdy_mat.matrix, 0, 0, 0.0);
gsl_matrix_set (&dfdy_mat.matrix, 0, 1, 1.0);
gsl_matrix_set (&dfdy_mat.matrix, 1, 0, -2.0*mu*y[0]*y[1] - 1.0);
gsl_matrix_set (&dfdy_mat.matrix, 1, 1, -mu*(y[0]*y[0] - 1.0));
dfdt[0] = 0.0;
dfdt[1] = 0.0;
return GSL_SUCCESS;
}
int
main (void)
{
const gsl_odeiv_step_type * T = gsl_odeiv_step_rk8pd;
gsl_odeiv_step * s = gsl_odeiv_step_alloc (T, 2);
gsl_odeiv_control * c = gsl_odeiv_control_y_new (1e-6, 0.0);
gsl_odeiv_evolve * e = gsl_odeiv_evolve_alloc (2);
double mu = 10;
gsl_odeiv_system sys = {func, jac, 2, &mu};
double t = 0.0, t1 = 100.0;
double h = 1e-6;
double y[2] = { 1.0, 0.0 } ;
gsl_ieee_env_setup();
while (t < t1)
{
int status = gsl_odeiv_evolve_apply(e, c, s, &sys, &t, t1, &h, y);
if (status != GSL_SUCCESS)
break;
printf("%.5e %.5e %.5e\n", t, y[0], y[1]);
}
gsl_odeiv_evolve_free(e);
gsl_odeiv_control_free(c);
gsl_odeiv_step_free(s);
}

[-- Attachment #3: random.c --]
[-- Type: application/octet-stream, Size: 352 bytes --]

#include <stdio.h>
#include <gsl/gsl_rng.h>
gsl_rng * r; /* global generator */

int main(void)
{
const gsl_rng_type * T;

gsl_rng_env_setup();
T = gsl_rng_rand48;
r = gsl_rng_alloc(T);
printf("generator type: %s\n", gsl_rng_name(r));
printf("seed = %u\n", gsl_rng_default_seed);
printf("first value = %u\n", gsl_rng_get(r));
return 0;
}

[-- Attachment #4: poly.c --]
[-- Type: application/octet-stream, Size: 372 bytes --]

#include <stdio.h>
#include <gsl/gsl_poly.h>
int
main ()
{
int i;
double a[6] = { -1, 0, 0, 0, 0, 1 }; /* P(x) = -1 + x^5 */
double z[10];
gsl_poly_complex_workspace * w = gsl_poly_complex_workspace_alloc (6) ;
gsl_poly_complex_solve (a, 6, w, z) ;
gsl_poly_complex_workspace_free (w) ;
for (i = 0; i < 5 ; i++)
{
printf("z%d = %+.18f %+.18f\n", i, z[2*i], z[2*i+1]) ;
}
}

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Problem with Cygwin installation: FAQ?
  2001-12-19 13:20 ` Brian Gough
@ 2001-11-19  9:00   ` Brian Gough
  2001-12-19 13:20   ` [Gnuwin32-users] " GnuWin32
  2001-12-19 13:20   ` Brian Gough
  2 siblings, 0 replies; 12+ messages in thread
From: Brian Gough @ 2001-11-19  9:00 UTC (permalink / raw)
  To: adam; +Cc: Gsl-Discuss, gnuwin32-users

Hi,

The Cygwin version of GSL is a third-party package made the GnuWin32
group. I don't know much about it I'm afraid -- I get the same error
as you, and I can't figure it out either.  Sorry I can't offer any
more help than that. I'm cc'ing this message to their mailing list to
see if they can offer any suggestions.

Their distribution does include the similar program "gsl-randist"
which generates random numbers correctly, so it must be possible to
get this to work -- perhaps it just requires some special Windows
compiler option that I'm not familiar with.

regards
Brian Gough



Adam Kleczkowski writes:
 > I am trying to install/compile/run GSL v. 1.0 in the Cygwin environment
 > (most up-to-date version), gcc 2.95.3-5. This has created a series of
 > various problems and I have not been successful so far.
 > 
 > Cygwin is installed in c:\cygwin
 > 
 > GSL libraries, include files etc in c:\cygwin\usr\bin etc, binaries in
 > c:\cygwin\bin
 > 
 > Testing by using example programs from the manual (pages referring to PDF
 > format):
 > 
 > Page 40:        poly.c (finding roots of the polynomial)
 > Page 162:       random.c (testing a random number generator)
 > Page 266:       vanderpol.c (Vanderpol oscilator)
 > 
 > Using the mingw installation.
 > All programs compile well, but:
 > a. poly.c executes with no problem
 > b. random.c and vanderpol.c crash giving the message:
 > 
 >       0 [main] A 86798653 handle_exceptions: Exception:
 > STATUS_ACCESS_VIOLATION
 >    1647 [main] A 86798653 open_stackdumpfile: Dumping stack trace to
 > RANDOM.EXE.stack
 > dump
 > 
 > I compile using simply
 > gcc -o random.exe -c random.c -lgsl -lm
 > 
 > I attach the programs. Any clues? In fact, I want to use random number
 > generators and ODE solver in my project, and these two have not compiled
 > well...
 > Thanks for a response in advance. If there is a reasonable FAQ that covers
 > the Cygwin installation, I would love to know where to find it. I tried to
 > compile GSL from the source under Cygwin (./configure, make, make install)
 > but run into horrific problems.
 > --
 > Adam Kleczkowski
 > Dept. Plant Sciences, University of Cambridge
 > e-mail: adam@kleczkowski.net
 > http://mathbio.com/ (work) http://kleczkowski.net/ (private)

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Gnuwin32-users] Re: Problem with Cygwin installation: FAQ?
  2001-12-19 13:20   ` [Gnuwin32-users] " GnuWin32
@ 2001-11-20  0:58     ` GnuWin32
  2001-12-19 13:20     ` Adam Kleczkowski
  1 sibling, 0 replies; 12+ messages in thread
From: GnuWin32 @ 2001-11-20  0:58 UTC (permalink / raw)
  To: Brian Gough, adam; +Cc: Gsl-Discuss, gnuwin32-users

The Gnuwin32 port at http://gnuwin32.sourceforge.net/ is not a Cygwin port,
but a native MS-Windows port (it only depends on msvcrt.dll, which is
supplied on all MS-Windows systems). When running 'make check', all went
well, and there were no errors (see check.log in gsl-1.0-src.zip). The
Gnuwin32 port comes with import libraries for Mingw (GCC for MS-Windows),
MSVC and Borland C.
I'm not sure what you have been trying to do. Do you use Cygwin to compile
Gsl? Usually libraries or programs that compile well under Linux, also
compile without any change under Cygwin (configure, make, make check, make
install), and in this case I'm not sure how your problem can be solved. I
could try a compilation under Cygwin, but this will have to wait until next
weekend.
Or did you compile a program under Cygwin (i.e. with the Cygwin GCC
compiler), while linking to the Gnuwin32 dll (by means of the Gnuwin32
import library gsl.dll.a)? In that case, some things will certainly go
wrong, e.g. because Cygwin dll's use an entry point that is different from
MS-Windows dll's, and because Cygwin dll's depend on cygwin1.dll and so you
end up with a program that depends on both cygwin1.dll (because you compiled
it under Cygwin) and msvcrt.dll (because gsl.dll depends on msvcrt.dll). And
since cygwin1.dll and msvcrt.dll export the same functions, the program will
crash. If you quikview an executable, you will see on which dll's it depends
directly; so if your executable depends on cygwin1.dll, this probably is the
cause of your problem. To solve this, make sure that  Mingw-GCC comes first
in your path, before cygwin\bin, and that the GCC compiler won't look after
libraries in cygwin\lib.
If you still have problems after this, then send me some sample programs,
and I will try whether they compile and execute well on my own system
(Windows 98).

Kees Zeelenberg

----- Oorspronkelijk bericht -----
Van: "Brian Gough" <bjg@network-theory.co.uk>
Aan: <adam@kleczkowski.net>
CC: "Gsl-Discuss" <gsl-discuss@sources.redhat.com>;
<gnuwin32-users@lists.sourceforge.net>
Verzonden: dinsdag 27 november 2001 20:47
Onderwerp: [Gnuwin32-users] Re: Problem with Cygwin installation: FAQ?


> Hi,
>
> The Cygwin version of GSL is a third-party package made the GnuWin32
> group. I don't know much about it I'm afraid -- I get the same error
> as you, and I can't figure it out either.  Sorry I can't offer any
> more help than that. I'm cc'ing this message to their mailing list to
> see if they can offer any suggestions.
>
> Their distribution does include the similar program "gsl-randist"
> which generates random numbers correctly, so it must be possible to
> get this to work -- perhaps it just requires some special Windows
> compiler option that I'm not familiar with.
>
> regards
> Brian Gough
>
>
>
> Adam Kleczkowski writes:
>  > I am trying to install/compile/run GSL v. 1.0 in the Cygwin environment
>  > (most up-to-date version), gcc 2.95.3-5. This has created a series of
>  > various problems and I have not been successful so far.
>  >
>  > Cygwin is installed in c:\cygwin
>  >
>  > GSL libraries, include files etc in c:\cygwin\usr\bin etc, binaries in
>  > c:\cygwin\bin
>  >
>  > Testing by using example programs from the manual (pages referring to
PDF
>  > format):
>  >
>  > Page 40:        poly.c (finding roots of the polynomial)
>  > Page 162:       random.c (testing a random number generator)
>  > Page 266:       vanderpol.c (Vanderpol oscilator)
>  >
>  > Using the mingw installation.
>  > All programs compile well, but:
>  > a. poly.c executes with no problem
>  > b. random.c and vanderpol.c crash giving the message:
>  >
>  >       0 [main] A 86798653 handle_exceptions: Exception:
>  > STATUS_ACCESS_VIOLATION
>  >    1647 [main] A 86798653 open_stackdumpfile: Dumping stack trace to
>  > RANDOM.EXE.stack
>  > dump
>  >
>  > I compile using simply
>  > gcc -o random.exe -c random.c -lgsl -lm
>  >
>  > I attach the programs. Any clues? In fact, I want to use random number
>  > generators and ODE solver in my project, and these two have not
compiled
>  > well...
>  > Thanks for a response in advance. If there is a reasonable FAQ that
covers
>  > the Cygwin installation, I would love to know where to find it. I tried
to
>  > compile GSL from the source under Cygwin (./configure, make, make
install)
>  > but run into horrific problems.
>  > --
>  > Adam Kleczkowski
>  > Dept. Plant Sciences, University of Cambridge
>  > e-mail: adam@kleczkowski.net
>  > http://mathbio.com/ (work) http://kleczkowski.net/ (private)
>
> _______________________________________________
> Gnuwin32-users mailing list
> Gnuwin32-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gnuwin32-users
>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Problem with Cygwin installation: FAQ?
  2001-12-19 13:20 ` Gerrit P. Haase
@ 2001-11-20  3:02   ` Gerrit P. Haase
  0 siblings, 0 replies; 12+ messages in thread
From: Gerrit P. Haase @ 2001-11-20  3:02 UTC (permalink / raw)
  To: Adam Kleczkowski; +Cc: Gsl-Discuss, adam

Hallo Adam,

Am 2001-11-27 um 13:33 schriebst du:

> I am trying to install/compile/run GSL v. 1.0 in the Cygwin environment
> (most up-to-date version), gcc 2.95.3-5. This has created a series of
> various problems and I have not been successful so far.

> Cygwin is installed in c:\cygwin

> GSL libraries, include files etc in c:\cygwin\usr\bin etc, binaries in
> c:\cygwin\bin

> Testing by using example programs from the manual (pages referring to PDF
> format):

> Page 40:        poly.c (finding roots of the polynomial)
> Page 162:       random.c (testing a random number generator)
> Page 266:       vanderpol.c (Vanderpol oscilator)

> Using the mingw installation.
> All programs compile well, but:
> a. poly.c executes with no problem
> b. random.c and vanderpol.c crash giving the message:

>       0 [main] A 86798653 handle_exceptions: Exception:
> STATUS_ACCESS_VIOLATION
>    1647 [main] A 86798653 open_stackdumpfile: Dumping stack trace to
> RANDOM.EXE.stack
> dump

> I compile using simply
> gcc -o random.exe -c random.c -lgsl -lm

As Kees wrote, you cannot mix cygwin and mingw, if you compile *with*
cygwin1.dll then you do correct like above, if you have a dsl lib compiled
*with* mingw you need to add -mno-cygwin to your link line to get a native
windows binary.

gcc -mno-cygwin -o random.exe -c random.c -lgsl -l...

and you need to add the correct libs (I don't know them, Kees wrote about
dependencies msvcrt and so), libm, libg, libc are all the same as libcygwin.

Ciao,

Gerrit P. Haase                            mailto:gp@familiehaase.de
-- 
=^..^=

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: [Gnuwin32-users] Re: Problem with Cygwin installation: FAQ?
  2001-12-19 13:20     ` Adam Kleczkowski
@ 2001-11-20 10:13       ` Adam Kleczkowski
  0 siblings, 0 replies; 12+ messages in thread
From: Adam Kleczkowski @ 2001-11-20 10:13 UTC (permalink / raw)
  To: GnuWin32; +Cc: Gsl-Discuss, gnuwin32-users, Brian Gough

Thanks for the replies. I realise now (having also thought it through last
night) that I have neither been particularly clear in my e-mail nor
consistent in what I was trying to achieve. Thank you for all suggestions as
they helped me understand the installation procedure and the duality between
Cygwin and gnuwin32 port.
As Kees pointed out, I managed to mix the two ports. I used sources from the
gnuwin32 port in hope that I can configure and compile them into libraries
that work under Cygwin port. Since that failed, I installed gnuwin32
binaries/libraries but used Cygwin gcc to compile the test programs.
Surprisingly that worked for some of them, and left me puzzled enough to
send this query.
I have just downloaded the 'original' sources, installed them successfully
using Cygwin port and got no error messages whatsoever. Thanks again for
help,
Thanks also to all who are working on gnuwin32, Cygwin and gsl.
Adam
--
Adam Kleczkowski
Dept. Plant Sciences, University of Cambridge
e-mail: adam@kleczkowski.net
http://mathbio.com/ (work) http://kleczkowski.net/ (private)


^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: [Gnuwin32-users] Re: Problem with Cygwin installation: FAQ?
  2001-12-19 13:20   ` [Gnuwin32-users] " GnuWin32
  2001-11-20  0:58     ` GnuWin32
@ 2001-12-19 13:20     ` Adam Kleczkowski
  2001-11-20 10:13       ` Adam Kleczkowski
  1 sibling, 1 reply; 12+ messages in thread
From: Adam Kleczkowski @ 2001-12-19 13:20 UTC (permalink / raw)
  To: GnuWin32; +Cc: Gsl-Discuss, gnuwin32-users, Brian Gough

Thanks for the replies. I realise now (having also thought it through last
night) that I have neither been particularly clear in my e-mail nor
consistent in what I was trying to achieve. Thank you for all suggestions as
they helped me understand the installation procedure and the duality between
Cygwin and gnuwin32 port.
As Kees pointed out, I managed to mix the two ports. I used sources from the
gnuwin32 port in hope that I can configure and compile them into libraries
that work under Cygwin port. Since that failed, I installed gnuwin32
binaries/libraries but used Cygwin gcc to compile the test programs.
Surprisingly that worked for some of them, and left me puzzled enough to
send this query.
I have just downloaded the 'original' sources, installed them successfully
using Cygwin port and got no error messages whatsoever. Thanks again for
help,
Thanks also to all who are working on gnuwin32, Cygwin and gsl.
Adam
--
Adam Kleczkowski
Dept. Plant Sciences, University of Cambridge
e-mail: adam@kleczkowski.net
http://mathbio.com/ (work) http://kleczkowski.net/ (private)


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Problem with Cygwin installation: FAQ?
  2001-12-19 13:20 Problem with Cygwin installation: FAQ? Adam Kleczkowski
  2001-11-19  0:05 ` Adam Kleczkowski
@ 2001-12-19 13:20 ` Brian Gough
  2001-11-19  9:00   ` Brian Gough
                     ` (2 more replies)
  2001-12-19 13:20 ` Adam Kleczkowski
  2001-12-19 13:20 ` Gerrit P. Haase
  3 siblings, 3 replies; 12+ messages in thread
From: Brian Gough @ 2001-12-19 13:20 UTC (permalink / raw)
  To: adam; +Cc: Gsl-Discuss, gnuwin32-users

Hi,

The Cygwin version of GSL is a third-party package made the GnuWin32
group. I don't know much about it I'm afraid -- I get the same error
as you, and I can't figure it out either.  Sorry I can't offer any
more help than that. I'm cc'ing this message to their mailing list to
see if they can offer any suggestions.

Their distribution does include the similar program "gsl-randist"
which generates random numbers correctly, so it must be possible to
get this to work -- perhaps it just requires some special Windows
compiler option that I'm not familiar with.

regards
Brian Gough



Adam Kleczkowski writes:
 > I am trying to install/compile/run GSL v. 1.0 in the Cygwin environment
 > (most up-to-date version), gcc 2.95.3-5. This has created a series of
 > various problems and I have not been successful so far.
 > 
 > Cygwin is installed in c:\cygwin
 > 
 > GSL libraries, include files etc in c:\cygwin\usr\bin etc, binaries in
 > c:\cygwin\bin
 > 
 > Testing by using example programs from the manual (pages referring to PDF
 > format):
 > 
 > Page 40:        poly.c (finding roots of the polynomial)
 > Page 162:       random.c (testing a random number generator)
 > Page 266:       vanderpol.c (Vanderpol oscilator)
 > 
 > Using the mingw installation.
 > All programs compile well, but:
 > a. poly.c executes with no problem
 > b. random.c and vanderpol.c crash giving the message:
 > 
 >       0 [main] A 86798653 handle_exceptions: Exception:
 > STATUS_ACCESS_VIOLATION
 >    1647 [main] A 86798653 open_stackdumpfile: Dumping stack trace to
 > RANDOM.EXE.stack
 > dump
 > 
 > I compile using simply
 > gcc -o random.exe -c random.c -lgsl -lm
 > 
 > I attach the programs. Any clues? In fact, I want to use random number
 > generators and ODE solver in my project, and these two have not compiled
 > well...
 > Thanks for a response in advance. If there is a reasonable FAQ that covers
 > the Cygwin installation, I would love to know where to find it. I tried to
 > compile GSL from the source under Cygwin (./configure, make, make install)
 > but run into horrific problems.
 > --
 > Adam Kleczkowski
 > Dept. Plant Sciences, University of Cambridge
 > e-mail: adam@kleczkowski.net
 > http://mathbio.com/ (work) http://kleczkowski.net/ (private)

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Gnuwin32-users] Re: Problem with Cygwin installation: FAQ?
  2001-12-19 13:20 ` Brian Gough
  2001-11-19  9:00   ` Brian Gough
@ 2001-12-19 13:20   ` GnuWin32
  2001-11-20  0:58     ` GnuWin32
  2001-12-19 13:20     ` Adam Kleczkowski
  2001-12-19 13:20   ` Brian Gough
  2 siblings, 2 replies; 12+ messages in thread
From: GnuWin32 @ 2001-12-19 13:20 UTC (permalink / raw)
  To: Brian Gough, adam; +Cc: Gsl-Discuss, gnuwin32-users

The Gnuwin32 port at http://gnuwin32.sourceforge.net/ is not a Cygwin port,
but a native MS-Windows port (it only depends on msvcrt.dll, which is
supplied on all MS-Windows systems). When running 'make check', all went
well, and there were no errors (see check.log in gsl-1.0-src.zip). The
Gnuwin32 port comes with import libraries for Mingw (GCC for MS-Windows),
MSVC and Borland C.
I'm not sure what you have been trying to do. Do you use Cygwin to compile
Gsl? Usually libraries or programs that compile well under Linux, also
compile without any change under Cygwin (configure, make, make check, make
install), and in this case I'm not sure how your problem can be solved. I
could try a compilation under Cygwin, but this will have to wait until next
weekend.
Or did you compile a program under Cygwin (i.e. with the Cygwin GCC
compiler), while linking to the Gnuwin32 dll (by means of the Gnuwin32
import library gsl.dll.a)? In that case, some things will certainly go
wrong, e.g. because Cygwin dll's use an entry point that is different from
MS-Windows dll's, and because Cygwin dll's depend on cygwin1.dll and so you
end up with a program that depends on both cygwin1.dll (because you compiled
it under Cygwin) and msvcrt.dll (because gsl.dll depends on msvcrt.dll). And
since cygwin1.dll and msvcrt.dll export the same functions, the program will
crash. If you quikview an executable, you will see on which dll's it depends
directly; so if your executable depends on cygwin1.dll, this probably is the
cause of your problem. To solve this, make sure that  Mingw-GCC comes first
in your path, before cygwin\bin, and that the GCC compiler won't look after
libraries in cygwin\lib.
If you still have problems after this, then send me some sample programs,
and I will try whether they compile and execute well on my own system
(Windows 98).

Kees Zeelenberg

----- Oorspronkelijk bericht -----
Van: "Brian Gough" <bjg@network-theory.co.uk>
Aan: <adam@kleczkowski.net>
CC: "Gsl-Discuss" <gsl-discuss@sources.redhat.com>;
<gnuwin32-users@lists.sourceforge.net>
Verzonden: dinsdag 27 november 2001 20:47
Onderwerp: [Gnuwin32-users] Re: Problem with Cygwin installation: FAQ?


> Hi,
>
> The Cygwin version of GSL is a third-party package made the GnuWin32
> group. I don't know much about it I'm afraid -- I get the same error
> as you, and I can't figure it out either.  Sorry I can't offer any
> more help than that. I'm cc'ing this message to their mailing list to
> see if they can offer any suggestions.
>
> Their distribution does include the similar program "gsl-randist"
> which generates random numbers correctly, so it must be possible to
> get this to work -- perhaps it just requires some special Windows
> compiler option that I'm not familiar with.
>
> regards
> Brian Gough
>
>
>
> Adam Kleczkowski writes:
>  > I am trying to install/compile/run GSL v. 1.0 in the Cygwin environment
>  > (most up-to-date version), gcc 2.95.3-5. This has created a series of
>  > various problems and I have not been successful so far.
>  >
>  > Cygwin is installed in c:\cygwin
>  >
>  > GSL libraries, include files etc in c:\cygwin\usr\bin etc, binaries in
>  > c:\cygwin\bin
>  >
>  > Testing by using example programs from the manual (pages referring to
PDF
>  > format):
>  >
>  > Page 40:        poly.c (finding roots of the polynomial)
>  > Page 162:       random.c (testing a random number generator)
>  > Page 266:       vanderpol.c (Vanderpol oscilator)
>  >
>  > Using the mingw installation.
>  > All programs compile well, but:
>  > a. poly.c executes with no problem
>  > b. random.c and vanderpol.c crash giving the message:
>  >
>  >       0 [main] A 86798653 handle_exceptions: Exception:
>  > STATUS_ACCESS_VIOLATION
>  >    1647 [main] A 86798653 open_stackdumpfile: Dumping stack trace to
>  > RANDOM.EXE.stack
>  > dump
>  >
>  > I compile using simply
>  > gcc -o random.exe -c random.c -lgsl -lm
>  >
>  > I attach the programs. Any clues? In fact, I want to use random number
>  > generators and ODE solver in my project, and these two have not
compiled
>  > well...
>  > Thanks for a response in advance. If there is a reasonable FAQ that
covers
>  > the Cygwin installation, I would love to know where to find it. I tried
to
>  > compile GSL from the source under Cygwin (./configure, make, make
install)
>  > but run into horrific problems.
>  > --
>  > Adam Kleczkowski
>  > Dept. Plant Sciences, University of Cambridge
>  > e-mail: adam@kleczkowski.net
>  > http://mathbio.com/ (work) http://kleczkowski.net/ (private)
>
> _______________________________________________
> Gnuwin32-users mailing list
> Gnuwin32-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gnuwin32-users
>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Problem with Cygwin installation: FAQ?
  2001-12-19 13:20 Problem with Cygwin installation: FAQ? Adam Kleczkowski
                   ` (2 preceding siblings ...)
  2001-12-19 13:20 ` Adam Kleczkowski
@ 2001-12-19 13:20 ` Gerrit P. Haase
  2001-11-20  3:02   ` Gerrit P. Haase
  3 siblings, 1 reply; 12+ messages in thread
From: Gerrit P. Haase @ 2001-12-19 13:20 UTC (permalink / raw)
  To: Adam Kleczkowski; +Cc: Gsl-Discuss, adam

Hallo Adam,

Am 2001-11-27 um 13:33 schriebst du:

> I am trying to install/compile/run GSL v. 1.0 in the Cygwin environment
> (most up-to-date version), gcc 2.95.3-5. This has created a series of
> various problems and I have not been successful so far.

> Cygwin is installed in c:\cygwin

> GSL libraries, include files etc in c:\cygwin\usr\bin etc, binaries in
> c:\cygwin\bin

> Testing by using example programs from the manual (pages referring to PDF
> format):

> Page 40:        poly.c (finding roots of the polynomial)
> Page 162:       random.c (testing a random number generator)
> Page 266:       vanderpol.c (Vanderpol oscilator)

> Using the mingw installation.
> All programs compile well, but:
> a. poly.c executes with no problem
> b. random.c and vanderpol.c crash giving the message:

>       0 [main] A 86798653 handle_exceptions: Exception:
> STATUS_ACCESS_VIOLATION
>    1647 [main] A 86798653 open_stackdumpfile: Dumping stack trace to
> RANDOM.EXE.stack
> dump

> I compile using simply
> gcc -o random.exe -c random.c -lgsl -lm

As Kees wrote, you cannot mix cygwin and mingw, if you compile *with*
cygwin1.dll then you do correct like above, if you have a dsl lib compiled
*with* mingw you need to add -mno-cygwin to your link line to get a native
windows binary.

gcc -mno-cygwin -o random.exe -c random.c -lgsl -l...

and you need to add the correct libs (I don't know them, Kees wrote about
dependencies msvcrt and so), libm, libg, libc are all the same as libcygwin.

Ciao,

Gerrit P. Haase                            mailto:gp@familiehaase.de
-- 
=^..^=

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Problem with Cygwin installation: FAQ?
@ 2001-12-19 13:20 Adam Kleczkowski
  2001-11-19  0:05 ` Adam Kleczkowski
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Adam Kleczkowski @ 2001-12-19 13:20 UTC (permalink / raw)
  To: Gsl-Discuss

[-- Attachment #1: Type: text/plain, Size: 1525 bytes --]

I am trying to install/compile/run GSL v. 1.0 in the Cygwin environment
(most up-to-date version), gcc 2.95.3-5. This has created a series of
various problems and I have not been successful so far.

Cygwin is installed in c:\cygwin

GSL libraries, include files etc in c:\cygwin\usr\bin etc, binaries in
c:\cygwin\bin

Testing by using example programs from the manual (pages referring to PDF
format):

Page 40:        poly.c (finding roots of the polynomial)
Page 162:       random.c (testing a random number generator)
Page 266:       vanderpol.c (Vanderpol oscilator)

Using the mingw installation.
All programs compile well, but:
a. poly.c executes with no problem
b. random.c and vanderpol.c crash giving the message:

      0 [main] A 86798653 handle_exceptions: Exception:
STATUS_ACCESS_VIOLATION
   1647 [main] A 86798653 open_stackdumpfile: Dumping stack trace to
RANDOM.EXE.stack
dump

I compile using simply
gcc -o random.exe -c random.c -lgsl -lm

I attach the programs. Any clues? In fact, I want to use random number
generators and ODE solver in my project, and these two have not compiled
well...
Thanks for a response in advance. If there is a reasonable FAQ that covers
the Cygwin installation, I would love to know where to find it. I tried to
compile GSL from the source under Cygwin (./configure, make, make install)
but run into horrific problems.
--
Adam Kleczkowski
Dept. Plant Sciences, University of Cambridge
e-mail: adam@kleczkowski.net
http://mathbio.com/ (work) http://kleczkowski.net/ (private)

[-- Attachment #2: vanderp.c --]
[-- Type: application/octet-stream, Size: 1354 bytes --]

#include <stdio.h>
#include <gsl/gsl_errno.h>
#include <gsl/gsl_matrix.h>
#include <gsl/gsl_odeiv.h>
int
func (double t, const double y[], double f[], void *params)
{
double mu = *(double *)params;
f[0] = y[1];
f[1] = -y[0] - mu*y[1]*(y[0]*y[0] - 1);
return GSL_SUCCESS;
}
int
jac (double t, const double y[], double *dfdy, double dfdt[],
void *params)
{
double mu = *(double *)params;
gsl_matrix_view dfdy_mat = gsl_matrix_view_array (dfdy, 2, 2);
gsl_matrix_set (&dfdy_mat.matrix, 0, 0, 0.0);
gsl_matrix_set (&dfdy_mat.matrix, 0, 1, 1.0);
gsl_matrix_set (&dfdy_mat.matrix, 1, 0, -2.0*mu*y[0]*y[1] - 1.0);
gsl_matrix_set (&dfdy_mat.matrix, 1, 1, -mu*(y[0]*y[0] - 1.0));
dfdt[0] = 0.0;
dfdt[1] = 0.0;
return GSL_SUCCESS;
}
int
main (void)
{
const gsl_odeiv_step_type * T = gsl_odeiv_step_rk8pd;
gsl_odeiv_step * s = gsl_odeiv_step_alloc (T, 2);
gsl_odeiv_control * c = gsl_odeiv_control_y_new (1e-6, 0.0);
gsl_odeiv_evolve * e = gsl_odeiv_evolve_alloc (2);
double mu = 10;
gsl_odeiv_system sys = {func, jac, 2, &mu};
double t = 0.0, t1 = 100.0;
double h = 1e-6;
double y[2] = { 1.0, 0.0 } ;
gsl_ieee_env_setup();
while (t < t1)
{
int status = gsl_odeiv_evolve_apply(e, c, s, &sys, &t, t1, &h, y);
if (status != GSL_SUCCESS)
break;
printf("%.5e %.5e %.5e\n", t, y[0], y[1]);
}
gsl_odeiv_evolve_free(e);
gsl_odeiv_control_free(c);
gsl_odeiv_step_free(s);
}

[-- Attachment #3: random.c --]
[-- Type: application/octet-stream, Size: 352 bytes --]

#include <stdio.h>
#include <gsl/gsl_rng.h>
gsl_rng * r; /* global generator */

int main(void)
{
const gsl_rng_type * T;

gsl_rng_env_setup();
T = gsl_rng_rand48;
r = gsl_rng_alloc(T);
printf("generator type: %s\n", gsl_rng_name(r));
printf("seed = %u\n", gsl_rng_default_seed);
printf("first value = %u\n", gsl_rng_get(r));
return 0;
}

[-- Attachment #4: poly.c --]
[-- Type: application/octet-stream, Size: 372 bytes --]

#include <stdio.h>
#include <gsl/gsl_poly.h>
int
main ()
{
int i;
double a[6] = { -1, 0, 0, 0, 0, 1 }; /* P(x) = -1 + x^5 */
double z[10];
gsl_poly_complex_workspace * w = gsl_poly_complex_workspace_alloc (6) ;
gsl_poly_complex_solve (a, 6, w, z) ;
gsl_poly_complex_workspace_free (w) ;
for (i = 0; i < 5 ; i++)
{
printf("z%d = %+.18f %+.18f\n", i, z[2*i], z[2*i+1]) ;
}
}

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Problem with Cygwin installation: FAQ?
  2001-12-19 13:20 ` Brian Gough
  2001-11-19  9:00   ` Brian Gough
  2001-12-19 13:20   ` [Gnuwin32-users] " GnuWin32
@ 2001-12-19 13:20   ` Brian Gough
  2 siblings, 0 replies; 12+ messages in thread
From: Brian Gough @ 2001-12-19 13:20 UTC (permalink / raw)
  To: adam; +Cc: gnuwin32-users

Hi,

The Cygwin version of GSL is a third-party package made the GnuWin32
group. I don't know much about it I'm afraid -- I get the same error
as you, and I can't figure it out either.  Sorry I can't offer any
more help than that. I'm cc'ing this message to their mailing list to
see if they can offer any suggestions.

Their distribution does include the similar program "gsl-randist"
which generates random numbers correctly, so it must be possible to
get this to work -- perhaps it just requires some special Windows
compiler option that I'm not familiar with.

regards
Brian Gough



Adam Kleczkowski writes:
 > I am trying to install/compile/run GSL v. 1.0 in the Cygwin environment
 > (most up-to-date version), gcc 2.95.3-5. This has created a series of
 > various problems and I have not been successful so far.
 > 
 > Cygwin is installed in c:\cygwin
 > 
 > GSL libraries, include files etc in c:\cygwin\usr\bin etc, binaries in
 > c:\cygwin\bin
 > 
 > Testing by using example programs from the manual (pages referring to PDF
 > format):
 > 
 > Page 40:        poly.c (finding roots of the polynomial)
 > Page 162:       random.c (testing a random number generator)
 > Page 266:       vanderpol.c (Vanderpol oscilator)
 > 
 > Using the mingw installation.
 > All programs compile well, but:
 > a. poly.c executes with no problem
 > b. random.c and vanderpol.c crash giving the message:
 > 
 >       0 [main] A 86798653 handle_exceptions: Exception:
 > STATUS_ACCESS_VIOLATION
 >    1647 [main] A 86798653 open_stackdumpfile: Dumping stack trace to
 > RANDOM.EXE.stack
 > dump
 > 
 > I compile using simply
 > gcc -o random.exe -c random.c -lgsl -lm
 > 
 > I attach the programs. Any clues? In fact, I want to use random number
 > generators and ODE solver in my project, and these two have not compiled
 > well...
 > Thanks for a response in advance. If there is a reasonable FAQ that covers
 > the Cygwin installation, I would love to know where to find it. I tried to
 > compile GSL from the source under Cygwin (./configure, make, make install)
 > but run into horrific problems.
 > --
 > Adam Kleczkowski
 > Dept. Plant Sciences, University of Cambridge
 > e-mail: adam@kleczkowski.net
 > http://mathbio.com/ (work) http://kleczkowski.net/ (private)

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Problem with Cygwin installation: FAQ?
  2001-12-19 13:20 Problem with Cygwin installation: FAQ? Adam Kleczkowski
  2001-11-19  0:05 ` Adam Kleczkowski
  2001-12-19 13:20 ` Brian Gough
@ 2001-12-19 13:20 ` Adam Kleczkowski
  2001-12-19 13:20 ` Gerrit P. Haase
  3 siblings, 0 replies; 12+ messages in thread
From: Adam Kleczkowski @ 2001-12-19 13:20 UTC (permalink / raw)
  To: Gsl-Discuss

[-- Attachment #1: Type: text/plain, Size: 1525 bytes --]

I am trying to install/compile/run GSL v. 1.0 in the Cygwin environment
(most up-to-date version), gcc 2.95.3-5. This has created a series of
various problems and I have not been successful so far.

Cygwin is installed in c:\cygwin

GSL libraries, include files etc in c:\cygwin\usr\bin etc, binaries in
c:\cygwin\bin

Testing by using example programs from the manual (pages referring to PDF
format):

Page 40:        poly.c (finding roots of the polynomial)
Page 162:       random.c (testing a random number generator)
Page 266:       vanderpol.c (Vanderpol oscilator)

Using the mingw installation.
All programs compile well, but:
a. poly.c executes with no problem
b. random.c and vanderpol.c crash giving the message:

      0 [main] A 86798653 handle_exceptions: Exception:
STATUS_ACCESS_VIOLATION
   1647 [main] A 86798653 open_stackdumpfile: Dumping stack trace to
RANDOM.EXE.stack
dump

I compile using simply
gcc -o random.exe -c random.c -lgsl -lm

I attach the programs. Any clues? In fact, I want to use random number
generators and ODE solver in my project, and these two have not compiled
well...
Thanks for a response in advance. If there is a reasonable FAQ that covers
the Cygwin installation, I would love to know where to find it. I tried to
compile GSL from the source under Cygwin (./configure, make, make install)
but run into horrific problems.
--
Adam Kleczkowski
Dept. Plant Sciences, University of Cambridge
e-mail: adam@kleczkowski.net
http://mathbio.com/ (work) http://kleczkowski.net/ (private)

[-- Attachment #2: poly.c --]
[-- Type: text/x-c, Size: 372 bytes --]

#include <stdio.h>
#include <gsl/gsl_poly.h>
int
main ()
{
int i;
double a[6] = { -1, 0, 0, 0, 0, 1 }; /* P(x) = -1 + x^5 */
double z[10];
gsl_poly_complex_workspace * w = gsl_poly_complex_workspace_alloc (6) ;
gsl_poly_complex_solve (a, 6, w, z) ;
gsl_poly_complex_workspace_free (w) ;
for (i = 0; i < 5 ; i++)
{
printf("z%d = %+.18f %+.18f\n", i, z[2*i], z[2*i+1]) ;
}
}

[-- Attachment #3: random.c --]
[-- Type: text/x-c, Size: 337 bytes --]

#include <stdio.h>
#include <gsl/gsl_rng.h>
gsl_rng * r; /* global generator */

int main(void)
{
const gsl_rng_type * T;

gsl_rng_env_setup();
T = gsl_rng_rand48;
r = gsl_rng_alloc(T);
printf("generator type: %s\n", gsl_rng_name(r));
printf("seed = %u\n", gsl_rng_default_seed);
printf("first value = %u\n", gsl_rng_get(r));
return 0;
}

[-- Attachment #4: vanderp.c --]
[-- Type: text/x-c, Size: 1354 bytes --]

#include <stdio.h>
#include <gsl/gsl_errno.h>
#include <gsl/gsl_matrix.h>
#include <gsl/gsl_odeiv.h>
int
func (double t, const double y[], double f[], void *params)
{
double mu = *(double *)params;
f[0] = y[1];
f[1] = -y[0] - mu*y[1]*(y[0]*y[0] - 1);
return GSL_SUCCESS;
}
int
jac (double t, const double y[], double *dfdy, double dfdt[],
void *params)
{
double mu = *(double *)params;
gsl_matrix_view dfdy_mat = gsl_matrix_view_array (dfdy, 2, 2);
gsl_matrix_set (&dfdy_mat.matrix, 0, 0, 0.0);
gsl_matrix_set (&dfdy_mat.matrix, 0, 1, 1.0);
gsl_matrix_set (&dfdy_mat.matrix, 1, 0, -2.0*mu*y[0]*y[1] - 1.0);
gsl_matrix_set (&dfdy_mat.matrix, 1, 1, -mu*(y[0]*y[0] - 1.0));
dfdt[0] = 0.0;
dfdt[1] = 0.0;
return GSL_SUCCESS;
}
int
main (void)
{
const gsl_odeiv_step_type * T = gsl_odeiv_step_rk8pd;
gsl_odeiv_step * s = gsl_odeiv_step_alloc (T, 2);
gsl_odeiv_control * c = gsl_odeiv_control_y_new (1e-6, 0.0);
gsl_odeiv_evolve * e = gsl_odeiv_evolve_alloc (2);
double mu = 10;
gsl_odeiv_system sys = {func, jac, 2, &mu};
double t = 0.0, t1 = 100.0;
double h = 1e-6;
double y[2] = { 1.0, 0.0 } ;
gsl_ieee_env_setup();
while (t < t1)
{
int status = gsl_odeiv_evolve_apply(e, c, s, &sys, &t, t1, &h, y);
if (status != GSL_SUCCESS)
break;
printf("%.5e %.5e %.5e\n", t, y[0], y[1]);
}
gsl_odeiv_evolve_free(e);
gsl_odeiv_control_free(c);
gsl_odeiv_step_free(s);
}

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2001-12-19 13:20 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-19 13:20 Problem with Cygwin installation: FAQ? Adam Kleczkowski
2001-11-19  0:05 ` Adam Kleczkowski
2001-12-19 13:20 ` Brian Gough
2001-11-19  9:00   ` Brian Gough
2001-12-19 13:20   ` [Gnuwin32-users] " GnuWin32
2001-11-20  0:58     ` GnuWin32
2001-12-19 13:20     ` Adam Kleczkowski
2001-11-20 10:13       ` Adam Kleczkowski
2001-12-19 13:20   ` Brian Gough
2001-12-19 13:20 ` Adam Kleczkowski
2001-12-19 13:20 ` Gerrit P. Haase
2001-11-20  3:02   ` Gerrit P. Haase

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).