cd2025 協同產品設計實習

  • Home
    • SMap
    • reveal
    • blog
  • About
    • Summary
      • Tasks
      • Closing
      • Shooter
    • Product
    • Control
    • CPS
    • AI
    • Project
  • Topics
    • Wink
      • Fossil
    • Topic1
      • w1
      • Portable
      • repo
      • SSH
      • list
      • IPv6
    • Topic2
      • Compile
      • Onshape
    • Topic3
      • Fourbar2
      • boomer
    • Topic4
      • ROS2
  • HW
    • HW1
    • HW2
    • HW3
  • Exam
    • Exam1
    • Exam2
    • Exam3
  • Final
    • Webots
    • Rotate
  • Tutorial
    • Fourbar
      • w10
    • Stage1
      • Tutorial1
      • Tutorial2
    • Stage2
      • Tutorial3
      • Distancesensor
      • Tutorial4
      • Tutorial5
    • Stage3
      • Tutorial6
      • Tutorial7
      • Stream
      • Webots Server
    • Solvespace
      • Learn_Solvs
    • Mecanum
    • Pyslvs-UI
    • PICSimLab
    • Fossil SCM
    • Leo Editor
    • uv
    • Old
  • Brython
Topic2 << Previous Next >> Onshape

Compile

以下要說明如何利用可攜程式套件編譯 Solvepace:

下載 cmake_and_msys64.7z, 將 cmake-3.21.0-windows-x86_64、msys64 與 libwinpthread-1.dll 等資料放入 portable_wcm2025.7z 解開壓縮後的 data 目錄中, 啟動可攜程式檔案就可以使用 MSYS2 編譯 Solvespace 3.1 版的原始碼. 取得的 solvespace.exe 只要與 libwinpthread-1.dll 處於同一個目錄, 就可以執行編譯完成的 solvespace.exe 執行參數化零組件的繪圖.

備註: 請更新上列 portable_wcm2025.7z 中的 wscite 為 5.5.5 版 (wscite_5.5.5.7z, 解開壓縮檔案後取代 5.5.4 版的 wscite 目錄)

編譯 Solvespace 的詳細步驟如下:

配置好 cmake_and_msys64.7z 後, 啟動可攜程式

在命令列中 cd tmp, 然後利用 git clone --recurse-submodules https://github.com/solvespace/solvespace.git 取下 solvespace 的原始碼

cd solvespace 後, 利用 git checkout v3.1 將版本切換到 v3.1 的原始碼內容

接下來則必須修改 solvespace\extlib\angle\src\libANGLE\HandleAllocator.cpp 加入標頭檔案:

#include <limits>

接著就可以進行程式碼的編譯與連結:

mkdir build

cd build

cmake .. -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release

mingw32-make

完成編譯後, solvespace.exe 即位於 build\bin 目錄中, 執行時則需要 libwinpthread-1.dll 動態連結程式庫.

進行上述流程編譯的原始碼 solvespace_v3.1_src.7z, 以及編譯完成的 solvespace_v3.1_msys2.7z.

註: portable_wcm2025.7z 中所配置的 solvespace.exe 是採用 Visual Studio C++ 編譯, 檔案只有約 7MB, 因為其執行時所需的動態連結程式庫已經配置在 Windows 操作系統中, 因此檔案較小, 而採上述流程, 使用 MSYS2 可攜方式編譯所得到的 solvespace.exe, 檔案約 15MB, 還需要 62KB 的 libwinpthread-1.dll 才能執行, 這是因為採 MSYS2 編譯的 solvespace.exe 必須自帶執行所需的程式庫, 因此檔案較大.


Topic2 << Previous Next >> Onshape

Copyright © All rights reserved | This template is made with by Colorlib