MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007691ardourbugspublic2018-11-24 03:342018-11-25 09:51
Reporteraquilarubra 
Assigned Tox42 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Platformx86_64OSWindowsOS Version10
Product Version5.X git (version in description) 
Target VersionFixed in Version 
Summary0007691: zita-convolver cross compilation issue
DescriptionWhile cross compiling for Windows, zita-convolver does not seem to recognize the Windows platform correctly and I have to run the following command to fix:

sed -i '1s/^/#define PTW32_VERSION\n\n/' libs/zita-convolver/zita-convolver/zita-convolver.h

A better Windows detection should be implemented.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0020476)
x42 (administrator)
2018-11-24 04:48

The case at hand is not to detect windows, but to detect which semaphore implementation to use. On Windows using ptw32 is the easiest.

The alternative would be to use code from libs/pbd/semutils.cc. We cannot use libpbd here since the convolver needs to be statically linked into plugins. Also ideally the code would go upstream to libzita-convolver.

Cross-compiling for windows works just fine (using mingw, that's what nightly.ardour.org offfers). The current code also compiles with MSVC.

How does it fail in your case? What semaphore implementation do you use?
(0020479)
timbyr (developer)
2018-11-24 15:26
edited on: 2018-11-24 15:27

An issue here is that for a few years mingw-w64 and GCC itself ship with winpthreads as the pthread implementation AFAIR.

I'm not sure if it is possible to still use pthreads-win32 with GCC/mingw-w64 anymore (At least I'm not aware of anyone still doing so).

Perhaps an appropriately licensed and header only cross platform semaphore implementation could be used instead and proposed upstream. Perhaps something like:

https://github.com/preshing/cpp11-on-multicore/blob/master/common/sema.h [^]

Without the C++11 only part at the bottom.

(0020480)
x42 (administrator)
2018-11-24 15:38

We do use pthreads-win32 with binaries from ardour.org as is john with MSVC.
(0020481)
x42 (administrator)
2018-11-24 15:44

@timbyr: is there a compiler define when mingw provides winpthread itself?
(0020482)
timbyr (developer)
2018-11-24 15:58

winpthreads does provide a semaphore.h header, so I guess you could add __WINPTHREADS_VERSION to ifdef and it might work.
(0020483)
x42 (administrator)
2018-11-24 16:07

That sounds like a good solution. @aquilarubra could you try that?

change zita-convolver.h line 37

 ... || defined(PTW32_VERSION) || defined (__WINPTHREADS_VERSION)
(0020484)
aquilarubra (reporter)
2018-11-24 22:39

Yes, I am using winpthreads. I'll try and report.
(0020485)
aquilarubra (reporter)
2018-11-24 23:19

I confirm it works with || defined (__WINPTHREADS_VERSION)
(0020488)
x42 (administrator)
2018-11-25 09:51

Fixed in 6.0-pre0-1306-g3fd8dad9d

- Issue History
Date Modified Username Field Change
2018-11-24 03:34 aquilarubra New Issue
2018-11-24 04:48 x42 Note Added: 0020476
2018-11-24 15:26 timbyr Note Added: 0020479
2018-11-24 15:27 timbyr Note Edited: 0020479 View Revisions
2018-11-24 15:38 x42 Note Added: 0020480
2018-11-24 15:44 x42 Note Added: 0020481
2018-11-24 15:58 timbyr Note Added: 0020482
2018-11-24 16:07 x42 Note Added: 0020483
2018-11-24 16:09 x42 Assigned To => x42
2018-11-24 16:09 x42 Status new => feedback
2018-11-24 22:39 aquilarubra Note Added: 0020484
2018-11-24 22:39 aquilarubra Status feedback => assigned
2018-11-24 23:19 aquilarubra Note Added: 0020485
2018-11-25 09:51 x42 Note Added: 0020488
2018-11-25 09:51 x42 Status assigned => resolved
2018-11-25 09:51 x42 Resolution open => fixed


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker