- #1
- 290
- 0
Hi,
I'm stumped trying to learn how to use the GNU scientific library.
I installed X11, Xcode and gsl library using MacPorts on my computer which is running Mac OSX 10.6.8. I've used Xcode plenty in the past year for generic (simple) c programs and it's worked fine, so I think all the installs worked.
All I am trying to do at the moment is run the first sample in the GNU scientific library manual (also located at http://www.gnu.org/software/gsl/manual/html_node/An-Example-Program.html): [Broken]
#include <stdio.h>
#include <gsl/gsl_sf_bessel.h>
int
main (void)
{
double x = 5.0;
double y = gsl_sf_bessel_J0 (x);
printf ("J0(%g) = %.18e\n", x, y);
return 0;
}
I saved this snippet as GSL-demo.c on my computer and in my terminal window I type:
$ gcc -Wall -I/usr/local/include -c GLS-mc-demo.c
which seems to compile fine. When I try to run it,
$ ./a.out
I get:
-bash: ./a.out: No such file or directory
How do I actually run the code? And what does -c mean? (I'm totally new to unix too, for the most part).
I'm stumped trying to learn how to use the GNU scientific library.
I installed X11, Xcode and gsl library using MacPorts on my computer which is running Mac OSX 10.6.8. I've used Xcode plenty in the past year for generic (simple) c programs and it's worked fine, so I think all the installs worked.
All I am trying to do at the moment is run the first sample in the GNU scientific library manual (also located at http://www.gnu.org/software/gsl/manual/html_node/An-Example-Program.html): [Broken]
#include <stdio.h>
#include <gsl/gsl_sf_bessel.h>
int
main (void)
{
double x = 5.0;
double y = gsl_sf_bessel_J0 (x);
printf ("J0(%g) = %.18e\n", x, y);
return 0;
}
I saved this snippet as GSL-demo.c on my computer and in my terminal window I type:
$ gcc -Wall -I/usr/local/include -c GLS-mc-demo.c
which seems to compile fine. When I try to run it,
$ ./a.out
I get:
-bash: ./a.out: No such file or directory
How do I actually run the code? And what does -c mean? (I'm totally new to unix too, for the most part).
Last edited by a moderator: