C/C++/Fortran/GSL/Boost

C/C++

tdm-gcc下载

C notepad++配置,

运行,

cmd /k chcp 65001 >nul && gcc -o "$(CURRENT_DIRECTORY)\$(NAME_PART).exe" "$(FULL_CURRENT_PATH)" && CLS && "$(CURRENT_DIRECTORY)\$(NAME_PART).exe" & PAUSE & EXIT
cmd /k gcc -o "$(CURRENT_DIRECTORY)\$(NAME_PART).exe" "$(FULL_CURRENT_PATH)" && CLS && "$(CURRENT_DIRECTORY)\$(NAME_PART).exe" & PAUSE & EXIT

C语言教程-菜鸟教程

C++语言教程-菜鸟教程

C&C++教程-极客学院

http://zh.cppreference.com/w/%E9%A6%96%E9%A1%B5

C/C++/Java代码风格格式化Notepad++插件NppAStyle

下载:《C教程v1.1


Fortran

Notepad++配置

cmd /k gfortran "$(FULL_CURRENT_PATH)" -o "$(CURRENT_DIRECTORY)\$(NAME_PART)" && CLS && "$(CURRENT_DIRECTORY)\$(NAME_PART)" & PAUSE & EXIT

GSL

Linux安装

./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

C++数值计算

Armadillo

Boost

Dlib

Eigen

mlpack

MTL4

The Computer Language Benchmarks Game


Boost

安装,

tar -jxvf boost_1_60_0.tar.bz2 && cd boost_1_60_0 && ./bootstrap.sh --with-libraries=all && ./b2 -j 256 && ./b2 install --prefix=/backup/home/misaraty/soft/boost1.6

修改.bashrc,

#boost
export C_INCLUDE_PATH=/backup/home/misaraty/soft/boost1.6/include:$C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH=/backup/home/misaraty/soft/boost1.6/include:$CPLUS_INCLUDE_PATH
export LD_LIBRARY_PATH=/backup/home/misaraty/soft/boost1.6/lib:$LD_LIBRARY_PATH
export LIBRARY_PATH=/backup/home/misaraty/soft/boost1.6/lib:$LIBRARY_PATH

注意:是/backup/home/misaraty/soft/boost1.6/include,而不是/backup/home/misaraty/soft/boost1.6/include/boost。

测试,

test.cpp,
#include <string>
#include <iostream>
#include <boost/version.hpp>
#include <boost/timer.hpp>

using namespace std;

int main()
{
boost::timer t;

cout << "max timespan: " << t.elapsed_max() / 3600 << "h" << endl;
cout << "min timespan: " << t.elapsed_min() << "s" << endl;
cout << "now time elapsed: " << t.elapsed() << "s" << endl;

cout << "boost version" << BOOST_VERSION <<endl;
cout << "boost lib version" << BOOST_LIB_VERSION <<endl;

return 0;
}

运行,

g++ test.cpp -o test && ./test