Changeset d36146f in OpenModelica
- Timestamp:
- 2020-10-21T14:04:18+02:00 (4 years ago)
- 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)
- 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._**2 1 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 3 21 This is an attempt to have a CMake configuration support for OMC. Right now the focus is in getting OMCompiler working. 4 22 This is **half way done**. It is here just for early discussion. If it is deemed unnecessary it might be removed completely. … … 12 30 13 31 ## Build 32 ### Linux and Windows with OMDev MSYS 14 33 It is pretty straightforward cmake stuff. 34 15 35 16 36 ```sh … … 31 51 ``` 32 52 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.** 34 54 35 # Install 55 ### Windows with other/fresh MSYS2 56 If 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/. 36 57 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. 58 Open 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 68 Then follow the same instructions as Linux/OMDev above. 69 70 71 ### Windows with Visual Studio Compiler 72 Coming 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 83 This will be next after Visual Studio. 84 85 86 ## Install 87 88 CMake 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. 39 89 40 90 If 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. 41 91 42 ``` 92 ```sh 43 93 # Build and Install just omc 44 #$ make install_omc # For makefile generators94 $ make install_omc # For makefile generators 45 95 # $ cmake --build <build_dir> --target install_omc # Generic usage. 46 96 # $ cmake -DCOMPONENT=compiler -P cmake_install.cmake # The equivalent cmake_install invocation 47 97 48 98 # 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. 50 100 # $ cmake --build <build_dir> --target install # Generic usage. 51 101 # $ cmake -P cmake_install.cmake # The equivalent cmake_install invocation … … 54 104 $ <install_dir>/bin/omc --help 55 105 ``` 56 57 58 ###### Installation can be buggy. It will be improved.59 106 60 107 # Benefits
Note: See TracChangeset
for help on using the changeset viewer.