GSL

GSL安装

./configure --prefix=/backup/home/misaraty/soft/gsl&&make -j 16&&make install

添加环境变量

.bashrc

#gsl
export C_INCLUDE_PATH=/home/misaraty/soft/gsl/include:$C_INCLUDE_PATH
export LD_LIBRARY_PATH=/home/misaraty/soft/gsl/lib:$LD_LIBRARY_PATH
export LIBRARY_PATH=/home/misaraty/soft/gsl/lib:$LIBRARY_PATH

测试程序

#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;
}

编译+链接

gcc test.c -lgsl -lgslcblas -O2 -Wall -o test.out && ./test.out


Windows GSL安装

下载

gcc test.c -Wall -I"C:\gsl-1.15-dev-win64\include" -L"C:\gsl-1.15-dev-win64\bin" -lgslcblas-0 -lgsl-0 -lm -o test

Notepad++

cmd /k chcp 65001 >nul && gcc -Wall -I"C:\gsl-1.15-dev-win64\include" -L"C:\gsl-1.15-dev-win64\bin" -lgslcblas-0 -lgsl-0 -lm -o "$(CURRENT_DIRECTORY)\$(NAME_PART).exe" "$(FULL_CURRENT_PATH)" && CLS && "$(CURRENT_DIRECTORY)\$(NAME_PART).exe" & PAUSE & EXIT