build FMDB in cygwin

1. Download build_Parallel_FMDB_GMI.sh .

2. export CC=; export CXX=; export MPIHOME=; 
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MPIHOME/lib
    To use iGeom/iMesh/iMeshP API, set ENABLE_ITAPS to 1 (default: 0)
    To use parmetis and/or zoltan already install export PARMETIS_HOME and/or ZOLTAN_HOME

3. Run the above shell script .

4. Modify /auxilaryBuildScripts/downloadAndBuildParmetis.sh as follow
        Modify all 'parmetis-3.1.0' to 'parmetis-4.0.2'

    Modify /auxilaryBuildScripts/downloadAndBuildZoltan.sh as follow
       Modify all 'v3.1' to 'v3.6'
       ../configure --with-parmetis-incdir=$PARMETIS_HOME to --with-parmetis-incdir=$PARMETIS_HOME/include and those relevent to parmetis dirs.

5. Modify 'make' command in downloadAndBuildParmetis.sh as
    make config
    make

6. Modify /FMDB-1.4.0/makefile, line 560 from ' /usr/local/include' to '-I/usr/local/include'
    Delete all setting about old-parallel in  /FMDB-1.4.0/makefile which use old-style interfaces of metis and parmetis.

7. Comment out  /FMDB-1.4.0/ghosting/pmGhostEntities.cc #include<mcheck.h>. It is not supported in cygwin.
   Comment out /test/serial/main.cc #include<sys/syscall.h>. It is not supported in cygwin.

8. A bug in zolton ver3.1. Modify line 291 of file parmetis_interface.c from #endif to #else and add #endif in line 347.

9. Modify setting of postdeps in /FMDB-1.4.0/libtool to
postdeps=" \
-L../../lib -lSCORECModel -lSCORECUtil -lipcomman \
-L../../zoltan/Zoltan_v3.6-install/lib -lzoltan \
-L../../parmetis/parmetis-4.0.2  -lparmetis -lmetis \
-lmpichcxx -lpmpich -lmpich -lopa -lmpl -lpthread -lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32  -lstdc++ -lgcc_s -lgcc"

10. Compile.

Build Trilinos in cygwin

Compared to build Trilinos by visual studio, it is easier to build Trilinos in cygwin. Because lots of external libararies, such as  pthread, zlib, HDF5, blas and lapack, suitesparse, could be installed by setup script of cygwin by just one click. There are also many libararies be compilered by cygwin much easier that VS. But, we could only obtains a win32 library by cygwin!

The build process is quite like that here. The configure files looks like:

#!/bin/sh
EXTRA_ARGS=$@
rm -r CMakeCache.txt CMakeFiles/
cmake \
-D Trilinos_ENABLE_TESTS:BOOL=ON \
-D CMAKE_CXX_COMPILER:FILEPATH=/usr/local/bin/mpic++ \
-D CMAKE_CXX_FLAGS:STRING="-D__cplusplus" \
-D CMAKE_C_COMPILER:FILEPATH=/usr/local/bin/mpicc \
-D CMAKE_Fortran_COMPILER:FILEPATH=/usr/local/bin/mpif90 \
-D TPL_ENABLE_MPI:BOOL=ON \
-D TPL_ENABLE_HDF5:BOOL=ON \
-D TPL_ENABLE_UMFPACK:BOOL=ON \
-D TPL_ENABLE_AMD:BOOL=ON \
-D TPL_ENABLE_BLAS:BOOL=ON \
-D TPL_ENABLE_LAPACK:BOOL=ON \
-D TPL_ENABLE_Zlib:BOOL=ON \
-D TPL_ENABLE_Pthread:BOOL=ON \
-D Trilinos_ENABLE_Epetra:BOOL=ON \
-D Trilinos_ENABLE_AztecOO:BOOL=ON \
-D Trilinos_ENABLE_Anasazi:BOOL=ON \
-D Trilinos_ENABLE_Amesos:BOOL=ON \
-D Trilinos_ENABLE_Ifpack:BOOL=ON \
-D Trilinos_ENABLE_FEI:BOOL=ON \
-D Trilinos_ENABLE_ML:BOOL=ON \
-D Trilinos_ENABLE_NOX:BOOL=ON \
-D Trilinos_ENABLE_Rythmos:BOOL=ON \
-D Trilinos_ENABLE_Thyra:BOOL=ON \
-D Trilinos_ENABLE_Zoltan:BOOL=ON \
-D UMFPACK_INCLUDE_DIRS:PATH="/usr/include/suitesparse" \
-D AMD_INCLUDE_DIRS:PATH="/usr/include/suitesparse" \
$EXTRA_ARGS \
../../Trilinos-11.0.3

However, all the config file generated by the cmake are not accessible. We need modify their attribute like below

#!/bin/sh
chmod u+wr packages/teuchos/src/Teuchos_config.h
chmod u+wr packages/teuchos/src/Teuchos_DLLExportMacro.h
chmod u+wr packages/ThreadPool/src/ThreadPool_config.h
chmod u+wr packages/sacado/src/Sacado_config.h
chmod u+wr packages/rtop/src/RTOp_Config.h
chmod u+wr packages/kokkos/classic/NodeAPI/KokkosClassic_config.h
chmod u+wr packages/kokkos/NodeAPI/Kokkos_config.h
chmod u+wr packages/epetra/src/Epetra_config.h
chmod u+wr packages/epetra/src/Epetra_DLLExportMacro.h
chmod u+wr packages/zoltan/src/Zoltan_config.h
chmod u+wr packages/triutils/src/Triutils_config.h
chmod u+wr packages/kokkos/LinAlg/Kokkos_config.h
chmod u+wr packages/kokkos/classic/LinAlg/KokkosClassic_config.h
chmod u+wr packages/kokkos/classic/NodeTSQR/Tsqr_Config.hpp
chmod u+wr packages/tpetra/src/Tpetra_config.h
chmod u+wr packages/epetraext/src/EpetraExt_config.h
chmod u+wr packages/thyra/core/src/Thyra_Config.h
chmod u+wr packages/isorropia/src/Isorropia_config.h
chmod u+wr packages/aztecoo/src/AztecOO_config.h
chmod u+wr packages/galeri/src/Galeri_config.h
chmod u+wr packages/amesos/src/Amesos_config.h
chmod u+wr packages/ifpack/src/Ifpack_config.h
chmod u+wr packages/ml/src/ml_config.h
chmod u+wr packages/belos/src/Belos_config.h
chmod u+wr packages/stratimikos/src/Stratimikos_InternalConfig.h
chmod u+wr packages/stratimikos/src/Stratimikos_Config.h
chmod u+wr packages/fei/base/FEI_config.h
chmod u+wr packages/fei/support-Trilinos/FEI_config.h
chmod u+wr packages/fei/test_utils/FEI_config.h
chmod u+wr packages/anasazi/src/Anasazi_config.h
chmod u+wr packages/anasazi/src/Anasazi_DLLExportMacro.h
chmod u+wr packages/anasazi/epetra/src/Anasaziepetra_DLLExportMacro.h
chmod u+wr packages/anasazi/epetra/util/ModeLaplace/Anasaziepetra_ModeLaplace_DLLExportMacro.h
chmod u+wr packages/nox/src/NOX_Config.h
chmod u+wr packages/rythmos/src/Rythmos_config.h

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

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