-
Notifications
You must be signed in to change notification settings - Fork 12
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
compilation under windows or cross-compilation #62
Comments
Hi, the dependencies have to be available in the same cross-compile configuration. Does that help? |
With xerces I solved the problem but libzip.... it's like building dependency to dependency to dependency and there is no end ... |
For zlib there is a package available (at least in Ubunutu 18.04) then libzib is built on top of that: I do have a docker file with all that somewhere, actually I meant to include that in the CI-process here.... |
I guess for docker file example I will appreciate :) (but IMO after installing libz that you recommended I did step forward, but now linking problem with xerces), it's like never-ending story. |
Found it. After all that I still had to tell cmake where to find ASIO, I put:
into Building can be quite frustrating, that's why docker is great: once you got it you got it.
|
Hi, |
Cross-Compiling is easiest because you can rely on the system packages for dependencies, all the steps should be in the docker file excerpt above. Building natively on Windows: |
@clemensschiffer
BUT
do you know what may be the reason? |
I think we should keep this issue strictly to compilation. For your example: Are you sure this is the exact same code including configuration, time_resolution, input/output connections and the model itself? Do the supplied examples differ per os? I can't believe that they do.... |
@clemensschiffer - Thanks for posting the Dockerfile. Is it possible to build the project with cmake+MSVC generators? Based on what I read from this thread, there are other dependencies for this project (ASIO, zip, etc) - and it would be impractical (and perhaps impossible) to build this on Window using cmake+MSVC. Is the option possible option is to cross-compile on Linux using mingw-win32 or mingw-win64? |
@svanimisetti from my experience use pacman.
install msys2 https://www.msys2.org/ and in msys
then in dcplib create a build directory and
|
Hello @svanimisetti, Building natively with MSVC is possible, as I wrote above:
You definitely need Xerces-c follow the instructions here: I hope I find the time soon to put this native build into the CI/CD process here, such that it later on it will only be copy/paste. ;) Kind regards, |
@clemensschiffer - Sorry for such a delayed response, but I was able to push through during the summer vacation and managed to compile DCPLib on Windows. As @masoud-najafi had also requested, I wanted to build directly on Windows with MinGW GCC, without the need to cross-compile via Linux or WSL. I was able to run all the cases successfully. If it is of any interest, I can write-up a small documentation and send PR your way. Let me know if that will be helpful. Otherwise, I can always document the learnings in this issue thread. Kindly advise. |
@femust - you have shown an example of FMU using DCP on win64 and linux64.
How are you able to combine the FMU with DCP? I am trying to achieve a similar objective. I am now able to compile the DCPLib on win64 and linux64. My next step is to embed the DCPLib inside FMU and connect a co-simulation master FMU on win64 to slave on linux64. I am running into issues. Do you have any documentation demonstrating how you achieved this? I don't mean to hijack this issue thread, but any information you can share will be greatly appreciated. |
@clemensschiffer - I just noticed that the documentation for installation is in the wiki (https://github.com/modelica/DCPLib.wiki.git). Unfortunately, there is no way to modify the wiki attached to main repo and send a pull request. Looks like the only way is to document the steps here. |
Hello @svanimisetti, thank you for your interest and the feedback! Coupling FMU<->DCP is a separate topic. Kindly, |
@clemensschiffer - Thanks for the direction. I would rather not pollute your current README. I will document the steps here for posterity and your review. If it seems acceptable to you, please merge it into the Wiki later. I will post the steps by end of this week. |
As discussed, I am documenting the steps I used to successfully compile DCPLib (along with the examples) on Windows 10 64-bit. I hope this is useful for anyone trying to compile the libraries on Windows 10. Build Instruction for Windows 10 64-bit using MinGWBuild instructions were tested on a computer with the following configuration:
NOTES:
Gather Dependencies:cd /c/Users/<username>/Downloads
wget https://sourceforge.net/projects/asio/files/asio/1.28.0%20%28Stable%29/asio-1.28.0.zip
wget https://dlcdn.apache.org/xerces/c/3/sources/xerces-c-3.2.4.zip
wget https://libzip.org/download/libzip-1.10.0.tar.gz Build DependenciesWhen building dependencies for Windows 10, it is advisable to use Also, since Ninja build system was used, the appropriate generator name is passed to CMake. Please refer to CMake-Ninja documentation for more details. ASIOcd /c/Users/<username>/Downloads
unzip asio-1.28.0.zip
cd asio-1.28.0
./configure --without-boost --prefix=/c/Users/<username>/Downloads/install_dir
cd include
make install Xerces-ccd /c/Users/<username>/Downloads
unzip xerces-c-3.2.4.zip
cd xerces-c-3.2.4
mkdir build
cmake -S . -B ./build -G "Ninja" --install-prefix /c/Users/<username>/Downloads/install_dir
cmake --build ./build --target install LibZip
Build DCP ProjectBuild DCPLibNOTE: In the following instructions, CMAKE_PREFIX_PATH is set to
Build DCP Test Examples
Run DCP Test ExamplesNOTE: must run slaves before master - otherwise will see following error
Open three command Git-Bash windows and set
Clean-upSimply delete |
Hey,
so I am running the script
build_mingw.sh
and I got the following error:-- Could NOT find ZIP (missing: ZIP_LIBRARY ZIP_INCLUDE_DIR)
since on ubuntu I have this library, I'm not sure why it can't find it, I mean, I am assuming it's due to compilation under windows, but then the question arises how should I install this zip library under ubuntu for cross compilation?
The text was updated successfully, but these errors were encountered: