Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building on Mac OS X Using Homebrew Fails due to Qscintilla2 Versioning #5058

Open
cversek opened this issue Mar 21, 2024 · 12 comments
Open
Labels
Comp: Build system Tweaks for the build systems / CI integration OS: macOS Type: Bug

Comments

@cversek
Copy link
Sponsor

cversek commented Mar 21, 2024

Describe the bug
When following the build step:

./scripts/macosx-build-homebrew.sh

Followed by:

 mkdir build && cd build && cmake .. -DEXPERIMENTAL=1    

The cmake script gives the following error:

CMake Error at /opt/homebrew/Cellar/cmake/3.28.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Qt5QScintilla (missing: QT5QSCINTILLA_LIBRARY) (found
  suitable version "2.14.1", minimum required is "2.8.0")
Call Stack (most recent call first):
  /opt/homebrew/Cellar/cmake/3.28.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  cmake/Modules/FindQt5QScintilla.cmake:112 (find_package_handle_standard_args)
  CMakeLists.txt:543 (find_package)


-- Configuring incomplete, errors occurred!

Environment and Version info (please complete the following information):

  • OS: macOS 14.4 Sonoma
  • System: Apple Silicon M3 Max
  • OpenSCAD Version - Latest Source from Github

Additional context
According to brew info qscintilla2:

==> qscintilla2: stable 2.14.1 (bottled)
Port to Qt of the Scintilla editing component
https://www.riverbankcomputing.com/software/qscintilla/intro
/opt/homebrew/Cellar/qscintilla2/2.14.1_3 (155 files, 8.3MB) *
  Poured from bottle using the formulae.brew.sh API on 2024-03-18 at 11:39:41
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/q/qscintilla2.rb
License: GPL-3.0-only
==> Dependencies
Build: pyqt-builder ✘, sip ✘
Required: pyqt ✔, python@3.12 ✔, qt ✔

The package qt is a dependency, but that package version via brew info qt is:

==> qt: stable 6.6.2 (bottled), HEAD

thus libraries for the qt5 version of qscintilla2 are missing.
The breaking change appears to have been introduced in this commit to homebrew: Homebrew/homebrew-core@ce9bebf

I don't have a workaround yet but I expect that it involves either installing qscintilla2@2.13.1 and somehow getting the build to use that instead of the head's version 2.14.1 OR maybe trying to build everything against qt6? Either way I am very new to homebrew and compiling on OSX in general.

@kintel
Copy link
Member

kintel commented Mar 21, 2024

See also Homebrew/homebrew-core#166414.
The ideal short-term workaround would be to get a qt5 version of QScintilla added to Homebrew.

The workaround for building OpenSCAD from source is to build the dependencies using https://github.com/openscad/openscad/blob/master/scripts/macosx-build-dependencies.sh

Out of curiosity, are you building manually vs. downloading the nightly builds for a reason (other than wanting to) ?

@kintel kintel added OS: macOS Comp: Build system Tweaks for the build systems / CI integration labels Mar 21, 2024
@cversek
Copy link
Sponsor Author

cversek commented Mar 21, 2024

@kintel
Yeah I know about the builds now, and it does work for me. I guess I just wanted to see if it would be easy to compile locally, and then I did some extra digging into the failure so that I could be at least a little helpful :)

@kintel
Copy link
Member

kintel commented Mar 21, 2024

Sounds good, let’s leave this ticket open to track this.

Btw., building from source using the above script should be fully automatic as well, and any problems with it are reportable as bugs.

@kintel
Copy link
Member

kintel commented Mar 22, 2024

Btw., this also breaks our CI, so it's pretty high priority to fix. I just keep hoping someone will pick up the Homebrew issue so I don't have to do it :)

@kintel
Copy link
Member

kintel commented Mar 22, 2024

Workaround:

curl -o qscintilla2.rb https://raw.githubusercontent.com/Homebrew/homebrew-core/da59bcdf7f1dadf70e30240394ddc0bd6014affe/Formula/q/qscintilla2.rb
brew unlink qscintilla2
brew install qscintilla2.rb

@cversek
Copy link
Sponsor Author

cversek commented Mar 22, 2024

@kintel

EDIT: see next comment for resolution to the following problem

So I pulled the latest changes to try out your workaround. The build environment seems ok, but there is some noisy warnings and errors on my end, which may just be artifacts of previous attempts:

% ./scripts/macosx-build-homebrew.sh 
Fri Mar 22 02:43:06 EDT 2024: Updating homebrew
==> Updating Homebrew...
Warning: No remote 'origin' in /opt/homebrew/Library/Taps/cversek/homebrew-local-tap, skipping update!
==> Updated Homebrew from 7b2bfee363 to d704e007c7.
Updated 1 tap (homebrew/core).
==> New Formulae
ingress2gateway                                                   rtabmap
==> Outdated Formulae
cmake                                                             libomp

You have 2 outdated formulae installed.
You can upgrade them with brew upgrade
or list them with brew outdated.

real	0m4.666s
user	0m1.139s
sys	0m1.465s
Fri Mar 22 02:43:11 EDT 2024: Listing homebrew configuration
HOMEBREW_VERSION: 4.2.13-96-gd704e00
ORIGIN: https://github.com/Homebrew/brew
HEAD: d704e007c7a40f97d1ed3005be4539cc2cd52ee4
Last commit: 5 hours ago
Core tap HEAD: 6b9f22abafb887533d9dc5dd06f604b52ba7c24e
Core tap last commit: 22 minutes ago
Core tap JSON: 22 Mar 06:43 UTC
Core cask tap JSON: 22 Mar 06:43 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 16
HOMEBREW_SORBET_RUNTIME: set
Homebrew Ruby: 3.1.4 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/bin/ruby
CPU: 16-core 64-bit arm_palma
Clang: 15.0.0 build 1500
Git: 2.39.3 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: 8.4.0 => /usr/bin/curl
macOS: 14.4-arm64
CLT: 15.3.0.0.1.1708646388
Xcode: 15.1
Rosetta 2: false

real	0m0.611s
user	0m0.223s
sys	0m0.120s
Error: No such keg: /opt/homebrew/Cellar/python@2
Fri Mar 22 02:43:13 EDT 2024: Installing or updating formula boost
boost 1.84.0_1
Warning: boost 1.84.0_1 already installed
==> `brew cleanup` has not been run in the last 30 days, running now...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
Removing: /Users/cversek/Library/Caches/Homebrew/cmake--3.28.3... (16.4MB)
Removing: /Users/cversek/Library/Caches/Homebrew/libomp--18.1.1... (567.3KB)
Removing: /opt/homebrew/Cellar/librsvg/2.57.2... (22 files, 37MB)
Removing: /Users/cversek/Library/Caches/Homebrew/librsvg--2.57.2... (11.7MB)
Removing: /opt/homebrew/Cellar/pango/1.52.0... (68 files, 3.4MB)
Removing: /Users/cversek/Library/Caches/Homebrew/pango--1.52.0... (808.6KB)
Removing: /opt/homebrew/Cellar/sqlite/3.45.1... (11 files, 4.8MB)
Removing: /Users/cversek/Library/Caches/Homebrew/sqlite--3.45.1... (2.2MB)
Removing: /opt/homebrew/Cellar/xz/5.6.0... (166 files, 2.7MB)
Removing: /Users/cversek/Library/Caches/Homebrew/xz--5.6.0... (684.4KB)
Pruned 0 symbolic links and 4 directories from /opt/homebrew

real	0m3.234s
user	0m1.339s
sys	0m1.071s
Fri Mar 22 02:43:16 EDT 2024: Installing formula pkg-config
pkg-config 0.29.2_3
Warning: pkg-config 0.29.2_3 is already installed and up-to-date.
To reinstall 0.29.2_3, run:
  brew reinstall pkg-config

real	0m0.813s
user	0m0.578s
sys	0m0.093s
Fri Mar 22 02:43:17 EDT 2024: Installing formula eigen
eigen 3.4.0_1
Warning: eigen 3.4.0_1 is already installed and up-to-date.
To reinstall 3.4.0_1, run:
  brew reinstall eigen

real	0m0.812s
user	0m0.573s
sys	0m0.095s
Fri Mar 22 02:43:19 EDT 2024: Installing formula cgal
cgal 5.6.1
Warning: cgal 5.6.1 is already installed and up-to-date.
To reinstall 5.6.1, run:
  brew reinstall cgal

real	0m0.815s
user	0m0.580s
sys	0m0.094s
Fri Mar 22 02:43:20 EDT 2024: Installing formula glew
glew 2.2.0_1
Warning: glew 2.2.0_1 is already installed and up-to-date.
To reinstall 2.2.0_1, run:
  brew reinstall glew

real	0m0.814s
user	0m0.578s
sys	0m0.094s
Fri Mar 22 02:43:21 EDT 2024: Installing formula glib
glib 2.80.0
Warning: glib 2.80.0 is already installed and up-to-date.
To reinstall 2.80.0, run:
  brew reinstall glib

real	0m0.826s
user	0m0.588s
sys	0m0.091s
Fri Mar 22 02:43:22 EDT 2024: Installing formula opencsg
opencsg 1.6.0
Warning: opencsg 1.6.0 is already installed and up-to-date.
To reinstall 1.6.0, run:
  brew reinstall opencsg

real	0m0.813s
user	0m0.578s
sys	0m0.086s
Fri Mar 22 02:43:23 EDT 2024: Installing formula freetype
freetype 2.13.2
Warning: freetype 2.13.2 is already installed and up-to-date.
To reinstall 2.13.2, run:
  brew reinstall freetype

real	0m0.812s
user	0m0.573s
sys	0m0.096s
Fri Mar 22 02:43:25 EDT 2024: Installing formula libzip
libzip 1.10.1
Warning: libzip 1.10.1 is already installed and up-to-date.
To reinstall 1.10.1, run:
  brew reinstall libzip

real	0m0.818s
user	0m0.580s
sys	0m0.095s
Fri Mar 22 02:43:26 EDT 2024: Installing formula libxml2
libxml2 2.12.6
Warning: libxml2 2.12.6 is already installed and up-to-date.
To reinstall 2.12.6, run:
  brew reinstall libxml2

real	0m0.793s
user	0m0.551s
sys	0m0.092s
Fri Mar 22 02:43:27 EDT 2024: Installing formula fontconfig
fontconfig 2.15.0
Warning: fontconfig 2.15.0 is already installed and up-to-date.
To reinstall 2.15.0, run:
  brew reinstall fontconfig

real	0m0.825s
user	0m0.582s
sys	0m0.099s
Fri Mar 22 02:43:28 EDT 2024: Installing formula harfbuzz
harfbuzz 8.3.1
Warning: harfbuzz 8.3.1 is already installed and up-to-date.
To reinstall 8.3.1, run:
  brew reinstall harfbuzz

real	0m0.808s
user	0m0.563s
sys	0m0.098s
Fri Mar 22 02:43:29 EDT 2024: Installing formula qt5
Warning: Formula qt5 was renamed to qt@5.
qt@5 5.15.13
Warning: Formula qt5 was renamed to qt@5.
Warning: qt@5 5.15.13 is already installed and up-to-date.
To reinstall 5.15.13, run:
  brew reinstall qt@5

real	0m0.809s
user	0m0.565s
sys	0m0.092s
Fri Mar 22 02:43:31 EDT 2024: Installing formula lib3mf
lib3mf 1.8.1
Warning: openscad/tap/lib3mf 1.8.1 is already installed and up-to-date.
To reinstall 1.8.1, run:
  brew reinstall lib3mf

real	0m0.802s
user	0m0.559s
sys	0m0.100s
Fri Mar 22 02:43:32 EDT 2024: Installing formula double-conversion
double-conversion 3.3.0
Warning: double-conversion 3.3.0 is already installed and up-to-date.
To reinstall 3.3.0, run:
  brew reinstall double-conversion

real	0m0.796s
user	0m0.553s
sys	0m0.101s
Fri Mar 22 02:43:33 EDT 2024: Installing formula imagemagick
imagemagick 7.1.1-29_1
Warning: imagemagick 7.1.1-29_1 is already installed and up-to-date.
To reinstall 7.1.1-29_1, run:
  brew reinstall imagemagick

real	0m0.793s
user	0m0.551s
sys	0m0.099s
Fri Mar 22 02:43:34 EDT 2024: Installing formula ccache
ccache 4.9.1
Warning: ccache 4.9.1 is already installed and up-to-date.
To reinstall 4.9.1, run:
  brew reinstall ccache

real	0m0.812s
user	0m0.567s
sys	0m0.102s
Fri Mar 22 02:43:35 EDT 2024: Installing formula ghostscript
ghostscript 10.03.0
Warning: ghostscript 10.03.0 is already installed and up-to-date.
To reinstall 10.03.0, run:
  brew reinstall ghostscript

real	0m0.797s
user	0m0.554s
sys	0m0.101s
Fri Mar 22 02:43:37 EDT 2024: Installing formula tbb
tbb 2021.11.0
Warning: tbb 2021.11.0 is already installed and up-to-date.
To reinstall 2021.11.0, run:
  brew reinstall tbb

real	0m0.823s
user	0m0.582s
sys	0m0.096s
Fri Mar 22 02:43:38 EDT 2024: Linking formula libzip
Warning: Already linked: /opt/homebrew/Cellar/libzip/1.10.1
To relink, run:
  brew unlink libzip && brew link libzip

real	0m0.657s
user	0m0.447s
sys	0m0.070s
Fri Mar 22 02:43:38 EDT 2024: Linking formula opencsg
Warning: Already linked: /opt/homebrew/Cellar/opencsg/1.6.0
To relink, run:
  brew unlink opencsg && brew link opencsg

real	0m0.677s
user	0m0.467s
sys	0m0.069s
Fri Mar 22 02:43:39 EDT 2024: Linking formula gettext
Warning: Already linked: /opt/homebrew/Cellar/gettext/0.22.5
To relink, run:
  brew unlink gettext && brew link gettext

real	0m0.675s
user	0m0.465s
sys	0m0.071s
Fri Mar 22 02:43:40 EDT 2024: Linking formula qt5
Warning: Formula qt5 was renamed to qt@5.
Linking /opt/homebrew/Cellar/qt@5/5.15.13... 
Error: Could not symlink bin/Assistant
Target /opt/homebrew/bin/Assistant
is a symlink belonging to qt. You can unlink it:
  brew unlink qt

To force the link and overwrite all conflicting files:
  brew link --overwrite qt@5

To list all files that would be deleted:
  brew link --overwrite qt@5 --dry-run

real	0m1.186s
user	0m0.825s
sys	0m0.197s
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  4414  100  4414    0     0  18340      0 --:--:-- --:--:-- --:--:-- 18391
Error: No such keg: /opt/homebrew/Cellar/qscintilla2
Error: Failed to load cask: qscintilla2.rb
Cask 'qscintilla2' is unreadable: wrong constant name #<Class:0x000000010b55cc68>
Warning: Treating qscintilla2.rb as a formula.
==> Downloading https://ghcr.io/v2/homebrew/core/qscintilla2/manifests/2.14.1_2-1
############################################################################################################################ 100.0%
==> Fetching qscintilla2
==> Downloading https://ghcr.io/v2/homebrew/core/qscintilla2/blobs/sha256:62b11b73e1f2c7b9dbc85ea61504571e05bb7e7e4cb1c8c4ad1e402d5
############################################################################################################################ 100.0%
Warning: qscintilla2 2.14.1_3 is available and more recent than version 2.14.1_2.
==> Pouring qscintilla2--2.14.1_2.arm64_sonoma.bottle.1.tar.gz
🍺  /opt/homebrew/Cellar/qscintilla2/2.14.1_2: 156 files, 8.2MB
==> Running `brew cleanup qscintilla2`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

Now, the cmake configuration seemed to work out:

% mkdir build && cd build && cmake .. -DEXPERIMENTAL=1
-- The C compiler identification is AppleClang 15.0.0.15000100
-- The CXX compiler identification is AppleClang 15.0.0.15000100
-- 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 PkgConfig: /opt/homebrew/bin/pkg-config (found version "0.29.2") 
CMake Deprecation Warning at submodules/mimalloc/CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- 
-- No build type selected, default to: Release
-- Use the C++ compiler to compile (MI_USE_CXX=ON)
-- 
-- Library base name: mimalloc
-- Version          : 1.7
-- Build type       : release
-- C++ Compiler     : /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Compiler flags   : -Wno-deprecated;-Wall;-Wextra;-Wno-unknown-pragmas;-fvisibility=hidden;-Wpedantic;-Wno-static-in-inline;-ftls-model=initial-exec
-- Compiler defines : 
-- Link libraries   : /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/lib/libpthread.tbd
-- Build targets    : static
-- 
-- Eigen: 3.4.0
-- Found Boost: /Users/cversek/miniforge3/envs/neurovep_data/lib/cmake/Boost-1.78.0/BoostConfig.cmake (found suitable version "1.78.0", minimum required is "1.56") found components: filesystem system regex program_options 
-- Boost: 1.78.0
-- Harfbuzz: 8.3.1
-- Fontconfig: 2.15.0
-- Checking for one of the modules 'glib-2.0'
-- Glib: 2.80.0
-- OPENCSG_DIR: 
-- OpenCSG include found in /opt/homebrew/include
-- OpenCSG library found in /opt/homebrew/lib/libopencsg.dylib
-- OpenCSG: 1.6.0
-- USE_GLAD/USE_GLEW not specified: Defaulting to GLAD
-- OpenGL: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/System/Library/Frameworks/OpenGL.framework;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/System/Library/Frameworks/OpenGL.framework
-- Using header-only CGAL
-- Targeting Unix Makefiles
-- Using /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ compiler.
-- Running in macOS DARWIN_VERSION=23
-- Found GMP: /opt/homebrew/lib/libgmp.dylib  
-- Found MPFR: /opt/homebrew/lib/libmpfr.dylib  
-- Found Boost: /Users/cversek/miniforge3/envs/neurovep_data/lib/cmake/Boost-1.78.0/BoostConfig.cmake (found suitable version "1.78.0", minimum required is "1.66")  
-- Boost include dirs: /Users/cversek/miniforge3/envs/neurovep_data/include
-- Boost libraries:    
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- CGAL: 5.6.1
-- CGAL: Using target CGAL::CGAL CGAL::CGAL_Core
-- libzip: 1.10.1
-- Freetype: 2.13.2
-- LibXml2: 2.9.13
-- HIDAPI: disabled
-- SpNav: disabled
-- CAIRO_INCLUDEDIR: /opt/homebrew/Cellar/cairo/1.18.0/include/cairo
-- CAIRO_INCLUDE_DIRS: /opt/homebrew/Cellar/cairo/1.18.0/include/cairo
-- CAIRO_LIBRARIES: /opt/homebrew/Cellar/cairo/1.18.0/lib/libcairo.dylib
-- Cairo: 1.18.0
-- Flex: 2.6.4
-- Bison: 3.8.2
-- lib3mf: 1.8.1
-- Qt5: 5.15.13
-- QScintilla: 2.14.1
-- DBus input driver enabled
-- Qt5Gamepad input driver enabled
-- Offscreen OpenGL Context - using Apple CGL/NSOpenGL
-- TBB: 2021.11.0
-- Found Python3: /opt/homebrew/Frameworks/Python.framework/Versions/3.12/bin/python3.12 (found suitable version "3.12.2", minimum required is "3.4") found components: Interpreter 
-- Checking for module 'Clipper2'
--   No package 'Clipper2' found
-- clipper2 not found, downloading from source
-- GLM: Version 0.9.9.9
-- glm not found, downloading from source
Parallel Backend: TBB
thrust not found, downloading from source
CMake Deprecation Warning at tests/CMakeLists.txt:5 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Found Python at /opt/homebrew/Frameworks/Python.framework/Versions/3.12/bin/python3.12
-- Preparing image_compare.py for test suite image comparison: /Users/cversek/gitwork/openscad/build/tests/venv
-- venv not found
-- Setting up testing venv for image comparison
Looking in links: /var/folders/y2/p6t622mx7yz_dg6v33lc5t1m0000gn/T/tmp9hmdzo5g
Requirement already satisfied: pip in /opt/homebrew/lib/python3.12/site-packages (24.0)
Collecting numpy
  Downloading numpy-1.26.4-cp312-cp312-macosx_11_0_arm64.whl.metadata (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.1/61.1 kB 2.0 MB/s eta 0:00:00
Collecting Pillow
  Downloading pillow-10.2.0-cp312-cp312-macosx_11_0_arm64.whl.metadata (9.7 kB)
Downloading numpy-1.26.4-cp312-cp312-macosx_11_0_arm64.whl (13.7 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 13.7/13.7 MB 14.1 MB/s eta 0:00:00
Downloading pillow-10.2.0-cp312-cp312-macosx_11_0_arm64.whl (3.3 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.3/3.3 MB 15.0 MB/s eta 0:00:00
Installing collected packages: Pillow, numpy
Successfully installed Pillow-10.2.0 numpy-1.26.4
/Users/cversek/gitwork/openscad/tests/image_compare.py library check successful
-- venv setup for /Users/cversek/gitwork/openscad/build/tests/venv/bin//python
-- creating CTestCustom.cmake
--  
-- ====================================
-- OpenSCAD Build Configuration Summary
-- ====================================
--  
-- Environment: macOS
--  
-- CMAKE_VERSION:         3.28.3
-- CMAKE_TOOLCHAIN_FILE:  
-- CMAKE_GENERATOR:       Unix Makefiles
-- CPACK_CMAKE_GENERATOR: Unix Makefiles
-- CMAKE_BUILD_TYPE:      
-- CMAKE_PREFIX_PATH:     /opt/homebrew/opt/qt@5
-- CMAKE_CXX_COMPILER_ID: AppleClang
-- CMAKE_CXX_COMPILER_VERSION: 15.0.0.15000100
--  
-- SUFFIX:                
-- CMAKE_OSX_DEPLOYMENT_TARGET: 10.14
-- CMAKE_OSX_ARCHITECTURES:     
--  
-- Experimental Features: 1
-- Snapshot build:        OFF
-- CGAL enabled:          ON
-- WASM build:            OFF
-- Headless build:        OFF
-- NULLGL build:          OFF
-- OpenGL wrangler:       GLAD
-- Profiling/coverage:    OFF
-- Use mimalloc:          ON
-- Use built-in OpenCSG:  OFF
-- CSG node id-prefix:    OFF
-- Offline documentation: OFF
--  
-- GL Offscreen Context:  Apple CGL/NSOpenGL
-- lib3mf:                API 1.x
--  
-- Input Drivers
-- - HID API Driver (disabled)
-- - Space Navigator Library Driver (disabled)
-- - Joystick Driver (disabled)
-- - DBus Remote Driver (enabled)
--  
-- DEFINES = ENABLE_EXPERIMENTAL;_REENTRANT;UNICODE;_UNICODE;USE_MIMALLOC;MI_LINK_STATIC;EIGEN_DONT_ALIGN;ENABLE_OPENCSG;ENABLE_CGAL;CGAL_DEBUG;CGAL_USE_GMPXX;ENABLE_LIBZIP;ENABLE_CAIRO;__GCC;ENABLE_LIB3MF;USE_GLAD;USE_QOPENGLWIDGET;ENABLE_DBUS;ENABLE_QGAMEPAD;OPENSCAD_VERSION=2024.03.22;OPENSCAD_SHORTVERSION=2024.03.22;OPENSCAD_YEAR=2024;OPENSCAD_MONTH=3;OPENSCAD_DAY=22;STACKSIZE=8388608;OPENSCAD_OS="Mac OS X";GL_SILENCE_DEPRECATION;ENABLE_MANIFOLD
-- LINK OPTIONS = -v
--  
-- Configuring done (27.7s)
-- Generating done (0.1s)
-- Build files have been written to: /Users/cversek/gitwork/openscad/build

But when I build with make, I encounter errors (truncated output):

[ 16%] Building CXX object CMakeFiles/OpenSCAD.dir/OpenSCAD_autogen/mocs_compilation.cpp.o
In file included from /Users/cversek/gitwork/openscad/build/OpenSCAD_autogen/mocs_compilation.cpp:2:
In file included from /Users/cversek/gitwork/openscad/build/OpenSCAD_autogen/MXUWEOXILK/moc_AboutDialog.cpp:10:
In file included from /Users/cversek/gitwork/openscad/build/OpenSCAD_autogen/MXUWEOXILK/../../../src/gui/AboutDialog.h:4:
In file included from /Users/cversek/gitwork/openscad/src/gui/qtgettext.h:13:
In file included from /opt/homebrew/opt/qt@5/lib/QtCore.framework/Headers/QString:1:
/opt/homebrew/opt/qt@5/lib/QtCore.framework/Headers/qstring.h:78:7: error: definition of type 'QStringList' conflicts with type alias of the same name
class QStringList;
      ^
/opt/homebrew/include/QtCore/qcontainerfwd.h:34:7: note: 'QStringList' declared here
using QStringList = QList<QString>;
      ^
In file included from /Users/cversek/gitwork/openscad/build/OpenSCAD_autogen/mocs_compilation.cpp:2:
In file included from /Users/cversek/gitwork/openscad/build/OpenSCAD_autogen/MXUWEOXILK/moc_AboutDialog.cpp:10:
In file included from /Users/cversek/gitwork/openscad/build/OpenSCAD_autogen/MXUWEOXILK/../../../src/gui/AboutDialog.h:4:
In file included from /Users/cversek/gitwork/openscad/src/gui/qtgettext.h:13:
In file included from /opt/homebrew/opt/qt@5/lib/QtCore.framework/Headers/QString:1:
/opt/homebrew/opt/qt@5/lib/QtCore.framework/Headers/qstring.h:81:29: error: redefinition of 'QVector' as different kind of symbol
template <typename T> class QVector;
                            ^
/opt/homebrew/include/QtCore/qcontainerfwd.h:33:22: note: previous definition is here
template<typename T> using QVector = QList<T>;
                     ^
In file included from /Users/cversek/gitwork/openscad/build/OpenSCAD_autogen/mocs_compilation.cpp:2:
In file included from /Users/cversek/gitwork/openscad/build/OpenSCAD_autogen/MXUWEOXILK/moc_AboutDialog.cpp:10:
In file included from /Users/cversek/gitwork/openscad/build/OpenSCAD_autogen/MXUWEOXILK/../../../src/gui/AboutDialog.h:4:
In file included from /Users/cversek/gitwork/openscad/src/gui/qtgettext.h:13:
In file included from /opt/homebrew/opt/qt@5/lib/QtCore.framework/Headers/QString:1:
/opt/homebrew/opt/qt@5/lib/QtCore.framework/Headers/qstring.h:261:13: error: unknown type name 'QStringData'
    typedef QStringData Data;
            ^
/opt/homebrew/opt/qt@5/lib/QtCore.framework/Headers/qstring.h:964:37: error: unknown type name 'QStringDataPtr'
    Q_DECL_CONSTEXPR inline QString(QStringDataPtr dd) : d(dd.ptr) {}
                                    ^
/opt/homebrew/opt/qt@5/lib/QtCore.framework/Headers/qstring.h:273:72: error: 'QString::Data' (aka 'int') is not a class, namespace, or enumeration
    inline QString(QString && other) noexcept : d(other.d) { other.d = Data::sharedNull(); }
                                                                       ^
/opt/homebrew/opt/qt@5/lib/QtCore.framework/Headers/qstring.h:277:39: error: member reference base type 'Data' (aka 'int') is not a structure or union
    inline int size() const { return d->size; }
                                     ~^ ~~~~
/opt/homebrew/opt/qt@5/lib/QtCore.framework/Headers/qstring.h:278:40: error: member reference base type 'Data' (aka 'int') is not a structure or union
    inline int count() const { return d->size; }
                                      ~^ ~~~~
/opt/homebrew/opt/qt@5/lib/QtCore.framework/Headers/qstring.h:558:14: error: member reference base type 'Data' (aka 'int') is not a structure or union
        if (d->ref.isShared() || uint(d->size) + 2u > d->alloc)
            ~^ ~~~
/opt/homebrew/opt/qt@5/lib/QtCore.framework/Headers/qstring.h:558:40: error: member reference base type 'Data' (aka 'int') is not a structure or union
        if (d->ref.isShared() || uint(d->size) + 2u > d->alloc)
                                      ~^ ~~~~
/opt/homebrew/opt/qt@5/lib/QtCore.framework/Headers/qstring.h:558:56: error: member reference base type 'Data' (aka 'int') is not a structure or union
        if (d->ref.isShared() || uint(d->size) + 2u > d->alloc)
                                                      ~^ ~~~~~
/opt/homebrew/opt/qt@5/lib/QtCore.framework/Headers/qstring.h:559:31: error: member reference base type 'Data' (aka 'int') is not a structure or union
            reallocData(uint(d->size) + 2u, true);
                             ~^ ~~~~
/opt/homebrew/opt/qt@5/lib/QtCore.framework/Headers/qstring.h:560:10: error: member reference base type 'Data' (aka 'int') is not a structure or union
        d->data()[d->size++] = c.unicode();
        ~^ ~~~~
/opt/homebrew/opt/qt@5/lib/QtCore.framework/Headers/qstring.h:560:20: error: member reference base type 'Data' (aka 'int') is not a structure or union
        d->data()[d->size++] = c.unicode();
                  ~^ ~~~~
/opt/homebrew/opt/qt@5/lib/QtCore.framework/Headers/qstring.h:561:10: error: member reference base type 'Data' (aka 'int') is not a structure or union
        d->data()[d->size] = '\0';
        ~^ ~~~~
/opt/homebrew/opt/qt@5/lib/QtCore.framework/Headers/qstring.h:561:20: error: member reference base type 'Data' (aka 'int') is not a structure or union
        d->data()[d->size] = '\0';
                  ~^ ~~~~
/opt/homebrew/opt/qt@5/lib/QtCore.framework/Headers/qstring.h:698:9: error: unknown type name 'QStringDataPtr'
        QStringDataPtr dataPtr = { fromLatin1_helper(str, (str && size == -1) ? int(strlen(str)) : size) };
        ^
/opt/homebrew/opt/qt@5/lib/QtCore.framework/Headers/qstring.h:952:37: error: 'QString::Data' (aka 'int') is not a class, namespace, or enumeration
    inline QString(const Null &): d(Data::sharedNull()) {}
                                    ^
/opt/homebrew/opt/qt@5/lib/QtCore.framework/Headers/qstring.h:955:46: error: 'QString::Data' (aka 'int') is not a class, namespace, or enumeration
    inline bool isNull() const { return d == Data::sharedNull(); }
                                             ^
/opt/homebrew/opt/qt@5/lib/QtCore.framework/Headers/qstring.h:1067:11: error: member reference base type 'Data' (aka 'int') is not a structure or union
{ return d->size; }
         ~^ ~~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [CMakeFiles/OpenSCAD.dir/OpenSCAD_autogen/mocs_compilation.cpp.o] Error 1
make[1]: *** [CMakeFiles/OpenSCAD.dir/all] Error 2
make: *** [all] Error 2

Not quite sure what to make of these errors in the qt@5 package core library.

@cversek
Copy link
Sponsor Author

cversek commented Mar 22, 2024

@kintel

I had a feeling that the wrong version of qt was being pulled into the build, so I purged qt6 from my brew environment and the compile seems to work now.

Complete commands with extra qt6 removal steps:

./scripts/macosx-build-homebrew.sh 
brew uninstall pyqt
brew uninstall qt
mkdir build && cd build && cmake .. -DEXPERIMENTAL=1
make
ctest

I'm not sure what the right steps should be for someone who uses the same brew environment for compiling with qt6 and qt5 (not a concern for me). I'm just posting these problems for anyone else who runs into the same issue.

I'm currently running ctest I'll post back with any further errors.

@cversek
Copy link
Sponsor Author

cversek commented Mar 22, 2024

Not bad, only 2 tests failed:

99% tests passed, 2 tests failed out of 1624

Total Test time (real) = 1096.26 sec

The following tests did not run:
	313 - cgalpngtest_nothing-decimal-comma-separated (Disabled)
	336 - cgalpngtest_background-modifier2 (Disabled)
	337 - cgalpngtest_child-background (Disabled)
	350 - cgalpngtest_highlight-and-background-modifier (Disabled)
	352 - cgalpngtest_highlight-modifier2 (Disabled)
	355 - cgalpngtest_import-empty-tests (Disabled)
	361 - cgalpngtest_linear_extrude-scale-zero-tests (Disabled)
	363 - cgalpngtest_minkowski3-difference-test (Disabled)
	397 - cgalpngtest_testcolornames (Disabled)
	465 - cgalpngtest_nef3_broken (Disabled)
	474 - cgalpngtest_empty-shape-tests (Disabled)
	560 - opencsgtest_child-background (Disabled)
	648 - opencsgtest_issue1165 (Disabled)
	651 - opencsgtest_issue1215 (Disabled)
	671 - opencsgtest_issue3158 (Disabled)
	689 - opencsgtest_nef3_broken (Disabled)
	806 - throwntogethertest_minkowski3-erosion (Disabled)
	811 - throwntogethertest_nullspace-difference (Disabled)
	839 - throwntogethertest_testcolornames (Disabled)
	859 - throwntogethertest_issue1089 (Disabled)
	870 - throwntogethertest_issue1215 (Disabled)
	885 - throwntogethertest_issue1803 (Disabled)
	908 - throwntogethertest_nef3_broken (Disabled)
	919 - throwntogethertest_internal-cavity (Disabled)
	920 - throwntogethertest_internal-cavity-polyhedron (Disabled)
	997 - csgpngtest_background-modifier2 (Disabled)
	998 - csgpngtest_child-background (Disabled)
	1011 - csgpngtest_highlight-and-background-modifier (Disabled)
	1013 - csgpngtest_highlight-modifier2 (Disabled)
	1022 - csgpngtest_linear_extrude-scale-zero-tests (Disabled)
	1024 - csgpngtest_minkowski3-difference-test (Disabled)
	1038 - csgpngtest_primitive-inf-tests (Disabled)
	1058 - csgpngtest_testcolornames (Disabled)
	1097 - csgpngtest_issue1258 (Disabled)
	1125 - csgpngtest_transform-nan-inf-tests (Disabled)
	1126 - csgpngtest_nef3_broken (Disabled)
	1373 - dxfpngtest_nullspace-2d (Disabled)
	1383 - dxfpngtest_text-empty-tests (Disabled)
	1414 - dxfpngtest_nothing-decimal-comma-separated (Disabled)
	1440 - svgpngtest_nullspace-2d (Disabled)
	1450 - svgpngtest_text-empty-tests (Disabled)
	1616 - openscad-viewoptions-edges_view-options-tests (Disabled)
	1617 - openscad-viewoptions-axes-scales-edges_view-options-tests (Disabled)
	1618 - openscad-viewoptions-wireframe_view-options-tests (Disabled)
	1653 - relative-output_csg_run (Disabled)
	1654 - relative-output_csg_check (Disabled)
	1665 - relative-output_ast_run (Disabled)
	1666 - relative-output_ast_check (Disabled)

The following tests FAILED:
	1270 - pdfexporttest_centered (Failed)
	1271 - pdfexporttest_simple-pdf (Failed)

Here are my test logs: __apple-m3-max_vwsg_report.txt

@kintel
Copy link
Member

kintel commented Mar 22, 2024

I think the PDF checks are false positives - it's probably due to the conversion from PDF to PNG for comparison (ghostscript updated in Homebrew; I get the same error locally).

@haikusw
Copy link
Contributor

haikusw commented Apr 28, 2024

I'm running into a build failure on macOS X (v13.6.6) on Apple Silicon due to qscintilla2:

Building using:

% mkdir build && cd build && cmake .. -DEXPERIMENTAL=1
...
-- Qt5: 5.15.13
CMake Error at /opt/homebrew/Cellar/cmake/3.29.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find Qt5QScintilla (missing: QT5QSCINTILLA_LIBRARY
QT5QSCINTILLA_INCLUDE_DIR) (Required is at least version "2.8.0")
Call Stack (most recent call first):
/opt/homebrew/Cellar/cmake/3.29.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
cmake/Modules/FindQt5QScintilla.cmake:112 (find_package_handle_standard_args)
CMakeLists.txt:543 (find_package)

As per the ReadMe.md I first ran but got an Error related to qscintilla2.rb

% ./scripts/macosx-build-homebrew.sh
...
real 0m0.889s
user 0m0.584s
sys 0m0.122s
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 4414 100 4414 0 0 24646 0 --:--:-- --:--:-- --:--:-- 24659
Unlinking /opt/homebrew/Cellar/qscintilla2/2.14.1_2... 0 symlinks removed.
Error: Failed to load cask: qscintilla2.rb
Cask 'qscintilla2' is unreadable: wrong constant name #Class:0x0000000108f7e618
Warning: Treating qscintilla2.rb as a formula.
Warning: qscintilla2 2.14.1_2 is already installed, it's just not linked.
To link this version, run:
brew link qscintilla2

which seems likely to be the root issue. I don't know how to fix this; the workaround in the ./scripts/macosx-build-homebrew.sh doesn't seem to be working for me.


I tried building dependencies from source as per option 1 in the ReadMe.md instructions via:

source scripts/setenv-macos.sh
./scripts/macosx-build-dependencies.sh

but that got an error relating to aclocal during hdiapi-hidapi-0.12.0 build:

Building hidapi 0.12.0 ...
Archive: hidapi-0.12.0.zip
76108294092c023a4ece99eb3219559cea0d5066
creating: hidapi-hidapi-0.12.0/

inflating: hidapi-hidapi-0.12.0/windows/hidtest.vcproj
inflating: hidapi-hidapi-0.12.0/windows/hidtest.vcxproj
inflating: hidapi-hidapi-0.12.0/windows/hidtest.vcxproj.filters

  • autoreconf --install --verbose --force
    autoreconf: export WARNINGS=
    autoreconf: Entering directory '.'
    autoreconf: configure.ac: not using Gettext
    autoreconf: running: aclocal --force -I m4
    Can't exec "aclocal": No such file or directory at /opt/homebrew/Cellar/autoconf/2.72/share/autoconf/Autom4te/FileUtils.pm line 299.
    autoreconf: error: aclocal failed with exit status: 2

So I'm unable to build OpenScad on macOS (v13.6.6) using either option for getting the dependencies installed.

Was going to try looking into fixing a bug but sort of need to get it building first :)

@kintel
Copy link
Member

kintel commented Apr 28, 2024

Option 1 (dependencies via homebrew) is temporarily a bit annoying since Homebrew upgraded qscintilla to Qt6 without making a Qt5 version available. You could try this:

brew uninstall --force qscintilla2
./scripts/macosx-build-homebrew.sh

Option 2 (locally built dependencies): You probably didn't install automake (brew install automake), as mentioned in build prerequisites at https://github.com/openscad/openscad?tab=readme-ov-file#building-for-macos

@haikusw
Copy link
Contributor

haikusw commented Apr 29, 2024

Thank you. I installed the build prerequisites but it seems I missed this one (sigh). Sorry to trouble you. Still won't build from source.

Your suggestion for qscintilla2 work-around worked though and I got it to build dependencies via brew after that and then OpenSCAD built - yay!

Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Comp: Build system Tweaks for the build systems / CI integration OS: macOS Type: Bug
Projects
None yet
Development

No branches or pull requests

3 participants