FS#14893 - [blender] Build with scons

Attached to Project: Arch Linux
Opened by Alessandro Doro (adoroo) - Sunday, 31 May 2009, 14:53 GMT
Last edited by Eric Belanger (Snowman) - Monday, 18 April 2011, 02:58 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To Tobias Kieslich (tobias)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

The current blender PKGBUILD is really a mess.
There are a bunch of outdated NAN variables and stesp no more useful because the defaults are changed.
I tried to build after a cleanup:
export NAN_NO_PLUGIN=true
export NAN_PYTHON_VERSION=2.6
export INTERNATIONAL=true
export WITH_BF_OPENMP=true
export NAN_FFMPEG=/usr
export NAN_ODE=/usr
export WITH_BF_OPENMP=true
but I'm having issues.
- problem while linking with openal; the linker search for /usr/lib/libopenal.a; no luck triyng to hardcode
- WITH_BF_OPENMP=true exposes a gcc bug; in order to procede I have to set it to false; see  FS#14766 

The steps to build with scons are easy:
· provide a user-config.py in the source root directory; this can be provided as an external file or generated in the PKGBUILD sedding config/linux2-config.py (note that one can also modify config/linux2-config.py directly).
· scons

In the next post I'll explain/justify the changes from the default linux2-config.py.
This task depends upon

Closed by  Eric Belanger (Snowman)
Monday, 18 April 2011, 02:58 GMT
Reason for closing:  Implemented
Additional comments about closing:  blender-2.57-1 in testing use cmake as build system as upstream seem to prefer cmake. In that release, cmake or scons are the only build systems available.
Comment by Alessandro Doro (adoroo) - Sunday, 31 May 2009, 15:07 GMT
--- config/linux2-config.py 2009-05-18 21:13:48.000000000 +0200
+++ user-config.py 2009-05-31 16:53:04.000000000 +0200
@@ -0,0 +1,2 @@
+WITH_BF_DOCS = True
***** This can be set to False; it builds the blender API documentation (8MB of html files).

+WITH_BF_OPENMP = True
***** It builds (It doens't with the make method:  FS#14766 )!!!

@@ -4 +6 @@
-WITH_BF_VERSE = False
+WITH_BF_VERSE = True
***** Maybe some user needs verse support.

@@ -87 +89 @@
-WITH_BF_ODE = False
+WITH_BF_ODE = True
***** Statically linked.

@@ -139,2 +141,2 @@
-BF_FFMPEG = '#extern/ffmpeg'
-BF_FFMPEG_LIB = ''
+# BF_FFMPEG = '#extern/ffmpeg'
+# BF_FFMPEG_LIB = ''
@@ -142,2 +144,2 @@
-# BF_FFMPEG = '/usr'
-# BF_FFMPEG_LIB = 'avformat avcodec swscale avutil avdevice'
+BF_FFMPEG = '/usr'
+BF_FFMPEG_LIB = 'avformat avcodec swscale avutil avdevice'
***** Blender source contains ffmpeg 0.5 now; so I link with the system ffmpeg.

@@ -148 +150 @@
-WITH_BF_OGG = False # -DWITH_OGG
+WITH_BF_OGG = True # -DWITH_OGG
***** ogg/vorbis/theora support for ffmpeg. Good!

@@ -180 +182 @@
-CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing']
+CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-march=i686','-mtune=generic']
@@ -183 +185 @@
-CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing']
+CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-march=i686','-mtune=generic']
***** Just taken from /etc/makepkg.conf. Are they needed?
Comment by Tobias Kieslich (tobias) - Sunday, 31 May 2009, 19:05 GMT
the scons build support was always behind the NAN Makefiles. I intend to keep those around at least until 2.50 hits the shelves. On a related note, it seems that internally the blender guys favour CMake over scons. As for me from version to version scons was way more unpredictable in the outcome than the Makefiles ever were.
Comment by Alessandro Doro (adoroo) - Sunday, 31 May 2009, 20:25 GMT
Well, it's a matter of personal preferences.
At least for a stable version every build system is supported and working (but see
[1]); during development it happens that some system is not updated for a few hours/days after certain changes in the source tree.
The thread "Removing Build Systems" in the bf-committers ML (2009, April) sheds some light about this issue.

Anyway at the moment the build fails in Arch with the NAN makefile if openmp is enabled (see [2], to investigate further).
Also I can't compile with openal support (given we want satisfy [3]).

[1]  FS#12862  - blender bullet physics not enabled due to wrong option
[2]  FS#14766  - [Blender] fails to build
]3]  FS#13875  - Blender3D has OpenAL disabled (no sound in games)

scons works nearly out of the box. I did not tried cmake recently; last time (after 2.48a) it gave me executables with inferior performance.

Only my POV/experience.
Comment by Alessandro Doro (adoroo) - Monday, 08 June 2009, 16:31 GMT
I said: "Blender source contains ffmpeg 0.5 now; so I link with the system ffmpeg".
But after SVN commit 20717 (trunk/blender/extern/ffmpeg: == FFMPEG ==) maybe it's better to stay with the blender provided ffmpeg.

References:
http://lists.blender.org/pipermail/bf-blender-cvs/2009-June/019907.html
http://lists.blender.org/pipermail/bf-committers/2009-June/023614.html

Comment by Alessandro Doro (adoroo) - Monday, 08 June 2009, 16:45 GMT
Regarding  FS#13875 .
The build with the NAN Makefiles stops at linking time; it wants the static lib while the Arch Linux package provides only the dynamic library.
Comment by Alessandro Doro (adoroo) - Friday, 12 June 2009, 13:02 GMT
Just a draft, not sure about (make)depends.
Comment by Alessandro Doro (adoroo) - Monday, 22 June 2009, 12:04 GMT
Updated PKGBUILD for 2.49a.
Comment by Tobias Kieslich (tobias) - Monday, 20 July 2009, 15:19 GMT
I'll close that for now and will reconsider after the 2.5 branch. The NAN files still do a good job and they do build ALL features without hacks.
Comment by Alessandro Doro (adoroo) - Monday, 20 July 2009, 20:17 GMT
Not really.
Many libraries are linked statically, there is no theora/vorbis support for the ffmpeg animation output. The PKGBUILD needs still a clean up.

Anyway I'm fine with that, you can close this task. Too much users whining in  FS#14766  and no one contributing to the discussion.
Comment by Tobias Kieslich (tobias) - Monday, 20 July 2009, 22:16 GMT
They are linked statically no matter what from what I see. That means even with scons they would be I think. We patch for dynamic openal and freetype, I'd like to keep that to a minimum, becuase it seems blender prefers static linking. I also prefer to use provided sources in blenders extern directory because they have a history of patching those and hence being different from vanilla upstream versions. I am accepting patches for the NAN_stuff cleanup, I think all exports done in the file have some results in then package though. I did grep -r through the makefiles for it. Agreed about the whining :P
Comment by Alessandro Doro (adoroo) - Tuesday, 21 July 2009, 01:15 GMT
Ok.
Forget about theora/vorbis, after some research I see that only scons supports it and it's not a vital feature.
Comment by Thomas Dziedzic (tomd123) - Thursday, 27 May 2010, 04:12 GMT
status of this? should we close?
Comment by Robert de Jager (blob) - Sunday, 17 April 2011, 10:41 GMT
Blender 2.57 stable has recently been released. I have made build files for blender and opencollada-svn. The latter is a bit messy, but it gets the job done and allows the blender package to retain collada import/export functionality.
I have been building svn trunk pulls for months now and concluded that cmake is the way to go.
Comment by Robert de Jager (blob) - Sunday, 17 April 2011, 14:44 GMT
The blender PKGBUILD in my previous post had a depricated cmake option and enabled the copying of python into blenders own install directory. Here is a fixed version.

Loading...