Build trilinos in windows by visual studio

1. You need cmake installed in your computer.

2. You need msys installed in your computer.

3. Of course, visual studio also. The free express edition is OK.

4. You need BLAS and LAPACK compiler in you computer. I choose clapack beacuse it need no Fortran compiler which could be compiler by express edition of visual studio.

5. Optional: MPI ( MPICH2 or MS-MPI ) for parallel computation.
    And, HDF5, MUMPS、UMFPACK etc

6. Download Trilinos and  uncompress it.

7. Make a new dir in your Trilinos home, e.g. &(TRILINOS_HOME)\build

8. Write down a shell script in this new folder like below

#!/bin/sh

EXTRA_ARGS=&@
rm -r CMakeCache.txt CMakeFiles/

cmake \
-G "Visual Studio 11 Win64" \
-D Trilinos_ENABLE_TESTS:BOOL=ON \
-D TPL_ENABLE_MPI:BOOL=ON \
-D Trilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=OFF \
-D Trilinos_ENABLE_Epetra:BOOL=ON \
-D Trilinos_ENABLE_EpetraExt:BOOL=ON \
-D Trilinos_ENABLE_AztecOO:BOOL=ON \
-D Trilinos_ENABLE_Amesos:BOOL=ON \
-D Trilinos_ENABLE_Belos:BOOL=ON \
-D Trilinos_ENABLE_Ifpack:BOOL=ON \
-D Trilinos_ENABLE_FEI:BOOL=ON \
-D Trilinos_ENABLE_ML:BOOL=ON \
-D Trilinos_ENABLE_Stratimikos:BOOL=ON \
-D Trilinos_ENABLE_Fortran:BOOL=OFF \
-D TPL_ENABLE_BLAS:BOOL=ON \
-D TPL_ENABLE_LAPACK:BOOL=ON \
$EXTRA_ARGS \

${TRILINOS_HOME}

9. Just run it in msys, it will generate files neccesary for VS compiler.

10. Compile.

Compiler errors
1. Return type error in Teuchos_Array.hpp
2. std::insert not defined error in Teucho_array.hpp, Ifpack_ConfigDefs.hpp, MLAPI_MultiVector.h.
Just include <funtional> to resolve it.
3. Add the following line into file EpetraExt_ConfigDefs.h if you include both HDF5 and MPI. Otheriwise errors of H5Pset_fapl_mpio etc not defined exist.
#ifndef H5_HAVE_PARALLEL
#define H5_HAVE_PARALLEL
#endif
4. There exists many error in packages like anasazi, zoltan that is hard to resolve!

没有评论:

发表评论

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

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