Ultimaker / cura-build-environment

CMake project to build dependencies for Cura
GNU Affero General Public License v3.0
24 stars 55 forks source link

Cannot build on macOS Mojave #70

Closed trouch closed 5 years ago

trouch commented 5 years ago

51 is still happening as of today

Tried on two mac computers, both on mojave with clean install. Tested different solution, xcode / brew update and install.

This issue is different from #69

Ghostkeeper commented 5 years ago

Could you try compiling this code?

#include <iostream>
#include <cstddef>

int main()
{
    size_t x = 100;
    std::cout << "Size: " << sizeof(size_t) << ", value: " << x << std::endl;
}

Then run it. I'd expect it to output something like:

Size: 8, value: 100
trouch commented 5 years ago
$ g++ sizetest.cpp -o sizetest && ./sizetest
Size: 8, value: 100

🤔

Ghostkeeper commented 5 years ago

Hmm, so it seems to work when using GCC manually but not when compiling it via CMake...

Are you using the GCC generator also for compiling the build environment?

On MacOS we are using Clang for the official builds (though that shouldn't matter really).

trouch commented 5 years ago

Thanks for the info, I've been able to reproduce the issue, track it down and got some progress. It was failing when using absolute path as found per CMAKE to call clang:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ /tmp/sizetest.cpp

In file included from /tmp/sizetest.cpp:1:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iostream:38:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ios:215:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iosfwd:90:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/wchar.h:119:15: fatal error: 'wchar.h' file not found
#include_next <wchar.h>
              ^~~~~~~~~
1 error generated.

I've cleaned up my install and reinstalled all tools in that order :

After doing that, I'm able to build the sizetest file as above, but cmake still is failing to configure Python. I've ran ./configure from the downloaded Python sources, and it works without issue. It seems to be a very specific issue with Python+CMake+Mojave. I'll continue testings from time to time, but I guess I can close the issue here. I'll submit a PR to update the README if I find something.