-
Notifications
You must be signed in to change notification settings - Fork 37
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
Unset _SHORTFIN_USING_DYLIB
when building static.
#633
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not familiar with this but it does feel wrong to have the static build "using dylib" - probably was added during iteration and not caught because it happened to work in one place. Ship it!
Sanity checked building Together with iree-org/iree#19346, I can now build shortfin on Windows again (using static linking, dynamic is blocked by #211 still). |
Yeah, Linux defaults to dynamic linking since that's what Stella preferred but Windows defaults to static because that's all that currently works. I think the static linking path on Linux is only lightly tested. |
Thanks. It is less that I prefer dynamic linking than that I would like to make sure it works, and using it is the best way to ensure that. Tests and the python extension dynamic link today and that catches a lot of bugs. |
This doesn't look intentional (added in #434) and it contributes to #534: ``` [main] Building folder: d:/dev/projects/shark-ai/shortfin/build [build] Starting build [proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --build d:/dev/projects/shark-ai/shortfin/build --config RelWithDebInfo --target shortfin_array_test -- [build] [1/2 0% :: 0.041] Re-checking globbed directories... [build] [1/1 100% :: 0.240] Linking CXX executable src\shortfin\array\shortfin_array_test.exe [build] FAILED: src/shortfin/array/shortfin_array_test.exe src/shortfin/array/shortfin_array_test[1]_tests.cmake D:/dev/projects/shark-ai/shortfin/build/src/shortfin/array/shortfin_array_test[1]_tests.cmake [build] C:\WINDOWS\system32\cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=src\shortfin\array\CMakeFiles\shortfin_array_test.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~2\MICROS~1\2022\BUILDT~1\VC\Tools\MSVC\1441~1.341\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\shortfin_array_test.rsp /out:src\shortfin\array\shortfin_array_test.exe /implib:src\shortfin\array\shortfin_array_test.lib /pdb:src\shortfin\array\shortfin_array_test.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console -natvis:D:/dev/projects/iree/runtime/iree.natvis /INCREMENTAL:NO /LTCG && C:\WINDOWS\system32\cmd.exe /C "cd /D D:\dev\projects\shark-ai\shortfin\build\src\shortfin\array && "C:\Program Files\CMake\bin\cmake.exe" -D TEST_TARGET=shortfin_array_test -D TEST_EXECUTABLE=D:/dev/projects/shark-ai/shortfin/build/src/shortfin/array/shortfin_array_test.exe -D TEST_EXECUTOR= -D TEST_WORKING_DIR=D:/dev/projects/shark-ai/shortfin/build -D TEST_EXTRA_ARGS= -D TEST_PROPERTIES= -D TEST_PREFIX= -D TEST_SUFFIX= -D TEST_FILTER= -D NO_PRETTY_TYPES=FALSE -D NO_PRETTY_VALUES=FALSE -D TEST_LIST=shortfin_array_test_TESTS -D CTEST_FILE=D:/dev/projects/shark-ai/shortfin/build/src/shortfin/array/shortfin_array_test[1]_tests.cmake -D TEST_DISCOVERY_TIMEOUT=5 -D TEST_XML_OUTPUT_DIR= -P "C:/Program Files/CMake/share/cmake-3.30/Modules/GoogleTestAddTests.cmake""" [build] LINK: command "C:\PROGRA~2\MICROS~1\2022\BUILDT~1\VC\Tools\MSVC\1441~1.341\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\shortfin_array_test.rsp /out:src\shortfin\array\shortfin_array_test.exe /implib:src\shortfin\array\shortfin_array_test.lib /pdb:src\shortfin\array\shortfin_array_test.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console -natvis:D:/dev/projects/iree/runtime/iree.natvis /INCREMENTAL:NO /LTCG /MANIFEST:EMBED,ID=1" failed (exit code 1120) with the following output: [build] array_test.cc.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class shortfin::local::Worker & __cdecl shortfin::local::System::init_worker(void)" (__imp_?init_worker@System@local@shortfin@@QEAAAEAVWorker@23@XZ) [build] array_test.cc.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::shared_ptr<class shortfin::local::Fiber> __cdecl shortfin::local::System::CreateFiber(class shortfin::local::Worker &,class std::span<class shortfin::local::Device * const,-1>)" (__imp_?CreateFiber@System@local@shortfin@@qeaa?AV?$shared_ptr@VFiber@local@shortfin@@@std@@AEAVWorker@23@V?$span@QEAVDevice@local@shortfin@@$0?0@5@@z) ... [build] src\shortfin\array\shortfin_array_test.exe : fatal error LNK1120: 50 unresolved externals [build] ninja: build stopped: subcommand failed. [proc] The command: "C:\Program Files\CMake\bin\cmake.EXE" --build d:/dev/projects/shark-ai/shortfin/build --config RelWithDebInfo --target shortfin_array_test -- exited with code: 1 [driver] Build completed: 00:00:00.301 [build] Build finished with exit code 1 ```
This doesn't look intentional (added in #434) and it contributes to #534: