-
Notifications
You must be signed in to change notification settings - Fork 281
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
Update README.md to explain cross-compiling #922
Comments
@piponazo I'll deal with README.md and README-CONAN.md. I believe most of the new documentation will go into README-CONAN.md and will be referenced in README.md I have not been able to get CMake to find and use the expat and zlib which were cross-compiled by conan, so I'm going to defer this for v0.27.3. Here's what I've done on Ubuntu 18.04 Install pip3 and conan:
Configure for cross-platform development
Build dependencies, run cmake, and build:
3a)
Testing the buildDon't know yet. To be investigated. It can be tested in MinGW in much the same way as I test Visual Studio builds. |
Sorry, I did not see this until now. I remember that I had also some issues with some of the dependencies when I tried to cross-compile from Ubuntu 18.04 to Windows with MinGW, but I think at the end I could solve them. I'll take a look to it at some point. |
Imho the simplest way how to cross compile from Linux with MinGW is to use Fedora (either grab the vagrant box or a container via
That's literally it. The only caveat is that shared libraries don't work due to the issues with the Error type, which I haven't solved yet in #685 and #779. |
I can't get this to work on Ubuntu for the following reasons:
I'm going to defer this for v0.27.3. |
Robin Mills <notifications@github.com> writes:
I can't get this to work on Ubuntu for the following reasons:
1) Conan doesn't install the expat dependency.
2) The file cmake/mingw-w64-x86_64.cmake isn't in the repos.
3) Dan's recipe requires `mingw-cmake` which does not exist in `apt`.
Because that is only available on Fedora. If you want a painless
solution: use Fedora, grab the same packages as on GitLab and it should
just work (no need to mess with Ubuntu, conan and cmake toolchain files).
4) Building "static only" is of limited usefulness.
This should be fixed once #685 makes it into master, no chance for 0.27
though.
… 5) I'd like to document how to test this on Windows or using wine on Linux.
I'm going to defer this for v0.27.3.
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#922 (comment)
|
Thanks, Dan. That's a bummer. I would like to get cross-compiling documented for "the dots". I had it working in January with a little magic in contrib and some DLLs which I shouldn't have put into the repos. I'll revisit this and look at Fedora for 0.27.3. Or maybe I'll focus on the book. We'll see. |
I've had another visit to this topic and installed Fedora 31.1.9 on a fresh VM. Dan's instructions here are correct:#922 (comment) I had some work to perform to install zlib1-devel and expat-devel on x86_64 to build native, however it built smoothly and passed the test framework. Then I used Dan's instructions to cross-compile, and indeed I haven't figured out how to configure the Fedora Network to "see" So, I tried to run the test manually (from information in README.md)
Amazing. It almost worked. So, I tried execute exiv2.exe from the command-prompt:
It's cross compiled to use dynamic dependencies which are not on PATH or LD_LIBRARY_PATH on Good Progress. Tomorrow is another day. |
You need to copy 5 DLLs from Fedora as follows:
The bash tests execute correctly, with the exception of a time issue in conversions.sh which I will not investigate.
The new tests I've tried to change all the python files without success:
That didn't fix it. I'll open a new issue about this and ask @D4N if it's possible to modify the test suite to forgive line-ending mismatches. #1146 |
Robin Mills <notifications@github.com> writes:
Running addmoddel.sh ...
all testcases passed.
Running conversions.sh ...
Files /home/rmills/temp/0.27-maintenance/test/tmp/conversions.out and /home/rmills/temp/0.27-maintenance/test/data/conversions.out differ
165c165
< Exif.Image.DateTime Ascii 20 2015:04:17 19:10:22
---
> Exif.Image.DateTime Ascii 20 2015:04:18 02:10:22
Looks like a timezone issue to me.
|
@D4N It is a time-zone issue and I've see it before. The test is set up for KL, Malaysia which is GMT+8 and I'm running it in BST (GMT+1). And the difference in output is 7 hours. I'm not going to bother investigating this further. The task here is to document cross compiling and I have sufficient information to update README.md which will reference this discussion. If you feel it's important to investigate this TZ issue, please open a new issue. |
The TZ issue has been investigated and resolved with a "tweak" in the test-harness. #485 The "tweak" can be extended to support
|
I've investigated @D4N 's caveat about cross building shared libraries. I'm pleased to say that it does successfully build, with the same restriction as the static libraries, which are:
|
I've investigated using wine to run exiv2 from Fedora and it works! Both build_mingw and build_mingw_shared are working. As before you have to copy the 5 "system" DLLs into the bin. Running the test harness is challenging because we don't have make and bash in the wine environment. I can think of two ways to get the test suite to run: Either: Or: There are notes in README.md about setting up MSYS2. Once you are running MSYS2/bash, you will be able to run the test suite as documented in README.md The line-ending issue with the python test suite has been fixed. #1146 #1150 |
EUREKA! Mounting the Fedora Directory in Windows works! I achieved that by getting Fedora to build into a shared drive on the Mac //Mac/Home/gnu/github/exiv2/0.27-maintenance/build_mingw_fedora. Build in the Copy the 5 DLLs on Fedora to the bin:
Run the test suite in MSYS on Windows on the build:
There are two issues:
I'm not going to work on the python test suite in this obscure environment. The JSON issue is another manifestation of the TZ issue. The other two are obscure. The test suite works impressively well and I have 100% confidence that the build is good. |
When I wrote README.md for v0.27, I had never succeeded in cross-compiling for MinGW from Linux. I believe this is now working and Dan has a CI job.
I hope to refresh my brain about this and get it documented for v0.27.2. For sure for v0.27.3
The text was updated successfully, but these errors were encountered: