Skip to content

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

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

1. 从别处拷过来的安装包,在拷贝过程中可能权限被修改导致无法运行,直接简单粗暴
chmod -R +x *
然后修改所有的Linux.sh
DSY_OS_Release="CentOS"
或者直接用命令
find . -name "Linux.sh" | 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: libXm.so.4: cannot open shared object file: No such file or directory
则安装
install libmotif-dev

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

4. 如果安装cae的过程中无法链接license server
安装flexnet
/opt/SIMULIA/License/2017/linux_a64/code/bin/lmutil lmdiag -c 27008@flexnet
ref: http://www.harrisgeospatial.com/Support/SelfHelpTools/HelpArticles/HelpArticles-Detail/TabId/2718/ArtMID/10220/ArticleID/19294/3246.aspx

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'.
"

ref: https://polymerfem.com/forum/finite-element-modeling/computer-software-aa/3288-glx-error-when-launching-abaqus-on-debian

6. 这步不需要,仅作为记录
file ****
ln -s /lib64/ld-linux-x86-64.so.2 /lib64/ld-lsb-x86-64.so.3

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

7. 对于ansys workbench,会出现Unable to resolve function glXMakeCurrent等等,参考
https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers/+bug/589250

sudo ln -s /usr/lib/nvidia-384/libGL.so.384.98 /usr/lib/libGL.so.1

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

https://stackoverflow.com/questions/29840144/display-thousand-of-different-sphere

int main(int, char *[])
{
    srand(time(NULL));

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

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

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

    // setup lookupTable and add some colors
    vtkSmartPointer<vtkLookupTable> colors = vtkSmartPointer<vtkLookupTable>::New();
    colors->SetNumberOfTableValues(4);
    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->SetPoints(points);
    grid->GetPointData()->AddArray(scales);    
    grid->GetPointData()->SetActiveScalars("scales"); // !!!to set radius first
    grid->GetPointData()->AddArray(col);

    // 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();
    glyph3D->SetInputData(grid);
    glyph3D->SetSourceConnection(sphereSource->GetOutputPort());

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

    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)
    mapper->SetLookupTable(colors);

    vtkActor *actor = vtkActor::New();
    actor->SetMapper(mapper);

    // create a renderer, render window, and interactor
    vtkSmartPointer<vtkRenderer> renderer = vtkSmartPointer<vtkRenderer>::New();
    vtkSmartPointer<vtkRenderWindow> renderWindow = vtkSmartPointer<vtkRenderWindow>::New();
    renderWindow->AddRenderer(renderer);
    vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor = vtkSmartPointer<vtkRenderWindowInteractor>::New();
    renderWindowInteractor->SetRenderWindow(renderWindow);
    // add the actor to the scene
    renderer->AddActor(actor);
    renderer->SetBackground(0, 0, 0);
    // render and interact
    renderWindow->Render();
    renderWindowInteractor->Start();
    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

change
setenv ParaView_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$paraviewArchName
to
setenv ParaView_DIR YOUR_PARAVIEW_PATH

also remember to check ParaView_VERSION and ParaView_MAJOR

安装meshlab心得

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

Workstation的glibc版本过低,无解。只能往ubuntu装

1. 下载vcglib 1.01,
https://github.com/cnr-isti-vclab/vcglib/releases
这是一个header file only的库,不用安装

2. 选择相应meshlab版本,V2016.12,
http://www.meshlab.net/#download

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

4. 安装
cd src/external/
gmake external.pro
make

cd src/
gmake meshlab_full.pro
make

5. 出错
Cannot find file: /home/nicklj/Platform/thirdparty/meshlab/src/plugins_experimental/io_TXT/io_TXT.pro.
make: *** [sub-plugins_experimental-io_TXT-make_first-ordered] Error 2
发现目录里面io_txt.pro是小写,这是在逗我?
mv plugins_experimental/io_TXT/io_txt.pro plugins_experimental/io_TXT/io_TXT.pro

5. 继续出错
/usr/bin/ld: ../../external/lib/linux-g++/libmpir.a(lt4-clear.o): unrecognized relocation (0x2a) in section `.text'
参考:https://github.com/cnr-isti-vclab/meshlab/issues/47

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 http://mpir.org/downloads.html
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

编译后的.a文件在.lib目录下

6. make meshlab, 搞定

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

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

https://my.oschina.net/zhangxu0512/blog/262275

Run qtcreator, cannot find GLIBC_2.14

1. Check current glibc
strings /lib64/libc.so.6 |grep GLIBC

2. 从http://www.gnu.org/software/libc/ 下载源代码。我下载的版本是2.14,链接地址是http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
However, 2.14 cannot be compiled by gcc5.2.0, so I download the 2.20

3.
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. 运行的时候依然有问题
转自 https://herowong.me/archives/install-and-running-multiple-version-glibc-in-a-single-host-1.html

可以通过ldd命令查看程序依赖的动态库

一般情况下(在没有指定DT_RPATH和DT_RUNPATH的情况下)
1.先查找$LD_LIBRARY_PATH中的目录
2.再查找缓存文件/etc/ld.so.cache
3.再默认的目录/lib,/usr/lib或者是/lib64和/usr/lib64

ld.so.cache缓存文件可以通过ldconfig命令来配置,具体就不多说了
而在用gcc编译一个程序的时候加载动态库文件的顺序又是怎么样的呢?
1.由gcc写死的路径,通过gcc –print-search-dirs看到,这里加载的是一些 libgcc_s.so的库
2.$LIBRARY_PATH变量指定目录或者是编译-L参数指定的目录
3.由ld命令设定的目录,这部分也是在编译ld这个程序时写死的,可以通过“ld –verbose | grep SEARCH”来查看

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

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. http://www.angularjs.cn/A0HC. 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: http://linuxbrew.sh/. 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://***@bitbucket.org/***/***': 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 (http://www.cnblogs.com/wowarsenal/p/4319002.html)

$ ./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: libcrypto.so.1.0.0: 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/libcrypt.so. So here's a tricky,

$ mkdir -p $HOME/usr/lib
$ ln -s /usr/lib64/libcrypt.so libcrypto.so.1.0.0

Then add $HOME/usr/lib to LD_LIBRARY_DIR

Anyway, it works. So stop now.

 

PS:
1. There is still problem in the config.log
ac_cv_lib_curl_Curl_ssl_init=no
/usr/bin/ld: cannot find -lexpat ( it seems this is required, http://stackoverflow.com/questions/8329485/git-clone-fatal-unable-to-find-remote-helper-for-https)

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.    https://www.mpich.org/. Setup environment variable,

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

6. Download and install petsc, as in https://www.dealii.org/developer/external-libs/petsc.html. 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/configure.py 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_TESTS:BOOL=ON \
-D Trilinos_ENABLE_Stratimikos=ON \
-D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_CXX_FLAGS="-g -O3" \
-D CMAKE_C_FLAGS="-g -O3" \
-D CMAKE_FORTRAN_FLAGS="-g -O5" \
-D Trilinos_EXTRA_LINK_FLAGS="-lgfortran -pthread" \
-D CMAKE_VERBOSE_MAKEFILE=ON \
-D Trilinos_VERBOSE_CONFIGURE=OFF \
-D TPL_ENABLE_MPI=ON \
-D MPI_BASE_DIR=$MYHOME/mpich-3.2/bin \
-D BUILD_SHARED_LIBS=ON \
\
-D TPL_ENABLE_BLAS:BOOL=ON \
-D BLAS_INCLUDE_DIRS=$MYHOME/OpenBLAS-0.2.15/include \
-D BLAS_LIBRARY_DIRS=$MYHOME/OpenBLAS-0.2.15/lib \
-D BLAS_LIBRARY_NAMES:STRING="libopenblas.a" \
-D TPL_ENABLE_LAPACK=ON \
-D LAPACK_INCLUDE_DIRS=$MYHOME/OpenBLAS-0.2.15/include \
-D LAPACK_LIBRARY_DIRS=$MYHOME/OpenBLAS-0.2.15/lib \
-D LAPACK_LIBRARY_NAMES:STRING="libopenblas.a" \
\
-D CMAKE_INSTALL_PREFIX:PATH=$MYHOME/trilinos-11.14.3 \
../

9. If we want to use UMFPACK compiled by ourselves (not significant speed change), download it from http://faculty.cse.tamu.edu/davis/suitesparse.html, 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 \
-DCMAKE_C_COMPILER="mpicc" -DCMAKE_CXX_COMPILER="mpicxx" -DCMAKE_Fortran_COMPILER="mpif90" \
-DCMAKE_INSTALL_PREFIX=$MYHOME/dealii-8.4.0 \
-DDEAL_II_WITH_METIS=ON -DMETIS_DIR=$MYHOME/metis-5.1.0 \
-DDEAL_II_WITH_P4EST=ON -DP4EST_DIR=$MYHOME/p4est-1.1 \
-DDEAL_II_WITH_TRILINOS=ON -DTRILINOS_DIR=$MYHOME/trilinos-11.14.3 \
(-DUMFPACK_DIR=$MYHOME/SuiteSparse -DDEAL_II_COMPONENT_PARAMETER_GUI=ON ) ../

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

** OUTPUT REQUESTS
*Node file, global=yes
U

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

*IMPERFECTION, FILE=aaa, STEP=1, (NSET=NodeSet)
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