curv3d / curv

a language for making art using mathematics
Apache License 2.0
1.14k stars 73 forks source link

Error building Curv on Windows 10 with MSYS2 #160

Open Vdemong opened 2 years ago

Vdemong commented 2 years ago

Build ERROR with latest MSYS2 (msys2-x86_64-20220603)

... cd release; make make[1]: Entering directory '/curv/release' make[2]: Entering directory '/curv/release' make[3]: Entering directory '/curv/release' make[3]: Leaving directory '/curv/release' make[3]: Entering directory '/curv/release' [ 0%] Building CXX object CMakeFiles/libfive.dir/extern/libfive/libfive/src/eval/base.cpp.obj In file included from C:/msys64/curv/extern/libfive/libfive/include/libfive/eval/base.hpp:14, from C:/msys64/curv/extern/libfive/libfive/src/eval/base.cpp:12: C:/msys64/curv/extern/libfive/libfive/include/libfive/tree/tree.hpp: In constructor 'libfive::Tree::Tree(libfive::Tree&&)': C:/msys64/curv/extern/libfive/libfive/include/libfive/tree/tree.hpp:53:20: error: 'exchange' is not a member of 'std' 53 | : ptr(std::exchange(other.ptr, nullptr)), flags(other.flags) | ^~~~ make[3]: [CMakeFiles/libfive.dir/build.make:76: CMakeFiles/libfive.dir/extern/libfive/libfive/src/eval/base.cpp.obj] Error 1 make[3]: Leaving directory '/curv/release' make[2]: [CMakeFiles/Makefile2:223: CMakeFiles/libfive.dir/all] Error 2 make[2]: Leaving directory '/curv/release' make[1]: [Makefile:136: all] Error 2 make[1]: Leaving directory '/curv/release' make: [Makefile:13: release] Error 2 == BUILD ERROR ==

lf94 commented 2 years ago

@Vdemong you need to use GCC-11. GCC-12 has broken a lot of upstream external dependencies, like libfive and openvdb. If you do CXX=gcc-11 after installing gcc-11 it'll work, as this is an issue I got stuck on too

meleano commented 2 years ago

Hello: Same here. Any working Idea? pls:

== building Curv executable rm -rf CMakeCache.txt CMakeFiles mkdir -p release cd release; cmake -G"MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release .. -- The C compiler identification is GNU 11.3.0 -- The CXX compiler identification is GNU 11.3.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/msys64/mingw64/bin/cc.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/msys64/mingw64/bin/c++.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found PkgConfig: C:/msys64/mingw64/bin/pkg-config.exe (found version "1.8.0") -- Checking for module 'eigen3>=3.2.92' -- Found eigen3, version 3.4.0 -- Found Boost: C:/msys64/mingw64/include (found suitable version "1.79.0", minimum required is "1.65") found components: iostreams system regex -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success -- Found Threads: TRUE -- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) -- Looking for dinput.h -- Looking for dinput.h - found -- Looking for xinput.h -- Looking for xinput.h - found -- Performing Test _GLFW_HAS_DEP -- Performing Test _GLFW_HAS_DEP - Success -- Performing Test _GLFW_HAS_ASLR -- Performing Test _GLFW_HAS_ASLR - Success -- Performing Test _GLFW_HAS_64ASLR -- Performing Test _GLFW_HAS_64ASLR - Success -- Using Win32 for window creation -- Configuring done -- Generating done -- Build files have been written to: C:/msys64/curv/release cd release; make make[1]: Entering directory '/curv/release' make[2]: Entering directory '/curv/release' make[3]: Entering directory '/curv/release' make[3]: Leaving directory '/curv/release' make[3]: Entering directory '/curv/release' [ 0%] Building CXX object CMakeFiles/libfive.dir/extern/libfive/libfive/src/eval/base.cpp.obj [ 1%] Building CXX object CMakeFiles/libfive.dir/extern/libfive/libfive/src/eval/deck.cpp.obj [ 1%] Building CXX object CMakeFiles/libfive.dir/extern/libfive/libfive/src/eval/eval_array.cpp.obj In file included from C:/msys64/curv/extern/libfive/libfive/include/libfive/eval/eval_array.hpp:16, from C:/msys64/curv/extern/libfive/libfive/src/eval/eval_array.cpp:10: C:/msys64/curv/extern/libfive/libfive/include/libfive/eval/eval_array.hpp: In static member function 'static void* libfive::ArrayEvaluator::operator new ': C:/msys64/curv/extern/libfive/libfive/include/libfive/render/brep/default_new_delete.hpp:46:16: error: 'aligned_alloc' was not declared in this scope; did you mean '_aligned_malloc'? 46 | return aligned_alloc(std::alignment_of_v, size); \ | ^~~~~ C:/msys64/curv/extern/libfive/libfive/include/libfive/render/brep/default_new_delete.hpp:46:16: note: in definition of macro 'ALIGNED_OPERATOR_NEW_AND_DELETE' 46 | return aligned_alloc(std::alignment_of_v, size); \ | ^~~~~ make[3]: [CMakeFiles/libfive.dir/build.make:104: CMakeFiles/libfive.dir/extern/libfive/libfive/src/eval/eval_array.cpp.obj] Error 1 make[3]: Leaving directory '/curv/release' make[2]: [CMakeFiles/Makefile2:223: CMakeFiles/libfive.dir/all] Error 2 make[2]: Leaving directory '/curv/release' make[1]: [Makefile:136: all] Error 2 make[1]: Leaving directory '/curv/release' make: [Makefile:13: release] Error 2 == BUILD ERROR ==

lf94 commented 1 year ago

@meleano It seems "aligned_alloc" is part of glibc. Your MSYS2 environment is probably not update enough. I would suggest refreshing it and again using gcc-11.

meleano commented 1 year ago

@meleano It seems "aligned_alloc" is part of glibc. Your MSYS2 environment is probably not update enough. I would suggest refreshing it and again using gcc-11.

Thnx .I'll try it as soon as I could.

doug-moen commented 1 year ago

The "aligned_alloc" problem is now fixed with today's checkin (bug in libfive). This might be enough for @meleano to build curv.

The github actions Windows build is still broken, which looks like a problem with the actions build script. Here are the current errors from that build:

D:/a/_temp/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -ltbb: No such file or directory
D:/a/_temp/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lHalf: No such file or directory
c

I'm keeping this bug open until the github actions build succeeds.