Open 3rav opened 2 years ago
FYI, I am also attempting the same process at the moment (building Trilinos under msys2) and using the same build generator. I also had to disable Kokkos & Tpetra due to the above issues, although I can sidestep the issue with Epetra by specifying CMAKE_CXX_FLAGS=-fpermissive
. That said, I still run into the final issue building Teuchos, i.e.:
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/teuchosparameterlist.dir/objects.a(Teuchos_XMLPerfTestArchive.cpp.obj):Teuchos_XMLPerfTestArchive.cpp:(.text+0x1918): undefined reference to `__imp_gethostname'
collect2.exe: error: ld returned 1 exit status
make[2]: *** [packages/teuchos/parameterlist/src/CMakeFiles/teuchosparameterlist.dir/build.make:836: packages/teuchos/parameterlist/src/libteuchosparameterlist.dll] Error 1
make[1]: *** [CMakeFiles/Makefile2:2288: packages/teuchos/parameterlist/src/CMakeFiles/teuchosparameterlist.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
I am compiling with gcc-10.3.0.
I believe I have identified the issue blocking Teuchos from building; Teuchos depends on the Windows socket library (winsock2.h
), but the TRiBITS configuration is incorrect for Windows. Fixing this allows Teuchos to correctly find the Windows socket library and thus build correctly. Specifically, I changed this line:
if (WIN32)
target_link_libraries (teuchosparameterlist ws2_32)
endif ()
to this:
if (WIN32)
target_link_libraries (teuchosparameterlist PUBLIC ws2_32)
endif ()
as it was conflicting with an already-defined TRiBITS macro.
@bartlettroscoe
What version of Trilinos is this?
@bartlettroscoe This is 13.0.1
@bartlettroscoe This is 13.0.1
@sskutnik, that is a very old version of Trilinos as shown by:
$ git log-short --name-status -1 trilinos-release-13-0-1
4796b92 "Merge Pull Request #8315 from trilinos/Trilinos/jwillenbring-release-13-0-1"
Author: trilinos-autotester <trilinos@sandia.gov>
Date: Fri Nov 13 17:13:13 2020 -0700 (11 months ago)
$ git log-short --name-status -1 github/develop
efad248 "Merge Pull Request #9826 from cwsmith/Trilinos/cws/zoltanConfigUpdate"
Author: trilinos-autotester <trilinos@sandia.gov>
Date: Thu Oct 21 19:08:11 2021 -0600 (17 hours ago)
$ git log --oneline HEAD --not trilinos-release-13-0-1 | wc -l
5010
My advice is to try a recent version of 'master'.
that is a very old version of Trilinos as shown by: ... My advice is to try a recent version of 'master'.
Even though it's old, 13.0.1 is the most recent Trilinos release.
FYI, the release schedule is a topic of recent discussion, and hopefully be more regular. I think @jwillenbring did a recent tag of a minor release, but I do not see it.
My test for master (download 10AM 25.10.2021 UTC+01:00).
Main setting:
-DCMAKE_BUILD_TYPE=Release \
-DBLAS_LIBRARY_NAMES="openblas" \
-DLAPACK_LIBRARY_NAMES="openblas" \
-DMPI_USE_COMPILER_WRAPPERS=ON \
-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES=ON \
-DTrilinos_ENABLE_ALL_PACKAGES=ON \
-DTrilinos_ENABLE_SEACAS=OFF \
-DTrilinos_ENABLE_Zoltan=OFF \
Error:
For Ninja and MSYS Makefiles:
CMake Error at packages/teuchos/parameterlist/src/CMakeLists.txt:28 (target_link_libraries):
The keyword signature for target_link_libraries has already been used with
the target "teuchosparameterlist". All uses of target_link_libraries with
a target must be either all-keyword or all-plain.
The uses of the keyword signature are here:
* cmake/tribits/core/package_arch/TribitsLibraryMacros.cmake:864 (target_link_libraries)
after add -DTrilinos_ENABLE_Teuchos=OFF \
for Ninja generator:
-- Configuring done
CMake Warning in packages/kokkos-kernels/src/CMakeLists.txt:
The object file directory
C:/msys64/usr/local/pkg_trilinos/reczne/build/packages/kokkos-kernels/src/CMakeFiles/kokkoskernels.dir/./
has 105 characters. The maximum full path to an object file is 250
characters (see CMAKE_OBJECT_PATH_MAX). Object file
impl/generated_specializations_cpp/spmv/Sparse_spmv_mv_struct_eti_DOUBLE_ORDINAL_INT_OFFSET_SIZE_T_LAYOUTLEFT_EXECSPACE_SERIAL_MEMSPACE_HOSTSPACE.cpp.obj
cannot be safely placed under this directory. The build may not work
correctly.
for MSYS Generator - OK (compiling start)
[ 9%] Building C object packages/common/auxiliarySoftware/SuiteSparse/src/CMakeFiles/trilinosss.dir/BTF/Source/trilinos_btf_order.c.obj
In file included from C:/msys64/usr/local/pkg_trilinos/reczne/packages/kokkos/core/src/Kokkos_Atomic.hpp:187,
from C:/msys64/usr/local/pkg_trilinos/reczne/packages/kokkos/core/src/impl/Kokkos_Atomic_View.hpp:48,
from C:/msys64/usr/local/pkg_trilinos/reczne/packages/kokkos/core/src/impl/Kokkos_ViewMapping.hpp:59,
from C:/msys64/usr/local/pkg_trilinos/reczne/packages/kokkos/core/src/Kokkos_View.hpp:501,
from C:/msys64/usr/local/pkg_trilinos/reczne/packages/kokkos/core/src/Kokkos_Parallel.hpp:53,
from C:/msys64/usr/local/pkg_trilinos/reczne/packages/kokkos/core/src/Kokkos_Serial.hpp:57,
from C:/msys64/usr/local/pkg_trilinos/reczne/packages/kokkos/core/src/decl/Kokkos_Declare_SERIAL.hpp:49,
from C:/msys64/usr/local/pkg_trilinos/reczne/build/packages/kokkos/KokkosCore_Config_DeclareBackend.hpp:47,
from C:/msys64/usr/local/pkg_trilinos/reczne/packages/kokkos/core/src/Kokkos_Core.hpp:56,
from C:/msys64/usr/local/pkg_trilinos/reczne/packages/kokkos/core/src/impl/Kokkos_Core.cpp:45:
C:/msys64/usr/local/pkg_trilinos/reczne/packages/kokkos/core/src/impl/Kokkos_Atomic_Windows.hpp: In function 'T Kokkos::atomic_compare_exchange(volatile T*, const T&, typename std::enable_if<(sizeof (T) == sizeof (char)), const T&>::type)':
C:/msys64/usr/local/pkg_trilinos/reczne/packages/kokkos/core/src/impl/Kokkos_Atomic_Windows.hpp:87:11: error: there are no arguments to '_InterlockedCompareExchange8' that depend on a template parameter, so a declaration of '_InterlockedCompareExchange8' must be available [-fpermissive]
87 | tmp.i = _InterlockedCompareExchange8((CHAR*)dest, *((CHAR*)&val),
after add -DTrilinos_ENABLE_Kokkos=OFF \
[ 34%] Building CXX object packages/epetra/src/CMakeFiles/epetra.dir/Epetra_Import_Util.cpp.obj
In file included from C:/msys64/usr/local/pkg_trilinos/reczne/packages/epetra/src/Epetra_Fortran_wrappers.cpp:43:
C:/msys64/usr/local/pkg_trilinos/reczne/packages/epetra/src/Epetra_C_wrappers.cpp: In function 'EPETRA_OBJECT_PTR epetra_serialcomm_create__()':
C:/msys64/usr/local/pkg_trilinos/reczne/packages/epetra/src/Epetra_C_wrappers.cpp:82:12: error: cast from 'Epetra_Comm*' to 'EPETRA_OBJECT_PTR' {aka 'long int'} loses precision [-fpermissive]
82 | return((EPETRA_OBJECT_PTR ) comm);
after add -DTrilinos_ENABLE_Epetra=OFF \
100% OK!
Now test with -DTrilinos_ENABLE_Epetra=ON \
and -DCMAKE_CXX_FLAGS=-fpermissive \
[ 84%] Building C object packages/ml/src/CMakeFiles/ml.dir/Utils/ml_agg_info.c.obj
C:/msys64/usr/local/pkg_trilinos/reczne/packages/ml/src/Utils/ml_epetra_utils.cpp: In function 'int ML_Epetra_getrow_Filter(ML_Operator*, int, int*, int, int*, double*, int*)':
C:/msys64/usr/local/pkg_trilinos/reczne/packages/ml/src/Utils/ml_epetra_utils.cpp:592:3: error: 'TEUCHOS_TEST_FOR_EXCEPT_MSG' was not declared in this scope
592 | TEUCHOS_TEST_FOR_EXCEPT_MSG(
It's really close to compiling all the trilinos packages in the msys2 (mingw) environment.
@3rav Try on the develop
branch with the MRs that were recently merged in. This takes care of Teuchos and I believe Epetra; the only one I'm still struggling with is Kokkos.
Try on the
develop
branch with the MRs that were recently merged in. This takes care of Teuchos and I believe Epetra; the only one I'm still struggling with is Kokkos.
@sskutnik You might already know this, but Kokkos is maintained separately at https://github.com/kokkos/kokkos, so any PR should go there. Kokkos developers are also very responsive on their slack channel -- see kokkos.org -> outreach.
For current develop branch I successfully compiled trilinos with give me 58 static .a libraries, with this flags:
-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES=ON \
-DTrilinos_ENABLE_ALL_PACKAGES=ON \
-DTrilinos_ENABLE_SEACAS=OFF \
-DTrilinos_ENABLE_Zoltan=OFF \
-DTrilinos_ENABLE_KokkosKernels=OFF \
-DTrilinos_ENABLE_Xpetra=OFF \
-DTrilinos_ENABLE_Moertel=OFF \
-DTrilinos_ENABLE_Piro=OFF \
error before Trilinos_ENABLE_Moertel=OFF:
[ 61%] Building CXX object packages/moertel/src/mortar/CMakeFiles/moertel.dir/mrtr_pnode.cpp.obj
In file included from C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/moertel/src/mortar/mrtr_segment.cpp:47:
C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/moertel/src/mortar/Moertel_ExplicitTemplateInstantiation.hpp:52:10: fatal error: Kokkos_DefaultNode.hpp: No such file or directory
52 | #include <Kokkos_DefaultNode.hpp>
| ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [packages/moertel/src/mortar/CMakeFiles/moertel.dir/build.make:188: packages/moertel/src/mortar/CMakeFiles/moertel.dir/mrtr_segment.cpp.obj] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/moertel/src/mortar/mrtr_node.cpp:47:
C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/moertel/src/mortar/Moertel_ExplicitTemplateInstantiation.hpp:52:10: fatal error: Kokkos_DefaultNode.hpp: No such file or directory
52 | #include <Kokkos_DefaultNode.hpp>
| ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [packages/moertel/src/mortar/CMakeFiles/moertel.dir/build.make:216: packages/moertel/src/mortar/CMakeFiles/moertel.dir/mrtr_node.cpp.obj] Error 1
In file included from C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/moertel/src/mortar/mrtr_overlap.hpp:324,
from C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/moertel/src/mortar/mrtr_point.cpp:48:
C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/moertel/src/mortar/mrtr_overlap_Def.hpp: In member function 'bool MOERTEL::Overlap<IFace>::Triangulation()':
C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/moertel/src/mortar/mrtr_overlap_Def.hpp:1590:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
1590 | if (func) delete func; func = NULL;
| ^~
C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/moertel/src/mortar/mrtr_overlap_Def.hpp:1590:28: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
1590 | if (func) delete func; func = NULL;
| ^~~~
C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/moertel/src/mortar/mrtr_overlap_Def.hpp:1606:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
1606 | if (func) delete func; func = NULL;
| ^~
C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/moertel/src/mortar/mrtr_overlap_Def.hpp:1606:28: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
1606 | if (func) delete func; func = NULL;
| ^~~~
In file included from C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/moertel/src/mortar/mrtr_overlap.hpp:324,
from C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/moertel/src/mortar/mrtr_integrator.H:70,
from C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/moertel/src/mortar/mrtr_interface_integrate3D.cpp:54:
C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/moertel/src/mortar/mrtr_overlap_Def.hpp: In member function 'bool MOERTEL::Overlap<IFace>::Triangulation()':
C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/moertel/src/mortar/mrtr_overlap_Def.hpp:1590:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
1590 | if (func) delete func; func = NULL;
| ^~
C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/moertel/src/mortar/mrtr_overlap_Def.hpp:1590:28: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
1590 | if (func) delete func; func = NULL;
| ^~~~
C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/moertel/src/mortar/mrtr_overlap_Def.hpp:1606:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
1606 | if (func) delete func; func = NULL;
| ^~
C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/moertel/src/mortar/mrtr_overlap_Def.hpp:1606:28: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
1606 | if (func) delete func; func = NULL;
| ^~~~
In file included from C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/moertel/src/mortar/mrtr_overlap.cpp:48:
C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/moertel/src/mortar/Moertel_ExplicitTemplateInstantiation.hpp:52:10: fatal error: Kokkos_DefaultNode.hpp: No such file or directory
52 | #include <Kokkos_DefaultNode.hpp>
| ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [packages/moertel/src/mortar/CMakeFiles/moertel.dir/build.make:230: packages/moertel/src/mortar/CMakeFiles/moertel.dir/mrtr_overlap.cpp.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:7250: packages/moertel/src/mortar/CMakeFiles/moertel.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 61%] Linking CXX static library libbelos.a
error before Trilinos_ENABLE_Piro=OFF:
[ 98%] Building CXX object packages/piro/src/CMakeFiles/piro.dir/Piro_ObserverToLOCASaveDataStrategyAdapter.cpp.obj
In file included from C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/piro/src/Piro_SteadyStateSolver_Def.hpp:80,
from C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/piro/src/Piro_SteadyStateSolver.hpp:161,
from C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/piro/src/Piro_NOXSolver.hpp:46,
from C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/piro/src/Piro_NOXSolver_Def.hpp:46,
from C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/piro/src/Piro_NOXSolver.cpp:43:
C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/piro/src/Piro_ThyraProductME_Constraint_SimOpt.hpp:53:10: fatal error: Tpetra_CrsMatrix.hpp: No such file or directory
53 | #include "Tpetra_CrsMatrix.hpp"
| ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/piro/src/Piro_SteadyStateSolver_Def.hpp:80,
from C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/piro/src/Piro_SteadyStateSolver.hpp:161,
from C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/piro/src/Piro_LOCASolver.hpp:46,
from C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/piro/src/Piro_LOCASolver_Def.hpp:46,
from C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/piro/src/Piro_LOCASolver.cpp:43:
C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/piro/src/Piro_ThyraProductME_Constraint_SimOpt.hpp:53:10: fatal error: Tpetra_CrsMatrix.hpp: No such file or directory
53 | #include "Tpetra_CrsMatrix.hpp"
| ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [packages/piro/src/CMakeFiles/piro.dir/build.make:174: packages/piro/src/CMakeFiles/piro.dir/Piro_LOCASolver.cpp.obj] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [packages/piro/src/CMakeFiles/piro.dir/build.make:160: packages/piro/src/CMakeFiles/piro.dir/Piro_NOXSolver.cpp.obj] Error 1
In file included from C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/piro/src/Piro_SteadyStateSolver_Def.hpp:80,
from C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/piro/src/Piro_SteadyStateSolver.hpp:161,
from C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/piro/src/Piro_LOCAAdaptiveSolver.hpp:46,
from C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/piro/src/Piro_LOCAAdaptiveSolver_Def.hpp:46,
from C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/piro/src/Piro_LOCAAdaptiveSolver.cpp:43:
C:/msys64/usr/local/pkg_trilinos/src/Trilinos-develop/packages/piro/src/Piro_ThyraProductME_Constraint_SimOpt.hpp:53:10: fatal error: Tpetra_CrsMatrix.hpp: No such file or directory
53 | #include "Tpetra_CrsMatrix.hpp"
| ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [packages/piro/src/CMakeFiles/piro.dir/build.make:188: packages/piro/src/CMakeFiles/piro.dir/Piro_LOCAAdaptiveSolver.cpp.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:7808: packages/piro/src/CMakeFiles/piro.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
==> ERROR: A failure occurred in build().
Aborting...
Can you release 13.2.1 based on develop branch, for this version (compared to 13.2.0), much more libraries are compiled 5 vs 58?
For current develop branch I successfully compiled trilinos with give me 58 static .a libraries, with this flags:
Can you release 13.2.1 based on develop branch, for this version (compared to 13.2.0), much more libraries are compiled 5 vs 58?
@3rav Thanks for the information. What SHA is this? @jwillenbring
This issue has had no activity for 365 days and is marked for closure. It will be closed after an additional 30 days of inactivity.
If you would like to keep this issue open please add a comment and/or remove the MARKED_FOR_CLOSURE
label.
If this issue should be kept open even with no activity beyond the time limits you can add the label DO_NOT_AUTOCLOSE
.
If it is ok for this issue to be closed, feel free to go ahead and close it. Please do not add any comments or change any labels or otherwise touch this issue unless your intention is to reset the inactivity counter for an additional year.
In order to keep the thread from being closed, this error persists (the latest version 13.4.1):
-- TrilinosBuildStats_Results: NOT added test because TrilinosBuildStats_ENABLE_TESTS=''.
No ETI support requested by packages.
Generating dummy makefiles in each directory to call Ninja ...
Set up for creating a distribution ...
Finished configuring Trilinos!
-- Configuring done
CMake Warning in packages/kokkos-kernels/src/CMakeLists.txt:
The object file directory
C:/msys64/usr/local/pkg_trilinos/src/build-MINGW64/packages/kokkos-kernels/src/CMakeFiles/kokkoskernels.dir/./
has 110 characters. The maximum full path to an object file is 250
characters (see CMAKE_OBJECT_PATH_MAX). Object file
531fb8313e1b749a911db0a0ffec32c2/Sparse_sptrsv_solve_eti_DOUBLE_ORDINAL_INT_OFFSET_INT_LAYOUTLEFT_EXECSPACE_SERIAL_MEMSPACE_HOSTSPACE.cpp.obj
cannot be safely placed under this directory. The build may not work
correctly.
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
MPI_USE_COMPILER_WRAPPERS
-- Build files have been written to: C:/msys64/usr/local/pkg_trilinos/src/build-MINGW64
ad. 1 With -GNinja (solved): "Support for path lengths over 260 characters on Windows https://github.com/ninja-build/ninja/issues/1900" more info: https://github.com/ninja-build/ninja/releases/tag/v1.12.0
I was able to compile Trillions in the mingw environment but had to exclude a few packages, due to the fact that I compiled the new seacas separately, I excluded its packages.
-DTrilinos_ENABLE_SEACAS=OFF and -DTrilinos_ENABLE_Zoltan=OFF
Errors encountered:
after changing to "MSYS Makefile" problem no longer exists, but a ninja generator is recommended.
Error with Kokkos:
After Kokkos and Tpetra =OFF:
add Epetra, Xpetra, Galeria and MueLu =OFF (excluding one forces the other):
and error only for mingw32 and shared library (-DBUILD_SHARED_LIBS=ON):