Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thyra: Unresolved external symbol on linking phase building on Windows with shared libraries #13355

Open
sskutnik opened this issue Aug 14, 2024 · 2 comments
Labels
type: bug The primary issue is a bug in Trilinos code or tests

Comments

@sskutnik
Copy link
Contributor

Bug Report

@bartlettroscoe

Description

I am attempting to compile Trillinos 14.4 on Windows (Windows Server 2019) using MSVC 2022. Doing this without shared libraries works fine (i.e., we routinely use Trilinos in our Windows build, wherein Trilinos is built / used without shared libraries). However, if I enable shared libraries, I'm running into the following unresolved symbol issue in linking:

FAILED: packages/thyra/core/src/thyracore.dll packages/thyra/core/src/thyracore.lib
C:\Windows\system32\cmd.exe /C "C:\Windows\system32\cmd.exe /C "C:\toolchains\serial\bin\cmake.exe -E __create_def E:\toolchains\windows\2k19\build\packages\thyra\core\src\CMakeFiles\thyracore.dir\.\exports.def E:\toolchains\windows\2k19\build\packages\thyra\core\src\CMakeFiles\thyracore.dir\.\exports.def.objs && cd E:\toolchains\windows\2k19\build" && C:\toolchains\serial\bin\cmake.exe -E vs_link_dll --intdir=packages\thyra\core\src\CMakeFiles\thyracore.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\mt.exe --manifests  -- C:\PROGRA~1\MICROS~1\2022\COMMUN~1\VC\Tools\MSVC\1439~1.335\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\thyracore.rsp  /out:packages\thyra\core\src\thyracore.dll /implib:packages\thyra\core\src\thyracore.lib /pdb:packages\thyra\core\src\thyracore.pdb /dll /version:14.4 /machine:x64 /INCREMENTAL:NO  /DEF:packages\thyra\core\src\CMakeFiles\thyracore.dir\.\exports.def && cd ."
LINK: command "C:\PROGRA~1\MICROS~1\2022\COMMUN~1\VC\Tools\MSVC\1439~1.335\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\thyracore.rsp /out:packages\thyra\core\src\thyracore.dll /implib:packages\thyra\core\src\thyracore.lib /pdb:packages\thyra\core\src\thyracore.pdb /dll /version:14.4 /machine:x64 /INCREMENTAL:NO /DEF:packages\thyra\core\src\CMakeFiles\thyracore.dir\.\exports.def /MANIFEST:EMBED,ID=2" failed (exit code 1120) with the following output:
   Creating library packages\thyra\core\src\thyracore.lib and object packages\thyra\core\src\thyracore.exp
Thyra_DefaultSerialDenseLinearOpWithSolve.cpp.obj : error LNK2019: unresolved external symbol "class Teuchos::Tuple<char,3> const RTOpPack::transpMap" (?transpMap@RTOpPack@@3V?$Tuple@D$02@Teuchos@@B) referenced in function "void __cdecl RTOpPack::getrs<double>(class RTOpPack::ConstSubMultiVectorView<double> const &,class Teuchos::ArrayView<int const > const &,enum RTOpPack::ETransp,class Teuchos::Ptr<class RTOpPack::SubMultiVectorView<double> const > const &)" (??$getrs@N@RTOpPack@@YAXAEBV?$ConstSubMultiVectorView@N@0@AEBV?$ArrayView@$$CBH@Teuchos@@W4ETransp@0@AEBV?$Ptr@$$CBV?$SubMultiVectorView@N@RTOpPack@@@3@@Z)
packages\thyra\core\src\thyracore.dll : fatal error LNK1120: 1 unresolved externals

Note that I'm trying to enable shared libraries because I'm trying to allow an external project to link to ours via shared libraries (wherein our project depends on Trilinos).

Steps to Reproduce

  1. SHA1: 9753074
  2. Configure script: Trilinos.txt
  3. Configure log: config.log
  4. Build log: build.log
  5. Input deck: N/A
@sskutnik sskutnik added the type: bug The primary issue is a bug in Trilinos code or tests label Aug 14, 2024
@bartlettroscoe
Copy link
Member

Hello @sskutnik, thanks for the bug report. I would have to study the code to see what the the problem might be but it would be hard without reproducing the problem myself. Unfortunately, I don't have a convenient way to reproduce errors with MSVC++ on Windows.

Due to constrained support budgets and lack of recent pull from internal customers, Trilinos is not currently testing or supporting Trilinos builds on Windows (even though CMake supports Windows just fine and that was actually one of the reasons that Trilinos switched over to CMake in 2008, ironically.)

According to official Trilinos policy:

we can accept PRs that address problems on non-supported compilers and platforms but can't directly support these platforms.

Please let me know what you would like to do about this.

@sskutnik
Copy link
Contributor Author

@bartlettroscoe Thanks; I will try to look into this a bit more on my end as time permits and report back if I find anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug The primary issue is a bug in Trilinos code or tests
Projects
None yet
Development

No branches or pull requests

2 participants