Difference between revisions of "Documentation/Nightly/Developers/Build Instructions"

From Slicer Wiki
Jump to: navigation, search
(Moved to readthedocs)
Tags: 2017 source edit, Replaced
 
(46 intermediate revisions by 10 users not shown)
Line 1: Line 1:
{{:{{FULLPAGENAME}}/Prerequisites}}
+
{{documentation/banner
 
+
| text = [https://slicer.readthedocs.io/en/latest/developer_guide/build_instructions/index.html This page has been moved to read-the-docs.]
<br><br><br><br>
+
| background-color = 8FBC8F }}
 
 
{{:{{FULLPAGENAME}}/CheckoutSourceCode}}
 
 
 
<br><br><br><br>
 
 
 
{{:{{FULLPAGENAME}}/Configure}}
 
 
 
<br><br><br><br>
 
 
 
{{:{{FULLPAGENAME}}/Compile}}
 
 
 
<br><br><br><br>
 
 
 
== RUN Slicer ==
 
=== Per-platform instructions===
 
==== Windows ====
 
 
 
Run <code>Slicer4-SuperBuild/Slicer-build/Slicer.exe</code>
 
 
 
==== Unix-like ====
 
 
 
Run <code>Slicer4-SuperBuild/Slicer-build/Slicer</code>
 
 
 
<br><br><br><br>
 
 
 
== DEBUG Slicer ==
 
=== Per-platform instructions===
 
==== Windows ====
 
* Make sure you build Slicer using the '''Debug''' configuration.
 
* Open a windows terminal <code>cmd.exe</code>
 
* Execute the following command:
 
  cd \path\to\Slicer4-SuperBuild\Slicer-build
 
  Slicer.exe --VisualStudio Slicer.sln
 
 
 
==== Unix-like ====
 
NA
 
 
 
<br><br><br><br>
 
 
 
== Common errors ==
 
=== A tool returned an error code from "Generating vtksysProcessFwd9xEnc.c" ===
 
  The application has failed to start because its side-by-side configuration is incorrect.
 
Please see the application event log or use the command-line sxstrace.exe tool for more detail.
 
Project : error PRJ0019: A tool returned an error code from "Generating
 
vtksysProcessFwd9xEnc.c"
 
Install [[Documentation/{{documentation/version}}/Developers/Build_Instructions/Prerequisites#Windows|SP1 of Visual Studio]]
 
 
 
=== error: ‘class QList<QString>’ has no member named ‘reserve’ ===
 
/nfs/Users/blowekamp/QtSDK/Desktop/Qt/474/gcc/include/QtCore/qdatastream.h: In function ‘QDataStream& operator>>(QDataStream&, QList<T>&) [with T = QString]’:
 
/nfs/Users/blowekamp/QtSDK/Desktop/Qt/474/gcc/include/QtCore/qstringlist.h:247:  instantiated from here
 
/nfs/Users/blowekamp/QtSDK/Desktop/Qt/474/gcc/include/QtCore/qdatastream.h:246: error: ‘class QList<QString>’ has no member named ‘reserve’
 
You have multiple Qt versions installed on your machine. Try removing the Qt version installed on the system.
 
 
 
=== libarchive.so: undefined reference to `SHA256_Update' ===
 
 
 
Linking CXX executable ../../../../../bin/MRMLLogicCxxTests
 
/home/benjaminlong/work/slicer/Slicer4-Superbuild-Debug/LibArchive-install/lib/libarchive.so: undefined reference to `SHA256_Update'
 
/home/benjaminlong/work/slicer/Slicer4-Superbuild-Debug/LibArchive-install/lib/libarchive.so: undefined reference to `SHA256_Final'
 
/home/benjaminlong/work/slicer/Slicer4-Superbuild-Debug/LibArchive-install/lib/libarchive.so: undefined reference to `SHA256_Init'
 
/home/benjaminlong/work/slicer/Slicer4-Superbuild-Debug/LibArchive-install/lib/libarchive.so: undefined reference to `MD5_Init'
 
 
 
Solution:
 
cd Slicer-superbuild
 
rm -rf LibArchive-*
 
make -j4
 
 
 
Details:
 
* http://na-mic.org/Mantis/view.php?id=1616
 
* http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=18923
 
* http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=18969
 
 
 
=== A tool returned an error code from "Performing configure step for ..." ===
 
 
 
CMake has some problems building complex projects on Windows7. See more details in: http://cmake.org/Bug/view.php?id=12957
 
 
 
A fix has been already identified and soon will be available in an official CMake release (probably 2.8.8). Until then this unofficial version can be used (based on CMake-2.8.7): https://qshare.queensu.ca/Users01/lasso/public/cmake-2.8.7.12957-win32-x86.exe
 
 
 
=== A tool returned an error code from "Performing download step (git clone) for ..." ===
 
 
 
CMake has problems cloning git repositories on Windows7. See more details in http://cmake.org/Bug/view.php?id=12564
 
 
 
If you think the described problem is the same as you have, please add your specific error message to the bug report (the more people report the problem the sooner it will be fixed).
 
 
 
=== No rule to make target `/usr/lib/x86_64-linux-gnu/libGL.so' ===
 
See http://techtidings.blogspot.com/2012/01/problem-with-libglso-on-64-bit-ubuntu.html
 
 
 
=== X11 Window errors at start time ===
 
<pre>
 
X Error: BadWindow (invalid Window parameter) 3
 
  Extension:    137 (Uknown extension)
 
  Minor opcode: 4 (Unknown request)
 
  Resource id:  0x4200199
 
X Error: BadWindow (invalid Window parameter) 3
 
  Extension:    137 (Uknown extension)
 
  Minor opcode: 4 (Unknown request)
 
  Resource id:  0x42001a6
 
X Error: BadWindow (invalid Window parameter) 3
 
  Extension:    137 (Uknown extension)
 
  Minor opcode: 4 (Unknown request)
 
  Resource id:  0x42001b3
 
</pre>
 
 
 
Solution:
 
* Reinstall Nvidia drivers (that also rewrite the xorg.conf file).
 
 
 
=== error C2061: syntax error : identifier 'ssize_t' ===
 
<pre>
 
4>1>Compiling...
 
4>1>version.c
 
4>1>c:\chene\winbin64\slicer4\cmcurl\urldata.h(585) : error C2061: syntax error : identifier 'ssize_t'
 
4>1>c:\chene\winbin64\slicer4\cmcurl\urldata.h(593) : error C2365: 'fread' : redefinition; previous definition was 'function'
 
4>1>        C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\stdio.h(248) : see declaration of 'fread'
 
4>1>c:\chene\winbin64\slicer4\cmcurl\urldata.h(610) : error C2059: syntax error : '}'
 
</pre>
 
 
 
Solution:
 
* See [[#A_tool_returned_an_error_code_from_.22Performing_configure_step_for_....22]]
 
 
 
=== ld: framework not found QtWebKit ===
 
 
 
<pre>
 
[...]
 
Linking CXX shared library libPythonQt.dylib
 
ld: framework not found QtWebKit
 
clang: error: linker command failed with exit code 1 (use -v to see invocation)
 
make[8]: *** [libPythonQt.dylib] Error 1
 
[...]
 
</pre>
 
 
 
See Slicer issue [http://na-mic.org/Mantis/view.php?id=2860 #2860]
 
 
 
Workaround:
 
* See http://public.kitware.com/Bug/view.php?id=13765#c31824
 
 
 
Solution:
 
* Use a [http://www.cmake.org/files/dev/?C=M;O=D recent nightly build of CMake]. It includes patch [http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cc676c3a cc676c3a]. Note also that the coming version of CMake 2.8.11 will work as expected.
 
 
 
=== On MacOSX 10.8, CMake hangs forever ===
 
 
 
Issue: http://www.na-mic.org/Bug/view.php?id=2957
 
 
 
Solution: Use CMake build >= 2.8.10.20130220-g53b279. See http://www.cmake.org/files/dev/cmake-2.8.10.20130220-g53b279-Darwin-universal.tar.gz
 
 
 
Details:
 
 
 
CMake folks (Thanks Brad King :)) fixed an issue that was preventing the most recent nightly from being used to successfully compile Slicer. The fix has been tested and is known to work. Tomorrow nightly build of CMake and by extension the coming release of CMake 2.8.11 will work.
 
 
 
If you are curious about the details, check the commit message:
 
 
 
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1df09e57 [^]
 
 
 
The associated CMake test have also been updated:
 
 
 
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bff3d9ce [^]
 
 
 
 
 
<br><br><br><br>
 
 
 
==Platform Notes==
 
 
 
* Linux Ubuntu: if you have odd rendering artifacts, try disabling visual effects (System/Appearance/Visual Effects)
 
* Linux Ubuntu 12.04: if the QtSdk installation hangs, please try [[Documentation/4.1/Developers/Build_Instructions/Prerequisites/Qt/Instal_QtSDK1.2_Offline_Linux_64#Potential_Errors|this solution]]
 
* Windows: If build was OK, but it Slicer doesn't start (gives the error: [bin/Release/SlicerQT-real.exe] exit abnormally - Report the problem.) then one possible root cause is that you have a copy of Python26.dll in your windows system directory (e.g., c:\Windows\System32\python26.dll). The solution is to rename or remove the python dll in the system directory. See more details here: http://www.na-mic.org/Bug/view.php?id=1180
 
 
 
==Quick Build on Debian==
 
sudo aptitude update
 
sudo aptitude install subversion git gcc g++ make cmake-curses-gui libqt4-dev
 
svn co http://svn.slicer.org/Slicer4/trunk Slicer4
 
mkdir Slicer4-SuperBuild-Debug
 
cd Slicer4-SuperBuild-Debug
 
cmake ../Slicer4
 
make -j5
 
 
# runtime dependency:
 
sudo aptitude install python-tk
 

Latest revision as of 19:03, 6 August 2020

Home < Documentation < Nightly < Developers < Build Instructions