diff --git a/lakefile.lean b/lakefile.lean index 313e0b57..34b73821 100644 --- a/lakefile.lean +++ b/lakefile.lean @@ -39,11 +39,12 @@ private def nativeLinkArgs : Array String := "-lstdc++", "-Wl,-rpath," ++ s!"{cudaHome}/lib64" ] - else if Platform.isWindows then + else if Platform.isWindows || Platform.isOSX then + -- Windows and macOS provide libm via the default C runtime #[] else - -- CPU stubs call functions from `math.h`; CUDA objects are C++ when a checkout switches - -- between CPU and CUDA builds without cleaning `.lake`, so Linux links both runtimes. + -- CPU stubs call functions from `math.h`; Linux keeps these in `libm`. + -- Keep libstdc++ for mixed native objects when switching between CPU and CUDA builds. #["-lm", "-lstdc++"] package TorchLean where