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

OpenCSG renders with errors on Macbook Air [$5] #65

Closed
iamwilhelm opened this issue Jan 11, 2012 · 33 comments
Closed

OpenCSG renders with errors on Macbook Air [$5] #65

iamwilhelm opened this issue Jan 11, 2012 · 33 comments

Comments

@iamwilhelm
Copy link
Contributor

iamwilhelm commented Jan 11, 2012

When I put in the test case:

intersection() {
sphere(30);
cube(30);
}

It's suppose to show 1/8th of a sphere. However, the display is completely blank and empty. This only happens with intersection and difference. For union, they both show up correctly.

I'm running mac os X 10.7.2. Lion. Are there libraries I need to install or check before I install openSCAD? I suspect I may be missing a library. But if not, then it's a bug with openSCAD.

I will try to compile it from source and see if I have the same issue.


Did you fix this issue? Go claim the $5 bounty on Bountysource.

@kintel
Copy link
Member

kintel commented Jan 11, 2012

Which version of OpenSCAD are you using?
Which Mac model do you have?
Can you go to Help->OpenGL info and add the information there to this issue?

@iamwilhelm
Copy link
Contributor Author

I tried both pre-compiled versions, 2011.12 and 2011.06 for OpenSCAD.
My Mac is a MacBookPro 13-inch, early 2011 on OSX Lion 10.7.2

This is the my OpenGL Info:

GLEW version 1.7.0
OpenGL version Intel HD Graphics 3000 OpenGL Engine
Intel Inc. (2.1 APPLE-7.12.9)

RGBA(8888), depth(24), stencil(8)
Extensions:
GL_ARB_color_buffer_float GL_ARB_depth_buffer_float GL_ARB_depth_clamp GL_ARB_depth_texture GL_ARB_draw_buffers GL_ARB_draw_elements_base_vertex GL_ARB_draw_instanced GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_framebuffer_object GL_ARB_framebuffer_sRGB GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_instanced_arrays GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_provoking_vertex GL_ARB_seamless_cube_map GL_ARB_shader_objects GL_ARB_shader_texture_lod GL_ARB_shading_language_100 GL_ARB_shadow GL_ARB_sync GL_ARB_texture_border_clamp GL_ARB_texture_compression GL_ARB_texture_compression_rgtc GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_float GL_ARB_texture_mirrored_repeat GL_ARB_texture_non_power_of_two GL_ARB_texture_rectangle GL_ARB_texture_rg GL_ARB_transpose_matrix GL_ARB_vertex_array_bgra GL_ARB_vertex_blend GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_vertex_shader GL_ARB_window_pos GL_EXT_abgr GL_EXT_bgra GL_EXT_blend_color GL_EXT_blend_equation_separate GL_EXT_blend_func_separate GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_clip_volume_hint GL_EXT_draw_buffers2 GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_EXT_framebuffer_object GL_EXT_framebuffer_sRGB GL_EXT_geometry_shader4 GL_EXT_gpu_program_parameters GL_EXT_gpu_shader4 GL_EXT_multi_draw_arrays GL_EXT_packed_depth_stencil GL_EXT_packed_float GL_EXT_provoking_vertex GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_specular_color GL_EXT_shadow_funcs GL_EXT_stencil_two_side GL_EXT_stencil_wrap GL_EXT_texture_array GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_s3tc GL_EXT_texture_env_add GL_EXT_texture_filter_anisotropic GL_EXT_texture_integer GL_EXT_texture_lod_bias GL_EXT_texture_rectangle GL_EXT_texture_shared_exponent GL_EXT_texture_sRGB GL_EXT_texture_sRGB_decode GL_EXT_timer_query GL_EXT_transform_feedback GL_EXT_vertex_array_bgra GL_APPLE_aux_depth_stencil GL_APPLE_client_storage GL_APPLE_element_array GL_APPLE_fence GL_APPLE_float_pixels GL_APPLE_flush_buffer_range GL_APPLE_flush_render GL_APPLE_object_purgeable GL_APPLE_packed_pixels GL_APPLE_pixel_buffer GL_APPLE_rgb_422 GL_APPLE_row_bytes GL_APPLE_specular_vector GL_APPLE_texture_range GL_APPLE_transform_hint GL_APPLE_vertex_array_object GL_APPLE_vertex_array_range GL_APPLE_vertex_point_size GL_APPLE_vertex_program_evaluators GL_APPLE_ycbcr_422 GL_ATI_separate_stencil GL_ATI_texture_env_combine3 GL_ATI_texture_float GL_IBM_rasterpos_clip GL_NV_blend_square GL_NV_conditional_render GL_NV_depth_clamp GL_NV_fog_distance GL_NV_light_max_exponent GL_NV_texgen_reflection GL_SGIS_generate_mipmap GL_SGIS_texture_edge_clamp GL_SGIS_texture_lod

@kintel
Copy link
Member

kintel commented Jan 12, 2012

I have no idea yet, but I'll test on Lion later today or tomorrow. Don't have a Macbook with an Intel card though - I suspect that to play a part.

Oh, and: Some OpenSCAD dependencies (e.g. libgmp) doesn't compile on clang (the default compiler on 10.7), so to compile it yourself you probably need to change back to gcc. It might be that MacPorts solves this for you though, but I haven't tested.

@msmollin
Copy link

I found a similar issue last night as well, running 10.7.2 on a latest generation Macbook Air, openSCAD 2011.12 using the pre-compiled DMG download on the main website.

Windows - http://img.ly/cB93

Mac - http://img.ly/cB92

My OpenGL Info:

GLEW version 1.7.0
OpenGL version Intel HD Graphics 3000 OpenGL Engine
Intel Inc. (2.1 APPLE-7.14.5)

RGBA(8888), depth(24), stencil(8)
Extensions:
GL_ARB_color_buffer_float GL_ARB_depth_buffer_float GL_ARB_depth_clamp GL_ARB_depth_texture GL_ARB_draw_buffers GL_ARB_draw_elements_base_vertex GL_ARB_draw_instanced GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_framebuffer_object GL_ARB_framebuffer_sRGB GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_instanced_arrays GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_provoking_vertex GL_ARB_seamless_cube_map GL_ARB_shader_objects GL_ARB_shader_texture_lod GL_ARB_shading_language_100 GL_ARB_shadow GL_ARB_sync GL_ARB_texture_border_clamp GL_ARB_texture_compression GL_ARB_texture_compression_rgtc GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_float GL_ARB_texture_mirrored_repeat GL_ARB_texture_non_power_of_two GL_ARB_texture_rectangle GL_ARB_texture_rg GL_ARB_transpose_matrix GL_ARB_vertex_array_bgra GL_ARB_vertex_blend GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_vertex_shader GL_ARB_window_pos GL_EXT_abgr GL_EXT_bgra GL_EXT_blend_color GL_EXT_blend_equation_separate GL_EXT_blend_func_separate GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_clip_volume_hint GL_EXT_draw_buffers2 GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_EXT_framebuffer_object GL_EXT_framebuffer_sRGB GL_EXT_geometry_shader4 GL_EXT_gpu_program_parameters GL_EXT_gpu_shader4 GL_EXT_multi_draw_arrays GL_EXT_packed_depth_stencil GL_EXT_packed_float GL_EXT_provoking_vertex GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_specular_color GL_EXT_shadow_funcs GL_EXT_stencil_two_side GL_EXT_stencil_wrap GL_EXT_texture_array GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_s3tc GL_EXT_texture_env_add GL_EXT_texture_filter_anisotropic GL_EXT_texture_integer GL_EXT_texture_lod_bias GL_EXT_texture_rectangle GL_EXT_texture_shared_exponent GL_EXT_texture_sRGB GL_EXT_texture_sRGB_decode GL_EXT_timer_query GL_EXT_transform_feedback GL_EXT_vertex_array_bgra GL_APPLE_aux_depth_stencil GL_APPLE_client_storage GL_APPLE_element_array GL_APPLE_fence GL_APPLE_float_pixels GL_APPLE_flush_buffer_range GL_APPLE_flush_render GL_APPLE_object_purgeable GL_APPLE_packed_pixels GL_APPLE_pixel_buffer GL_APPLE_rgb_422 GL_APPLE_row_bytes GL_APPLE_specular_vector GL_APPLE_texture_range GL_APPLE_transform_hint GL_APPLE_vertex_array_object GL_APPLE_vertex_array_range GL_APPLE_vertex_point_size GL_APPLE_vertex_program_evaluators GL_APPLE_ycbcr_422 GL_ATI_separate_stencil GL_ATI_texture_env_combine3 GL_ATI_texture_float GL_IBM_rasterpos_clip GL_NV_blend_square GL_NV_conditional_render GL_NV_depth_clamp GL_NV_fog_distance GL_NV_light_max_exponent GL_NV_texgen_reflection GL_SGIS_generate_mipmap GL_SGIS_texture_edge_clamp GL_SGIS_texture_lod

@iamwilhelm
Copy link
Contributor Author

Thanks for verifying, so I'm not crazy. Thanks for the tip about clang. I'll try to get it to compile today.

@iamwilhelm
Copy link
Contributor Author

I need a little bit of help. I'm having trouble compiling the pre-requisite, OpenCSG. The rest of the pre-requisites I was able to install using homebrew.

I seem to be missing the Glew symbols. Does the Makefile for OpenCSG compile Glew also? I see it included in the directory for OpenCSG.

How would I get the Glew lib linked corrected? Thanks.

My make output is below:

[ruby-1.9.2-p0 /private/tmp/homebrew-opencsg-1.3.2-9Wb2/OpenCSG-1.3.2 ]

make
for X in glew src example; do make -C $X ; done
mkdir lib
cc -DGLEW_NO_GLU -O2 -Wall -W -Iinclude -no-cpp-precomp -dynamic -fno-common -fPIC -o src/glew.pic_o -c src/glew.c
cc -dynamiclib -install_name /usr/lib/libGLEW.1.7.0.dylib -current_version 1.7.0 -compatibility_version 1.7 -o lib/libGLEW.1.7.0.dylib src/glew.pic_o -framework AGL -framework OpenGL
ln -sf libGLEW.1.7.0.dylib lib/libGLEW.1.7.dylib
ln -sf libGLEW.1.7.0.dylib lib/libGLEW.dylib
cc -DGLEW_NO_GLU -O2 -Wall -W -Iinclude -no-cpp-precomp -dynamic -fno-common -o src/glew.o -c src/glew.c
ar cr lib/libGLEW.a src/glew.o
sed
-e "s|@Prefix@|/usr|g"
-e "s|@libdir@|/usr/lib|g"
-e "s|@exec_prefix@|/usr/bin|g"
-e "s|@includedir@|/usr/include/GL|g"
-e "s|@Version@|1.7.0|g"
-e "s|@cflags@||g"
-e "s|@libname@|GLEW|g"
< glew.pc.in > glew.pc
cc -DGLEW_NO_GLU -DGLEW_MX -O2 -Wall -W -Iinclude -no-cpp-precomp -dynamic -fno-common -fPIC -o src/glew.mx.pic_o -c src/glew.c

cc -dynamiclib -install_name /usr/lib/libGLEWmx.1.7.0.dylib -current_version 1.7.0 -compatibility_version 1.7 -o lib/libGLEWmx.1.7.0.dylib src/glew.mx.pic_o -framework AGL -framework OpenGL
ln -sf libGLEWmx.1.7.0.dylib lib/libGLEWmx.1.7.dylib
ln -sf libGLEWmx.1.7.0.dylib lib/libGLEWmx.dylib
cc -DGLEW_NO_GLU -DGLEW_MX -O2 -Wall -W -Iinclude -no-cpp-precomp -dynamic -fno-common -o src/glew.mx.o -c src/glew.c
ar cr lib/libGLEWmx.a src/glew.mx.o
sed
-e "s|@Prefix@|/usr|g"
-e "s|@libdir@|/usr/lib|g"
-e "s|@exec_prefix@|/usr/bin|g"
-e "s|@includedir@|/usr/include/GL|g"
-e "s|@Version@|1.7.0|g"
-e "s|@cflags@|-DGLEW_MX|g"
-e "s|@libname@|GLEWmx|g"
< glew.pc.in > glewmx.pc
mkdir bin
cc -c -O2 -Wall -W -Iinclude -no-cpp-precomp -dynamic -fno-common -o src/glewinfo.o src/glewinfo.c
cc -O2 -Wall -W -Iinclude -no-cpp-precomp -dynamic -fno-common -o bin/glewinfo src/glewinfo.o -Llib -lGLEW -framework AGL -framework OpenGL
cc -c -O2 -Wall -W -Iinclude -no-cpp-precomp -dynamic -fno-common -o src/visualinfo.o src/visualinfo.c
src/visualinfo.c: In function ‘VisualInfo’:
src/visualinfo.c:583: warning: unused parameter ‘ctx’
cc -O2 -Wall -W -Iinclude -no-cpp-precomp -dynamic -fno-common -o bin/visualinfo src/visualinfo.o -Llib -lGLEW -framework AGL -framework OpenGL
g++ -c -pipe -Wall -W -O2 -fPIC -I. -I../include -I../glew/include -I.. -I/usr/X11R6/include -o area.o area.cpp
g++ -c -pipe -Wall -W -O2 -fPIC -I. -I../include -I../glew/include -I.. -I/usr/X11R6/include -o batch.o batch.cpp
g++ -c -pipe -Wall -W -O2 -fPIC -I. -I../include -I../glew/include -I.. -I/usr/X11R6/include -o context.o context.cpp
g++ -c -pipe -Wall -W -O2 -fPIC -I. -I../include -I../glew/include -I.. -I/usr/X11R6/include -o channelManager.o channelManager.cpp
g++ -c -pipe -Wall -W -O2 -fPIC -I. -I../include -I../glew/include -I.. -I/usr/X11R6/include -o frameBufferObject.o frameBufferObject.cpp
g++ -c -pipe -Wall -W -O2 -fPIC -I. -I../include -I../glew/include -I.. -I/usr/X11R6/include -o frameBufferObjectExt.o frameBufferObjectExt.cpp
g++ -c -pipe -Wall -W -O2 -fPIC -I. -I../include -I../glew/include -I.. -I/usr/X11R6/include -o occlusionQuery.o occlusionQuery.cpp
g++ -c -pipe -Wall -W -O2 -fPIC -I. -I../include -I../glew/include -I.. -I/usr/X11R6/include -o offscreenBuffer.o offscreenBuffer.cpp
g++ -c -pipe -Wall -W -O2 -fPIC -I. -I../include -I../glew/include -I.. -I/usr/X11R6/include -o opencsgRender.o opencsgRender.cpp
g++ -c -pipe -Wall -W -O2 -fPIC -I. -I../include -I../glew/include -I.. -I/usr/X11R6/include -o openglHelper.o openglHelper.cpp
g++ -c -pipe -Wall -W -O2 -fPIC -I. -I../include -I../glew/include -I.. -I/usr/X11R6/include -o pBufferTexture.o pBufferTexture.cpp
g++ -c -pipe -Wall -W -O2 -fPIC -I. -I../include -I../glew/include -I.. -I/usr/X11R6/include -o primitive.o primitive.cpp
g++ -c -pipe -Wall -W -O2 -fPIC -I. -I../include -I../glew/include -I.. -I/usr/X11R6/include -o primitiveHelper.o primitiveHelper.cpp
g++ -c -pipe -Wall -W -O2 -fPIC -I. -I../include -I../glew/include -I.. -I/usr/X11R6/include -o renderGoldfeather.o renderGoldfeather.cpp
g++ -c -pipe -Wall -W -O2 -fPIC -I. -I../include -I../glew/include -I.. -I/usr/X11R6/include -o renderSCS.o renderSCS.cpp
g++ -c -pipe -Wall -W -O2 -fPIC -I. -I../include -I../glew/include -I.. -I/usr/X11R6/include -o scissorMemo.o scissorMemo.cpp
g++ -c -pipe -Wall -W -O2 -fPIC -I. -I../include -I../glew/include -I.. -I/usr/X11R6/include -o settings.o settings.cpp
g++ -c -pipe -Wall -W -O2 -fPIC -I. -I../include -I../glew/include -I.. -I/usr/X11R6/include -o stencilManager.o stencilManager.cpp
g++ -c -pipe -Wall -W -O2 -fPIC -I. -I../include -I../glew/include -I.. -I/usr/X11R6/include -o RenderTexture.o ../RenderTexture/RenderTexture.cpp
test -d ../lib/ || mkdir -p ../lib/
rm -f libopencsg.so.1.3.2 libopencsg.so libopencsg.so.1 libopencsg.so.1.3
g++ -shared -Wl,-install_name,libopencsg.so.1 -Wl,-rpath,../lib -o libopencsg.so.1.3.2 area.o batch.o context.o channelManager.o frameBufferObject.o frameBufferObjectExt.o occlusionQuery.o offscreenBuffer.o opencsgRender.o openglHelper.o pBufferTexture.o primitive.o primitiveHelper.o renderGoldfeather.o renderSCS.o scissorMemo.o settings.o stencilManager.o RenderTexture.o -L/usr/X11R6/lib -lGLU -lGL -lXmu
Undefined symbols for architecture x86_64:
"___GLEW_ARB_texture_env_dot3", referenced from:
OpenCSG::ChannelManager::find() constin channelManager.o
OpenCSG::ChannelManager::setupTexEnv(OpenCSG::Channel) in channelManager.o
OpenCSG::ChannelManager::request() in channelManager.o
"___GLEW_ARB_framebuffer_object", referenced from:
OpenCSG::ChannelManager::init() in channelManager.o
OpenCSG::OpenGL::FrameBufferObject::Initialize(int, int, bool, bool)in frameBufferObject.o

<....a whole bunch of symbols for __GLEW />

ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[1]: *** [../lib/libopencsg.so.1.3.2] Error 1
g++ -c -pipe -Wall -W -O2 -I. -I../glew/include -I../include -I/usr/X11R6/include -I/usr/X11R6/include -o displaylistPrimitive.o displaylistPrimitive.cpp
g++ -c -pipe -Wall -W -O2 -I. -I../glew/include -I../include -I/usr/X11R6/include -I/usr/X11R6/include -o main.o main.cpp
g++ -o opencsgexample displaylistPrimitive.o main.o -L/usr/X11R6/lib -L/usr/X11R6/lib -L../lib -lopencsg -lglut -L../glew/lib -lGLEW -lGLU -lGL -lXmu -lXext -lX11 -lm
ld: library not found for -lopencsg
collect2: ld returned 1 exit status
make[1]: *** [opencsgexample] Error 1
make: *** [all] Error 2

@kintel
Copy link
Member

kintel commented Jan 12, 2012

On Jan 12, 2012, at 20:41 PM, Wil with one L wrote:

I need a little bit of help. I'm having trouble compiling the pre-requisite, OpenCSG. The rest of the pre-requisites I was able to install using homebrew.

I seem to be missing the Glew symbols. Does the Makefile for OpenCSG compile Glew also? I see it included in the directory for OpenCSG.

How would I get the Glew lib linked corrected? Thanks.

I'm compiling my own glew due to the OpenCSG build system not being too cool.
I may have forgotten to mention that there is a script which builds all Mac dependencies (except Qt and header-only stuff):
https://github.com/openscad/openscad/blob/master/scripts/macosx-build-dependencies.sh

If you look inside there, you can see that I'm patching OpenCSG to fix the build system.

-Marius

@kintel
Copy link
Member

kintel commented Jan 13, 2012

The example which ships with OpenSCAD fails in the same fashion.
I've contacted the OpenCSG author about this - perhaps he has some insights.

@iamwilhelm
Copy link
Contributor Author

Cool. I contacted him about compiling OpenCSG. He seems pretty responsive. I've managed to get close to compiling openSCAD. the only part that didn't work was, you guessed it, compiling openCSG, even with your build dependencies script.

Keep me updated on this issue. Thanks.

@kintel
Copy link
Member

kintel commented Jan 14, 2012

I just added an experimental setting under Preferences->Advanced, where you can force OpenCSG to use the Goldfeather algorithm. I believe this will work around these problems for now.
Ideally, we should dig to the bottom of this, but I think the solution to this lies inside OpenSCG.

I'm building new Mac binaries as we speak - please test and report back :)

@iamwilhelm
Copy link
Contributor Author

I still had problems compiling OpenCSG from your mac build script. I had to go in OpenCSG 1.3.2 in the openscad library directory your script creates and edit the makefiles after the patch in the build script, namely including the GLEW library in the libs options (-lGLEW) and turning off the i386 architecture in the cflags options (it couldn't find GLEW symbols for i386).

Now, I'm getting an error about it not being able to find Eigen. It wasn't in the mac build script to download and compile Eigen. Should it be?

make
g++ -c -pipe -fno-strict-aliasing -frounding-math -O2 -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -Wall -W -DOPENSCAD_VERSION=2012.01.15 -DOPENSCAD_YEAR=2012.0 -DOPENSCAD_MONTH=01.0 -DOPENSCAD_DAY=15.0 -DDEBUG -DENABLE_MDI -DUSE_PROGRESSWIDGET -DENABLE_CGAL -DENABLE_OPENCSG -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Cellar/qt/4.8.0/mkspecs/macx-g++ -I. -I/usr/local/Cellar/qt/4.8.0/lib/QtCore.framework/Versions/4/Headers -I/opt/local/include/eigen2 -I/usr/local/Cellar/qt/4.8.0/lib/QtCore.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.0/lib/QtGui.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.0/lib/QtGui.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.0/lib/QtOpenGL.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.0/lib/QtOpenGL.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.0/include -Isrc -I/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers -I/System/Library/Frameworks/AGL.framework/Headers -Iobjects -Iobjects -I/usr/local/include -F/usr/local/Cellar/qt/4.8.0/lib -o objects/linalg.o src/linalg.cc
In file included from src/linalg.cc:1:
src/linalg.h:4:22: error: Eigen/Core: No such file or directory
src/linalg.h:5:26: error: Eigen/Geometry: No such file or directory
src/linalg.h:6:23: error: Eigen/Dense: No such file or directory
In file included from src/linalg.cc:1:
src/linalg.h:8: error: ‘Eigen’ has not been declared
src/linalg.h:9: error: ‘Eigen’ has not been declared
src/linalg.h:10: error: ‘Eigen’ has not been declared
src/linalg.h:10: error: expected initializer before ‘<’ token
src/linalg.h:11: error: ‘Eigen’ has not been declared
src/linalg.h:12: error: ‘Eigen’ has not been declared
src/linalg.h:13: error: ‘Eigen’ has not been declared
src/linalg.h:14: error: ‘Eigen’ has not been declared
src/linalg.h:16: error: expected constructor, destructor, or type conversion before ‘operator’
src/linalg.h:18: error: ‘Eigen’ has not been declared
src/linalg.h:18: error: expected `{' before ‘Vector4f’
src/linalg.h:18: error: function definition does not declare parameters
src/linalg.cc:14: error: expected constructor, destructor, or type conversion before ‘operator’
make: *** [objects/linalg.o] Error 1

@kintel
Copy link
Member

kintel commented Jan 16, 2012

The build script builds fat (32+64 bit) libraries, so you'd need GLEW to also be fat.
The environment variable OPENSCAD_LIBRARIES is set by the build script - this causes GLEW to be linked. I didn't patch up the build system of OpenCSG to work outside the script

Since Eigen is header-only, I install it using MacPorts: port install eigen

In addition, I install Qt using the official binaries.

@iamwilhelm
Copy link
Contributor Author

One last question:
I was able to get it to compile--most of the problems were with openCSG. I managed to compile openCSG and copy libraries over by hand to install/lib and install/include. And once that was done, I was able to use brew to install an earlier version of eigen, and get the entire OpenSCAD project to compile and link.

However, when I go to run the application, it crashes:

Application Specific Information:
dyld: launch, loading dependent libraries

Dyld Error Message:
  Library not loaded: libopencsg.1.dylib
  Referenced from: /Users/USER/*/OpenSCAD.app/Contents/MacOS/OpenSCAD
  Reason: image not found

I seem to be missing libopencsg.1.dylib. however, I explicitly copied it to my openscad_libraries/install/lib directory, and it seemed to have found it during compile time. I don't know what env variable or path setting I need to point to that lib directory to get it to work. Do you happen to know? Thanks.

@kintel
Copy link
Member

kintel commented Jan 17, 2012

You should set the DYLD_LIBRARY_PATH to where the dylibs are installed.

@kintel
Copy link
Member

kintel commented Jan 17, 2012

btw., did the latest development binaries I posted work if you change the "Force Goldberg" preferences setting?

@iamwilhelm
Copy link
Contributor Author

Thanks for the tip, I'll give it a shot.

Oh neat, there's a dev binary. I had misinterpreted what you said earlier, which is why I kept trying to compile. I did just try it out and it works...sort of. The general shape is correct, but there are visual artifacts of where the intersection is.

https://skitch.com/iamwilhelm/g3kgm/preferences

The visual artifact kind of shimmers and changes as one rotates the model around.

But overall, I think it's usable as a patch, thanks! How would we get to the bottom of the original bug? I assume we'd have to rely on a fix from the maintainer of OpenCSG?

@kintel
Copy link
Member

kintel commented Jan 17, 2012

I talked to Florian, the maintainer.
You can see the bug also with the example which comes with OpenCSG, so that's a good place to start.
I don't think Florian has access to the hardware in question, so it would require some remote debugging to get him to suggest fixes. He is responsive though.

@iamwilhelm
Copy link
Contributor Author

I just tried it with a more complex model:

http://www.thingiverse.com/image:95164

It doesn't look like that at all when I render it in OpenSCAD:

https://skitch.com/iamwilhelm/g3kct/openscad-gregs-new-x-carriage.scad

Does it look correct when you render that thingiverse object? I don't know what exactly is the culprit in the model's code, but I just wanted to check that it doesn't look like that for you as well.

@MarkVillacampa
Copy link

Having exactly the same issue with mt Macbook Air 2011, is there's any extra info I can give you that would help fix it just let me know.

@kintel
Copy link
Member

kintel commented Feb 2, 2012

I believe this has only been observed on that particular Macbook Air revision (with the Intel HD 3000 GPU).
There are other issues with this setup (see issue #71), and it's not limited to OpenCSG or OpenSCAD - so it requires significantly more digging I'm afraid.
If there is a developer out there with some OpenGL experience and with possession of such a Macbook Air, some help would be very appreciated :)

Btw., in the latest development snaphot, there is a "Force Goldberg" preference setting which should temporarily work around this. Have you tried turning on that?

@MarkVillacampa
Copy link

After just a little testing, "Force Goldberg" seems to work fine, but I will try more complex renders.

Are there any cons using "Force Goldberg" that I should know when working in my renders?

Un fortunatelly I dont have any OpenGL experience, is there anything else I can do to help?

@kintel
Copy link
Member

kintel commented Feb 2, 2012

I'm not sure what cons there are with Force Goldberg. If someone looks at this in detail, it would be beneficial to discuss it with Florian, the OpenCSG author. He was the one suggesting this temporary workaround in the first place.

@msmollin
Copy link

msmollin commented Feb 2, 2012

I believe the root issue here is that the Intel HD Graphics present on current gen MacBook airs( and previous for that matter) does not support the full OpenGL 2.0 specification. What would have to happen (I think) is openCSG would have to be written to utilize CoreGraphics as my understanding is CG will translate any unsupported calls in ones the hardware understands. I'm an iOS developer so this is coming from my understanding of how CoreGraphics works on the mobile devices, but it's effectively unchanged from OS X. I'm guessing this Workaround Florian provided does something similar.

@kintel
Copy link
Member

kintel commented Feb 2, 2012

The drivers claim to do OpenGL 2.0. If they're not compliant, they shouldn't be allowed to tag it as OpenGL 2.0 as that would severely undermine OpenGL.
Do you know if there is any information about which parts of OpenGL 2.0 are not supported by these GPUs and drivers?

@kintel
Copy link
Member

kintel commented Feb 3, 2012

iamwilhelm: Just FYI: The latest version of the build script works fine on a pretty plain Lion machine. OpenSCAD also runs and build fine: https://github.com/openscad/openscad/blob/master/scripts/macosx-build-dependencies.sh

(this has nothing to do with the Intel GPU issue, but just a note for the ones trying to hunt for it under Lion)

@MarkVillacampa
Copy link

I've noticed the same issue in Ubuntu running in an Atom netbook with al Intel GMA 945 graphic chip.

Seems to be an Intel GPU issue, not operating system related.

@kintel
Copy link
Member

kintel commented Feb 5, 2012

Mark:

  1. Does the "Force Goldfeather" checkbox make it work again on your GMA 945 GPU?
  2. Could you give me a dump of the "OpenGL Info" menu for that machine?

@kintel
Copy link
Member

kintel commented Feb 5, 2012

Some ideas/suggestions/questions from Florian/OpenCSG:

  1. I would first try to switch to the Goldfeather algorithm (instead of SCS, which I suppose is used by default here). The output will be different, but will it be ok?

  2. Is this really a Mac issue, or does the same effect happens on Windows with that hardware?

  3. I guess that the problem is in SCSChannelManager::merge() (renderSCS.cpp). See the large comment in the middle. Performing the alpha test with GL_EQUAL is problematic. The Goldfeather performs the alpha test with (GL_GEQUAL, 0.5), and the values in the texture are either 0 or 1. This is numerically stable. I don't believe that the issue is related to positive or negative shapes. But this might be possibly ruled out.

My notes:

  1. Goldfeather is reported to work
  2. Intel GMA 945 is reported to produce the bug under Ubuntu
  3. FIXME: Investigation should be done by someone with the correct hardware

@msmollin
Copy link

msmollin commented Feb 5, 2012

This appears to be a Mac / Linux only issue. I have a Windows 7 Dell Latitude laptop running an Intel GMA965 with Intel's latest drivers from 2009, and it renders correctly with the latest pre-compiled binaries fresh from installation (no changes made). Screenshot from that - http://img.ly/dyMI. There are some rendering artifacts inside the M, but it renders the full M correctly unlike my Macbook Air - http://img.ly/cB92

OpenGL info for that machine:

GLEW version 1.7.0
OpenGL version Intel 965/963 Graphics Media Accelerator
Intel (2.0.0 - Build 8.14.10.1930)

RGBA(8888), depth(24), stencil(8)
Extensions:
GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_blend_color GL_EXT_abgr GL_EXT_texture3D GL_EXT_clip_volume_hint GL_EXT_compiled_vertex_array GL_SGIS_texture_edge_clamp GL_SGIS_generate_mipmap GL_EXT_draw_range_elements GL_SGIS_texture_lod GL_EXT_rescale_normal GL_EXT_packed_pixels GL_EXT_separate_specular_color GL_ARB_multitexture GL_EXT_texture_env_combine GL_EXT_bgra GL_EXT_blend_func_separate GL_EXT_secondary_color GL_EXT_fog_coord GL_EXT_texture_env_add GL_ARB_texture_cube_map GL_ARB_transpose_matrix GL_ARB_texture_env_add GL_IBM_texture_mirrored_repeat GL_EXT_multi_draw_arrays GL_NV_blend_square GL_ARB_texture_compression GL_3DFX_texture_compression_FXT1 GL_EXT_texture_filter_anisotropic GL_ARB_texture_border_clamp GL_ARB_point_parameters GL_ARB_texture_env_combine GL_ARB_texture_env_dot3 GL_ARB_texture_env_crossbar GL_EXT_texture_compression_s3tc GL_ARB_shadow GL_ARB_window_pos GL_EXT_shadow_funcs GL_EXT_stencil_wrap GL_ARB_vertex_program GL_EXT_texture_rectangle GL_ARB_fragment_program GL_EXT_stencil_two_side GL_ATI_separate_stencil GL_ARB_vertex_buffer_object GL_EXT_texture_lod_bias GL_ARB_occlusion_query GL_ARB_fragment_shader GL_ARB_shader_objects GL_ARB_shading_language_100 GL_ARB_texture_non_power_of_two GL_ARB_vertex_shader GL_NV_texgen_reflection GL_ARB_point_sprite GL_EXT_blend_equation_separate GL_ARB_depth_texture GL_ARB_texture_rectangle GL_ARB_draw_buffers GL_ARB_pixel_buffer_object GL_WIN_swap_hint GL_EXT_framebuffer_object

@josefprusa
Copy link

Have same issue with HD3000 on i5 2500k. From some internet research it looks that only problem is, that intel hd graphics are crap with even crappier drivers :-/ Tomorrow Im gonna buy a new graphics card for my desktop and I'm happy that my macbook air is still with nvidia graphics :-)

@cstratton
Copy link

Mac Minis were missing most external surfaces in 3d view, turning on goldfeather in preferences-advanced after seeing kintel's comment seems to have fixed it.

@kintel
Copy link
Member

kintel commented Sep 11, 2016

Can anyone still reproduce this issue?

@kintel
Copy link
Member

kintel commented Dec 7, 2018

Closing as likely to be an ancient driver issue, possibly solved by OpenCSG-1.4.2 and new drivers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants