Skip to content

Commit 5eafe7d

Browse files
conradhueblerclaude
andcommitted
Fix MSVC link: don't pass raw pthread to curcuma_core/curcuma_cap
MSVC has no pthread.lib (threads come from the CRT), so any executable linking curcuma_core/curcuma_cap failed with LNK1181 "cannot open input file 'pthread.lib'" (seen on parallel_scf; qurcuma's own target would hit it next). Guard the link item via CURCUMA_PTHREAD: empty on MSVC, 'pthread' elsewhere. MinGW (winpthreads), Linux and macOS are unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 8a160b5 commit 5eafe7d

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

CMakeLists.txt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,8 +1244,17 @@ if(USE_VULKAN)
12441244
message(STATUS "Vulkan support enabled: -gpu vulkan available (Stage 0)")
12451245
endif()
12461246

1247-
target_link_libraries(curcuma_core pthread fmt::fmt-header-only )
1248-
target_link_libraries(curcuma_cap pthread fmt::fmt-header-only )
1247+
# Claude Generated 2026 - MSVC has no pthread (threads come from the CRT); MinGW
1248+
# (winpthreads), Linux and macOS still need -lpthread. Guard the link item so MSVC
1249+
# doesn't try to open a nonexistent pthread.lib (LNK1181) when anything links
1250+
# curcuma_core/curcuma_cap (parallel_scf, qurcuma, ...).
1251+
if(MSVC)
1252+
set(CURCUMA_PTHREAD "")
1253+
else()
1254+
set(CURCUMA_PTHREAD pthread)
1255+
endif()
1256+
target_link_libraries(curcuma_core ${CURCUMA_PTHREAD} fmt::fmt-header-only )
1257+
target_link_libraries(curcuma_cap ${CURCUMA_PTHREAD} fmt::fmt-header-only )
12491258

12501259
# Link BLAS/LAPACK for curcuma_core.
12511260
# EIGEN_USE_BLAS: per-file in eeq_solver.cpp (avoids Eigen 3.4 complex-type conflict).

0 commit comments

Comments
 (0)