From aaeb57d5a2d2d6b5779833334a8c6ee41e17d0a0 Mon Sep 17 00:00:00 2001 From: gpitel Date: Thu, 13 Apr 2023 22:40:59 -0400 Subject: [PATCH 1/3] Update BUILD.md Added more setup instructions for preparing and downloading dockerfile Corrected instructions for running tests. --- BUILD.md | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/BUILD.md b/BUILD.md index 156f889..670d2f8 100644 --- a/BUILD.md +++ b/BUILD.md @@ -1,25 +1,35 @@ +## Setup steps + + Install [Docker for Ubuntu](https://docs.docker.com/engine/install/ubuntu). The installation instructions were tested on the following OS/Docker version combination: +- Docker 23.0.03, Ubuntu 22.04.2 LTS + +Prepare a directory to download and build Docker image. +``` +cd ~ +mkdir openmagnetics +cd openmagnetics +sudo wget https://raw.githubusercontent.com/OpenMagnetics/.github/main/Dockerfile +``` ## Build steps -1. Build Docker image: +Build Docker image ``` +cd ~/openmagnetics docker build -t openmagnetics . ``` -2. Enter built Docker image: +Run built the OpenMagnetics docker image form command line ``` docker run -it openmagnetics bash ``` -3. Run tests: +To confirm proper installation and project compilation run the tests in each project. Each test should run without error. ``` -/home/openmagnetics/OpenMagnetics/MAS -./MAS_tests -/home/openmagnetics/OpenMagnetics/MKF -./MKF_tests -/home/openmagnetics/OpenMagnetics/MVB -python3 tests/test_builder.py +/home/openmagnetics/OpenMagnetics/MAS/build/./MAS_tests +/home/openmagnetics/OpenMagnetics/MKF/build/./MKF_tests +python3 /home/openmagnetics/OpenMagnetics/MVB/tests/test_builder.py ``` From 9ffccf88df8dfe587a7541d7ba4871d93b2eb71e Mon Sep 17 00:00:00 2001 From: AlfVII Date: Mon, 17 Feb 2025 21:49:04 +0100 Subject: [PATCH 2/3] Update README.md --- profile/README.md | 93 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) diff --git a/profile/README.md b/profile/README.md index 381aeec..914b211 100644 --- a/profile/README.md +++ b/profile/README.md @@ -1 +1,94 @@ Open Magnetics is a an open-source platform for collecting and sharing knowledge about Magnetic Components + +```mermaid +classDiagram + MKF <|-- PyMKF + MKF <|-- WebLibMKF + MKF <|-- MKFNet + MAS <|-- MKF + + + namespace ModulesAndLanguages { + class MKF{ + C++ + simulate() + design() + findInCatalog() + } + class PyMKF{ + Python + loadCatalog() + } + class WebLibMKF{ + Javascript + loadCatalog() + } + class MKFNet{ + CSharp + loadCatalog() + } + class MAS{ + JsonSchema + loadCoreMaterials() + loadCoreShapes() + } + } + + style MKF fill:orange,stroke:black,color:black + style PyMKF fill:green,stroke:black,color:black + style WebLibMKF fill:cyan,stroke:black,color:black + style MKFNet fill:pink,stroke:black,color:black + style MAS fill:olive,stroke:black,color:black + + +``` + +```mermaid +classDiagram + namespace OpenMagnetics { + class WebFrontend { + Vue3.js + WASM + WebLibMKF + } + + class WebBackend { + Python + FastAPI + PyMKF + Plot() + } + + class MAS { + JSON + MAS + } + } + class Ansyas { + Python + PyMKF + } + class Ansys + class Trafolo + class LtSpice + class Ngspice + class Simba + class NL5 + class PSIM + class PSPICE + + WebFrontend <--> WebBackend + WebFrontend --> MAS + MAS --> Trafolo + MAS --> Ansyas + Ansyas --> Ansys + WebFrontend --> LtSpice + WebFrontend --> Ngspice + WebFrontend --> Simba + WebFrontend --> NL5 + WebFrontend --> PSIM + WebFrontend --> PSPICE + + style MKF fill:orange,stroke:black,color:black + + style PyMKF fill:green,stroke:black,color:black + style WebBackend fill:green,stroke:black,color:black + style Ansyas fill:green,stroke:black,color:black + style WebFrontend fill:cyan,stroke:black,color:black + style WebLibMKF fill:cyan,stroke:black,color:black + style MAS fill:olive,stroke:black,color:black +``` From fbb4f8279c8f3b1a3b389db1eab68e1e9d3e600a Mon Sep 17 00:00:00 2001 From: grantpitel Date: Wed, 27 Aug 2025 10:44:33 -0400 Subject: [PATCH 3/3] having pythin install issues, additional changes to get OM up and running --- Dockerfile | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7cd4746..546f0cb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,27 @@ -# Using the Ubuntu image (our OS) -FROM ubuntu:latest -# Update package manager (apt-get) -# and install (with the yes flag `-y`) -# Python and Pip +FROM ubuntu:22.04 +ENV DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC -RUN apt-get update && apt-get install -y gnupg2 ca-certificates wget software-properties-common curl +# Make sure apt can see everything, then install the PPA tool +RUN apt-get update && apt-get install -y --no-install-recommends \ + software-properties-common ca-certificates gnupg2 curl wget \ + && rm -rf /var/lib/apt/lists/* -RUN apt-get install -y \ - python3.11 \ - python3-pip \ - git \ - cmake \ - ninja-build +# Dev/build deps (separate layer keeps cache saner) +RUN apt-get update && apt-get install -y --no-install-recommends \ + python3 python3-pip python3-dev \ + git cmake ninja-build build-essential pkg-config \ + libboost-all-dev libeigen3-dev \ + libjpeg-dev libtiff5-dev libpng-dev \ + libfftw3-dev libopenblas-dev liblapack-dev \ + && rm -rf /var/lib/apt/lists/* + +# FreeCAD (daily) PPA — only valid on Ubuntu +RUN add-apt-repository -y ppa:freecad-maintainers/freecad-daily \ + && apt-get update \ + && apt-get install -y --no-install-recommends freecad-daily \ + && rm -rf /var/lib/apt/lists/* + +# ...rest of your Dockerfile (clone/build MAS & MKF, pip install, etc.) RUN mkdir /root/.ssh @@ -32,7 +42,6 @@ RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test RUN apt install -y gcc-11 g++-11 RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 10 RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 10 -RUN apt-get install -y libboost-all-dev libeigen3-dev RUN mkdir -p /home/openmagnetics WORKDIR /home/openmagnetics @@ -50,15 +59,6 @@ WORKDIR /home/openmagnetics/OpenMagnetics/MAS/build RUN cmake .. -G "Ninja" RUN cmake --build . -WORKDIR /home/openmagnetics/OpenMagnetics/MKF -RUN mkdir build && cd build -WORKDIR /home/openmagnetics/OpenMagnetics/MKF/build -RUN cmake .. -G "Ninja" -RUN python3 -m pip install -e ../ -vvv -RUN cmake --build . - -RUN add-apt-repository ppa:freecad-maintainers/freecad-daily -RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install -y -qq freecad-daily WORKDIR /home/openmagnetics/OpenMagnetics/MVB RUN python3 -m pip install -r requirements.txt