pynest2d icon indicating copy to clipboard operation
pynest2d copied to clipboard

Can't build mac m1

Open emmajane1313 opened this issue 2 years ago • 8 comments

Getting an error on running conan install . --build=missing --update

make[2]: *** [src/x86/darwin.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
libffi/3.2.1:
libffi/3.2.1: ERROR: Package '240c2182163325b213ca6886a7614c8ed2bf1738' build failed
libffi/3.2.1: WARN: Build folder /Users/devdesign/.conan/data/libffi/3.2.1/_/_/build/240c2182163325b213ca6886a7614c8ed2bf1738
ERROR: libffi/3.2.1: Error in build() method, line 160
	autotools.make()
	ConanException: Error 2 while executing make -j10

emmajane1313 avatar Oct 08 '22 22:10 emmajane1313

please paste the complete output from the conan install command

jellespijker avatar Oct 17 '22 19:10 jellespijker

I got issue on conan build . [13/13] Linking CXX shared library pynest2d.so

[13/13] Linking CXX shared library pynest2d.so
FAILED: pynest2d.so 
: && /Library/Developer/CommandLineTools/usr/bin/g++ -stdlib=libc++ -std=c++17 -O3      -stdlib=libc++ -O3 -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -dynamiclib -Wl,-headerpad_max_install_names  -o pynest2d.so -install_name @rpath/pynest2d.so CMakeFiles/sip_pynest2d.dir/sip/pynest2d/sippynest2dBottomLeftConfig.cpp.o CMakeFiles/sip_pynest2d.dir/sip/pynest2d/sippynest2dBox.cpp.o CMakeFiles/sip_pynest2d.dir/sip/pynest2d/sippynest2dCircle.cpp.o CMakeFiles/sip_pynest2d.dir/sip/pynest2d/sippynest2dDJDHeuristicConfig.cpp.o CMakeFiles/sip_pynest2d.dir/sip/pynest2d/sippynest2dItem.cpp.o CMakeFiles/sip_pynest2d.dir/sip/pynest2d/sippynest2dItemGroup.cpp.o CMakeFiles/sip_pynest2d.dir/sip/pynest2d/sippynest2dNfpConfig.cpp.o CMakeFiles/sip_pynest2d.dir/sip/pynest2d/sippynest2dPoint.cpp.o CMakeFiles/sip_pynest2d.dir/sip/pynest2d/sippynest2dRectangle.cpp.o CMakeFiles/sip_pynest2d.dir/sip/pynest2d/sippynest2dcmodule.cpp.o CMakeFiles/sip_pynest2d.dir/sip/pynest2d/sippynest2dstdstring.cpp.o CMakeFiles/sip_pynest2d.dir/sip/pynest2d/sippynest2dstdvector0101Item.cpp.o  

[...]

~/.conan/data/zlib/1.2.11/_/_/package/6f12be38b2e454b75ce1f2efb692e5b77c8cdee3/lib/libz.a && :
ld: warning: ignoring duplicate libraries: '-lc++'
Undefined symbols for architecture arm64:
  "_sip_init_library", referenced from:
      _PyInit_pynest2d in sippynest2dcmodule.cpp.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
ERROR: conanfile.py (pynest2d/5.4.0-alpha): Error in build() method, line 133
        cmake.build()
        ConanException: Error 1 while executing cmake --build "/pynest2d-5.3.0/build/Release" '--' '-j8'

mvvkinn avatar Aug 07 '24 05:08 mvvkinn

I suspect you're mixing different architecture. Maybe you did a conan install on a emulated Intel rossetta terminal and the build on the native arm terminal.

Remove your build folder, possibly your ~/.conan/data and do everything from the same native arm terminal. Check if your conan profile mentioned the arm architecture and make sure that your system python with sip is installed on this architecture as well

jellespijker avatar Aug 08 '24 06:08 jellespijker

I suspect you're mixing different architecture. Maybe you did a conan install on a emulated Intel rossetta terminal and the build on the native arm terminal.

Remove your build folder, possibly your ~/.conan/data and do everything from the same native arm terminal. Check if your conan profile mentioned the arm architecture and make sure that your system python with sip is installed on this architecture as well

@jellespijker

tried again and python crashes with SIGSEGV. about this, I created new issue #31

mvvkinn avatar Aug 09 '24 09:08 mvvkinn

try adding a --require-override=cpython/3.10.4@ultimaker/testing it is probably finding the system python during building since you aren't building this as part of Cura, where this cpython recipe is overwritten in the conanfile.py of Cura

jellespijker avatar Aug 09 '24 19:08 jellespijker

@jellespijker tried with command conan install . --build=missing --update --require-override=cpython/3.10.4@ultimaker/testing

cpython/3.10@ultimaker/testing: Not found in local cache, looking in remotes...
cpython/3.10@ultimaker/testing: Trying with 'cura'...
ERROR: Failed requirement 'cpython/3.10@ultimaker/testing' from 'conanfile.py (pynest2d/5.4.0-alpha)'
ERROR: Unable to find 'cpython/3.10@ultimaker/testing' in remotes

in addition, this is my config below

Configuration (profile_host):
[settings]
arch=armv8
arch_build=armv8
build_type=Release
compiler=apple-clang
compiler.cppstd=17
compiler.libcxx=libc++
compiler.version=15
os=Macos
os_build=Macos
curaengine:compiler.cppstd=20
curaengine*:compiler.cppstd=20
curaengine_plugin_infill_generate:compiler.cppstd=20
curaengine_plugin_gradual_flow:compiler.cppstd=20
curaengine_grpc_definitions:compiler.cppstd=20
scripta:compiler.cppstd=20
umspatial*:compiler.cppstd=20
dulcificum:compiler.cppstd=20
cura_settings:compiler.cppstd=20
[options]
[build_requires]
[env]
[conf]
tools.cmake.cmaketoolchain:generator=Ninja
tools.env.virtualenv:auto_use=True
tools.gnu:define_libcxx11_abi=True
tools.build:skip_test=False

Configuration (profile_build):
[settings]
arch=armv8
arch_build=armv8
build_type=Release
compiler=apple-clang
compiler.cppstd=17
compiler.libcxx=libc++
compiler.version=15
os=Macos
os_build=Macos
[options]
[build_requires]
[env]
[conf]
tools.cmake.cmaketoolchain:generator=Ninja
tools.env.virtualenv:auto_use=True
tools.gnu:define_libcxx11_abi=True
tools.build:skip_test=False

mvvkinn avatar Aug 10 '24 16:08 mvvkinn

my mistake testing should be stable

conan install . --build=missing --update --require-override=cpython/3.10.4@ultimaker/stable

typing this on my phone double check please

jellespijker avatar Aug 10 '24 17:08 jellespijker

Tried with --require-override=cpython/3.10.4@ultimaker/stable and issue still persists.

Is this problem could be related to sip, cmake, ninja version? I'm using latest stable release. Version of Conan is 1.64.1.

mvvkinn avatar Aug 11 '24 11:08 mvvkinn