Skip to content

Commit

Permalink
chore: Unify with pro (#176)
Browse files Browse the repository at this point in the history
* chore: Unify with pro

* build: Linux build fix
  • Loading branch information
vasylskorych authored Dec 17, 2023
1 parent bb009bf commit 3e96f3f
Show file tree
Hide file tree
Showing 66 changed files with 721 additions and 206 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ env:
BUILD_CONFIGURATION: Release
BUILD_PLATFORM: x64

# Versions.
# Versions
QT_VERSION: 5.15.2
QT_VS_VERSION: msvc2019_64
QT_VS_ADDIN_VERSION: 2.7.2
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
# Also, it installs them to %LOCALAPPDATA%\QtMsBuild, so they can not be used by other Windows users.
# Download the extension and extract requited files to the project directory.
run: |
Invoke-WebRequest -Uri https://ftp.fau.de/qtproject/archive/vsaddin/${{env.QT_VS_ADDIN_VERSION}}/qt-vsaddin-msvc2019-${{env.QT_VS_ADDIN_VERSION}}.vsix -MaximumRetryCount 10 -RetryIntervalSec 30 -OutFile vspackage.vsix
Invoke-WebRequest -Uri https://ftp.fau.de/qtproject/archive/vsaddin/${{env.QT_VS_ADDIN_VERSION}}/qt-vsaddin-msvc2019-${{env.QT_VS_ADDIN_VERSION}}.vsix -MaximumRetryCount 10 -RetryIntervalSec 30 -OutFile vspackage.vsix
Expand-Archive vspackage.vsix -DestinationPath ${{github.workspace}}/ExternalLibraries/qtvsaddin
- name: Cache ZLib
Expand Down Expand Up @@ -159,7 +159,7 @@ jobs:
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1

- name: Download Build Artifact
- name: Download Build Artifact
uses: actions/download-artifact@v3
with:
name: build-artifact
Expand All @@ -183,27 +183,27 @@ jobs:

- name: Install Graphviz
run: choco install graphviz

- name: Install Doxygen
run: choco install doxygen.install

- name: Install Sphinx
run: pip install -U sphinx sphinx-rtd-theme breathe

- name: Cache MiKTeX
id: cache-miktex
uses: actions/cache@v3
with:
path: C:/Program Files/MiKTeX
key: ${{runner.os}}-MiKTeXCache-${{env.MIKTEX_VERSION}}

- name: Install MiKTeX
if: steps.cache-miktex.outputs.cache-hit != 'true'
run: choco install miktex.install --version ${{env.MIKTEX_VERSION}} -y

- name: Add MiKTeX to PATH
run: Add-Content $env:GITHUB_PATH "C:\Program Files\MiKTeX\miktex\bin\x64"

- name: Configure MiKTeX
run: |
initexmf --admin --verbose --set-config-value=[MPM]AutoInstall=1
Expand All @@ -219,12 +219,12 @@ jobs:
working-directory: ${{github.workspace}}
# Add additional options to the MSBuild command line here: see https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference.
run: msbuild -maxCpuCount -verbosity:minimal -property:Configuration=${{env.BUILD_CONFIGURATION}} -property:Platform=${{env.BUILD_PLATFORM}} -property:SolutionDir=${{github.workspace}}/ ${{env.DOCS_PROJECT_PATH}}

cleanup:
runs-on: windows-2019
needs: [build, tests]
if: ${{always()}}

steps:
- name: Delete Build Artifact
uses: geekyeggo/delete-artifact@v2
Expand Down
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ SET(INSTALL_HEADERS_PATH ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/)
SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

##################################################
### Binaries
### Binaries
IF(BUILD_BINARIES)

add_executable(DyssolC
Expand Down Expand Up @@ -89,7 +89,7 @@ IF(BUILD_BINARIES)
TARGET_LINK_LIBRARIES(libdyssol_shared ${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES} ${SUNDIALS_LIBRARIES})
TARGET_LINK_LIBRARIES(libdyssol_static ${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES} ${SUNDIALS_LIBRARIES})
TARGET_LINK_LIBRARIES(DyssolC libdyssol_shared)

# link filesystem or experimantal/filesystem for gcc
IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
IF (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)
Expand Down Expand Up @@ -126,7 +126,7 @@ IF(BUILD_BINARIES)
ENDIF(BUILD_BINARIES)

##################################################
### Testing
### Testing
IF(BUILD_TESTS)

ENABLE_TESTING()
Expand Down Expand Up @@ -188,7 +188,7 @@ IF(BUILD_TESTS)
COMMAND python3 ${CMAKE_SOURCE_DIR}/tests/compare.py "${CMAKE_SOURCE_DIR}/tests/${CURRENT_TEST}/ideal.res" "${CMAKE_BINARY_DIR}/tests/${CURRENT_TEST}/real.res" -t ${TOLERANCE}
)
ENDIF(WIN32)

# _diff tests can only be run when the _run test is done
SET_TESTS_PROPERTIES(${CURRENT_TEST}_diff PROPERTIES DEPENDS ${CURRENT_TEST}_run)
ENDIF(NOT CMAKE_BUILD_TYPE MATCHES Debug)
Expand All @@ -198,7 +198,7 @@ IF(BUILD_TESTS)
ENDIF(BUILD_TESTS)

##################################################
### Documentation
### Documentation
IF(BUILD_DOCS)

#=================================================
Expand Down Expand Up @@ -274,7 +274,7 @@ IF(BUILD_DOCS)

# Replace variables inside @@ with the current values
CONFIGURE_FILE(${SPHINX_CONFIG_IN} ${SPHINX_CONFIG_OUT} @ONLY)

ADD_CUSTOM_COMMAND(OUTPUT ${SPHINX_INDEX_FILE}
COMMAND ${SPHINX_EXECUTABLE} -b linkcheck ${SPHINX_SOURCE_DIR} ${SPHINX_BUILD} # Check links
COMMAND ${SPHINX_EXECUTABLE} -b html -Dbreathe_projects.Dyssol=${DOXYGEN_OUTPUT_XML_DIR} ${SPHINX_SOURCE_DIR} ${SPHINX_BUILD}
Expand Down
50 changes: 26 additions & 24 deletions Documentation/001_ui/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,32 @@ You can find exemplary script files in the installation directory under ``Exampl
Only 3 script keys from the list are mandatory: ``SOURCE_FILE`` or ``RESULT_FILE``, ``MODELS_PATH``, and ``MATERIALS_DATABASE``. The rest are optional and will override parameters set in initial file, specified as ``SOURCE_FILE``. If ``SOURCE_FILE`` is not defined, the script should describe the entire flowsheet with all parameters, and ``RESULT_FILE`` is required. If ``RESULT_FILE`` parameter is not specified, results of the simulation will be written to a ``SOURCE_FILE``.
script keys ``MODELS_PATH``, ``DISTRIBUTION_GRID``, ``UNIT``, ``STREAM``, ``UNIT_PARAMETER``, ``UNIT_HOLDUP_*``, ``EXPORT_STREAM_*``, ``EXPORT_HOLDUP_*``, and ``EXPORT_UNIT_*`` can be mentioned several times in the script file, the rest should be places only once.
script keys ``MODELS_PATH``, ``DISTRIBUTION_GRID``, ``UNIT``, ``STREAM``, ``UNIT_PARAMETER``, ``UNIT_HOLDUP_*``, ``EXPORT_STREAM_*``, ``EXPORT_HOLDUP_*``, ``EXPORT_UNIT_*`` can be mentioned several times in the script file, the rest should be places only once.
Main
----
+--------------------+--------+--------------------------------------------------------------+
| Script key | Value | Description |
+====================+========+==============================================================+
| JOB | | Delimiter for a sequentially executed job within one script |
+--------------------+--------+--------------------------------------------------------------+
| SOURCE_FILE | <path> | Full path to a \*.dflw file with initial flowsheet |
+--------------------+--------+--------------------------------------------------------------+
| RESULT_FILE | <path> | Full path to a file where simulation results will be written |
+--------------------+--------+--------------------------------------------------------------+
| MODELS_PATH | <path> | Path to the directory with libraries of units and solvers |
+--------------------+--------+--------------------------------------------------------------+
| MATERIALS_DATABASE | <path> | Full path to the file with materials database |
+--------------------+--------+--------------------------------------------------------------+
+--------------------+--------------------------------+--------------------------------------------------------------+
| Script key | Value | Description |
+====================+================================+==============================================================+
| JOB | | Delimiter for a sequentially executed job within one script |
+--------------------+--------------------------------+--------------------------------------------------------------+
| SOURCE_FILE | <path> | Full path to a \*.dflw file with initial flowsheet |
+--------------------+--------------------------------+--------------------------------------------------------------+
| RESULT_FILE | <path> | Full path to a file where simulation results will be written |
+--------------------+--------------------------------+--------------------------------------------------------------+
| MODELS_PATH | <path> | Path to the directory with libraries of units and solvers |
+--------------------+--------------------------------+--------------------------------------------------------------+
| MATERIALS_DATABASE | <path> | Full path to the file with materials database |
+--------------------+--------------------------------+--------------------------------------------------------------+
|
Simulation
----------
Simulation options
------------------
^^^^^^^^^^^^^^^^^^
+------------------------------+-----------------------------------------+----------------------------------------------------------------------------------------------------------------------------+
| Script key | Value | Description |
Expand Down Expand Up @@ -105,7 +107,7 @@ Simulation options
|
Phases
------
^^^^^^
+------------+---------------------------------------------------------+----------------+
| Script key | Value | Description |
Expand All @@ -116,7 +118,7 @@ Phases
|
Compounds
---------
^^^^^^^^^
+------------+-----------------------------------+-------------------------------------------+
| Script key | Value | Description |
Expand All @@ -127,7 +129,7 @@ Compounds
|
Grids
-----
^^^^^
+----------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
| Script key | Value | Description |
Expand All @@ -144,7 +146,7 @@ Grids
|
Flowsheet structure
-------------------
^^^^^^^^^^^^^^^^^^^
+---------------------+----------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+
| Script key | Value | Description |
Expand All @@ -159,7 +161,7 @@ Flowsheet structure
|
Unit parameters
---------------
^^^^^^^^^^^^^^^
+----------------+---------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------+
| Script key | Value | Description |
Expand All @@ -174,7 +176,7 @@ Unit parameters
|
Holdups
-------
^^^^^^^
+------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+
| Script key | Value | Description |
Expand All @@ -201,7 +203,7 @@ Holdups
|
Export
------
^^^^^^
+-----------------------------------+------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
| Script key | Value | Description |
Expand Down Expand Up @@ -255,4 +257,4 @@ Export
| EXPORT_FLOWSHEET_GRAPH | <path> | Export flowsheet graph as a \*.png file |
+-----------------------------------+------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
2 changes: 1 addition & 1 deletion Documentation/001_ui/gui.rst
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ Application-wide settings.
2. Open application-wide configuration file
3. Path to store cache files
4. Change cache path
5. Delete all cache files
5. Delete all cache files

.. _sec.gui.menu_help:

Expand Down
13 changes: 12 additions & 1 deletion Dyssol.sln
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Documentation", "DyssolInst
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tests", "DyssolInstallers\Tests\Tests.vcxproj", "{9E33ACE6-5DDA-400C-8242-6BE0B8569221}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SimulationThread", "GUIWidgets\SimulationThread\SimulationThread.vcxproj", "{0F7B1A52-7766-4E37-9ACD-AC76AB000000}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Expand Down Expand Up @@ -632,6 +634,14 @@ Global
{9E33ACE6-5DDA-400C-8242-6BE0B8569221}.Debug|x64.ActiveCfg = Debug|x64
{9E33ACE6-5DDA-400C-8242-6BE0B8569221}.Release|Win32.ActiveCfg = Release|Win32
{9E33ACE6-5DDA-400C-8242-6BE0B8569221}.Release|x64.ActiveCfg = Release|x64
{0F7B1A52-7766-4E37-9ACD-AC76AB000000}.Debug|Win32.ActiveCfg = Debug|Win32
{0F7B1A52-7766-4E37-9ACD-AC76AB000000}.Debug|Win32.Build.0 = Debug|Win32
{0F7B1A52-7766-4E37-9ACD-AC76AB000000}.Debug|x64.ActiveCfg = Debug|x64
{0F7B1A52-7766-4E37-9ACD-AC76AB000000}.Debug|x64.Build.0 = Debug|x64
{0F7B1A52-7766-4E37-9ACD-AC76AB000000}.Release|Win32.ActiveCfg = Release|Win32
{0F7B1A52-7766-4E37-9ACD-AC76AB000000}.Release|Win32.Build.0 = Release|Win32
{0F7B1A52-7766-4E37-9ACD-AC76AB000000}.Release|x64.ActiveCfg = Release|x64
{0F7B1A52-7766-4E37-9ACD-AC76AB000000}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -702,9 +712,10 @@ Global
{80FB8E0A-CCA8-4AB7-BC79-21E82A141842} = {DA539701-563C-4DCF-883B-941DE792BC4A}
{C91712C5-4A46-4703-9857-4E742D247601} = {FF9F78BB-144A-48EF-87D3-7EEE6C6B4682}
{9E33ACE6-5DDA-400C-8242-6BE0B8569221} = {FF9F78BB-144A-48EF-87D3-7EEE6C6B4682}
{0F7B1A52-7766-4E37-9ACD-AC76AB000000} = {8B7A2AEC-46DD-47CE-937E-767D7692C15F}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {CAC327DA-BA65-4990-BEC0-618347D67688}
Qt5Version = msvc2019_64
SolutionGuid = {CAC327DA-BA65-4990-BEC0-618347D67688}
EndGlobalSection
EndGlobal
24 changes: 24 additions & 0 deletions DyssolInstallers/Scripts/ExtLibs.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
; Copyright (c) 2023, DyssolTEC GmbH. All rights reserved. This file is part of Dyssol. See LICENSE file for license information.

#include "CommonConstants.iss"

#dim ExternalLibs[4]
#define ExternalLibs[0] "hdf5"
#define ExternalLibs[1] "sundials"
#define ExternalLibs[2] "zlib"

#define I

[Files]
; External libraries
#sub ExternalLibsFileEntry
Source: "..\..\ExternalLibraries\{#ExternalLibs[I]}\include\*"; DestDir: "{app}\{code:DirModelsCreator}\{code:DirExternalLibs}\{#ExternalLibs[I]}\include"; Flags: ignoreversion createallsubdirs recursesubdirs
#ifdef IsIncludeX32
Source: "..\..\ExternalLibraries\{#ExternalLibs[I]}\lib32\*"; DestDir: "{app}\{code:DirModelsCreator}\{code:DirExternalLibs}\{#ExternalLibs[I]}\lib32"; Flags: ignoreversion createallsubdirs recursesubdirs; Check: not Is64BitInstallMode
#endif
#ifdef IsIncludeX64
Source: "..\..\ExternalLibraries\{#ExternalLibs[I]}\lib64\*"; DestDir: "{app}\{code:DirModelsCreator}\{code:DirExternalLibs}\{#ExternalLibs[I]}\lib64"; Flags: ignoreversion createallsubdirs recursesubdirs; Check: Is64BitInstallMode
#endif
#endsub
#for {I = 0; I < DimOf(ExternalLibs); I++} ExternalLibsFileEntry

1 change: 1 addition & 0 deletions DyssolInstallers/Scripts/Main.iss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
; #define IsWithSrc
; #define IsWithSDK

#include "ExtLibs.iss"
#include "QtLibs.iss"
#include "FlowsheetsExamples.iss"
#include "SolversExamples.iss"
Expand Down
17 changes: 0 additions & 17 deletions DyssolInstallers/Scripts/ModelsCreator.iss
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@
#define CppProjects[5] "ModelsAPI"
#define CppProjects[6] "Utilities"

#dim ExternalLibs[3]
#define ExternalLibs[0] "hdf5"
#define ExternalLibs[1] "sundials"
#define ExternalLibs[2] "zlib"

#dim SolverTemplates[1]
#define SolverTemplates[0] "AgglomerationTemplate"

Expand Down Expand Up @@ -48,18 +43,6 @@ Source: "..\..\x64\Release\{#CppProjects[I]}*.lib"; DestDir: "{app}\{code:DirM
#endsub
#for {I = 0; I < DimOf(CppProjects); I++} CppProjectsFileEntry

; External libraries
#sub ExternalLibsFileEntry
Source: "..\..\ExternalLibraries\{#ExternalLibs[I]}\include\*"; DestDir: "{app}\{code:DirModelsCreator}\{code:DirExternalLibs}\{#ExternalLibs[I]}\include"; Flags: ignoreversion createallsubdirs recursesubdirs
#ifdef IsIncludeX32
Source: "..\..\ExternalLibraries\{#ExternalLibs[I]}\lib32\*"; DestDir: "{app}\{code:DirModelsCreator}\{code:DirExternalLibs}\{#ExternalLibs[I]}\lib32"; Flags: ignoreversion createallsubdirs recursesubdirs; Check: not Is64BitInstallMode
#endif
#ifdef IsIncludeX64
Source: "..\..\ExternalLibraries\{#ExternalLibs[I]}\lib64\*"; DestDir: "{app}\{code:DirModelsCreator}\{code:DirExternalLibs}\{#ExternalLibs[I]}\lib64"; Flags: ignoreversion createallsubdirs recursesubdirs; Check: Is64BitInstallMode
#endif
#endsub
#for {I = 0; I < DimOf(ExternalLibs); I++} ExternalLibsFileEntry

; Solvers templates
#sub SolverTemplatesFileEntry
Source: "..\..\Solvers\Templates\{#SolverTemplates[I]}\*.vcxproj"; DestDir: "{app}\{code:DirModelsCreator}\{code:DirSolverTemplates}\{#SolverTemplates[I]}"; Flags: ignoreversion
Expand Down
5 changes: 3 additions & 2 deletions DyssolInstallers/Tests/build_and_run_tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ if ($pre_build_binaries -eq "true") {
Write-Host Compiling $platform $configuration
devenv $solution_path /build "$($configuration)|$($platform)"
}

# create build directory
if (!(Test-Path $build_path)) {
New-Item -itemType Directory -Path $build_path
}

# compile docs
# compile tests
Set-Location $build_path

cmake $solution_dir -D BUILD_BINARIES=NO -D BUILD_DOCS=NO -A $platform -D CMAKE_BUILD_TYPE=$configuration --fresh
cmake --build . --target RUN_TESTS --parallel $ENV:NUMBER_OF_PROCESSORS
5 changes: 4 additions & 1 deletion DyssolMainWindow/DyssolMainWindow.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,10 @@
<ProjectReference Include="$(SolutionDir)GUIDialogs\ModulesManagerTab\ModulesManagerTab.vcxproj">
<Project>{4882842d-566d-456a-a267-a5f9c8fdb16d}</Project>
</ProjectReference>
<ProjectReference Include="..\ScriptInterface\ScriptInterface.vcxproj">
<ProjectReference Include="..\GUIWidgets\SimulationThread\SimulationThread.vcxproj">
<Project>{0f7b1a52-7766-4e37-9acd-ac76ab000000}</Project>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)ScriptInterface\ScriptInterface.vcxproj">
<Project>{0736ddb9-c29b-4dea-8e9a-6feffed8cfb6}</Project>
</ProjectReference>
</ItemGroup>
Expand Down
Loading

0 comments on commit 3e96f3f

Please sign in to comment.