curv3d / curv

a language for making art using mathematics
Apache License 2.0
1.14k stars 73 forks source link

Viewer window not opening / OSX Sierra, MBP2017 #27

Closed rqhub closed 6 years ago

rqhub commented 6 years ago

Greetings, Install done almost as instructed, with a mod in transform.hpp (added #define GLM_ENABLE_EXPERIMENTAL at the start) to allow compilation to end.

i can generate an stl but the viewer wont open

any tips to get it working?

Cheers

doug-moen commented 6 years ago

What is the commit ID for your copy of Curv? Type git log, then copy and paste the first line of output beginning with commit.

What happens when you type curv -x cube in a Terminal window? Copy and paste any messages written to the terminal. Does another window appear?

doug-moen commented 6 years ago

After running brew upgrade on macOS, I was able to reproduce the compile failure with GLM, and fixed it. (The Viewer window still works for me.)

rqhub commented 6 years ago

git clone was made yesterday

3D shape 2×2×2 Viewer process abnormal exit: 4

Will update & retry, hold on

rqhub commented 6 years ago

I've deleted the folder and cloned again, make and make install the compile error dissapeared but the same issue survived - abnormal exit: 4

compilation log here:

rm -rf CMakeCache.txt CMakeFiles
mkdir -p release
cd release; cmake -DCMAKE_BUILD_TYPE=Release ..
-- The C compiler identification is AppleClang 8.1.0.8020042
-- The CXX compiler identification is AppleClang 8.1.0.8020042
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonInterp: /usr/bin/python (found version "2.7.10") 
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE  
-- Boost version: 1.67.0
-- Found the following Boost libraries:
--   iostreams
--   system
--   thread
--   regex
--   chrono
--   date_time
--   atomic
-- Found ZLIB: /usr/lib/libz.dylib (found version "1.2.8") 
-- Found OpenGL: /System/Library/Frameworks/OpenGL.framework   
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/me/git_apps/curv/release
cd release; make
Scanning dependencies of target libcurv
[  1%] Building CXX object CMakeFiles/libcurv.dir/libcurv/analyser.cc.o
[  3%] Building CXX object CMakeFiles/libcurv.dir/libcurv/arg.cc.o
[  4%] Building CXX object CMakeFiles/libcurv.dir/libcurv/builtin.cc.o
[  4%] Building CXX object CMakeFiles/libcurv.dir/libcurv/context.cc.o
[  6%] Building CXX object CMakeFiles/libcurv.dir/libcurv/definition.cc.o
[  7%] Building CXX object CMakeFiles/libcurv.dir/libcurv/die.cc.o
[  7%] Building CXX object CMakeFiles/libcurv.dir/libcurv/dtostr.cc.o
[  9%] Building CXX object CMakeFiles/libcurv.dir/libcurv/evaluator.cc.o
[ 10%] Building CXX object CMakeFiles/libcurv.dir/libcurv/exception.cc.o
[ 12%] Building CXX object CMakeFiles/libcurv.dir/libcurv/file.cc.o
[ 12%] Building CXX object CMakeFiles/libcurv.dir/libcurv/function.cc.o
[ 14%] Building CXX object CMakeFiles/libcurv.dir/libcurv/gl_compiler.cc.o
[ 15%] Building CXX object CMakeFiles/libcurv.dir/libcurv/gl_context.cc.o
[ 15%] Building CXX object CMakeFiles/libcurv.dir/libcurv/list.cc.o
[ 17%] Building CXX object CMakeFiles/libcurv.dir/libcurv/location.cc.o
[ 18%] Building CXX object CMakeFiles/libcurv.dir/libcurv/math.cc.o
[ 20%] Building CXX object CMakeFiles/libcurv.dir/libcurv/module.cc.o
[ 20%] Building CXX object CMakeFiles/libcurv.dir/libcurv/parser.cc.o
[ 21%] Building CXX object CMakeFiles/libcurv.dir/libcurv/pattern.cc.o
[ 23%] Building CXX object CMakeFiles/libcurv.dir/libcurv/phrase.cc.o
[ 23%] Building CXX object CMakeFiles/libcurv.dir/libcurv/program.cc.o
[ 25%] Building CXX object CMakeFiles/libcurv.dir/libcurv/range.cc.o
[ 26%] Building CXX object CMakeFiles/libcurv.dir/libcurv/record.cc.o
[ 28%] Building CXX object CMakeFiles/libcurv.dir/libcurv/scanner.cc.o
[ 28%] Building CXX object CMakeFiles/libcurv.dir/libcurv/string.cc.o
[ 29%] Building CXX object CMakeFiles/libcurv.dir/libcurv/structure.cc.o
[ 31%] Building CXX object CMakeFiles/libcurv.dir/libcurv/system.cc.o
[ 31%] Building CXX object CMakeFiles/libcurv.dir/libcurv/value.cc.o
[ 32%] Building CXX object CMakeFiles/libcurv.dir/libcurv/version.cc.o
[ 34%] Linking CXX static library libcurv.a
[ 34%] Built target libcurv
Scanning dependencies of target GlslViewer
[ 34%] Building CXX object extern/glslViewer/CMakeFiles/GlslViewer.dir/src/app.cpp.o
[ 35%] Building CXX object extern/glslViewer/CMakeFiles/GlslViewer.dir/src/main.cpp.o
[ 37%] Building CXX object extern/glslViewer/CMakeFiles/GlslViewer.dir/src/3d/camera.cpp.o
In file included from /Users/me/git_apps/curv/extern/glslViewer/src/3d/camera.cpp:1:
/Users/me/git_apps/curv/extern/glslViewer/src/3d/camera.h:39:15: warning: private field
      'm_viewMatrix' is not used [-Wunused-private-field]
    glm::mat4 m_viewMatrix;
              ^
1 warning generated.
[ 37%] Building CXX object extern/glslViewer/CMakeFiles/GlslViewer.dir/src/3d/node.cpp.o
[ 39%] Building CXX object extern/glslViewer/CMakeFiles/GlslViewer.dir/src/gl/fbo.cpp.o
[ 40%] Building CXX object extern/glslViewer/CMakeFiles/GlslViewer.dir/src/gl/pingpong.cpp.o
[ 42%] Building CXX object extern/glslViewer/CMakeFiles/GlslViewer.dir/src/gl/shader.cpp.o
[ 42%] Building CXX object extern/glslViewer/CMakeFiles/GlslViewer.dir/src/gl/texture.cpp.o
[ 43%] Building CXX object extern/glslViewer/CMakeFiles/GlslViewer.dir/src/gl/uniform.cpp.o
[ 45%] Building CXX object extern/glslViewer/CMakeFiles/GlslViewer.dir/src/gl/vbo.cpp.o
[ 45%] Building CXX object extern/glslViewer/CMakeFiles/GlslViewer.dir/src/gl/vertexLayout.cpp.o
[ 46%] Building CXX object extern/glslViewer/CMakeFiles/GlslViewer.dir/src/tools/fs.cpp.o
[ 48%] Building CXX object extern/glslViewer/CMakeFiles/GlslViewer.dir/src/tools/geom.cpp.o
[ 50%] Building CXX object extern/glslViewer/CMakeFiles/GlslViewer.dir/src/tools/text.cpp.o
[ 50%] Building CXX object extern/glslViewer/CMakeFiles/GlslViewer.dir/src/types/mesh.cpp.o
[ 51%] Building CXX object extern/glslViewer/CMakeFiles/GlslViewer.dir/src/types/polarPoint.cpp.o
[ 53%] Building CXX object extern/glslViewer/CMakeFiles/GlslViewer.dir/src/types/polyline.cpp.o
[ 53%] Building CXX object extern/glslViewer/CMakeFiles/GlslViewer.dir/src/types/rectangle.cpp.o
[ 54%] Building CXX object extern/glslViewer/CMakeFiles/GlslViewer.dir/src/types/shapes.cpp.o
[ 56%] Building CXX object extern/glslViewer/CMakeFiles/GlslViewer.dir/src/ui/cursor.cpp.o
[ 57%] Building CXX object extern/glslViewer/CMakeFiles/GlslViewer.dir/include/tinyobjloader/tiny_obj_loader.cc.o
[ 57%] Linking CXX static library liblibGlslViewer.a
[ 57%] Built target GlslViewer
Scanning dependencies of target libcurv_geom
[ 59%] Building CXX object CMakeFiles/libcurv_geom.dir/libcurv/geom/compiled_shape.cc.o
[ 59%] Building CXX object CMakeFiles/libcurv_geom.dir/libcurv/geom/export_frag.cc.o
[ 60%] Building CXX object CMakeFiles/libcurv_geom.dir/libcurv/geom/shape.cc.o
[ 62%] Building CXX object CMakeFiles/libcurv_geom.dir/libcurv/geom/tempfile.cc.o
[ 62%] Building CXX object CMakeFiles/libcurv_geom.dir/libcurv/geom/viewer.cc.o
[ 64%] Linking CXX static library libcurv_geom.a
[ 64%] Built target libcurv_geom
Scanning dependencies of target openvdb_static
[ 65%] Building CXX object extern/openvdb/openvdb/CMakeFiles/openvdb_static.dir/Grid.cc.o
[ 65%] Building CXX object extern/openvdb/openvdb/CMakeFiles/openvdb_static.dir/MetaMap.cc.o
[ 67%] Building CXX object extern/openvdb/openvdb/CMakeFiles/openvdb_static.dir/Metadata.cc.o
[ 68%] Building CXX object extern/openvdb/openvdb/CMakeFiles/openvdb_static.dir/Platform.cc.o
[ 70%] Building CXX object extern/openvdb/openvdb/CMakeFiles/openvdb_static.dir/io/Archive.cc.o
[ 70%] Building CXX object extern/openvdb/openvdb/CMakeFiles/openvdb_static.dir/io/Compression.cc.o
[ 71%] Building CXX object extern/openvdb/openvdb/CMakeFiles/openvdb_static.dir/io/File.cc.o
[ 73%] Building CXX object extern/openvdb/openvdb/CMakeFiles/openvdb_static.dir/io/GridDescriptor.cc.o
[ 73%] Building CXX object extern/openvdb/openvdb/CMakeFiles/openvdb_static.dir/io/Queue.cc.o
[ 75%] Building CXX object extern/openvdb/openvdb/CMakeFiles/openvdb_static.dir/io/Stream.cc.o
[ 76%] Building CXX object extern/openvdb/openvdb/CMakeFiles/openvdb_static.dir/io/TempFile.cc.o
[ 78%] Building CXX object extern/openvdb/openvdb/CMakeFiles/openvdb_static.dir/math/Maps.cc.o
[ 78%] Building CXX object extern/openvdb/openvdb/CMakeFiles/openvdb_static.dir/math/Proximity.cc.o
[ 79%] Building CXX object extern/openvdb/openvdb/CMakeFiles/openvdb_static.dir/math/QuantizedUnitVec.cc.o
[ 81%] Building CXX object extern/openvdb/openvdb/CMakeFiles/openvdb_static.dir/math/Transform.cc.o
[ 81%] Building CXX object extern/openvdb/openvdb/CMakeFiles/openvdb_static.dir/points/AttributeArray.cc.o
[ 82%] Building CXX object extern/openvdb/openvdb/CMakeFiles/openvdb_static.dir/points/AttributeArrayString.cc.o
[ 84%] Building CXX object extern/openvdb/openvdb/CMakeFiles/openvdb_static.dir/points/AttributeGroup.cc.o
[ 85%] Building CXX object extern/openvdb/openvdb/CMakeFiles/openvdb_static.dir/points/AttributeSet.cc.o
[ 85%] Building CXX object extern/openvdb/openvdb/CMakeFiles/openvdb_static.dir/points/StreamCompression.cc.o
[ 87%] Building CXX object extern/openvdb/openvdb/CMakeFiles/openvdb_static.dir/points/points.cc.o
[ 89%] Building CXX object extern/openvdb/openvdb/CMakeFiles/openvdb_static.dir/openvdb.cc.o
[ 89%] Building CXX object extern/openvdb/openvdb/CMakeFiles/openvdb_static.dir/util/Formats.cc.o
[ 90%] Building CXX object extern/openvdb/openvdb/CMakeFiles/openvdb_static.dir/util/Util.cc.o
[ 92%] Linking CXX static library libopenvdb.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libopenvdb.a(Platform.cc.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libopenvdb.a(Platform.cc.o) has no symbols
[ 92%] Built target openvdb_static
Scanning dependencies of target curv
[ 93%] Building C object CMakeFiles/curv.dir/cmd/readlinex.c.o
[ 95%] Building CXX object CMakeFiles/curv.dir/cmd/curv.cc.o
[ 95%] Building CXX object CMakeFiles/curv.dir/cmd/export.cc.o
[ 96%] Building CXX object CMakeFiles/curv.dir/cmd/export_mesh.cc.o
[ 98%] Building CXX object CMakeFiles/curv.dir/cmd/progdir.cc.o
[100%] Linking CXX executable curv
[100%] Built target curv

me$ make install
mkdir -p release
cd release; cmake -DCMAKE_BUILD_TYPE=Release ..
-- Boost version: 1.67.0
-- Found the following Boost libraries:
--   iostreams
--   system
--   thread
--   regex
--   chrono
--   date_time
--   atomic
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/me/git_apps/curv/release
cd release; make install
[ 34%] Built target libcurv
[ 57%] Built target GlslViewer
[ 64%] Built target libcurv_geom
[ 92%] Built target openvdb_static
[100%] Built target curv
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/bin/curv
-- Installing: /usr/local/lib/std.curv
-- Installing: /usr/local/share/gtksourceview-3.0/language-specs/curv.lang
doug-moen commented 6 years ago

Abnormal exit with status code 4 means "illegal instruction".

Here's a thread describing a similar sounding problem: http://discourse.glfw.org/t/os-x-crash-running-program-compiled-on-a-different-mac/92/9

The solution, in this case, was to reinstall the glfw library like this:

brew install glfw3 --static --build-bottle
doug-moen commented 6 years ago

One idea that I can try is to include the glfw library as a submodule, so that the latest sources are being used, and so that the library is built from source, to avoid the potential problem of using a prebuilt binary as described by the previous comment.

HOWEVER, in the latest version of GLFW, there is an unresolved crash bug on macOS High Sierra 10.13, and unfortunately this bug might be related: https://github.com/glfw/glfw/issues/1282

doug-moen commented 6 years ago

I've made the GLFW library into a submodule. Once you upgrade, you'll be compiling the latest version of GLFW as part of the Curv build process. This might fix the problem, or, the crash might be a manifestation of https://github.com/glfw/glfw/issues/1282 which I can't fix by myself.

To upgrade, open the Terminal application and run the following commands:

doug-moen commented 6 years ago

In the latest version of Curv, curv --version now prints some debug information about the GPU. It shows the GPU model and driver information, as seen by Curv. It is intended to be useful in debugging GPU issues. If you are still listening, maybe try this?

doug-moen commented 6 years ago

Since this bug was opened, I've rewritten the Viewer window, and fixed one crash bug in the Viewer. I've also included GLFW as a submodule. The original bug may be fixed, but I have no way of reproducing the original build environment where it was failing. So I'm closing the issue.