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

Regex conflict while compiling #14

Closed
Daandelange opened this issue Feb 25, 2020 · 3 comments
Closed

Regex conflict while compiling #14

Daandelange opened this issue Feb 25, 2020 · 3 comments

Comments

@Daandelange
Copy link
Collaborator

Daandelange commented Feb 25, 2020

Hello Emanuele / World,
I'm giving trying to compile Mosaic but I'm stuck on a compilation conflict and would like some insight.

  • Mosaic/src/TextEditor.h includes <regex> which loads /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/regex.
  • ofxPython includes /usr/include/python2.7/pyport.h which sets a macro: #define tolower(c)... that overrules the regex's tolower function-like macro.
  • Compilation throws an error : too many arguments provided to function-like macro invocation __ct_->tolower(&__s[0], &__s[0] + __s.size());.

I guess this is some kind of conflict between python 2.7 and libc++::regex.
Before digging further, I'm wondering how you don't get this error (if so). Might this be related to Apple's libc++ implementation ?

Do you have any clue about this ?

My configuration : Mosaic master (0.3.2) + OF 0.11.0 (release) + QT Creator 4.6.1 + Osx 12.12
My Qt Desktop kit is configured to compile with Apple Clang++ (within XCode); using /usr/bin/clang++ throws lots of errors anyways, nor does it compile OF.
I'm able to compile other OF projects using this same configuration.

Edit: I'm using Xcode 8.1 which holds libc++ ; I'll try to update that and report back.

@d3cod3
Copy link
Owner

d3cod3 commented Feb 25, 2020

Hi Daan,

the problem is probably about the osx version, do you mean 10.12 (Sierra) ?

I'm compiling on High Sierra (10.13) and Mojave (10.14) without problem, while the rest is the same, latest Mosaic code, OF 0.11.0 (works with 0.10.0 and 0.10.1 too) and QT Creator 4.6.1.

Another problem could be the Apple Clang++, i'm compiling with GCC (/usr/bin/) for both C and C++ x86 64bit.

I hope that helps, let me know if more problems appears.

@Daandelange
Copy link
Collaborator Author

Thanks for these infos. (yes I meant 10.12)
I got it compiling with /usr/bin/ but no change.
So I guess it's my OS, which I can't upgrade right now. :(

I isolated the issue to ofxPython (so it's not directly Mosaic) and found a dirty workaround. Alternatively Python 2.7.13 should also fix this.

Getting closer : Now I'm running into some linker errors, many *.a files are for 10.11 while I'm linking for 10.9. That might be more related to OF in general.
Do you link against 10.9 ? (I suppose yes, as the release runs on 10.9?)

For now, adding 'QTKit' to the .qbs's of.frameworks and adding cpp.minimumOsxVersion: "10.11" lets me compile a custom-build binary !
Running it requires me to manually copy libndi.3.dylib next to the binary (and run your script).

🎉
mosaic-first-launch
There's some crashes, but at least I got it compiling.

@d3cod3
Copy link
Owner

d3cod3 commented Feb 27, 2020

I'm happy you got it compiling!

About the errors/warnings:

I'm thinking in upgrade python to python3, so probably refactoring the code will solve the actual compiling issues with python

Yes, i'm linking against 10.9, just to leave OF defaults untouched, so when you compile on a different version the compiler will give you a warning about a library built for a newer OSX version, but that is usually not a problem at all (at least i've never had one related to that)

About the libndi.3.dylib, yes, my mistake, i use the OF embedded compile script to search for .dylib files inside lib folder and copy it next to the binary (OF do that for libfmodex), but it's not properly automated nor documented yet (and it's a OSX only issue, not needed on linux)

Let me know how is working, there is no manual or proper documentation yet, i'm beta testing right now, cleaning code and fixing bugs, but i'm starting with the manual too, empty now but you can check it here: https://github.com/d3cod3/Mosaic-Manual

And there is the official page with some documentation about 70% of the objects:

https://mosaic.d3cod3.org/

If you have any question, don't hesitate to ask!

@d3cod3 d3cod3 closed this as completed Mar 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants