Difference between revisions of "User:Jodiah Jensen"
m (tagging as a viewer compile info page (i.e. Category:Compiling viewer)) |
|||
(44 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
= HOW I COMPILED SL SOURCE w/ VC++ 2008 Express Edition = | |||
CAVEAT: although I was able to successfully build the source using these steps, it hangs after loading the settings | CAVEAT: although I was able to successfully build the source using these steps, it hangs after loading the settings | ||
Line 7: | Line 7: | ||
== '''ASSUMPTIONS:''' == | == '''ASSUMPTIONS:''' == | ||
Source version 1 | Source version 1-21-r99587 (viewer version 1.21.6.0) | ||
Windows 32bit OS | Windows 32bit OS (I use WindowsXP 32bit) | ||
== '''REQUIREMENTS:''' == | |||
== '''REQUIREMENTS''' == | |||
*Cygwin (make sure that patchutils, flex and bison (all under "devel") are installed) http://www.cygwin.com/ | *Cygwin (make sure that patchutils, flex and bison (all under "devel") are installed) http://www.cygwin.com/ | ||
*Python (the cmake scripts specifically EXCLUDE the cygwin version of the Python interpreter, in the Python.cmake script, see step 3 below) IMPORTANT: DO NOT rely on the Cygwin version of Python. | *Python http://www.python.org/download/ (the cmake scripts specifically EXCLUDE the cygwin version of the Python interpreter, in the Python.cmake script, see step 3 below) '''IMPORTANT:''' DO NOT rely on the Cygwin version of Python. | ||
Get | * The Windows Platform SDK. Get the latest version (as of 29 Oct 2008) here: [http://www.microsoft.com/downloads/details.aspx?FamilyID=F26B1AA4-741A-433A-9BE5-FA919850BDBF&displaylang=en Windows SDK for Windows Server 2008 and .NET Framework 3.5] | ||
Get DirectX SDK November 2007 from Microsoft -- '''Warning 400MB+''' http://www.microsoft.com/downloads/details.aspx?FamilyId=4B78A58A-E672-4B83-A28E-72B5E93BD60A&displaylang=en | Get DirectX SDK November 2007 from Microsoft -- '''Warning 400MB+''' http://www.microsoft.com/downloads/details.aspx?FamilyId=4B78A58A-E672-4B83-A28E-72B5E93BD60A&displaylang=en | ||
NOTE: Thanks Lear (I missed this one), the DirectX SDK is required, however, This is a REALLY old version of the DirectX SDK. Since this is a page of how *I* compiled the source successfully, I should mention here that I use the August 2008 version of the DirectX SDK and it works fine. | NOTE: Thanks [[User:Lear_Cale Lear Cale|Lear Cale]] (I missed this one), the DirectX SDK is required, however, This is a REALLY old version of the DirectX SDK. Since this is a page of how *I* compiled the source successfully, I should mention here that I use the August 2008 version of the DirectX SDK and it works fine. | ||
You can get the August 2008 version at this link: [http://www.microsoft.com/downloads/details.aspx?FamilyID=ea4894b5-e98d-44f6-842d-e32147237638&DisplayLang=en DirectX SDK - (August 2008)] | |||
I assume the Nov 2007 link is for the OLDEST SDK you can get away with (in case you do not WANT to update to August 2008, or can't for some reason). It is important to mention that updating the SDK will also update your DirectX runtimes. | |||
== '''OPTIONAL:'''== | |||
* If applicable/desired, [http://developer.apple.com/quicktime/download/ Quicktime SDK for Windows] installed | |||
== ''' | == '''PREPARATION:''' == | ||
'''SETUP CMAKE:''' | '''SETUP CMAKE:''' | ||
IMPORTANT: DO NOT use the Cygwin version of CMake, as it does not support VS and <code>'develop.py'</code> will fail. | IMPORTANT: DO NOT use the Cygwin version of CMake, as it does not support VS and <code>'develop.py'</code> will fail (probably with the error '''''"could not create named generator"'''''). | ||
*Download CMAKE 2.4.8 from http://www.cmake.org/files/v2.4/cmake-2.4.8-win32-x86.exe (this is the version I used in this document) | |||
:* or The latest version [http://www.cmake.org/HTML/Download.html download CMake] (as of this writing, the latest version is 2.6.2). | |||
:'''NOTE:''' according to [[CMake#Performing_A_Build_With_Cmake|Performing a Build with Cmake]](posted by [[User:Rob_Linden|Rob Linden]]) ''"There are many known issues with CMake 2.6.0 and 2.6.1 in conjunction with building the Second Life viewer. CMake 2.4.8 is supported, as well as 2.6.2 and beyond."'' | |||
*Install CMAKE | |||
*Make sure both CMake and Python are in the windows PATH environment variable | |||
'''SETUP FMOD:''' | |||
* [http://www.fmod.org/index.php/download#FMOD3ProgrammersAPI Fmod 3.75] (''not'' 4.x), and its source files. (these will be copied to the correct locations in STEP 4 below. (see the Fmod sections of [[Compiling_the_viewer_(Linux)#FMOD_.28audio.29|Linux]], [[Compiling the viewer (Mac OS X)#Fmod|Mac]], [[Compiling the viewer (MSVS2005)#Fmod|Windows]]) ) | |||
*:(Fmod is the only bit of manual copying needed as of late July 2008; later, this could become automated.) | |||
== '''STEP 1''' == | == '''STEP 1 - Downloading the source code''' == | ||
DOWNLOAD SOURCE: | *DOWNLOAD SOURCE: | ||
http://secondlife.com/developers/opensource/downloads/2008/10/slviewer-src-viewer_1-21-r99587.zip | http://secondlife.com/developers/opensource/downloads/2008/10/slviewer-src-viewer_1-21-r99587.zip | ||
DOWNLOAD LIBS | *DOWNLOAD LIBS | ||
http://secondlife.com/developers/opensource/downloads/2008/10/slviewer-win32-libs-viewer_1-21-r99587.zip | http://secondlife.com/developers/opensource/downloads/2008/10/slviewer-win32-libs-viewer_1-21-r99587.zip | ||
DOWNLOAD ARTWORK | *DOWNLOAD ARTWORK | ||
http://secondlife.com/developers/opensource/downloads/2008/10/slviewer-artwork-viewer_1-21-r99587.zip | http://secondlife.com/developers/opensource/downloads/2008/10/slviewer-artwork-viewer_1-21-r99587.zip | ||
NOTE: These are the source files *I* used, there may be newer source files available by the time you read this. This page applies specifically to this version of the source (viewer version 1.21.6) ..._1-21-r99587 | NOTE: These are the source files *I* used, there may be newer source files available by the time you read this. This page applies specifically to this version of the source (viewer version 1.21.6.0) ..._1-21-r99587 | ||
== '''STEP 2''' == | == '''STEP 2''' - Installing the source, libs, and Artwork== | ||
'''EXTRACT ALL THREE ZIP FILES TO SAME PATH (no spaces in the path name) ie "D:\SL_SRC\"''' | '''EXTRACT ALL THREE ZIP FILES TO SAME PATH (no spaces in the path name) ie "D:\SL_SRC\"''' | ||
Line 59: | Line 72: | ||
TODO: insert directory tree here | TODO: insert directory tree here | ||
== '''STEP 3''' == | == '''STEP 3''' - Setting up your development directory tree using develop.py== | ||
'''RUN develop.py SCRIPT''' | '''RUN develop.py SCRIPT''' | ||
run a command prompt in the "D:\SL_SRC\linden\indra" path | *run a command prompt in the "D:\SL_SRC\linden\indra" path | ||
run the script using "develop.py -G VC90" | *run the script using "develop.py -G VC90" (this is for VS C++ 2008) | ||
:* This will configure a "non-standalone" source code tree, which means that the required third party library packages (as built by Linden Lab) will be downloaded during the CMake process. | |||
:* TODO: building a standalone version of the source tree. | |||
NOTE: to get the develop.py script to find the python interpreter when using Python 2.6, I needed to modify the D:\SL_SRC\linden\indra\cmake\Python.cmake file as follows: | NOTE: to get the develop.py script to find the python interpreter when using Python 2.6, I needed to modify the D:\SL_SRC\linden\indra\cmake\Python.cmake file as follows: | ||
Line 78: | Line 94: | ||
) | ) | ||
NOTE: Thanks to [ | NOTE: Thanks to [[User:Lear_Cale Lear Cale|Lear Cale]] for the above code. I originally tried this code, but for some reason when I installed Python 2.6, it failed to create the InstallPath key. So, I manually inserted the path to my python.exe in the Python.cmake file. This worked fine. However, after seeing Lear Cale's modification to my page, I decided to re-install Python and check again. It seems to work now, as the proper keys were created in the registry this time. IF you try this method and are still getting '''''"CMake Error: No Python interpreter found"''''' error, try uninstalling then re-installing Python 2.6. | ||
If all else fails, here is the way I ORIGINALLY solved the problem: | If all else fails, here is the way I ORIGINALLY solved the problem: | ||
Line 93: | Line 109: | ||
) | ) | ||
'''NOTE:''' | |||
:Hi Jodiah, I did see that, and thanks! In fact, after reading your page, I saw your Python 2.6 tweak, and nudged the dev team to pick up the change, so that it should work in the future without needing that edit (it'll be in the next trunk rev, and will show up in roughly the 1.23 timeframe). -- [[User:Rob Linden|Rob Linden]] 16:23, 29 October 2008 (UTC) | |||
'''UPDATE NOTE: as of version 1-22-11, the above change has been made to the distributed 'python.cmake' file and no longer needs to be done manually.''' | |||
'''OUTPUT from develop.py''': | '''OUTPUT from develop.py''': | ||
Line 114: | Line 134: | ||
NOTE: this appears to be a problem with using VStool with the express version of VC++, I had to manually set the Startup Project, Build Type, and Working directory (see step 5) | NOTE: this appears to be a problem with using VStool with the express version of VC++, I had to manually set the Startup Project, Build Type, and Working directory (see step 5) | ||
== '''STEP 4''' == | == '''STEP 4''' - Setting up FMOD == | ||
'''place FMOD files in proper places''' | '''place FMOD files in proper places''' | ||
Copy "fmodapi375win\api\inc\fmod.h" to "linden\libraries\include" | *Copy "fmodapi375win\api\inc\fmod.h" to "linden\libraries\include" | ||
Copy "fmodapi375win\api\inc\fmod_errors.h" to "linden\libraries\include" | *Copy "fmodapi375win\api\inc\fmod_errors.h" to "linden\libraries\include" | ||
Copy "fmodapi375win\api\lib\fmodvc.lib" to "linden\libraries\i686-win32\lib\release" and to "linden\libraries\i686-win32\lib\debug" | *Copy "fmodapi375win\api\lib\fmodvc.lib" to "linden\libraries\i686-win32\lib\release" and to "linden\libraries\i686-win32\lib\debug" | ||
Copy "fmodapi375win\api\fmod.dll" to "linden\indra\newview" | *Copy "fmodapi375win\api\fmod.dll" to "linden\indra\newview" | ||
== '''STEP 5''' == | == '''STEP 5''' - Setting up Visual Studio and compiling the source code== | ||
OPEN D:\SL_SRC\linden\indra\build-VC90\secondlife.sln in VC++ | OPEN D:\SL_SRC\linden\indra\build-VC90\secondlife.sln in VC++ | ||
set 'secondlife-bin' (in Solution Explorer) as Startup Project | *set 'secondlife-bin' (in Solution Explorer) as Startup Project | ||
set the working directory to 'D:\SL_SRC\linden\indra\newview' (select secondlife-bin and use Project > Properties > Configuration Properties > Debugging) | *set the working directory to 'D:\SL_SRC\linden\indra\newview' (select secondlife-bin and use Project > Properties > Configuration Properties > Debugging) | ||
select build type 'RelWithDebInfo' (in the dropdown to the right of the green arrow on the toolbar) | *select build type 'RelWithDebInfo' (in the dropdown to the right of the green arrow on the toolbar) | ||
Remove the llkdu.dll.rule entries (three of them) from the copy_win_libs project CMake Rules folder (per the notes from Cristopher Omega at | *Remove the llkdu.dll.rule entries (three of them) from the copy_win_libs project CMake Rules folder (per the notes from [[User:Cristopher Omega|Christopher Omega]] at [[CMake#CMake_and_Visual_Studio_C.2B.2B_2005_Express_Edition|CMake and Visual Studio C++ 2005 Express Edition]] ) | ||
click the green arrow (start debugging) | *click the green arrow (start debugging) | ||
(thanks to [ | (thanks to [[User:Lear_Cale Lear Cale|Lear Cale]] for cleaning up this section and clarifying a few things) | ||
== POST MORTEM: == | == POST MORTEM: == | ||
Build was successful, but the executable doesn't run properly, it hangs , looping through code in the XTREE source file. I suspect this is due to problems with the BOOST libraries and using the 2008 version of VC++ (see Michelle Zenovka's page https:// | Build was successful, but the executable doesn't run properly, it hangs , looping through code in the XTREE source file. I suspect this is due to problems with the BOOST libraries and using the 2008 version of VC++ (see Michelle Zenovka's page, [[User:Michelle2_Zenovka/cmake#boost_hell|Boost Hell]]). | ||
* The boost problem is being worked on. Look here for updates: [https://jira.secondlife.com/browse/VWR-9541 VWR-9541] | |||
== COMMON PROBLEMS == | |||
TODO: | |||
== REFERENCES == | == REFERENCES == | ||
Line 156: | Line 178: | ||
https://wiki.secondlife.com/wiki/User:Michelle2_Zenovka/cmake | https://wiki.secondlife.com/wiki/User:Michelle2_Zenovka/cmake | ||
= UPDATING BOOST LIBRARIES TO WORK WITH VS2008 = | |||
== OVERVIEW: == | |||
This is a synopsis of *MY* workaround for this problem. I admit it feels a bit kludgy, but, it worked for me. If you find you have a better method, this method doesn't work for you, or you spot a glaring error: please make your changes/suggestions in the form of comments, or on the discussion page, thank you. Please "sign" your comments. | |||
As of version 1.21-r99587 of the SL Viewer source code, the included boost libraries are for boost v1.34.1 . This is the version I compiled for VS2008 (--toolset=msvc-9.0 for bjam) | |||
There appear to be issues with getting the viewer to compile and run (using the distributed boost packages) with VS 2008. | |||
This problem is referred to as "Boost Hell" by [[User:Michelle2 Zenovka|Michelle2 Zenovka]] here: [https://wiki.secondlife.com/wiki/User:Michelle2_Zenovka/cmake#Boost_Hell Boost Hell] | |||
* The boost problem is being worked on, and should be resolved in 1-22. Look here for updates: [https://jira.secondlife.com/browse/VWR-9541 VWR-9541] | |||
== CAVEATS: == | |||
*Although the steps will be similar for later versions of the boost libraries, I have only tested this procedure for version 1.34.1 | |||
*Even though the VC90 versions of the .lib files are in the right places, and are being linked in, VS is still linking in the VC80 versions of the libraries as well. If I remove either set of .libs from the \linden\libraries\i686-win32\lib\debug or \linden\libraries\i686-win32\lib\release directories, the build will fail to run. I haven't quite worked this out yet. Possibly a CMake issue, I haven't worked much with CMake and I may be missing something. | |||
== PREPARATION: == | |||
* You will need to run develop.py at least once before updating boost and installing the new libraries, as this will create the target directories for your new boost libs, and as of this writing, the vc80 versions of the libs are still required in addition to the vc90 .libs we will be building here. | |||
== STEP 1 - Downloading the boost source code == | |||
* get the source code for your desired version of the boost libraries from here: [http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=8041 Boost Downloads] | |||
::'''NOTE:'''This document is written to cover the 1.34.1 version of the boost libraries | |||
== STEP 2 - Building the required boost libraries == | |||
NOTE: Most of the boost libraries are "header only" libraries, and only require placement of the appropriate header files in their proper places in your source tree. There are however 4 libraries that require building as .lib binary files for use with the SL source code: (see here for more info: [http://www.boost.org/doc/libs/1_36_0/more/getting_started/windows.html#id28 Header-only Libraries]) | |||
::*libboost-program_options (Boost.ProgramOptions) | |||
::*libboost-python (Boost.Python) | |||
::*libboost-regex (Boost.Regex) | |||
::*libboost-signals (Boost.Signals) | |||
After downloading the boost source: | |||
(the following text is taken from [[Compiling_the_viewer_libraries_%28MSVS_2003%29#Boost|Compiling the viewer libraries(MSVS2003) - Boost]] and modified here as it applies to MSVC 2008 (aka VC90).) | |||
---- | |||
:NOTE: the Boost Wiki says to use the Visual Studio command prompt instead of the regular command prompt for the following steps: | |||
* cd to "boost_1_34_1\tools\jam\" | |||
* Run "boost_1_34_1\tools\jam\build_dist.bat". | |||
* Copy "boost_1_34_1\tools\jam\src\bin.ntx86\bjam.exe" to "boost_1_34_1\". [NOTE: found in stage directory, not src, in Boost 1.35.0 and later] | |||
** For Boost 1.39, bjam is placed at "...\boost_1_39_0\tools\jam\stage\boost-jam-3.1.17-1-ntx86" (thanks to [[User:Geneko Nemeth|Geneko Nemeth]] for this ) | |||
* Using the command prompt, build the static libraries: | |||
** cd boost_1_34_1 | |||
** set PYTHON_ROOT=C:\Python26 | |||
***the path to your Python root may be different. | |||
** set PYTHON_VERSION=2.6 | |||
*** you may be using a different version of Python. | |||
** Run the command: | |||
:<code>''bjam --toolset=msvc-9.0 --with-python --with-program_options --with-regex --with-signals --build-type=complete link=static stage''</code> | |||
---- | |||
for more info on building boost with bjam on windows: [http://www.boost.org/doc/libs/1_36_0/more/getting_started/windows.html#id39 Invoke bjam] | |||
== STEP 3 - Placing new libs where they belong == | |||
* Copy the "\boost_1_34_1\boost" folder to "\linden\libraries\include\". (these are the header files for the boost libraries) | |||
*copy the following files from "boost_1_34_1\stage\lib\" to "\linden\libraries\i686-win32\lib\release\" | |||
**libboost_program_options-vc90-mt-s-1_34_1.lib | |||
**libboost_python-vc90-mt-s-1_34_1.lib | |||
**libboost_regex-vc90-mt-s-1_34_1.lib | |||
**libboost_signals-vc90-mt-s-1_34_1.lib | |||
*copy the following files from "boost_1_34_1\stage\lib\" to "\linden\libraries\i686-win32\lib\debug\" | |||
**libboost_program_options-vc90-mt-sgd-1_34_1.lib | |||
**libboost_python-vc90-mt-sgd-1_34_1.lib | |||
**libboost_regex-vc90-mt-sgd-1_34_1.lib | |||
**libboost_signals-vc90-mt-sgd-1_34_1.lib | |||
== STEP 4 - Add link dependencies to the Secondlife-bin project == | |||
*In Solution explorer, highlight the secondlife-bin project and right-click | |||
*select 'Properties' at bottom of menu | |||
*In the left pane of the Property Pages dialog, go to Configuration Properties > Linker > Input | |||
*In the 'Additional Dependencies' field, find: | |||
**libboost_program_options-vc80-mt-s-1_34_1.lib | |||
**libboost_regex-vc80-mt-s-1_34_1.lib | |||
**libboost_signals-vc80-mt-s-1_34_1.lib | |||
* change vc80 to vc90 like so: | |||
**libboost_program_options-vc90-mt-s-1_34_1.lib | |||
**libboost_regex-vc90-mt-s-1_34_1.lib | |||
**libboost_signals-vc90-mt-s-1_34_1.lib | |||
* click OK to close the Property Pages dialog. | |||
== POST MORTEM: == | |||
You should now be able to compile and run 1.21-r99587 source code using the steps found here: | |||
[https://wiki.secondlife.com/wiki/User:Jodiah_Jensen#HOW_I_COMPILED_SL_SOURCE_w.2F_VC.2B.2B_2008_Express_Edition How I compiled SL SOURCE w/ VC++ 2008 Express Edition] | |||
:'''NOTE:''' You may see a lot of "Unknown compiler version" warnings when building the solution, but it should compile and run just fine. | |||
== REFERENCES == | |||
https://wiki.secondlife.com/wiki/Compiling_the_viewer_libraries_%28MSVS_2003%29#Boost | |||
[[Category:Compiling viewer]] |
Latest revision as of 13:19, 20 May 2010
HOW I COMPILED SL SOURCE w/ VC++ 2008 Express Edition
CAVEAT: although I was able to successfully build the source using these steps, it hangs after loading the settings
This is a synopsis of how *I* successfully compiled the source. It worked for me, but if you find you have a better method, this method doesn't work for you, or you spot a glaring error: please make your changes/suggestions in the form of comments, or on the discussion page, thank you. Please "sign" your comments.
ASSUMPTIONS:
Source version 1-21-r99587 (viewer version 1.21.6.0)
Windows 32bit OS (I use WindowsXP 32bit)
REQUIREMENTS:
- Cygwin (make sure that patchutils, flex and bison (all under "devel") are installed) http://www.cygwin.com/
- Python http://www.python.org/download/ (the cmake scripts specifically EXCLUDE the cygwin version of the Python interpreter, in the Python.cmake script, see step 3 below) IMPORTANT: DO NOT rely on the Cygwin version of Python.
- The Windows Platform SDK. Get the latest version (as of 29 Oct 2008) here: Windows SDK for Windows Server 2008 and .NET Framework 3.5
Get DirectX SDK November 2007 from Microsoft -- Warning 400MB+ http://www.microsoft.com/downloads/details.aspx?FamilyId=4B78A58A-E672-4B83-A28E-72B5E93BD60A&displaylang=en
NOTE: Thanks Lear Cale (I missed this one), the DirectX SDK is required, however, This is a REALLY old version of the DirectX SDK. Since this is a page of how *I* compiled the source successfully, I should mention here that I use the August 2008 version of the DirectX SDK and it works fine.
You can get the August 2008 version at this link: DirectX SDK - (August 2008)
I assume the Nov 2007 link is for the OLDEST SDK you can get away with (in case you do not WANT to update to August 2008, or can't for some reason). It is important to mention that updating the SDK will also update your DirectX runtimes.
OPTIONAL:
- If applicable/desired, Quicktime SDK for Windows installed
PREPARATION:
SETUP CMAKE:
IMPORTANT: DO NOT use the Cygwin version of CMake, as it does not support VS and 'develop.py'
will fail (probably with the error "could not create named generator").
- Download CMAKE 2.4.8 from http://www.cmake.org/files/v2.4/cmake-2.4.8-win32-x86.exe (this is the version I used in this document)
- or The latest version download CMake (as of this writing, the latest version is 2.6.2).
- NOTE: according to Performing a Build with Cmake(posted by Rob Linden) "There are many known issues with CMake 2.6.0 and 2.6.1 in conjunction with building the Second Life viewer. CMake 2.4.8 is supported, as well as 2.6.2 and beyond."
- Install CMAKE
- Make sure both CMake and Python are in the windows PATH environment variable
SETUP FMOD:
- Fmod 3.75 (not 4.x), and its source files. (these will be copied to the correct locations in STEP 4 below. (see the Fmod sections of Linux, Mac, Windows) )
- (Fmod is the only bit of manual copying needed as of late July 2008; later, this could become automated.)
STEP 1 - Downloading the source code
- DOWNLOAD SOURCE:
http://secondlife.com/developers/opensource/downloads/2008/10/slviewer-src-viewer_1-21-r99587.zip
- DOWNLOAD LIBS
- DOWNLOAD ARTWORK
NOTE: These are the source files *I* used, there may be newer source files available by the time you read this. This page applies specifically to this version of the source (viewer version 1.21.6.0) ..._1-21-r99587
STEP 2 - Installing the source, libs, and Artwork
EXTRACT ALL THREE ZIP FILES TO SAME PATH (no spaces in the path name) ie "D:\SL_SRC\"
this will result in a single folder inside D:\SL_SRC\ called "linden" ("D:\SL_SRC\linden")
TODO: insert directory tree here
STEP 3 - Setting up your development directory tree using develop.py
RUN develop.py SCRIPT
- run a command prompt in the "D:\SL_SRC\linden\indra" path
- run the script using "develop.py -G VC90" (this is for VS C++ 2008)
- This will configure a "non-standalone" source code tree, which means that the required third party library packages (as built by Linden Lab) will be downloaded during the CMake process.
- TODO: building a standalone version of the source tree.
NOTE: to get the develop.py script to find the python interpreter when using Python 2.6, I needed to modify the D:\SL_SRC\linden\indra\cmake\Python.cmake file as follows:
find_program(PYTHON_EXECUTABLE NAMES python25.exe python23.exe python.exe NO_DEFAULT_PATH # added so that cmake does not find cygwin python PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.6\\InstallPath] #<-- add this line [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath] )
NOTE: Thanks to Lear Cale for the above code. I originally tried this code, but for some reason when I installed Python 2.6, it failed to create the InstallPath key. So, I manually inserted the path to my python.exe in the Python.cmake file. This worked fine. However, after seeing Lear Cale's modification to my page, I decided to re-install Python and check again. It seems to work now, as the proper keys were created in the registry this time. IF you try this method and are still getting "CMake Error: No Python interpreter found" error, try uninstalling then re-installing Python 2.6.
If all else fails, here is the way I ORIGINALLY solved the problem:
find_program(PYTHON_EXECUTABLE
NAMES python25.exe python23.exe python.exe
NO_DEFAULT_PATH # added so that cmake does not find cygwin python
PATHS
C:\\Python26\\ #this is the path to 'python.exe'
on MY system,
#replace the drive letter and path with your own, make sure to use the \\ rather than \
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]
)
NOTE:
- Hi Jodiah, I did see that, and thanks! In fact, after reading your page, I saw your Python 2.6 tweak, and nudged the dev team to pick up the change, so that it should work in the future without needing that edit (it'll be in the next trunk rev, and will show up in roughly the 1.23 timeframe). -- Rob Linden 16:23, 29 October 2008 (UTC)
UPDATE NOTE: as of version 1-22-11, the above change has been made to the distributed 'python.cmake' file and no longer needs to be done manually.
OUTPUT from develop.py:
... ... -- Version of viewer is 1.21.6.0 -- Configuring done -- Generating done -- Build files have been written to: D:/SL_SRC/linden/indra/build-VC90 Running 'tools\\vstool\\VSTool.exe --solution build-VC90\\SecondLife.sln --config RelWithDebInfo --startup secondlife-bin' in 'D:\\SL_SRC\\linden\\indra' Editing solution: build-VC90\SecondLife.sln Looking for existing VisualStudio instance... Didn't find open solution, starting new background VisualStudio instance... Reading .sln file version... Using version: VC90... Value cannot be null. Parameter name: type Quitting do to error opening: D:\SL_SRC\linden\indra\build-VC90\SecondLife.sln
NOTE: this appears to be a problem with using VStool with the express version of VC++, I had to manually set the Startup Project, Build Type, and Working directory (see step 5)
STEP 4 - Setting up FMOD
place FMOD files in proper places
- Copy "fmodapi375win\api\inc\fmod.h" to "linden\libraries\include"
- Copy "fmodapi375win\api\inc\fmod_errors.h" to "linden\libraries\include"
- Copy "fmodapi375win\api\lib\fmodvc.lib" to "linden\libraries\i686-win32\lib\release" and to "linden\libraries\i686-win32\lib\debug"
- Copy "fmodapi375win\api\fmod.dll" to "linden\indra\newview"
STEP 5 - Setting up Visual Studio and compiling the source code
OPEN D:\SL_SRC\linden\indra\build-VC90\secondlife.sln in VC++
- set 'secondlife-bin' (in Solution Explorer) as Startup Project
- set the working directory to 'D:\SL_SRC\linden\indra\newview' (select secondlife-bin and use Project > Properties > Configuration Properties > Debugging)
- select build type 'RelWithDebInfo' (in the dropdown to the right of the green arrow on the toolbar)
- Remove the llkdu.dll.rule entries (three of them) from the copy_win_libs project CMake Rules folder (per the notes from Christopher Omega at CMake and Visual Studio C++ 2005 Express Edition )
- click the green arrow (start debugging)
(thanks to Lear Cale for cleaning up this section and clarifying a few things)
POST MORTEM:
Build was successful, but the executable doesn't run properly, it hangs , looping through code in the XTREE source file. I suspect this is due to problems with the BOOST libraries and using the 2008 version of VC++ (see Michelle Zenovka's page, Boost Hell).
- The boost problem is being worked on. Look here for updates: VWR-9541
COMMON PROBLEMS
TODO:
REFERENCES
https://wiki.secondlife.com/wiki/CMake
https://wiki.secondlife.com/wiki/Talk:CMake
https://wiki.secondlife.com/wiki/Compiling_the_viewer
https://wiki.secondlife.com/wiki/User:Michelle2_Zenovka/cmake
UPDATING BOOST LIBRARIES TO WORK WITH VS2008
OVERVIEW:
This is a synopsis of *MY* workaround for this problem. I admit it feels a bit kludgy, but, it worked for me. If you find you have a better method, this method doesn't work for you, or you spot a glaring error: please make your changes/suggestions in the form of comments, or on the discussion page, thank you. Please "sign" your comments.
As of version 1.21-r99587 of the SL Viewer source code, the included boost libraries are for boost v1.34.1 . This is the version I compiled for VS2008 (--toolset=msvc-9.0 for bjam)
There appear to be issues with getting the viewer to compile and run (using the distributed boost packages) with VS 2008. This problem is referred to as "Boost Hell" by Michelle2 Zenovka here: Boost Hell
- The boost problem is being worked on, and should be resolved in 1-22. Look here for updates: VWR-9541
CAVEATS:
- Although the steps will be similar for later versions of the boost libraries, I have only tested this procedure for version 1.34.1
- Even though the VC90 versions of the .lib files are in the right places, and are being linked in, VS is still linking in the VC80 versions of the libraries as well. If I remove either set of .libs from the \linden\libraries\i686-win32\lib\debug or \linden\libraries\i686-win32\lib\release directories, the build will fail to run. I haven't quite worked this out yet. Possibly a CMake issue, I haven't worked much with CMake and I may be missing something.
PREPARATION:
- You will need to run develop.py at least once before updating boost and installing the new libraries, as this will create the target directories for your new boost libs, and as of this writing, the vc80 versions of the libs are still required in addition to the vc90 .libs we will be building here.
STEP 1 - Downloading the boost source code
- get the source code for your desired version of the boost libraries from here: Boost Downloads
- NOTE:This document is written to cover the 1.34.1 version of the boost libraries
STEP 2 - Building the required boost libraries
NOTE: Most of the boost libraries are "header only" libraries, and only require placement of the appropriate header files in their proper places in your source tree. There are however 4 libraries that require building as .lib binary files for use with the SL source code: (see here for more info: Header-only Libraries)
- libboost-program_options (Boost.ProgramOptions)
- libboost-python (Boost.Python)
- libboost-regex (Boost.Regex)
- libboost-signals (Boost.Signals)
After downloading the boost source:
(the following text is taken from Compiling the viewer libraries(MSVS2003) - Boost and modified here as it applies to MSVC 2008 (aka VC90).)
- NOTE: the Boost Wiki says to use the Visual Studio command prompt instead of the regular command prompt for the following steps:
- cd to "boost_1_34_1\tools\jam\"
- Run "boost_1_34_1\tools\jam\build_dist.bat".
- Copy "boost_1_34_1\tools\jam\src\bin.ntx86\bjam.exe" to "boost_1_34_1\". [NOTE: found in stage directory, not src, in Boost 1.35.0 and later]
- For Boost 1.39, bjam is placed at "...\boost_1_39_0\tools\jam\stage\boost-jam-3.1.17-1-ntx86" (thanks to Geneko Nemeth for this )
- Using the command prompt, build the static libraries:
- cd boost_1_34_1
- set PYTHON_ROOT=C:\Python26
- the path to your Python root may be different.
- set PYTHON_VERSION=2.6
- you may be using a different version of Python.
- Run the command:
bjam --toolset=msvc-9.0 --with-python --with-program_options --with-regex --with-signals --build-type=complete link=static stage
for more info on building boost with bjam on windows: Invoke bjam
STEP 3 - Placing new libs where they belong
- Copy the "\boost_1_34_1\boost" folder to "\linden\libraries\include\". (these are the header files for the boost libraries)
- copy the following files from "boost_1_34_1\stage\lib\" to "\linden\libraries\i686-win32\lib\release\"
- libboost_program_options-vc90-mt-s-1_34_1.lib
- libboost_python-vc90-mt-s-1_34_1.lib
- libboost_regex-vc90-mt-s-1_34_1.lib
- libboost_signals-vc90-mt-s-1_34_1.lib
- copy the following files from "boost_1_34_1\stage\lib\" to "\linden\libraries\i686-win32\lib\debug\"
- libboost_program_options-vc90-mt-sgd-1_34_1.lib
- libboost_python-vc90-mt-sgd-1_34_1.lib
- libboost_regex-vc90-mt-sgd-1_34_1.lib
- libboost_signals-vc90-mt-sgd-1_34_1.lib
STEP 4 - Add link dependencies to the Secondlife-bin project
- In Solution explorer, highlight the secondlife-bin project and right-click
- select 'Properties' at bottom of menu
- In the left pane of the Property Pages dialog, go to Configuration Properties > Linker > Input
- In the 'Additional Dependencies' field, find:
- libboost_program_options-vc80-mt-s-1_34_1.lib
- libboost_regex-vc80-mt-s-1_34_1.lib
- libboost_signals-vc80-mt-s-1_34_1.lib
- change vc80 to vc90 like so:
- libboost_program_options-vc90-mt-s-1_34_1.lib
- libboost_regex-vc90-mt-s-1_34_1.lib
- libboost_signals-vc90-mt-s-1_34_1.lib
- click OK to close the Property Pages dialog.
POST MORTEM:
You should now be able to compile and run 1.21-r99587 source code using the steps found here: How I compiled SL SOURCE w/ VC++ 2008 Express Edition
- NOTE: You may see a lot of "Unknown compiler version" warnings when building the solution, but it should compile and run just fine.
REFERENCES
https://wiki.secondlife.com/wiki/Compiling_the_viewer_libraries_%28MSVS_2003%29#Boost