gsl

ld: library not found for -lgsl

断了今生、忘了曾经 提交于 2019-12-18 14:46:41
问题 I'm working in OSX and I'm attempting to run a make file and when I try I get the following: ld: library not found for -lgsl clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [harm] Error 1 Earlier I found out the I needed to get the gsl library and I used mac ports and typed: sudo port install gsl into my command line window and it seemed to isntall okay. Is the missing lgsl not configured correctly or does it not come with gsl? I tried googling lgsl

Double pendulum solution using GSL

淺唱寂寞╮ 提交于 2019-12-18 09:38:53
问题 I am learning to use GSL to solve ODE. I wanted to solve double pendulum problem using GSL ODE functions. I decided to use this equations: (source: http://www.physics.usyd.edu.au/~wheat/dpend_html/) My code: #include <iostream> #include <cmath> #include "gsl/gsl_errno.h" #include "gsl/gsl_matrix.h" #include "gsl/gsl_odeiv2.h" #include "constants.h" double L1; double L2; double M1; double M2; double T_START; double T_END; double S1_ANGLE; double S2_ANGLE; double V1_INIT; double V2_INIT; int

Gnu Scientific Library stopped working in Ubuntu 16.04

青春壹個敷衍的年華 提交于 2019-12-14 03:08:37
问题 I had GSL (Gnu Scientific library) installed on my Ubuntu 14.04 and it was working fine. I then upgraded to Ubuntu 16.04 and now if I try to compile C++ code using GSL I obtain the error message g++ -c FILE.cpp In file included from FILE.cpp:1:0: FILE.h:3:28: fatal error: gsl/gsl_matrix.h: No such file or directory compilation terminated. Makefile:42: recipe for target 'FILE.o' failed make: *** [FILE.o] Error 1 How do I fix this issue? 回答1: The upgrade appears to have removed older packages.

GCC suddenly not finding GSL headers

别等时光非礼了梦想. 提交于 2019-12-13 07:09:50
问题 I'm on OS X 10.11, and I have never had problems with linking libraries, but yesterday, out of the blue, I start getting errors when including GSL headers. For instance, I get: "fatal error: 'gsl/gsl_matrix.h' file not found", coming from the line #include<gsl/gsl_matrix.h> I then compile with the -lgsl flag, which has worked for the last 6 months, but now suddenly stopped working. GSL is installed through Homebrew, and is located in /usr/local/Cellar/gsl and passing this to the compiler with

C++ class member function to GSL ODE solver

梦想的初衷 提交于 2019-12-13 03:07:30
问题 I am struggling with -- apparently -- a well known problem. I have an ODE system which is defined by a class member function, and I want to solve/integrate it by one of the GSL solvers. I.e., say my model is defined by: class my_model{ ... public: int NEQ = 4; double y[4], dydt[4]; double params[25]; int ode_gsl(double t, const double y[], double dydt[], void * params); ... }; int my_model::int ode_gsl(double t, const double y[], double dydt[], void * params){ dydt[0] = params[1]*params[0]*y

Using unique_ptr with gsl_vector

五迷三道 提交于 2019-12-12 18:35:27
问题 One of my favorite aspects of unique_ptr is the automatic memory management it provides. I would like to use unique_ptr with something like a GSL vector. However, gsl_vector has its own mechanism for freeing memory ( gsl_vector_free ). Is there a way to force the unique pointer to use GSL's vector freeing method? Valgrind (correctly) reports a mismatched use of malloc/delete when creating a unique_ptr<gsl_vector> below: #include <memory> #include <gsl/gsl_vector.h> void mem_gsl() { gsl_vector

GSL library in R - Symbol not found

泪湿孤枕 提交于 2019-12-12 10:09:53
问题 my knowledge in C is very limited as a new users, I have some code written in C that I need to use in R. I try to use the "gsl_integration" library. Because the code needs to be passed around to different people that might not have the GSL library installed, I have created my "integration.h" file that includes all the functions and dependencies from the "gsl_integration" library. I am able to compile my code.c file using the $ R CMD SHLIB code.c and this is the output I get -I/Library

GSL Fast-Fourier Transform - Double-Valued Gaussian?

自闭症网瘾萝莉.ら 提交于 2019-12-12 04:28:51
问题 All I want to do is evaluate the Fourier transform of a Gaussian (as a test of course), but I'm getting what looks like a double-valued function, as can be seen in the plot below. When you look closely at the tails of the Gaussian, you can see that the FFT returned values are actually oscillating between positive and negative, making the DFT look "double-valued". Why is this happening? Is there a way to fix this (without just plotting the complex modulus of course)? #include <gsl/gsl_fft

gsl openmp failed integration

≯℡__Kan透↙ 提交于 2019-12-12 02:49:41
问题 This is my first post on here, so go easy on me! I have a very strange problem. I've written a c code that converts particle data to grid data (the data comes from a cosmological simulation). In order to do this conversion, I am using the gsl Monte Carlo vegas integrator. When I run it in serial, it runs just fine and gives me the correct answer (albeit slowly). As an attempt at speeding it up, I tried openmp. The problem is that when I run it in parallel, the integration times out (I set a

Another GSL linking error in Windows

时光毁灭记忆、已成空白 提交于 2019-12-11 21:02:17
问题 I've done everything, and it's payed off. Trying to compile a mex file from MATLAB using the Windows 7.1 SDK. ~ I've created an compiled my C source code on GCC ~ I've created a MEX file that links and compiles fine via GCC on both Linux and OS X. Does not crash MATLAB, gateway function works fine ~ After much confusion, I switched my dev platform form 64-bit to x86 Win7 ~ I've found .dll built files, but they do not link. Linking libs in MATLAB using MATLAB's linker flags will default to