Skip to content


办公室新Workstation的ubuntu上自己安装Abaqus2017的一些记录 published on No Comments on 办公室新Workstation的ubuntu上自己安装Abaqus2017的一些记录

1. 从别处拷过来的安装包,在拷贝过程中可能权限被修改导致无法运行,直接简单粗暴
chmod -R +x *
find . -name "" | sudo xargs sed -i 's/export DSY_OS_Release=${DSY_OS_Release}/export DSY_OS_Release=CentOS/g'

2. 运行./StartGUI.sh安装,如果出现错误
error while loading shared libraries: cannot open shared object file: No such file or directory
install libmotif-dev

3. 先安装service(solver),再安装cae

4. 如果安装cae的过程中无法链接license server
/opt/SIMULIA/License/2017/linux_a64/code/bin/lmutil lmdiag -c 27008@flexnet

5. 运行cae的时候
X Error: code 2 major 154 minor 3: BadValue (integer parameter out of range for operation).

I had a similar issue when running some GL applications via 'ssh -X' and solved it by adding "+iglx" to xserver-command in /usr/share/lightdm/lightdm.conf.d/50-xserver-command.conf.

# Dump core
xserver-command=X -core +iglx
After which you either reboot or Ctrl-Alt-F1, login, and 'sudo service lightdm restart'.


6. 这步不需要,仅作为记录
file ****
ln -s /lib64/ /lib64/

如果安装了CUDA,会导致编译很多软件出现locale error stray *** in program等问题。去掉环境变量即可

7. 对于ansys workbench,会出现Unable to resolve function glXMakeCurrent等等,参考

sudo ln -s /usr/lib/nvidia-384/ /usr/lib/

Sample code for vtk to display thousands of spheres with different radius

Sample code for vtk to display thousands of spheres with different radius published on No Comments on Sample code for vtk to display thousands of spheres with different radius

int main(int, char *[])

    // create points
    vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New();

    // setup scales
    vtkSmartPointer<vtkFloatArray> scales = vtkSmartPointer<vtkFloatArray>::New();

     // setup color label
    vtkSmartPointer<vtkFloatArray> col = vtkSmartPointer<vtkFloatArray>::New();

    // setup lookupTable and add some colors
    vtkSmartPointer<vtkLookupTable> colors = vtkSmartPointer<vtkLookupTable>::New();
    colors->SetTableValue(0 ,1.0 ,0.0 ,0.0 ,1.0); // red
    colors->SetTableValue(1 ,0.0 ,1.0 ,0.0 ,1.0); // green
    colors->SetTableValue(2 ,0.0 ,0.0 ,1.0 ,1.0); // blue
    colors->SetTableValue(3 ,1.0 ,1.0 ,0.0 ,1.0); // yellow
    // the last double value is for opacity (1->max, 0->min)

    for(int i=0; i<100; i++)
        points->InsertNextPoint(15*cos(i*PI/50), 15*sin(i*PI/50), 0); // sphere in circle
        scales->InsertNextValue((rand()% 100)/double(100)); // random radius between 0 and 0.99
        col->InsertNextValue((rand()% 4)); // random color label

    // grid structured to append center, radius and color label
    vtkSmartPointer<vtkUnstructuredGrid> grid = vtkSmartPointer<vtkUnstructuredGrid>::New();
    grid->GetPointData()->SetActiveScalars("scales"); // !!!to set radius first

    // create anything you want here, we will use a sphere for the demo
    vtkSmartPointer<vtkSphereSource> sphereSource = vtkSmartPointer<vtkSphereSource>::New();

    // object to group sphere and grid and keep smooth interaction
    vtkSmartPointer<vtkGlyph3D> glyph3D = vtkSmartPointer<vtkGlyph3D>::New();

    // create a mapper and actor
    vtkSmartPointer<vtkPolyDataMapper> mapper = vtkSmartPointer<vtkPolyDataMapper>::New();

    mapper->SetScalarModeToUsePointFieldData(); // without, color are displayed regarding radius and not color label
    mapper->SetScalarRange(0, 3); // to scale color label (without, col should be between 0 and 1)
    mapper->SelectColorArray("col"); // !!!to set color (nevertheless you will have nothing)

    vtkActor *actor = vtkActor::New();

    // create a renderer, render window, and interactor
    vtkSmartPointer<vtkRenderer> renderer = vtkSmartPointer<vtkRenderer>::New();
    vtkSmartPointer<vtkRenderWindow> renderWindow = vtkSmartPointer<vtkRenderWindow>::New();
    vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor = vtkSmartPointer<vtkRenderWindowInteractor>::New();
    // add the actor to the scene
    renderer->SetBackground(0, 0, 0);
    // render and interact
    return EXIT_SUCCESS;

Install paraFOAM in any OpenFOAM version

Install paraFOAM in any OpenFOAM version published on No Comments on Install paraFOAM in any OpenFOAM version

Modify etc/config.csh/paraview

setenv ParaView_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$paraviewArchName

also remember to check ParaView_VERSION and ParaView_MAJOR


安装meshlab心得 published on No Comments on 安装meshlab心得


1. 下载vcglib 1.01,
这是一个header file only的库,不用安装

2. 选择相应meshlab版本,V2016.12,

3. 按照readme里面的提示放置。qt需要5.8版本,设置好路径

4. 安装
cd src/external/

cd src/

5. 出错
Cannot find file: /home/nicklj/Platform/thirdparty/meshlab/src/plugins_experimental/io_TXT/
make: *** [sub-plugins_experimental-io_TXT-make_first-ordered] Error 2
mv plugins_experimental/io_TXT/ plugins_experimental/io_TXT/

5. 继续出错
/usr/bin/ld: ../../external/lib/linux-g++/libmpir.a(lt4-clear.o): unrecognized relocation (0x2a) in section `.text'

LibMpir is an external library that could be a little tricky to compile (that's particularly true on Windows...a lot easier on Linux), so we provide inside the MeshLab source code an already compile version of the library itself. Obviously that approach could be dangerous, considering the wide range of the compilers existing. If you are interested in the plugin I suggest you to:

download the mpir 2.4.0 source code from the mpir official site
call ./configure --enable-cxx --enable-static --with-pic in the extracted library folder
call ./make
move the generated mpir.h and mpirxx.h in src\external\inc\linux-g++\mpir-2.4.0
move the static libs libmpir.a and libmpirxx.a in src\external\lib\linux-g+(be careful the files are compiled in a hidden folder if you have the "don't show hidden folders" file browser option set to true you can waste an afternoon, as it happens to me, to find the compiled libs 😀 )
try to compile again the filter_csg plugin in MeshLab


6. make meshlab, 搞定

qtcreator: /lib64/ version `GLIBC_2.14' not found (最后还是没有比较好的解决办法)

qtcreator: /lib64/ version `GLIBC_2.14' not found (最后还是没有比较好的解决办法) published on No Comments on qtcreator: /lib64/ version `GLIBC_2.14' not found (最后还是没有比较好的解决办法)

Run qtcreator, cannot find GLIBC_2.14

1. Check current glibc
strings /lib64/ |grep GLIBC

2. 从 下载源代码。我下载的版本是2.14,链接地址是
However, 2.14 cannot be compiled by gcc5.2.0, so I download the 2.20

tar xvf glibc-2.14.tar.gz
cd glibc-2.14
mkdir build
cd ./build
../configure --prefix=/opt/glibc-2.14
make -j4
make install

4. There will be
Error: no such instruction: `vinserti128 $1,%xmm0,%ymm0,%ymm0'

5. Install binutils-2.25

6. 运行的时候依然有问题


1.由gcc写死的路径,通过gcc –print-search-dirs看到,这里加载的是一些 libgcc_s.so的库
3.由ld命令设定的目录,这部分也是在编译ld这个程序时写死的,可以通过“ld –verbose | grep SEARCH”来查看

回到刚才的问题,把新版本的Glibc添加到$LD_LIBRARY_PATH加会导致其它常用的程序如ls会挂掉,那我能不能把编译我想要的工具时指定使用新版的Glibc呢?当然可以,去google一下你可以看到so上的这个问题的答案 在编译的时候加上
-Wl,–rpath=/path/to/newglibc \

Install Git without root

Install Git without root published on No Comments on Install Git without root

The old git version on workstation can not satisfy me. It is not convenient to used, and cannot push to GitHub. Then I want to install Git from source code. This really killing me. Here are some experience.

There are a lot of articles online to show that compile git from source code, as long as you can "sudo apt-get install ****(a lot of libraries)". This is ridiculous. If I can use sudo, why not directly install it from repository?

Here are some ideas about what we need to install. However, the author use brew, which needs ruby to install. I don't know how to install ruby without root. However, this is an elegant idea to do this work, and can be referred if possible. The linuxbrew can be found at: Besides, it seems that it requires curl supporting https, which is exactly the problem I will talk about next.

Install Git is not big. However, it depends several libraries. During the installation, it requires something like xmlto, asciidoc, etc. Just download and compile them, not big deal. Then we can

$ ./make configure
$ ./configure --prefix=$HOME/git
$ make & make install

Seems wonderful. It can be used without problem locally. However, when I want to push or clone from repository, it shows:
fatal: Unable to find remote helper for 'https'

After searching on the internet, it seems that this is caused by curl. We need to install the curl.

So, download and install as usual. It works, but without https support, when git push/pull, we have error

fatal: unable to access 'https://******/***': Protocol "https" not supported or disabled in libcurl

In order to configure curl with hppts, t seems we need libssh2

./configure --prefix=$HOME/curl --with-libssh2

Still cannot, there is no libssh2, so we download libssh2. Still cannot, since we need gnu-crypto, so download, it requires javac. There is no javac...... I want to stop. I think there is way to compile libssh2 with system crypto, but I have no time to try.

Do it another way. I found that there is also curl in anaconda package, so we can try to compile Git it like this (

$ ./make configure
$ ./configure --prefix=$HOME/git --with-curl=$HOME/anaconda
$ make & make install

Configure without problem. However, when running, it shows:
git: error while loading shared libraries: cannot open shared object file: No such file or directory

Obviously we still need this crypto library. Try this in the system lib, we can find a /usr/lib64/ So here's a tricky,

$ mkdir -p $HOME/usr/lib
$ ln -s /usr/lib64/

Then add $HOME/usr/lib to LD_LIBRARY_DIR

Anyway, it works. So stop now.


1. There is still problem in the config.log
/usr/bin/ld: cannot find -lexpat ( it seems this is required,

2. make install will exit error, don't know why

3. make doc will have problem

New update on configure deal.ii with trilinos

New update on configure deal.ii with trilinos published on 1 Comment on New update on configure deal.ii with trilinos

Since mpi environment is essential and all package require the same mpi environment, it is better to separate the MPICH into the home folder, not downloaded with petsc. Here is some refined procedures

1,2,3,4. The same as "Tips on setting up deal.ii and petsc"

5. Download and install mpich-3.2. Setup environment variable,

$ export PATH=$PATH:HOME/mpich-3.2/bin

6. Download and install petsc, as in It should be noted that "--download-hypre=1" is required for deal.ii 8.4.0 and later, otherwise there  is error "undefined reference to `PCHYPRESetType' " when compiling program. MPI environment needs to be assigned. However, blas and lapack can be downloaded, since not all softwares require the same blas&lapack. Here is a configuration

./config/ PETSC_ARCH=arch-linux-release \
--with-shared=1 --with-x=0 --with-mpi=1 --download-hypre=1 --with-debugging=0 \
--with-cc=mpicc --with-cxx=mpicxx --with-fc=mpif90 --download-fblaslapack
(or specify --with-blas-lapack-dir=$MYHOME/fblaslapack-3.4.2)

7. Download and install METIS, P4EST, OpenBLAS as before

8. Download and install trilinos using:

cmake \
-D Trilinos_ENABLE_Sacado=ON \
-D Trilinos_ENABLE_MueLu:BOOL=ON \
-D Trilinos_ENABLE_Anasazi:BOOL=ON \
-D Trilinos_ENABLE_Epetra:BOOL=ON \
-D Trilinos_ENABLE_EpetraExt:BOOL=ON \
-D Trilinos_ENABLE_Triutils:BOOL=ON \
-D Trilinos_ENABLE_Belos:BOOL=ON \
-D Trilinos_ENABLE_Ifpack:BOOL=ON \
-D Trilinos_ENABLE_Stratimikos=ON \
-D CMAKE_C_FLAGS="-g -O3" \
-D Trilinos_EXTRA_LINK_FLAGS="-lgfortran -pthread" \
-D MPI_BASE_DIR=$MYHOME/mpich-3.2/bin \
-D BLAS_INCLUDE_DIRS=$MYHOME/OpenBLAS-0.2.15/include \
-D BLAS_LIBRARY_NAMES:STRING="libopenblas.a" \

9. If we want to use UMFPACK compiled by ourselves (not significant speed change), download it from, unzip to the home folder. It requires blas&lapack, we can use OpenBLAS.
Add "$MYHOME/OpenBLAS-0.2.15/lib" to LD_LIBRARY_PATH, and LIBRARY_PATH environment variable$ make install BLAS=-lopenblas LAPACK=-lopenblas
Since SparseSuite needs to be found by dynamics link at runtime, we need to add $MYHOME/SparseSuite/lib to LD_LIBRARY_PATH

10. Download deal.II 8.4.0 and install (Be careful only deal.II 8.3.0 comes with meshconvert)

cmake \

A practice of imposing *imperfection for post-buckling analysis in Abaqus

A practice of imposing *imperfection for post-buckling analysis in Abaqus published on No Comments on A practice of imposing *imperfection for post-buckling analysis in Abaqus

1. Step - Linear Perturbation - Buckle

2. Apply boundary conditions and force. This will essentially influence the result. Force direction is very important, but magnitude doesn't matter. Choose the number of eigenvalues we need, generally 10 is enough.

3. Edit inp file. In the output region, we add

*Node file, global=yes

The result node will be written in the *.fil

4. Observe in the result which mode we need. Try to adjust the scaling factor to see what is a appropriate value for imposing the imperfection, see 1e-5 for example

5. Edit the analysis inp file, add

7, 2e-5

This can be put just before all the steps.
When the NSET is used, be careful of the boundary condition and contact constrain if multiple instances exist in the assembly

6. Run the analysis