linux环境下github的基本操作

1.  复制  git clone 克隆地址
2.  程序文件修正后 
      git add 文件名 通知该文件已经更新
      git commit -m ‘修正信息’
      git push 更新完了
3.   如果在git push时要求用户密码信息, 则表明ssh键设定有问题,需要重新设定repository位置
   1)   git config remote.origin.url 确认现有设定,一般为
            https://github.com/用户ID/repository名
  2)git remote set-url origin git@github.com:用户ID/repository名.git
          重新设定

3.   git status 状态确认
4.   git log更新履历确认

   

Build NASA NSTRAIN-95 in Windows by MSYS2

Although there is no technical support available for NASA NSTRAIN-95 there is a fork here which runs reasonably well on Linux https://github.com/ldallolio/NASTRAN-95/. It confirms work well in windows 7 also as follows:

1. Install MSYS2
2. Install following software in MSYS2
   pacman -S autoconf automake libtoll
   pacman -S gcc gcc-fortran
   pacman -S git
3. Download NASTRAIN -95 by git clone https://github.com/Idallolio/NASTRAN-95.git
4. Modify file /mds/nastrn.f
   COMMON / ZZZZZZ / IZ(400000000)   => IZ(4000000)
   LENOPC = 400000000                        =>  LENOPC = 4000000
which depends upon your memory size
5. In directory where NASTRAIN-95 downloaded, run
   sh bootstrap and make
the exe file nastran.exe will be generated in subdirectory /mds

2015年全球幸福指数

WIN(Worldwide Independent Network of Market Research)公布了2015年度全球希望,经济期待和幸福指数。其结果如下




幸福指数的前十是;1 哥伦比亚(85) 2 菲济/沙特(82) 4 阿塞拜疆(81) 5 越南(80) 6 阿根廷/巴拿马(79) 8 墨西哥(76) 9 厄瓜多尔(75) 10 中国/爱尔兰(74)

G7国家没有上榜。其中最好的是加拿大,23名幸福指数60。 可见金钱不是万能的!但是在同一国家中的统计结果中(世界平均),幸福指数如下; 高收入者70, 中高收入者68, 中收入者57, 中低收入者40, 低收入者32。可见没有钱是万万不能的。

2015年最悲惨的国家是伊拉克(-12), 其次是突尼斯(7)和希腊(9)。



Compile METIS-5.1.0/ParMETIS-4.0.3 in mingw64 gcc 5.2.0

Following three modifications are needed to compile METIS-5.1.0:

1.  Modify line 4 of CMakelists.txt from
set(GKLIB_PATH "GKlib" CACHE PATH "path to GKlib")
    to
set(GKLIB_PATH "${CMAKE_SOURCE_DIR}/GKlib" CACHE PATH "path to GKlib")

2. Delete POSIX include file #include <sys/resource.h> in gk_arch.h. Seems allright.

3.  Exclude
--------------
extern int gk_getopt(int __argc, char **__argv, char *__shortopts);
extern int gk_getopt_long(int __argc, char **__argv, char *__shortopts,
              struct gk_option *__longopts, int *__longind);
extern int gk_getopt_long_only (int __argc, char **__argv,
              char *__shortopts, struct gk_option *__longopts, int *__longind);
--------------
in file gk_getopt.h by, e.g.

#if !defined _MINGW64
extern int gk_getopt(int __argc, char **__argv, char *__shortopts);
extern int gk_getopt_long(int __argc, char **__argv, char *__shortopts,
              struct gk_option *__longopts, int *__longind);
extern int gk_getopt_long_only (int __argc, char **__argv,
              char *__shortopts, struct gk_option *__longopts, int *__longind);
#endif


To compile ParMETIS-4.0.3
1. Set GKLIB_PATH like
set(GKLIB_PATH "${CMAKE_SOURCE_DIR}/metis/GKlib" CACHE PATH "path to GKlib")

2.  Add a line "include( findMPI )" in front of  "include_directories(${MPI_INCLUDE_PATH})" inside CMAKElistx.txt
     For those who use MSMPI, you should be include <_mingw.h> in mpi.h of MSMPI. Otherwise there should be undefined data type errors.

3. Do above modification 2,3 for metis compile.

Code::Blocks + GLUT + FLTK

Code::Blocks provides project templates for both GLUT and FLTK, but no for GLUT + FLTK. Here is a procedure to build a simple GLUT + FLTK program in Code::Blocks.


1.  Build up a new project for GLUT by using the Code::Blocks' template.
2.  Add search directories setting to the include and library directories of FLTK.
3.  Modify #include <GL/glut.h> in main.cpp to #include<FL/glut.H>
4.  Modify the Linker settings as follows
   1)  Add other linker options:  -mwindows
   2)  Link libraries as: fltk_images, fltk_gl, fltk, fltk_png, fltk_z, fltk_jpeg, glu32, opengl32, ole32, uuid, comctl32. Pay attention to that the sequential order of those libraries is important.


The project would be rebuilt successfully. You can then add FLTK functions as you like.

How to install GLUT for mingw

There are some binary distribution of glut in windows available, such as here. But it is not sure if they are available for your system, the version of your gcc compiler on your mingw32 or mingw64 etc. On the other hand, it is not easy to compile its sourcecode in mingw. However, freeglut provides cmake support for cross platform compiling. It is therefore suggested that freeglut, which provides binary distribution also, be adopted.


1. Compile freeglut by using cmake.


2. Keeping the include, library  and dll file of freeglut available and compile like:
    g++ -Os -Wall test.cc -o test -mwindows -lfreeglut -lopengl32 -lglu32


That's all.

如何将windows的dll库文件转换为mingw库文件

1  下载gendef
http://sourceforge.net/projects/mingw/files/MinGW/Extension/gendef/gendef-1.0.1346/


2.  执行gendef dll库文件名产生def文件
   如  gendef msmpi.dll 将产生 msmpi.def


3   执行dlltool -d msmpi.def -l libmpi.def -l libmsmpi.a -D msmpi.dll 将库文件名产生libmsmpi.a


如果要在64位机上使用msmpi,除此以外还需
1)  在/Inc/mpi.h文件的第128行,加上
     #include <stdint.h>
2) 如果使用非intel编译器,如gfortran,还需将/Inc/mpif.h文件用用mpich中的相关文件替代。

VS Code下cmake, c++编译,调试环境的构成步骤

1   下载必须extension      按[Ctrl+Shift+X]打开extension窗口,选择安装"C/C++", "CMake", "CMake Tools" 2   在VSCode下打开作业目录 ...