Changeset d36146f in OpenModelica


Ignore:
Timestamp:
2020-10-21T14:04:18+02:00 (4 years ago)
Author:
Mahder Gebremedhin <mahder.gebremedhin@…>
Children:
b782523
Parents:
d4a68940
git-author:
Mahder Gebremedhin <mahder.gebremedhin@…> (10/19/20 16:48:41)
git-committer:
Mahder Gebremedhin <mahder.gebremedhin@…> (10/21/20 14:04:18)
Message:

[cmake] Update documentation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OMCompiler/README.cmake.md

    rd4a68940 rd36146f  
    1 **_This an updated version of the PR #6648. That was reverted due to issues with compilation of simulationruntimemsvc target.  This fixes that and brings back the changes from the PR._**
    21
     2<!-- @import "[TOC]" {cmd="toc" depthFrom=1 depthTo=6 orderedList=false} -->
     3
     4<!-- code_chunk_output -->
     5
     6- [Purpose](#purpose)
     7- [Usage](#usage)
     8  - [Build](#build)
     9    - [Linux and Windows with OMDev MSYS](#linux-and-windows-with-omdev-msys)
     10    - [Windows with other/fresh MSYS2](#windows-with-otherfresh-msys2)
     11    - [Windows with Visual Studio Compiler](#windows-with-visual-studio-compiler)
     12    - [MacOS](#macos)
     13  - [Install](#install)
     14- [Benefits](#benefits)
     15- [Potential (Further improvement)](#potential-further-improvement)
     16- [Progress](#progress)
     17
     18<!-- /code_chunk_output -->
     19
     20# Purpose
    321This is an attempt to have a CMake configuration support for OMC. Right now the focus is in getting OMCompiler working.
    422This is **half way done**. It is here just for early discussion. If it is deemed unnecessary it might be removed completely.
     
    1230
    1331## Build
     32### Linux and Windows with OMDev MSYS
    1433It is pretty straightforward cmake stuff.
     34
    1535
    1636```sh
     
    3151```
    3252
    33 If you are on Linux like systems omc will check if it is in a folder whose path includes `/bin` or `/lib`. If it is not, it will tell you to update your OPENMODELICAHOME env variable.  Instead, you can just INSTALL the files as shown below or copy or move the generated omc into a folder called <something>/bin for now.
     53**If you are on Linux like systems omc will check if it is in a folder whose path includes `/bin` or `/lib`. If it is not, it will tell you to update your OPENMODELICAHOME env variable.  Instead, you can just INSTALL the files as shown below or copy or move the generated omc into a folder called <something>/bin for now.**
    3454
    35 # Install
     55### Windows with other/fresh MSYS2
     56If you are using windows you can also use your own MSYS (non-OMDev) installation to build omc.  You can also use a fresh MSYS2 from https://www.msys2.org/.
    3657
    37 CMake uses a separate script (cmake_install.cmake) to perform installation. Since we are used to issuing 'make install' by default, CMake
    38 provides an specific built-in 'install' target. However, this target implies a **full build and full install**. That is you have no control on which parts you want to install. If this is what you want to do you can use that.
     58Open a MINGW64 shell and install the dependencies needed to build omc.
     59
     60
     61```sh
     62# Install dependencies using pacman
     63$ pacman -S make bison flex mingw-w64-x86_64-curl mingw-w64-x86_64-openblas
     64```
     65
     66*Note that we install the MSYS version of `make`. The mingw32-make is not what you need here. Bison and flex are not strictly needed. They are only needed for building 3rdParty/lpsolve and that will be made optional soon*
     67
     68Then follow the same instructions as Linux/OMDev above.
     69
     70
     71### Windows with Visual Studio Compiler
     72Coming soon. There are two things to be decided/done
     73
     74  - Getting the needed Windows versions of OpenModelica dependencies to be used with VS.
     75    - I am using vcpkg to manage the dependencies now and it seems to work fine.
     76      However there will be discussions on if and which package manager OpenModelica chooses to use.
     77
     78      If you would like to try out the vcpkg version let me know.
     79
     80  - Fixing of compilation errors due to Linux/POSIX vs Windows differences in some system functions.
     81
     82### MacOS
     83This will be next after Visual Studio.
     84
     85
     86## Install
     87
     88CMake uses a separate script (cmake_install.cmake) to perform installation. Since we are used to issuing 'make install' by default, CMake provides a specific _built-in_ 'install' target. However, this target implies a **full build and full install**. That is, you have no control on which parts you want to install. If this is what you want to do you can use that.
    3989
    4090If you are working on just omc and do not need the whole set of *simulation runtime* libraries built and installed, there is a custom target `install_omc` provided which will build and install what is needed to run omc.
    4191
    42 ```
     92```sh
    4393# Build and Install just omc
    44 # $ make install_omc # For makefile generators
     94$ make install_omc # For makefile generators
    4595# $ cmake --build <build_dir> --target install_omc # Generic usage.
    4696# $ cmake -DCOMPONENT=compiler -P cmake_install.cmake # The equivalent cmake_install invocation
    4797
    4898# Build and Install everything
    49 # $ make install # NOTE: This will first build everything. Not just omc.
     99$ make install # NOTE: This will first build everything. Not just omc.
    50100# $ cmake --build <build_dir> --target install # Generic usage.
    51101# $ cmake -P cmake_install.cmake # The equivalent cmake_install invocation
     
    54104$ <install_dir>/bin/omc --help
    55105```
    56 
    57 
    58 ###### Installation can be buggy. It will be improved.
    59106
    60107# Benefits
Note: See TracChangeset for help on using the changeset viewer.