<?xml version="1.0" encoding="UTF-8"?>

<!--XBRL Document Created with the Workiva Platform-->
<!--Copyright 2026 Workiva-->
<!--r:019dd0b2-9f41-7061-80c5-0ea4653ab161,g:bcbe042f-2133-4ee4-a0ed-25d2e4f2803f-->
<link:linkbase xmlns:link="http://www.xbrl.org/2003/linkbase" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.xbrl.org/2003/linkbase http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd">
  <link:arcroleRef arcroleURI="https://xbrl.org/2023/arcrole/summation-item" xlink:type="simple" xlink:href="https://www.xbrl.org/2023/calculation-1.1.xsd#summation-item"/>
  <link:roleRef roleURI="http://www.sanmina.com/role/CondensedConsolidatedBalanceSheets" xlink:type="simple" xlink:href="sanm-20260627.xsd#CondensedConsolidatedBalanceSheets"/>
  <link:calculationLink xlink:role="http://www.sanmina.com/role/CondensedConsolidatedBalanceSheets" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesNoncurrent_019dd0b2-a095-7f41-b458-6f4d7eaad9af" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LiabilitiesNoncurrent"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermDebtNoncurrent_019dd0b2-a095-702e-bb21-270148c443a4" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LongTermDebtNoncurrent"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesNoncurrent_019dd0b2-a095-7f41-b458-6f4d7eaad9af" xlink:to="loc_us-gaap_LongTermDebtNoncurrent_019dd0b2-a095-702e-bb21-270148c443a4" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherLiabilitiesNoncurrent_019dd0b2-a095-7d9b-9f4c-062e696d0cf6" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OtherLiabilitiesNoncurrent"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesNoncurrent_019dd0b2-a095-7f41-b458-6f4d7eaad9af" xlink:to="loc_us-gaap_OtherLiabilitiesNoncurrent_019dd0b2-a095-7d9b-9f4c-062e696d0cf6" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetsCurrent_019dd0b2-a095-7636-8814-8a56ca81af79" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AssetsCurrent"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashAndCashEquivalentsAtCarryingValue_019dd0b2-a095-7926-a800-9a0b63f68680" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CashAndCashEquivalentsAtCarryingValue"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_AssetsCurrent_019dd0b2-a095-7636-8814-8a56ca81af79" xlink:to="loc_us-gaap_CashAndCashEquivalentsAtCarryingValue_019dd0b2-a095-7926-a800-9a0b63f68680" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccountsAndOtherReceivablesNetCurrent_019dd0b2-a095-7760-ab0a-742180e13035" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AccountsAndOtherReceivablesNetCurrent"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_AssetsCurrent_019dd0b2-a095-7636-8814-8a56ca81af79" xlink:to="loc_us-gaap_AccountsAndOtherReceivablesNetCurrent_019dd0b2-a095-7760-ab0a-742180e13035" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ContractWithCustomerAssetNetCurrent_019dd0b2-a095-7178-96d0-34206038b3ae" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ContractWithCustomerAssetNetCurrent"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_AssetsCurrent_019dd0b2-a095-7636-8814-8a56ca81af79" xlink:to="loc_us-gaap_ContractWithCustomerAssetNetCurrent_019dd0b2-a095-7178-96d0-34206038b3ae" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InventoryNet_019dd0b2-a095-7555-9d93-46d375659d3a" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_InventoryNet"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_AssetsCurrent_019dd0b2-a095-7636-8814-8a56ca81af79" xlink:to="loc_us-gaap_InventoryNet_019dd0b2-a095-7555-9d93-46d375659d3a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PrepaidExpenseAndOtherAssetsCurrent_019dd0b2-a095-7fab-99ee-32b13e6f7fce" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_PrepaidExpenseAndOtherAssetsCurrent"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_AssetsCurrent_019dd0b2-a095-7636-8814-8a56ca81af79" xlink:to="loc_us-gaap_PrepaidExpenseAndOtherAssetsCurrent_019dd0b2-a095-7fab-99ee-32b13e6f7fce" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesCurrent_019dd0b2-a095-78d3-a985-baeaf5ff4afc" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LiabilitiesCurrent"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccountsPayableCurrent_019dd0b2-a095-7797-b2a8-064eb52fcbb4" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AccountsPayableCurrent"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesCurrent_019dd0b2-a095-78d3-a985-baeaf5ff4afc" xlink:to="loc_us-gaap_AccountsPayableCurrent_019dd0b2-a095-7797-b2a8-064eb52fcbb4" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherLiabilitiesCurrent_019dd0b2-a095-79d6-8c05-e9131f3a8fc8" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OtherLiabilitiesCurrent"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesCurrent_019dd0b2-a095-78d3-a985-baeaf5ff4afc" xlink:to="loc_us-gaap_OtherLiabilitiesCurrent_019dd0b2-a095-79d6-8c05-e9131f3a8fc8" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeRelatedLiabilitiesCurrent_019dd0b2-a095-7e7b-8fc9-03827b5388ad" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_EmployeeRelatedLiabilitiesCurrent"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesCurrent_019dd0b2-a095-78d3-a985-baeaf5ff4afc" xlink:to="loc_us-gaap_EmployeeRelatedLiabilitiesCurrent_019dd0b2-a095-7e7b-8fc9-03827b5388ad" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtCurrent_019dd0b2-a095-74a0-b83f-bbfe4f637e96" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DebtCurrent"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesCurrent_019dd0b2-a095-78d3-a985-baeaf5ff4afc" xlink:to="loc_us-gaap_DebtCurrent_019dd0b2-a095-74a0-b83f-bbfe4f637e96" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_sanm_DeferredRevenueAndCustomerAdvances_019dd0b2-a095-740e-859b-45396c0c1394" xlink:href="sanm-20260627.xsd#sanm_DeferredRevenueAndCustomerAdvances"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesCurrent_019dd0b2-a095-78d3-a985-baeaf5ff4afc" xlink:to="loc_sanm_DeferredRevenueAndCustomerAdvances_019dd0b2-a095-740e-859b-45396c0c1394" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Assets_019dd0b2-a095-772c-b624-3da890cdd56f" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_Assets"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetsCurrent_019dd0b2-a095-76c0-914f-ac411f00a785" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AssetsCurrent"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_019dd0b2-a095-772c-b624-3da890cdd56f" xlink:to="loc_us-gaap_AssetsCurrent_019dd0b2-a095-76c0-914f-ac411f00a785" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentNet_019dd0b2-a095-7261-bbbc-a867e8b33e65" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_PropertyPlantAndEquipmentNet"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_019dd0b2-a095-772c-b624-3da890cdd56f" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentNet_019dd0b2-a095-7261-bbbc-a867e8b33e65" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxAssetsNet_019dd0b2-a095-71e3-ac6f-80e9002393e0" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DeferredIncomeTaxAssetsNet"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_019dd0b2-a095-772c-b624-3da890cdd56f" xlink:to="loc_us-gaap_DeferredIncomeTaxAssetsNet_019dd0b2-a095-71e3-ac6f-80e9002393e0" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Goodwill_019dd0b2-a095-7ac9-b4ef-8c2698c1a99b" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_Goodwill"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_019dd0b2-a095-772c-b624-3da890cdd56f" xlink:to="loc_us-gaap_Goodwill_019dd0b2-a095-7ac9-b4ef-8c2698c1a99b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherAssetsNoncurrent_019dd0b2-a095-7444-afa6-35034b489a0e" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OtherAssetsNoncurrent"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_019dd0b2-a095-772c-b624-3da890cdd56f" xlink:to="loc_us-gaap_OtherAssetsNoncurrent_019dd0b2-a095-7444-afa6-35034b489a0e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesAndStockholdersEquity_019dd0b2-a095-7186-b984-714ad9c6f033" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LiabilitiesAndStockholdersEquity"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesNoncurrent_019dd0b2-a095-7ab1-bf22-8634248fbb45" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LiabilitiesNoncurrent"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquity_019dd0b2-a095-7186-b984-714ad9c6f033" xlink:to="loc_us-gaap_LiabilitiesNoncurrent_019dd0b2-a095-7ab1-bf22-8634248fbb45" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesCurrent_019dd0b2-a095-734f-b7c6-26ec47596018" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LiabilitiesCurrent"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquity_019dd0b2-a095-7186-b984-714ad9c6f033" xlink:to="loc_us-gaap_LiabilitiesCurrent_019dd0b2-a095-734f-b7c6-26ec47596018" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterest_019dd0b2-a095-7585-9b1e-b2d0e589a1a8" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterest"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquity_019dd0b2-a095-7186-b984-714ad9c6f033" xlink:to="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterest_019dd0b2-a095-7585-9b1e-b2d0e589a1a8" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.sanmina.com/role/CondensedConsolidatedStatementsofIncome" xlink:type="simple" xlink:href="sanm-20260627.xsd#CondensedConsolidatedStatementsofIncome"/>
  <link:calculationLink xlink:role="http://www.sanmina.com/role/CondensedConsolidatedStatementsofIncome" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss_019dd0b2-a095-759c-9aa7-67922daf5972" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_NetIncomeLoss"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProfitLoss_019dd0b2-a095-7c95-9849-30375e0673ef" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ProfitLoss"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetIncomeLoss_019dd0b2-a095-759c-9aa7-67922daf5972" xlink:to="loc_us-gaap_ProfitLoss_019dd0b2-a095-7c95-9849-30375e0673ef" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLossAttributableToNoncontrollingInterest_019dd0b2-a095-78d7-acca-ea2c138d4af9" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_NetIncomeLossAttributableToNoncontrollingInterest"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetIncomeLoss_019dd0b2-a095-759c-9aa7-67922daf5972" xlink:to="loc_us-gaap_NetIncomeLossAttributableToNoncontrollingInterest_019dd0b2-a095-78d7-acca-ea2c138d4af9" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NonoperatingIncomeExpense_019dd0b2-a095-7090-8d11-84434c2933c1" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_NonoperatingIncomeExpense"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestAndOtherIncome_019dd0b2-a095-7b16-a24d-cdf5c4f663b5" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_InterestAndOtherIncome"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NonoperatingIncomeExpense_019dd0b2-a095-7090-8d11-84434c2933c1" xlink:to="loc_us-gaap_InterestAndOtherIncome_019dd0b2-a095-7b16-a24d-cdf5c4f663b5" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestExpenseNonoperating_019dd0b2-a095-7a4c-8e4a-b84027216676" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_InterestExpenseNonoperating"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NonoperatingIncomeExpense_019dd0b2-a095-7090-8d11-84434c2933c1" xlink:to="loc_us-gaap_InterestExpenseNonoperating_019dd0b2-a095-7a4c-8e4a-b84027216676" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherNonoperatingIncomeExpense_019dd0b2-a095-7536-832d-444b6a4de80d" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OtherNonoperatingIncomeExpense"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NonoperatingIncomeExpense_019dd0b2-a095-7090-8d11-84434c2933c1" xlink:to="loc_us-gaap_OtherNonoperatingIncomeExpense_019dd0b2-a095-7536-832d-444b6a4de80d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingExpenses_019dd0b2-a095-7132-857c-0efe6a8549ea" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OperatingExpenses"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SellingGeneralAndAdministrativeExpense_019dd0b2-a095-7c36-b30d-59dae8cd2a6c" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_SellingGeneralAndAdministrativeExpense"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_OperatingExpenses_019dd0b2-a095-7132-857c-0efe6a8549ea" xlink:to="loc_us-gaap_SellingGeneralAndAdministrativeExpense_019dd0b2-a095-7c36-b30d-59dae8cd2a6c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ResearchAndDevelopmentExpense_019dd0b2-a095-789f-ac2c-b013b3ccbba9" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ResearchAndDevelopmentExpense"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_OperatingExpenses_019dd0b2-a095-7132-857c-0efe6a8549ea" xlink:to="loc_us-gaap_ResearchAndDevelopmentExpense_019dd0b2-a095-789f-ac2c-b013b3ccbba9" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_sanm_AcquisitionIntegrationAndOthers_019dd0b2-a095-743d-b9f8-8844fefa8c33" xlink:href="sanm-20260627.xsd#sanm_AcquisitionIntegrationAndOthers"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_OperatingExpenses_019dd0b2-a095-7132-857c-0efe6a8549ea" xlink:to="loc_sanm_AcquisitionIntegrationAndOthers_019dd0b2-a095-743d-b9f8-8844fefa8c33" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AmortizationOfIntangibleAssets_019dd0b2-a095-77b1-83b4-c47958a3bb4e" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AmortizationOfIntangibleAssets"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_OperatingExpenses_019dd0b2-a095-7132-857c-0efe6a8549ea" xlink:to="loc_us-gaap_AmortizationOfIntangibleAssets_019dd0b2-a095-77b1-83b4-c47958a3bb4e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringCharges_019dd0b2-a095-7011-9433-75e839a33fe6" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RestructuringCharges"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_OperatingExpenses_019dd0b2-a095-7132-857c-0efe6a8549ea" xlink:to="loc_us-gaap_RestructuringCharges_019dd0b2-a095-7011-9433-75e839a33fe6" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingIncomeLoss_019dd0b2-a095-7d3a-ac61-72f10e474b55" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OperatingIncomeLoss"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GrossProfit_019dd0b2-a095-7cd1-8257-b0f57e377c58" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_GrossProfit"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_OperatingIncomeLoss_019dd0b2-a095-7d3a-ac61-72f10e474b55" xlink:to="loc_us-gaap_GrossProfit_019dd0b2-a095-7cd1-8257-b0f57e377c58" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingExpenses_019dd0b2-a095-7d50-abdd-fb51af744d4e" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OperatingExpenses"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_OperatingIncomeLoss_019dd0b2-a095-7d3a-ac61-72f10e474b55" xlink:to="loc_us-gaap_OperatingExpenses_019dd0b2-a095-7d50-abdd-fb51af744d4e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_019dd0b2-a095-7e29-bbd6-d8172a95435f" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NonoperatingIncomeExpense_019dd0b2-a095-79be-af61-ea01feff8684" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_NonoperatingIncomeExpense"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_019dd0b2-a095-7e29-bbd6-d8172a95435f" xlink:to="loc_us-gaap_NonoperatingIncomeExpense_019dd0b2-a095-79be-af61-ea01feff8684" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingIncomeLoss_019dd0b2-a095-73fe-b3f9-feaa5f446802" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OperatingIncomeLoss"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_019dd0b2-a095-7e29-bbd6-d8172a95435f" xlink:to="loc_us-gaap_OperatingIncomeLoss_019dd0b2-a095-73fe-b3f9-feaa5f446802" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GrossProfit_019dd0b2-a095-7895-bcab-86665de3768d" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_GrossProfit"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_019dd0b2-a095-7ded-a43a-1660f8b2fe34" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_GrossProfit_019dd0b2-a095-7895-bcab-86665de3768d" xlink:to="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_019dd0b2-a095-7ded-a43a-1660f8b2fe34" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CostOfGoodsAndServicesSold_019dd0b2-a095-7349-8405-9d2b6ef3a213" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CostOfGoodsAndServicesSold"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_GrossProfit_019dd0b2-a095-7895-bcab-86665de3768d" xlink:to="loc_us-gaap_CostOfGoodsAndServicesSold_019dd0b2-a095-7349-8405-9d2b6ef3a213" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProfitLoss_019dd0b2-a095-7421-a811-00a2b1959688" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ProfitLoss"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxExpenseBenefit_019dd0b2-a095-7465-a102-9e91ca7f0efb" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_IncomeTaxExpenseBenefit"/>
    <link:calculationArc order="1" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_ProfitLoss_019dd0b2-a095-7421-a811-00a2b1959688" xlink:to="loc_us-gaap_IncomeTaxExpenseBenefit_019dd0b2-a095-7465-a102-9e91ca7f0efb" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_019dd0b2-a095-72c2-be2c-404f51e4b23c" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_ProfitLoss_019dd0b2-a095-7421-a811-00a2b1959688" xlink:to="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_019dd0b2-a095-72c2-be2c-404f51e4b23c" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.sanmina.com/role/CondensedConsolidatedStatementofComprehensiveIncomeLoss" xlink:type="simple" xlink:href="sanm-20260627.xsd#CondensedConsolidatedStatementofComprehensiveIncomeLoss"/>
  <link:calculationLink xlink:role="http://www.sanmina.com/role/CondensedConsolidatedStatementofComprehensiveIncomeLoss" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ComprehensiveIncomeNetOfTax_019dd0b2-a095-782f-bd9d-259afccc78ca" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ComprehensiveIncomeNetOfTax"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLossAttributableToNoncontrollingInterest_019dd0b2-a095-70a5-be1a-740508b474bf" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_NetIncomeLossAttributableToNoncontrollingInterest"/>
    <link:calculationArc order="1" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_ComprehensiveIncomeNetOfTax_019dd0b2-a095-782f-bd9d-259afccc78ca" xlink:to="loc_us-gaap_NetIncomeLossAttributableToNoncontrollingInterest_019dd0b2-a095-70a5-be1a-740508b474bf" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ComprehensiveIncomeNetOfTaxIncludingPortionAttributableToNoncontrollingInterest_019dd0b2-a095-7ac0-b534-c7fa2de79c63" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ComprehensiveIncomeNetOfTaxIncludingPortionAttributableToNoncontrollingInterest"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_ComprehensiveIncomeNetOfTax_019dd0b2-a095-782f-bd9d-259afccc78ca" xlink:to="loc_us-gaap_ComprehensiveIncomeNetOfTaxIncludingPortionAttributableToNoncontrollingInterest_019dd0b2-a095-7ac0-b534-c7fa2de79c63" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTax_019dd0b2-a095-7c40-a1bd-a280bda504d7" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OtherComprehensiveIncomeLossNetOfTax"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossCashFlowHedgeGainLossBeforeReclassificationAfterTax_019dd0b2-a095-7a29-866a-05e340bcd016" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OtherComprehensiveIncomeLossCashFlowHedgeGainLossBeforeReclassificationAfterTax"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTax_019dd0b2-a095-7c40-a1bd-a280bda504d7" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossCashFlowHedgeGainLossBeforeReclassificationAfterTax_019dd0b2-a095-7a29-866a-05e340bcd016" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossCashFlowHedgeGainLossReclassificationAfterTax_019dd0b2-a095-7a7f-8016-064eceb0edde" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OtherComprehensiveIncomeLossCashFlowHedgeGainLossReclassificationAfterTax"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTax_019dd0b2-a095-7c40-a1bd-a280bda504d7" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossCashFlowHedgeGainLossReclassificationAfterTax_019dd0b2-a095-7a7f-8016-064eceb0edde" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationAdjustmentNetOfTax_019dd0b2-a095-7254-abd6-4308197b9d1c" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationAdjustmentNetOfTax"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTax_019dd0b2-a095-7c40-a1bd-a280bda504d7" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationAdjustmentNetOfTax_019dd0b2-a095-7254-abd6-4308197b9d1c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeDefinedBenefitPlansAdjustmentNetOfTaxPortionAttributableToParent_019dd0b2-a095-7b00-898d-8aaa49808e16" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OtherComprehensiveIncomeDefinedBenefitPlansAdjustmentNetOfTaxPortionAttributableToParent"/>
    <link:calculationArc order="4" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTax_019dd0b2-a095-7c40-a1bd-a280bda504d7" xlink:to="loc_us-gaap_OtherComprehensiveIncomeDefinedBenefitPlansAdjustmentNetOfTaxPortionAttributableToParent_019dd0b2-a095-7b00-898d-8aaa49808e16" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ComprehensiveIncomeNetOfTaxIncludingPortionAttributableToNoncontrollingInterest_019dd0b2-a095-720d-ad44-45218f3c9978" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ComprehensiveIncomeNetOfTaxIncludingPortionAttributableToNoncontrollingInterest"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProfitLoss_019dd0b2-a095-72c5-978d-201d5a54912c" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ProfitLoss"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_ComprehensiveIncomeNetOfTaxIncludingPortionAttributableToNoncontrollingInterest_019dd0b2-a095-720d-ad44-45218f3c9978" xlink:to="loc_us-gaap_ProfitLoss_019dd0b2-a095-72c5-978d-201d5a54912c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTax_019dd0b2-a095-7806-a22e-045bc3dfa1f4" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OtherComprehensiveIncomeLossNetOfTax"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_ComprehensiveIncomeNetOfTaxIncludingPortionAttributableToNoncontrollingInterest_019dd0b2-a095-720d-ad44-45218f3c9978" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTax_019dd0b2-a095-7806-a22e-045bc3dfa1f4" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.sanmina.com/role/CondensedConsolidatedStatementsofCashFlows" xlink:type="simple" xlink:href="sanm-20260627.xsd#CondensedConsolidatedStatementsofCashFlows"/>
  <link:calculationLink xlink:role="http://www.sanmina.com/role/CondensedConsolidatedStatementsofCashFlows" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_019dd0b2-a095-765a-b46d-a1064e6b4415" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_NetCashProvidedByUsedInOperatingActivities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProfitLoss_019dd0b2-a095-7605-b74a-1ff6b8330464" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ProfitLoss"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_019dd0b2-a095-765a-b46d-a1064e6b4415" xlink:to="loc_us-gaap_ProfitLoss_019dd0b2-a095-7605-b74a-1ff6b8330464" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DepreciationDepletionAndAmortization_019dd0b2-a095-791b-b1b0-5c4f8630bcaf" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DepreciationDepletionAndAmortization"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_019dd0b2-a095-765a-b46d-a1064e6b4415" xlink:to="loc_us-gaap_DepreciationDepletionAndAmortization_019dd0b2-a095-791b-b1b0-5c4f8630bcaf" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensation_019dd0b2-a095-7902-ab39-51faf87b6c0f" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShareBasedCompensation"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_019dd0b2-a095-765a-b46d-a1064e6b4415" xlink:to="loc_us-gaap_ShareBasedCompensation_019dd0b2-a095-7902-ab39-51faf87b6c0f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxExpenseBenefit_019dd0b2-a095-766e-9976-8b4db101f804" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DeferredIncomeTaxExpenseBenefit"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_019dd0b2-a095-765a-b46d-a1064e6b4415" xlink:to="loc_us-gaap_DeferredIncomeTaxExpenseBenefit_019dd0b2-a095-766e-9976-8b4db101f804" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_sanm_AmortizationOfInventoryFairValueAdjustment_019dd0b2-a095-7383-ac35-dcfdff66c6ec" xlink:href="sanm-20260627.xsd#sanm_AmortizationOfInventoryFairValueAdjustment"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_019dd0b2-a095-765a-b46d-a1064e6b4415" xlink:to="loc_sanm_AmortizationOfInventoryFairValueAdjustment_019dd0b2-a095-7383-ac35-dcfdff66c6ec" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationContingentConsiderationArrangementsChangeInAmountOfContingentConsiderationLiability1_019dd0b2-a095-7a02-92e0-edaa092665b1" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessCombinationContingentConsiderationArrangementsChangeInAmountOfContingentConsiderationLiability1"/>
    <link:calculationArc order="6" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_019dd0b2-a095-765a-b46d-a1064e6b4415" xlink:to="loc_us-gaap_BusinessCombinationContingentConsiderationArrangementsChangeInAmountOfContingentConsiderationLiability1_019dd0b2-a095-7a02-92e0-edaa092665b1" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GainLossOnSaleOfInvestments_019dd0b2-a095-7d0e-b2d0-7981f392c531" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_GainLossOnSaleOfInvestments"/>
    <link:calculationArc order="7" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_019dd0b2-a095-765a-b46d-a1064e6b4415" xlink:to="loc_us-gaap_GainLossOnSaleOfInvestments_019dd0b2-a095-7d0e-b2d0-7981f392c531" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherOperatingActivitiesCashFlowStatement_019dd0b2-a095-7d62-9078-ada5e731a3e9" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OtherOperatingActivitiesCashFlowStatement"/>
    <link:calculationArc order="8" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_019dd0b2-a095-765a-b46d-a1064e6b4415" xlink:to="loc_us-gaap_OtherOperatingActivitiesCashFlowStatement_019dd0b2-a095-7d62-9078-ada5e731a3e9" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInAccountsReceivable_019dd0b2-a095-7d6a-b0c2-d1d14839f7a3" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_IncreaseDecreaseInAccountsReceivable"/>
    <link:calculationArc order="9" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_019dd0b2-a095-765a-b46d-a1064e6b4415" xlink:to="loc_us-gaap_IncreaseDecreaseInAccountsReceivable_019dd0b2-a095-7d6a-b0c2-d1d14839f7a3" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInContractWithCustomerAsset_019dd0b2-a095-7142-9239-eb188bd0914d" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_IncreaseDecreaseInContractWithCustomerAsset"/>
    <link:calculationArc order="10" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_019dd0b2-a095-765a-b46d-a1064e6b4415" xlink:to="loc_us-gaap_IncreaseDecreaseInContractWithCustomerAsset_019dd0b2-a095-7142-9239-eb188bd0914d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInInventories_019dd0b2-a095-7b64-8af0-74181dadf43c" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_IncreaseDecreaseInInventories"/>
    <link:calculationArc order="11" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_019dd0b2-a095-765a-b46d-a1064e6b4415" xlink:to="loc_us-gaap_IncreaseDecreaseInInventories_019dd0b2-a095-7b64-8af0-74181dadf43c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets_019dd0b2-a095-7905-904f-24eb7a994a7b" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets"/>
    <link:calculationArc order="12" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_019dd0b2-a095-765a-b46d-a1064e6b4415" xlink:to="loc_us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets_019dd0b2-a095-7905-904f-24eb7a994a7b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInAccountsPayable_019dd0b2-a095-71cf-95db-925a19ea4cbd" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_IncreaseDecreaseInAccountsPayable"/>
    <link:calculationArc order="13" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_019dd0b2-a095-765a-b46d-a1064e6b4415" xlink:to="loc_us-gaap_IncreaseDecreaseInAccountsPayable_019dd0b2-a095-71cf-95db-925a19ea4cbd" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_sanm_IncreaseDecreaseInDeferredRevenueAndCustomerAdvances_019dd0b2-a095-7601-99cf-fe26a5add075" xlink:href="sanm-20260627.xsd#sanm_IncreaseDecreaseInDeferredRevenueAndCustomerAdvances"/>
    <link:calculationArc order="14" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_019dd0b2-a095-765a-b46d-a1064e6b4415" xlink:to="loc_sanm_IncreaseDecreaseInDeferredRevenueAndCustomerAdvances_019dd0b2-a095-7601-99cf-fe26a5add075" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInOtherOperatingLiabilities_019dd0b2-a095-731a-9847-f2ad0faecfb1" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_IncreaseDecreaseInOtherOperatingLiabilities"/>
    <link:calculationArc order="15" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_019dd0b2-a095-765a-b46d-a1064e6b4415" xlink:to="loc_us-gaap_IncreaseDecreaseInOtherOperatingLiabilities_019dd0b2-a095-731a-9847-f2ad0faecfb1" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_019dd0b2-a095-7ea8-88e1-0d723ea23534" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_019dd0b2-a095-7766-9434-661c4a756025" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_NetCashProvidedByUsedInOperatingActivities"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_019dd0b2-a095-7ea8-88e1-0d723ea23534" xlink:to="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_019dd0b2-a095-7766-9434-661c4a756025" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_019dd0b2-a095-78a4-98c0-9e5640fefa8a" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_NetCashProvidedByUsedInInvestingActivities"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_019dd0b2-a095-7ea8-88e1-0d723ea23534" xlink:to="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_019dd0b2-a095-78a4-98c0-9e5640fefa8a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_019dd0b2-a095-767d-b5c3-b7efb8d7e5fd" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_NetCashProvidedByUsedInFinancingActivities"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_019dd0b2-a095-7ea8-88e1-0d723ea23534" xlink:to="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_019dd0b2-a095-767d-b5c3-b7efb8d7e5fd" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectOfExchangeRateOnCashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_019dd0b2-a095-7eb6-9f65-087cfd19a3bf" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_EffectOfExchangeRateOnCashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_019dd0b2-a095-7ea8-88e1-0d723ea23534" xlink:to="loc_us-gaap_EffectOfExchangeRateOnCashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_019dd0b2-a095-7eb6-9f65-087cfd19a3bf" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_019dd0b2-a095-7597-9af2-939fbad58d4f" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_NetCashProvidedByUsedInInvestingActivities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsToAcquirePropertyPlantAndEquipment_019dd0b2-a095-799b-9712-91f237d84692" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_PaymentsToAcquirePropertyPlantAndEquipment"/>
    <link:calculationArc order="1" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_019dd0b2-a095-7597-9af2-939fbad58d4f" xlink:to="loc_us-gaap_PaymentsToAcquirePropertyPlantAndEquipment_019dd0b2-a095-799b-9712-91f237d84692" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsToAcquireBusinessesNetOfCashAcquired_019dd0b2-a095-7789-bdbd-2a75cd9889c4" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_PaymentsToAcquireBusinessesNetOfCashAcquired"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_019dd0b2-a095-7597-9af2-939fbad58d4f" xlink:to="loc_us-gaap_PaymentsToAcquireBusinessesNetOfCashAcquired_019dd0b2-a095-7789-bdbd-2a75cd9889c4" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsToAcquireInvestments_019dd0b2-a095-7355-8bec-ab0632c68a93" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_PaymentsToAcquireInvestments"/>
    <link:calculationArc order="3" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_019dd0b2-a095-7597-9af2-939fbad58d4f" xlink:to="loc_us-gaap_PaymentsToAcquireInvestments_019dd0b2-a095-7355-8bec-ab0632c68a93" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromSaleAndMaturityOfOtherInvestments_019dd0b2-a095-72ee-8744-22a4c50ed6fd" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ProceedsFromSaleAndMaturityOfOtherInvestments"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_019dd0b2-a095-7597-9af2-939fbad58d4f" xlink:to="loc_us-gaap_ProceedsFromSaleAndMaturityOfOtherInvestments_019dd0b2-a095-72ee-8744-22a4c50ed6fd" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsForProceedsFromOtherInvestingActivities_019dd0b2-a095-712b-a816-6a463b11ce7b" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_PaymentsForProceedsFromOtherInvestingActivities"/>
    <link:calculationArc order="5" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_019dd0b2-a095-7597-9af2-939fbad58d4f" xlink:to="loc_us-gaap_PaymentsForProceedsFromOtherInvestingActivities_019dd0b2-a095-712b-a816-6a463b11ce7b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_019dd0b2-a095-752a-918d-24d3e0d0e336" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_NetCashProvidedByUsedInFinancingActivities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RepaymentsOfDebt_019dd0b2-a095-7424-af05-0fc08d6eb88e" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RepaymentsOfDebt"/>
    <link:calculationArc order="1" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_019dd0b2-a095-752a-918d-24d3e0d0e336" xlink:to="loc_us-gaap_RepaymentsOfDebt_019dd0b2-a095-7424-af05-0fc08d6eb88e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromIssuanceOfLongTermDebt_019dd0b2-a095-7f0f-889f-4eb6ec4dc920" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ProceedsFromIssuanceOfLongTermDebt"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_019dd0b2-a095-752a-918d-24d3e0d0e336" xlink:to="loc_us-gaap_ProceedsFromIssuanceOfLongTermDebt_019dd0b2-a095-7f0f-889f-4eb6ec4dc920" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromLinesOfCredit_019dd0b2-a095-7116-ace5-1dcb68882732" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ProceedsFromLinesOfCredit"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_019dd0b2-a095-752a-918d-24d3e0d0e336" xlink:to="loc_us-gaap_ProceedsFromLinesOfCredit_019dd0b2-a095-7116-ace5-1dcb68882732" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RepaymentsOfLinesOfCredit_019dd0b2-a095-766b-8043-3ea02cccf538" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RepaymentsOfLinesOfCredit"/>
    <link:calculationArc order="4" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_019dd0b2-a095-752a-918d-24d3e0d0e336" xlink:to="loc_us-gaap_RepaymentsOfLinesOfCredit_019dd0b2-a095-766b-8043-3ea02cccf538" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsOfDebtIssuanceCosts_019dd0b2-a095-77c1-94f1-2def3ab87a82" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_PaymentsOfDebtIssuanceCosts"/>
    <link:calculationArc order="5" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_019dd0b2-a095-752a-918d-24d3e0d0e336" xlink:to="loc_us-gaap_PaymentsOfDebtIssuanceCosts_019dd0b2-a095-77c1-94f1-2def3ab87a82" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_sanm_RepurchasesOfCommonStockIncludingExciseTax_019dd0b2-a095-7676-9b52-70c9057ab40c" xlink:href="sanm-20260627.xsd#sanm_RepurchasesOfCommonStockIncludingExciseTax"/>
    <link:calculationArc order="6" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_019dd0b2-a095-752a-918d-24d3e0d0e336" xlink:to="loc_sanm_RepurchasesOfCommonStockIncludingExciseTax_019dd0b2-a095-7676-9b52-70c9057ab40c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsRelatedToTaxWithholdingForShareBasedCompensation_019dd0b2-a095-72c6-a000-0a639647c513" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_PaymentsRelatedToTaxWithholdingForShareBasedCompensation"/>
    <link:calculationArc order="7" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_019dd0b2-a095-752a-918d-24d3e0d0e336" xlink:to="loc_us-gaap_PaymentsRelatedToTaxWithholdingForShareBasedCompensation_019dd0b2-a095-72c6-a000-0a639647c513" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.sanmina.com/role/EARNINGSPERSHAREDetails" xlink:type="simple" xlink:href="sanm-20260627.xsd#EARNINGSPERSHAREDetails"/>
  <link:calculationLink xlink:role="http://www.sanmina.com/role/EARNINGSPERSHAREDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_019dd0b2-a096-74a6-a5d2-96efc3fe88a5" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic_019dd0b2-a096-724e-9766-66510953d57f" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_WeightedAverageNumberOfSharesOutstandingBasic"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_019dd0b2-a096-74a6-a5d2-96efc3fe88a5" xlink:to="loc_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic_019dd0b2-a096-724e-9766-66510953d57f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustment_019dd0b2-a096-784b-af1d-f3587e4527ea" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustment"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_019dd0b2-a096-74a6-a5d2-96efc3fe88a5" xlink:to="loc_us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustment_019dd0b2-a096-784b-af1d-f3587e4527ea" xlink:type="arc"/>
  </link:calculationLink>
</link:linkbase>
