Bug 175490 - graphics/blender port build fails
Summary: graphics/blender port build fails
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Marcus von Appen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-21 20:30 UTC by Chris
Modified: 2013-02-04 21:20 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris 2013-01-21 20:30:00 UTC
The port build of blender fails with the following:

_gen.c, rna_sound_gen.c, rna_space_gen.c, rna_speaker_gen.c, rna_test_gen.c, rna_text_gen.c, rna_texture_gen.c, rna_timeline_gen.c, rna_tracking_gen.c, rna_ui_gen.c, rna_userdef_gen.c, rna_vfont_gen.c, rna_wm_gen.c, rna_world_gen.c
Running makesrna
Illegal instruction (core dumped)
*** [source/blender/makesrna/intern/rna_ID_gen.c] Error code 132
1 error
*** [source/blender/makesrna/intern/CMakeFiles/bf_rna.dir/all] Error code 2
1 error
*** [all] Error code 2
1 error
*** [do-build] Error code 1

Stop in /usr/ports/graphics/blender.
*** [build] Error code 1

Stop in /usr/ports/graphics/blender.

How-To-Repeat: Build the port.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-01-22 07:04:31 UTC
Responsible Changed
From-To: freebsd-ports-bugs->mva

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Marcus von Appen freebsd_committer freebsd_triage 2013-01-28 07:13:08 UTC
Can you please provide more information on how the environment is
configured? The following information are important:

- Output of 'make showconfig' within /usr/ports/graphics/blender
- Contents of your /etc/make.conf changes that might have an impact on
  the ports (if any)

Thanks
Marcus
Comment 3 Marcus von Appen freebsd_committer freebsd_triage 2013-01-28 20:43:35 UTC
On, Mon Jan 28, 2013, Chris Calvey wrote:

[...]
> ===> The following configuration options are available for blender-2.65a_2:
>      BOOLEAN=on: Boolean library support
>      BULLET=on: Bullet physics engine
>      CAMERATRACK=off: Camera tracking support
>      CINEON=on: CINEON and DPX graphics format support
>      CYCLES=on: Cycles render engine support
>      DDS=on: DDS graphics format support
>      FFMPEG=off: FFmpeg (WMA, AIFF, AC3, APE...)
>      FFTW3=off: Floating point support using fftw
>      GAMEENGINE=on: Enable the game engine
>      HDR=on: Generic high dynamic-range (HDR) support
>      HEADLESS=on: Disable user interface (for render-farms)
>      JACK=on: JACK audio server
>      MENU=off: Install desktop menu
>      NLS=on: Native Language Support
>      OCEANSIM=off: Ocean simulation support
>      OPENAL=on: OpenAL support
>      OPENCOLORIO=on: OpenColorIO-based color management support
>      OPENEXR=on: HDR via OpenEXR
>      OPENJPEG=on: Enhanced JPEG graphics
>      OPENMP=on: Parallel processing via OpenMP
>      PLAYER=on: Enable blender player
>      REDCODE=off: RedCode graphics format support
>      SAMPLERATE=on: Sample rate conversion
>      SDL=on: Audio and Joystick support using SDL
>      SNDFILE=off: libsndfile support
>      TIFF=on: TIFF image format
>      XF86VMODE=on: X11 video mode switching support
>      XINPUT=on: X11 Xinput (tablet) support
> ===> Use 'make config' to modify these settings
[...]

Thanks for the information. Unfortunately I could not reproduce that
issue so far.

One of my guesses is that your CPU might not support the SSE2
instruction set, while the relevant blender code tries to use SSE2
instructions anyways. To check, if this is might be the case on your
system, could you please send me the output of `dmesg`?

Please note that the command might reveal sensitive information about
your system. In case that you would not want those to be shared or do
not want to provide certain parts:

the most important information about the SSE2 instruction set are found
at the top of the dmesg output (everything about your CPU until the
"real memory = ..."  line should be enough).

Please provide the output of `sysctl hw.instruction_sse`, too.

Thanks
Marcus
Comment 4 Marcus von Appen freebsd_committer freebsd_triage 2013-01-29 15:34:16 UTC
[...]

As announced earlier, find attached a quick'n'dirty check to really
reassure that the SSE/SSE2 instruction sets are the culprit for your
CPU.

Please apply the patch to /usr/ports/graphics/Makefile (the patch just
adds a -DWITH_RAYOPTIMIZATION:BOOL=OFF to the CMAKE_ARGS, which should
disable the usage of SSE2 code).

If this still causes the error to occur, please send me the output of
`make configure` for further investigation.


Index: Makefile
===================================================================
--- Makefile	(revision 311168)
+++ Makefile	(working copy)
@@ -26,7 +26,8 @@

 CMAKE_OUTSOURCE=	yes
 CMAKE_ARGS+=	-DWITH_PYTHON_INSTALL:BOOL=OFF \
-		-DWITH_PYTHON_INSTALL_NUMPY:BOOL=OFF
+		-DWITH_PYTHON_INSTALL_NUMPY:BOOL=OFF \
+		-DWITH_RAYOPTIMIZATION:BOOL=OFF

 SUB_FILES=	blender blenderplayer
 MAN1=		blender.1
Comment 5 dfilter service freebsd_committer freebsd_triage 2013-02-04 21:19:46 UTC
Author: mva
Date: Mon Feb  4 21:19:38 2013
New Revision: 311647
URL: http://svnweb.freebsd.org/changeset/ports/311647

Log:
  - Add a RAYOPTIMIZATION option for the ray optimization code to allow
    i386 systems without SSE2 to build blender properly
  - Add CYCLESOSL option to add support for cycles render shaders
  - Clean up some PLIST_SUB leftovers
  
  PR:		ports/175490
  Submitted by:	chris@imagemetrica.com

Added:
  head/graphics/blender/files/patch-intern_cycles_render_osl.cpp   (contents, props changed)
Modified:
  head/graphics/blender/Makefile

Modified: head/graphics/blender/Makefile
==============================================================================
--- head/graphics/blender/Makefile	Mon Feb  4 21:15:31 2013	(r311646)
+++ head/graphics/blender/Makefile	Mon Feb  4 21:19:38 2013	(r311647)
@@ -3,7 +3,7 @@
 
 PORTNAME=	blender
 PORTVERSION=	2.65a
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	graphics games
 MASTER_SITES=	http://download.blender.org/source/ \
 		http://mirror.cs.umn.edu/blender.org/source/ \
@@ -36,21 +36,22 @@ OUTDIR=		${INSTALL_WRKSRC}/bin/2.65
 LANG=	ar cs de eo es es_ES fa fr he hr hu id it ja ky nl pt pt_BR ru \
 	sr sr@latin sv tr uk zh_CN zh_TW
 
-OPTIONS_DEFINE=	BOOLEAN BULLET CINEON CAMERATRACK CYCLES DDS FFMPEG FFTW3 \
-		GAMEENGINE HDR HEADLESS JACK NLS MENU OCEANSIM OPENAL \
-		OPENCOLORIO OPENEXR OPENJPEG OPENMP PLAYER REDCODE SAMPLERATE \
-		SDL SNDFILE TIFF XINPUT XF86VMODE
-OPTIONS_DEFAULT=	BOOLEAN BULLET CINEON CYCLES DDS GAMEENGINE HDR JACK \
-			OPENAL OPENCOLORIO OPENEXR OPENJPEG OPENMP PLAYER \
-			SAMPLERATE SDL TIFF XINPUT XF86VMODE
+OPTIONS_DEFINE=	BOOLEAN BULLET CINEON CAMERATRACK CYCLES CYCLESOSL DDS FFMPEG \
+		FFTW3 GAMEENGINE HDR HEADLESS JACK NLS MENU OCEANSIM OPENAL \
+		OPENCOLORIO OPENEXR OPENJPEG OPENMP PLAYER RAYOPTIMIZATION \
+		REDCODE SAMPLERATE SDL SNDFILE TIFF XINPUT XF86VMODE
+OPTIONS_DEFAULT=	BOOLEAN BULLET CINEON CYCLES CYCLESOSL DDS GAMEENGINE \
+			HDR JACK OPENAL OPENCOLORIO OPENEXR OPENJPEG OPENMP \
+			PLAYER SAMPLERATE SDL TIFF XINPUT XF86VMODE
 
 BOOLEAN_DESC=		Boolean library support
 BULLET_DESC=		Bullet physics engine
 CINEON_DESC=		CINEON and DPX graphics format support
 CAMERATRACK_DESC=	Camera tracking support
 CYCLES_DESC=		Cycles render engine support
+CYCLESOSL_DESC=		Shading support for the cycles render engine
 DDS_DESC=		DDS graphics format support
-FFTW3_DESC=		Floating point support using fftw
+FFTW3_DESC=		Use fftw for smoke and audio effects
 GAMEENGINE_DESC=	Enable the game engine
 HDR_DESC=		Generic high dynamic-range (HDR) support
 HEADLESS_DESC=		Disable user interface (for render-farms)
@@ -58,6 +59,7 @@ MENU_DESC=		Install desktop menu
 OCEANSIM_DESC=		Ocean simulation support
 OPENCOLORIO_DESC=	OpenColorIO-based color management support
 PLAYER_DESC=		Enable blender player
+RAYOPTIMIZATION_DESC=	Enable SSE optimizatons for raytracing
 REDCODE_DESC=		RedCode graphics format support
 SDL_DESC=		Audio and Joystick support using SDL
 XINPUT_DESC=		X11 Xinput (tablet) support
@@ -66,7 +68,6 @@ XF86VMODE_DESC=		X11 video mode switchin
 # TODO: provide switches for the following options
 #
 # WITH_IMAGE_FRAMESERVER WITH_LZO WITH_LZMA WITH_LIBMV WITH_INPUT_NDOF
-# WITH_RAYOPTIMIZATION WITH_CYCLES_OSL WITH_COMPOSITOR
 
 .include <bsd.port.options.mk>
 
@@ -103,10 +104,18 @@ IGNORE=	cycles render engine only works 
 .endif
 CMAKE_ARGS+=	-DWITH_CYCLES:BOOL=ON
 LIB_DEPENDS+=	OpenImageIO:${PORTSDIR}/graphics/openimageio
-PLIST_SUB+=	CYCLES=""
 .else
 CMAKE_ARGS+=	-DWITH_CYCLES:BOOL=OFF
-PLIST_SUB+=	CYCLES="@comment "
+.endif
+
+.if ${PORT_OPTIONS:MCYCLESOSL}
+.if !${PORT_OPTIONS:MCYCLES}
+IGNORE=	support for the OpenShadingLanguage in cycles obviously requires CYCLES
+.endif
+CMAKE_ARGS+=	-DWITH_CYCLES_OSL:BOOL=ON
+LIB_DEPENDS+=	oslexec:${PORTSDIR}/graphics/openshadinglanguage
+.else
+CMAKE_ARGS+=	-DWITH_CYCLES_OSL:BOOL=OFF
 .endif
 
 .if ${PORT_OPTIONS:MDDS}
@@ -156,18 +165,13 @@ CMAKE_ARGS+=	-DWITH_JACK:BOOL=OFF
 
 .if ${PORT_OPTIONS:MMENU}
 USE_GNOME=	desktopfileutils
-PLIST_SUB+=	MENU=""
-.else
-PLIST_SUB+=	MENU="@comment "
 .endif
 
 .if ${PORT_OPTIONS:MNLS}
 USE_GETTEXT=	yes
 USE_ICONV=	yes
-PLIST_SUB+=	NLS=""
 CMAKE_ARGS+=	-DWITH_INTERNATIONAL:BOOL=ON
 .else
-PLIST_SUB+=	NLS="@comment "
 CMAKE_ARGS+=	-DWITH_INTERNATIONAL:BOOL=OFF
 .endif
 
@@ -221,16 +225,20 @@ CMAKE_ARGS+=	-DWITH_OPENMP:BOOL=OFF
 
 .if ${PORT_OPTIONS:MPLAYER}
 .if ${PORT_OPTIONS:MGAMEENGINE}
-PLIST_SUB+=	PLAYER=""
 CMAKE_ARGS+=	-DWITH_PLAYER:BOOL=ON
 .else
 BROKEN=		PLAYER requires GAMEENGINE
 .endif
 .else
-PLIST_SUB+=	PLAYER="@comment "
 CMAKE_ARGS+=	-DWITH_PLAYER:BOOL=OFF
 .endif
 
+.if ${PORT_OPTIONS:MRAYOPTIMIZATION}
+CMAKE_ARGS+=	-DWITH_RAYOPTIMIZATION:BOOL=ON
+.else
+CMAKE_ARGS+=	-DWITH_RAYOPTIMIZATION:BOOL=OFF
+.endif
+
 .if ${PORT_OPTIONS:MREDCODE}
 .if ${PORT_OPTIONS:MOPENJPEG} && ${PORT_OPTIONS:MFFMPEG}
 CMAKE_ARGS+=	-DWITH_IMAGE_REDCODE:BOOL=ON

Added: head/graphics/blender/files/patch-intern_cycles_render_osl.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/blender/files/patch-intern_cycles_render_osl.cpp	Mon Feb  4 21:19:38 2013	(r311647)
@@ -0,0 +1,11 @@
+--- intern/cycles/render/osl.cpp.orig	2013-02-02 23:31:36.000000000 +0100
++++ intern/cycles/render/osl.cpp	2013-02-02 23:31:56.000000000 +0100
+@@ -277,7 +277,7 @@
+ 
+ const char *OSLShaderManager::shader_load_bytecode(const string& hash, const string& bytecode)
+ {
+-	ss->LoadMemoryShader(hash.c_str(), bytecode.c_str());
++	ss->LoadMemoryCompiledShader(hash.c_str(), bytecode.c_str());
+ 
+ 	/* this is a bit weak, but works */
+ 	OSLShaderInfo info;
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 6 Marcus von Appen freebsd_committer freebsd_triage 2013-02-04 21:20:47 UTC
State Changed
From-To: open->closed

A fix has been committed, introducing a new RAYOPTIMIZATION option that 
should solve your issue. Thanks for testing!