coin3d / pivy

python bindings to coin3d
ISC License
53 stars 39 forks source link

macos build failure using cmake #96

Open ipatch opened 2 years ago

ipatch commented 2 years ago

hello 👋,

i've been attempting build pivy from source from the latest git master HEAD and also from the 0.6.7 tarball release on macos catalina but have been running into build failures.

i realize pivy requires a dependency on coin3d, and built coin from the latest tarball and from git master head without any issues from building and linking against python 3.10 more specifically the homebrew installation of python@3.10 on an intel mac.

the cmake commands i'm using are below,

cd /opt/code/github/public/forks/freecad-git/deps/pivy-git/pivy.src/build/build.git.master.head

cmake 
-DCMAKE_PREFIX_PATH=$bp/Cellar/coin3d-py3_10@4.0.0/HEAD-bad7605 \
 ../..
STDOUT from above ☝️ cmake command ``` -- The C compiler identification is AppleClang 12.0.0.12000032 -- The CXX compiler identification is AppleClang 12.0.0.12000032 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - 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: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found SWIG: /usr/local/bin/swig (found suitable version "4.0.2", minimum required is "4.0.0") -- Could NOT find SoQt (missing: SoQt_DIR) -- Found Python: /usr/local/Frameworks/Python.framework/Versions/3.10/bin/python3.10 (found version "3.10.4") found components: Interpreter Development Development.Module Development.Embed -- Configuring done -- Generating done -- Build files have been written to: /opt/code/github/public/forks/freecad-git/deps/pivy-git/pivy.src/build/build.git.master.head ```

i then run make and that produces the below 👇 error message

make cmd / build error STDOUT ``` InternalEvent(SbName const &) not supported (incomplete type checking rule - no precedence level in typecheck typemap for 'SbName const &'). [ 33%] Built target coin_swig_compilation [ 66%] Building CXX object interfaces/CMakeFiles/coin.dir/__/pivy/coinPYTHON_wrap.cxx.o /opt/code/github/public/forks/freecad-git/deps/pivy-git/pivy.src/build/build.git.master.head/pivy/coinPYTHON_wrap.cxx:9622:12: error: array type 'va_list' (aka '__builtin_va_list') is not assignable arg3 = *temp; ~~~~ ^ /opt/code/github/public/forks/freecad-git/deps/pivy-git/pivy.src/build/build.git.master.head/pivy/coinPYTHON_wrap.cxx:9623:32: warning: 'delete' applied to a pointer-to-array type 'va_list *' (aka '__builtin_va_list *') treated as 'delete[]' if (SWIG_IsNewObj(res3)) delete temp; ^ ~~~~ [] 1 warning and 1 error generated. make[2]: *** [interfaces/CMakeFiles/coin.dir/__/pivy/coinPYTHON_wrap.cxx.o] Error 1 make[1]: *** [interfaces/CMakeFiles/coin.dir/all] Error 2 make: *** [all] Error 2 ```

if the entire output from running the make cmd is helpful let me know and i'll gladly post the entire output.

looooo commented 2 years ago

Which swig version are you using? I can remember having a similar problem long ago, but I can't remember the solution.

ipatch commented 2 years ago

for what it's worth, im only running into build issues using the cmake procedure. i took look at how the arch package is setup and installed,

https://github.com/archlinux/svntogit-community/blob/packages/python-pivy/trunk/PKGBUILD

and used the python command from the above link, and was able to build pivy on macos catalina using python 3.10 with the latest HEAD of coin3d.

the command i used to build pivy is below

python3 setup.py install --prefix=../installs/ --root=(pwd)
looooo commented 2 years ago

nice to see this is still working. Not sure about the issue with cmake. I am testing this with conda and do not see such issues.

ipatch commented 2 years ago

curious, what platform and what OS are you using to test the conda cmake procedure with?

looooo commented 2 years ago

https://github.com/coin3d/pivy/runs/6227287786?check_suite_focus=true

hopefully soon osx_arm64 will join. Pyside2 is still missing.

ipatch commented 2 years ago

coin3d/pivy/runs/6227287786?check_suite_focus=true

hopefully soon osx_arm64 will join. Pyside2 is still missing.

on a separate but related issue regarding python 3.10 i was able to build both pyside and shiboken 5.15.3 using python 3.10 thanks to a patch from the arch linux distro. you can see how i set things up with the homebrew formula below, if that helps,

https://github.com/FreeCAD/homebrew-freecad/blob/master/Formula/pyside2%405.15.3.rb

ageeye commented 2 years ago

I used for pyside2 a patch from Fedro. That included some more changes than your fix. But since I updated to QT 5.15.3, I do not need a fix for pyside2. Conda used an older QT tree.

Swig version is 4.0.2.

ipatch commented 2 years ago

@ageeye

are you able to build pivy on macos using cmake? and if so, what are the steps you are using?

ageeye commented 2 years ago

I used setup.py. Attached are the cmake logs.

CMakeOutput.log CMakeCache.txt .

ipatch commented 2 years ago

@ageeye

have you been able to build pivy with cmake?

ageeye commented 2 years ago

I'll test it at the weekend.

ageeye commented 2 years ago

First step I get the export stuff by edit the formula with "brew edit .../freecad/pivy" and add the line " system "export -p". Then the standard stuff:

export ..
git clone https://github.com/coin3d/pivy.git   
mkdir build
cd build
cmake ../pivy
make -j8

Works fine with a lot of warnings.

luzpaz commented 2 years ago

bumping for progress on https://github.com/FreeCAD/FreeCAD/issues/6856

luzpaz commented 2 years ago

soft bump

luzpaz commented 1 year ago

bump

luzpaz commented 1 year ago

bumpity bump

luzpaz commented 1 year ago

Anyone?

thyssentishman commented 1 year ago

I'm running into the same error on OpenBSD 7.3 - current.

/usr/ports/pobj/py-pivy-0.6.8/build-amd64/pivy/coinPYTHON_wrap.cxx:9951:12: error: array type 'va_list' (aka '__builtin_va_list') is not assignable
      arg3 = *temp;
      ~~~~ ^
/usr/ports/pobj/py-pivy-0.6.8/build-amd64/pivy/coinPYTHON_wrap.cxx:9952:32: warning: 'delete' applied to a pointer-to-array type 'va_list *' (aka '__builtin_va_list *') treated as 'delete[]'
      if (SWIG_IsNewObj(res3)) delete temp;
                               ^      ~~~~
                                     []
1 warning and 1 error generated.
ninja: build stopped: subcommand failed.

I'm using python-3.10.13, swig-4.1.0 and the latest coin-4.0.0. Any workarounds for this?

thyssentishman commented 1 year ago

Nevermind, using setup.py instead of cmake worked.

bgbsww commented 5 months ago

I think the workaround for cmake is to add %ignore SbString::vsprintf(const char * formatstr, va_list args); to interfaces/soqt.i.

It isn't reasonable to assign a va_list.

Builds on ubuntu for python 3.12, swig 4.02, coin 4.0.0