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

Trouble compiling on MacOS 12.3.1 #71

Open
manroygood opened this issue May 20, 2022 · 5 comments
Open

Trouble compiling on MacOS 12.3.1 #71

manroygood opened this issue May 20, 2022 · 5 comments
Labels
acknowledged Coin3d team acknowledges this issue

Comments

@manroygood
Copy link

I am trying to install soqt as part of the installation of the bifurcation software AUTO-07p. The README says to ask for help if you can't get it to build, so here I am.

In the AUTO manual, the instructions are straightforward. Install a few things from home-brew and then make and install soqt

brew install cmake qt@5 coin3d; brew link qt@5 –force
export PATH="/usr/local/opt/qt@5/bin:$PATH"
curl -O -L \
https://github.com/coin3d/soqt/releases/download/SoQt-1.6.0/soqt-1.6.0-src.tar.gz
tar xf soqt-1.6.0-src.tar.gz
cd soqt/build
cmake ..
make
sudo make install

The make step returns many pages of warnings (I'll paste a few to give a flavor and will save them in a file if we need to look at them in more detail.) The program that I use it to build runs, but the window that pops up is mostly just a black rectangle, with a few broken interface elements and containing none of the plots it's supposed to.

Here's a few snippets of the output from make, showing a few typical warnings. A lot are about &&

/Users/goodman/Downloads/soqt/soqt/src/Inventor/Qt/SoQt.cpp:443:18: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand]
  if (SOQT_DEBUG && 0) { // debug
                 ^  ~

Many others complain of deprecated constructors:

/Users/goodman/Downloads/soqt/soqt/src/Inventor/Qt/SoQtGLWidget.cpp:195:43: warning: 'QFlags' is deprecated: Use default constructor instead [-Wdeprecated-declarations]
  PRIVATE(this)->glformat = new QGLFormat(0);
                                          ^
/usr/local/include/QtCore/qflags.h:123:5: note: 'QFlags' has been explicitly marked deprecated here
    QT_DEPRECATED_X("Use default constructor instead") Q_DECL_CONSTEXPR inline QFlags(Zero) noexcept : i(0) {}

Any help would be appreciated.

@VolkerEnderlein
Copy link
Collaborator

Did you already tried the prebuilt artifacts or the accompanying source tarballs (coin-latest-src.tar.gz and soqt-latest-src.tar.gz) from the coin CI builds and soqt CI builds prerelease? They are built using Github actions for Catalina, Monterey, and Big Sur. It just might be that we need a new release.

@manroygood
Copy link
Author

Where do I install these files?

@manroygood
Copy link
Author

Looking at the output of make one more time, and this particular error stands out as possibly more significant:

ld: warning: dylib (/usr/local/lib/libCoin.4.0.0.dylib) was built for newer macOS version (12.0) than being linked (11.3)
ld: warning: dylib (/usr/local/lib/libX11.dylib) was built for newer macOS version (12.0) than being linked (11.3)

@VolkerEnderlein
Copy link
Collaborator

VolkerEnderlein commented May 23, 2022

To use the build artifacts you should extract them to a common directory, say /Users/roy/coininstall.
A directory named Coin3D will be created in this common directory.
Then build one of the soqt examples, say tripleview.cpp.
For that to work you need to write a CMakeLists.txt file as follows:

cmake_minimum_required(VERSION 3.0)
project(tripleview)
find_package(Coin REQUIRED)
find_package(SoQt REQUIRED)
add_executable(tripleview tripleview.cpp)
target_link_libraries(tripleview PUBLIC SoQt::SoQt Coin::Coin)

To build your local project run the following commands:

cmake -S tripleview -B tripleview_build -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Release -D CMAKE_PREFIX_PATH="/Users/roy/coininstall/Coin3D:/opt/local/libexec/qt5"
cmake --build /Users/roy/tripleview_build --target all --config Release

Otherwise you can always try to manually built Coin and SoQt. Extract coin-latest-src.tar.gz and soqt-latest-src.tar.gz to a common directory.
Then run:

cmake -S coin -B coin_build -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/Users/roy/coininstall -D CMAKE_PREFIX_PATH="/Users/roy/coininstall:/opt/local/libexec/qt5" -D COIN_BUILD_DOCUMENTATION=OFF -D COIN_BUILD_TESTS=OFF -D COIN_BUILD_MAC_FRAMEWORK=OFF
cmake --build /Users/roy/coin_build --target install --config Release
cmake -S soqt -B soqt_build -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/Users/roy/coininstall -D CMAKE_PREFIX_PATH="/Users/roy/coininstall:/opt/local/libexec/qt5" -D SOQT_BUILD_DOCUMENTATION=OFF -D SOQT_BUILD_MAC_FRAMEWORK=OFF
cmake --build /Users/roy/soqt_build --target install --config Release
./soqt_build/bin/tripleview

Hope that helps you further
Cheers, Volker

@manroygood
Copy link
Author

manroygood commented Jun 7, 2022

I'm getting closer to what I need, I think. I moved the .dylib files to usr/local/lib and the makefile runs a lot longer before giving any warnings or errors.

Eventually, I encounter a fatal error:

./printToPS.h:7:10: fatal error: 'Inventor/Xt/viewers/SoXtExaminerViewer.h' file not found
#include <Inventor/Xt/viewers/SoXtExaminerViewer.h>

which refers to these lines in a header file

#ifdef USE_SOQT
#include <Inventor/Qt/viewers/SoQtExaminerViewer.h>
#else
#include <Inventor/Xt/viewers/SoXtExaminerViewer.h>
#endif

It appears to me as if USE_SOQT is undefined and it's trying to find an SoXt equivalent. How/where should it be finding one or the other of these headers?

@VolkerEnderlein VolkerEnderlein added the acknowledged Coin3d team acknowledges this issue label May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
acknowledged Coin3d team acknowledges this issue
Projects
None yet
Development

No branches or pull requests

2 participants