Potential fix for command-line builds (windows)

Discussion and help for Compilation problems and platform portability.

Moderator: coordinators

Potential fix for command-line builds (windows)

Postby helloworld922 » Sat Sep 18, 2010 10:22 am

I think I've found a potential fix for command-line building of luxrender (only 64-bit version right now

1. Use the VCProps I posted in the Windows build issues (got rid of all "s). Otherwise you'll get a lot of errors when you attempt to build from command-line
2. modify build-luxrender-x64.bat to this:

Code: Select all
@Echo off

echo.
echo **************************************************************************
echo * Startup                                                                *
echo **************************************************************************
echo.
echo This script will use 3 pre-built binaries to help build LuxRender:
echo  1: GNU flex.exe       from http://gnuwin32.sourceforge.net/packages/flex.htm
echo  2: GNU bison.exe      from http://gnuwin32.sourceforge.net/packages/bison.htm
echo  3: GNU patch.exe      from http://gnuwin32.sourceforge.net/packages/patch.htm
echo.
echo If you do not wish to execute these binaries for any reason, PRESS CTRL-C NOW
echo Otherwise,
pause

echo.
echo **************************************************************************
echo * Checking environment                                                   *
echo **************************************************************************

IF EXIST build-vars.bat (
   call build-vars.bat
)

IF NOT EXIST %LUX_X64_PYTHON2_ROOT% (
   echo.
   echo %%LUX_X64_PYTHON2_ROOT%% not valid! Aborting.
   exit /b -1
)
IF NOT EXIST %LUX_X64_PYTHON3_ROOT% (
   echo.
   echo %%LUX_X64_PYTHON3_ROOT%% not valid! Aborting.
   exit /b -1
)
IF NOT EXIST %LUX_X64_BOOST_ROOT% (
   echo.
   echo %%LUX_X64_BOOST_ROOT%% not valid! Aborting.
   exit /b -1
)
IF NOT EXIST %LUX_X64_QT_ROOT% (
   echo.
   echo %%LUX_X64_QT_ROOT%% not valid! Aborting.
   exit /b -1
)
IF NOT EXIST %LUX_X64_FREEIMAGE_ROOT% (
   echo.
   echo %%LUX_X64_FREEIMAGE_ROOT%% not valid! Aborting.
   exit /b -1
)
IF NOT EXIST %LUX_X64_ZLIB_ROOT% (
   echo.
   echo %%LUX_X64_ZLIB_ROOT%% not valid! Aborting.
   exit /b -1
)

msbuild /? > nul
if NOT ERRORLEVEL 0 (
   echo.
   echo Cannot execute the 'msbuild' command. Please run
   echo this script from the Visual Studio 2008 Command Prompt.
   exit /b -1
)

echo Environment OK.



echo.
echo **************************************************************************
echo **************************************************************************
echo *                                                                        *
echo *        Building For x64                                                *
echo *                                                                        *
echo **************************************************************************
echo **************************************************************************


:DebugChoice
echo Build Debug binaries ?
echo 0: No (default)
echo 1: Yes
set BUILD_DEBUG=0
set /P BUILD_DEBUG="Selection? "
IF %BUILD_DEBUG% EQU 0 ( GOTO LuxRender )
IF %BUILD_DEBUG% EQU 1 ( GOTO LuxRender )
echo Invalid choice
GOTO DebugChoice


:: ****************************************************************************
:: ******************************* LuxRender **********************************
:: ****************************************************************************
:LuxRender
echo.
echo **************************************************************************
echo * Building LuxRender                                                     *
echo **************************************************************************
cd /d %LUX_WINDOWS_BUILD_ROOT%
IF %BUILD_DEBUG% EQU 1 (
   msbuild /property:Configuration=Release;Platform=x64;useenv=true /target:rebuild lux.sln
)

msbuild /property:Configuration=Release;Platform=x64;useenv=true /target:rebuild lux.sln



:: ****************************************************************************
:: *********************************** Install ********************************
:: ****************************************************************************

cd /d %LUX_WINDOWS_BUILD_ROOT%

IF EXIST ./install-x64.bat (
   call install-x64.bat
)



:postLuxRender
:: ****************************************************************************
:: *********************************** Finished *******************************
:: ****************************************************************************
cd /d %LUX_WINDOWS_BUILD_ROOT%

echo.
echo **************************************************************************
echo **************************************************************************
echo *                                                                        *
echo *        Building Completed                                              *
echo *                                                                        *
echo **************************************************************************
echo **************************************************************************


What has (and hasn't) been tested:
1. 64-bit release building on command-line completes successfully, appears to runs and render fine
2. 64-bit release building from VS2008 gui appears to work (builds fine, runs and renders fine)
3. 64-bit debug builds have not been tested (either from command-line or from the VS gui)
4. 32-bit builds (any) have not been tested

If this works, I'll post the diffs as a patch (or someone else can generate them)

edit:

You will also need to check the boost dependency directory to make sure that python3 boost libs built successfully and are in the correct directory (/stage/python3/lib/). See the same post with the VCProps for details on this.

link to post with VCProps and python3 boost lib fixes
helloworld922
 
Posts: 57
Joined: Sat Jul 10, 2010 12:21 pm

Re: Potential fix for command-line builds (windows)

Postby dougal2 » Sat Sep 18, 2010 10:45 am

Code: Select all
IF %BUILD_DEBUG% EQU 1 (
   msbuild /property:Configuration=Release;Platform=x64;useenv=true /target:rebuild lux.sln
)

msbuild /property:Configuration=Release;Platform=x64;useenv=true /target:rebuild lux.sln


Really? :roll:
User avatar
dougal2
Developer
 
Posts: 3075
Joined: Mon Jan 14, 2008 7:21 am

Re: Potential fix for command-line builds (windows)

Postby dougal2 » Sat Sep 18, 2010 10:57 am

Have you tried rendering with the binaries this produces? Still doesn't work for me, I get "Static loading of ... failed" errors.
User avatar
dougal2
Developer
 
Posts: 3075
Joined: Mon Jan 14, 2008 7:21 am

Re: Potential fix for command-line builds (windows)

Postby helloworld922 » Sat Sep 18, 2010 11:02 am

I think so (I tried rendering, but now that you mention that I'm not sure which binary actually is being used), I cleaned out the build directory and am re-trying the build again to make sure it works (it does use the rebuild option so I thought this already was taken care of).
helloworld922
 
Posts: 57
Joined: Sat Jul 10, 2010 12:21 pm

Re: Potential fix for command-line builds (windows)

Postby helloworld922 » Sat Sep 18, 2010 11:43 am

hmm, so I did a fresh re-build and for some reason it built everything as a static library (luxrender.lib, luxconsole.lib, etc). I'll try to figure out why it's doing this and re-try to make sure it works.
helloworld922
 
Posts: 57
Joined: Sat Jul 10, 2010 12:21 pm

Re: Potential fix for command-line builds (windows)

Postby dougal2 » Sat Sep 18, 2010 12:01 pm

helloworld922 wrote:hmm, so I did a fresh re-build and for some reason it built everything as a static library (luxrender.lib, luxconsole.lib, etc). I'll try to figure out why it's doing this and re-try to make sure it works.


You should end up with .exe, .lib and .exp files for each binary produced - the problem is not that you've got a .lib it is that you've not got a .exe
User avatar
dougal2
Developer
 
Posts: 3075
Joined: Mon Jan 14, 2008 7:21 am


Return to Compilation & Portability

Who is online

Users browsing this forum: No registered users and 2 guests