pivy icon indicating copy to clipboard operation
pivy copied to clipboard

macos build failure using cmake

Open ipatch opened this issue 3 years ago • 20 comments

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 [email protected] 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/[email protected]/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.

ipatch avatar May 11 '22 01:05 ipatch

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

looooo avatar May 11 '22 07:05 looooo

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)

ipatch avatar May 11 '22 16:05 ipatch

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.

looooo avatar May 11 '22 16:05 looooo

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

ipatch avatar May 11 '22 16:05 ipatch

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

hopefully soon osx_arm64 will join. Pyside2 is still missing.

looooo avatar May 11 '22 16:05 looooo

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

ipatch avatar May 11 '22 17:05 ipatch

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.

ageeye avatar May 11 '22 19:05 ageeye

@ageeye

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

ipatch avatar May 11 '22 19:05 ipatch

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

CMakeOutput.log CMakeCache.txt .

ageeye avatar May 11 '22 19:05 ageeye

@ageeye

have you been able to build pivy with cmake?

ipatch avatar May 11 '22 20:05 ipatch

I'll test it at the weekend.

ageeye avatar May 12 '22 18:05 ageeye

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.

ageeye avatar May 15 '22 15:05 ageeye

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

luzpaz avatar May 27 '22 21:05 luzpaz

soft bump

luzpaz avatar Jun 05 '22 13:06 luzpaz

bump

luzpaz avatar Dec 29 '22 13:12 luzpaz

bumpity bump

luzpaz avatar Apr 15 '23 21:04 luzpaz

Anyone?

luzpaz avatar Jun 01 '23 13:06 luzpaz

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 avatar Sep 18 '23 10:09 thyssentishman

Nevermind, using setup.py instead of cmake worked.

thyssentishman avatar Sep 18 '23 11:09 thyssentishman

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

bgbsww avatar Apr 23 '24 03:04 bgbsww