Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OMCompiler: Relocatable compilation tools #12039

Merged
merged 1 commit into from
Feb 29, 2024

Conversation

jschueller
Copy link
Contributor

@jschueller jschueller commented Feb 28, 2024

Related Issues

The location of compilation tools (cmake & gcc) for fmu export might not be the same when OM is compiled on a different machine than the one on which it will be used (eg conda packages built from conda-forge automatic builders),
and in that case the export can fail (the _build_env directory only existed on the build machine):

Error: Error building simulator. Build log: cmd: cd 'deviation.fmutmp/sources/' && mkdir build_cmake_dynamic && cd build_cmake_dynamic && \"/home/conda/feedstock_root/build_artifacts/omcompiler_1709022273479/_build_env/bin/cmake\" -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER='/home/runner/miniconda3/envs/test/bin/x86_64-conda-linux-gnu-cc' -DCMAKE_CXX_COMPILER='/home/conda/feedstock_root/build_artifacts/omcompiler_1709022273479/_build_env/bin/x86_64-conda-linux-gnu-c++' .. && \"/home/conda/feedstock_root/build_artifacts/omcompiler_1709022273479/_build_env/bin/cmake\" --build . --parallel  --target install && cd .. && rm -rf build_cmake_dynamic
/bin/sh: 1: /home/conda/feedstock_root/build_artifacts/omcompiler_1709022273479/_build_env/bin/cmake: not found

Purpose

Allow for usable fmu export on conda-forge

Approach

I patched OM to drop absolute paths (and rely on PATH)
xref https://github.com/conda-forge/omcompiler-feedstock/blob/main/recipe/meta.yaml

@jschueller jschueller changed the title Relocatable compilation tools [OMCompiler] Relocatable compilation tools Feb 28, 2024
@jschueller jschueller changed the title [OMCompiler] Relocatable compilation tools OMCompiler: Relocatable compilation tools Feb 28, 2024
@mahge
Copy link
Contributor

mahge commented Feb 28, 2024

#9563 for reference.

I think it should have been as you have done it now. I am not sure what exactly was the issue that made us change it to be hard coded. In any case, considering OMDev's cmake has been updated to a good enough version since then, we should be fine using the CMake found on path and falling back to it if all fails.

@AnHeuermann AnHeuermann merged commit 6d03b27 into OpenModelica:master Feb 29, 2024
2 checks passed
@AnHeuermann AnHeuermann added the COMP/FMI Issue and pull request related to FMI export label Feb 29, 2024
@jschueller jschueller deleted the reloc branch February 29, 2024 12:27
@jschueller
Copy link
Contributor Author

could this be included in 1.22.3 ?

@AnHeuermann
Copy link
Member

I wouldn't back port it to 1.22. Only really bad bugs should be ported to the maintenance branch.
The next release of OpenModelica should be published soonish and you can use the nightly if your need this fix right now.

@jschueller
Copy link
Contributor Author

fair enough, I'll wait 1.23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
COMP/FMI Issue and pull request related to FMI export
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants