|
Tags: 2017 source edit, Replaced |
(5 intermediate revisions by 4 users not shown) |
Line 1: |
Line 1: |
− | <noinclude>{{documentation/versioncheck}}</noinclude>
| + | {{documentation/banner |
− | {{:{{FULLPAGENAME}}/Prerequisites}}
| + | | text = [https://slicer.readthedocs.io/en/latest/developer_guide/build_instructions/index.html This page has been moved to read-the-docs.] |
− | | + | | background-color = 8FBC8F }} |
− | <br><br><br><br>
| |
− | | |
− | {{:{{FULLPAGENAME}}/CheckoutSourceCode}}
| |
− | | |
− | <br><br><br><br>
| |
− | | |
− | {{:{{FULLPAGENAME}}/Configure}}
| |
− | | |
− | <br><br><br><br>
| |
− | | |
− | {{:{{FULLPAGENAME}}/Compile}}
| |
− | | |
− | <br><br><br><br>
| |
− | | |
− | {{:{{FULLPAGENAME}}/Run}}
| |
− | | |
− | <br><br><br><br>
| |
− | | |
− | {{:{{FULLPAGENAME}}/Test}}
| |
− | | |
− | <br><br><br><br>
| |
− | | |
− | {{:{{FULLPAGENAME}}/Package}}
| |
− | | |
− | <!--
| |
− | == DEBUG Slicer ==
| |
− | | |
− | To be able to debug Slicer application, you are expected to build it with Debug symbols in a clean directory.
| |
− | | |
− | {|width = "100%"
| |
− | ! width="50%" style="border-bottom: 1px solid darkgrey;font-size: 75%;"| Linux or MacOSX
| |
− | ! width="50%" style="border-bottom: 1px solid darkgrey;font-size: 75%;"| Windows (Visual Studio)
| |
− | |-
| |
− | | valign="top" |
| |
− | Configure Slicer using <code>-DCMAKE_BUILD_TYPE:STRING=Debug</code>
| |
− | | valign="top" |
| |
− | Selecting <code>Debug</code> configuration in Visual Studio.
| |
− | |}
| |
− | | |
− | {|width = "100%"
| |
− | ! width="50%" style="border-bottom: 1px solid darkgrey;font-size: 75%;"| Linux or MacOSX
| |
− | ! width="50%" style="border-bottom: 1px solid darkgrey;font-size: 75%;"| Windows (Visual Studio)
| |
− | |-
| |
− | | valign="top" |
| |
− | <br>
| |
− | {{wip}} TBD
| |
− | <br>
| |
− | | valign="top" |
| |
− | <ol start="1" style="list-style-type: decimal;">
| |
− | <li>Press "Win-R," type "cmd" and press "Enter" to open a Command Prompt session.</li>
| |
− | <li>
| |
− | <p>Start Visual Studio with Slicer environment:</p>
| |
− | <pre>> cd \path\to\Slicer-SuperBuild\Slicer-build
| |
− | > Slicer.exe --VisualStudio Slicer.sln</pre>
| |
− | </li>
| |
− | </ol>
| |
− | |}
| |
− | | |
− | <br><br><br><br>
| |
− | -->
| |
− | | |
− | == Common errors ==
| |
− | | |
− | === CMake complains during configuration ===
| |
− | CMake may not directly show what's wrong; try to look for log files of the form BUILD/CMakeFiles/*.log (where BUILD is your build directory) to glean further information.
| |
− | | |
− | === 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"
| |
− | '''Suggested solution: [[Documentation/{{documentation/version}}/Developers/Build_Instructions/Prerequisites#Windows|Install SP1 of Visual Studio]]'''
| |
− | | |
− | See also:
| |
− | | |
− | * [http://www.kitware.com/blog/home/post/4|"Deploying on Windows with DLL Manifest Issues"] (Bill Hoffman, Kitware blog).
| |
− | * [https://stackoverflow.com/questions/13217174/how-to-properly-setup-vs2008-for-x64-programing/13222870#13222870| How to create a custom installer to correct a missing WinSXS manifest entry] (StackOverflow).
| |
− | | |
− | === 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/Slicer-SuperBuild-Debug/LibArchive-install/lib/libarchive.so: undefined reference to `SHA256_Update'
| |
− | /home/benjaminlong/work/slicer/Slicer-SuperBuild-Debug/LibArchive-install/lib/libarchive.so: undefined reference to `SHA256_Final'
| |
− | /home/benjaminlong/work/slicer/Slicer-SuperBuild-Debug/LibArchive-install/lib/libarchive.so: undefined reference to `SHA256_Init'
| |
− | /home/benjaminlong/work/slicer/Slicer-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
| |
− | | |
− | === 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>
| |
− | | |
− | === On MacOSX 10.8/10.9 with XQuartz, 'X11/Xlib.h' file not found ===
| |
− | | |
− | Issue: http://www.na-mic.org/Bug/view.php?id=3405
| |
− | | |
− | Workaround: Build with -DSlicer_USE_PYTHONQT_WITH_TCL:BOOL=OFF
| |
− | | |
− | Tcl is required only for EMSegment module.
| |
− | | |
− | Details: See http://www.na-mic.org/Bug/view.php?id=3405
| |
− | <br><br>
| |
− | | |
− | === svn: E175002: Unable to connect to a repository at URL XXX ===
| |
− | | |
− | Issue: Cisco AnyConnect is installed with the "Web Security" option checked (default), which blocks Subversion checkouts even when inactive!
| |
− | | |
− | Solution: Uninstall and reinstall Cisco AnyConnect, deselecting the "Web Security" feature during install
| |
− | | |
− | [[File:CiscoAnyConnectInstallOptions.png]]
| |
− | | |
− | === My antivirus software reports that files in my build directory are infected ===
| |
− | | |
− | Although usually antivirus software does not interfere with the build process, it is recommended to disable antivirus and search indexing for build directories to improve performance and minimize the chance of concurrent file access problems.
| |
− | | |
− | === Visual Studio compiler crashes ===
| |
− | | |
− | * If you use Visual Studio 2008, make sure Visual Studio 2008 service pack 1 is installed
| |
− | * Build Slicer in a short directory, for example source code in C:\S4, binary directory C:\S4D or C:\S4R
| |
− | | |
− | === 'QSslSocket' : is not a class or namespace name ===
| |
− | | |
− | This error message occurs if Slicer is configured to use SSL but Qt is built without SSL support.
| |
− | | |
− | Either set Slicer_USE_PYTHONQT_WITH_OPENSSL to OFF when configuring Slicer build in CMake, or build Qt with SSL support.
| |
− | | |
− | === error: Missing Qt module QTWEBKIT ===
| |
− | | |
− | CMake Error at CMake/SlicerBlockFindQtAndCheckVersion.cmake:43 (message):
| |
− | error: Missing Qt module QTWEBKIT
| |
− | Call Stack (most recent call first):
| |
− | CMake/SlicerBlockFindQtAndCheckVersion.cmake:88 (__SlicerBlockFindQtAndCheckVersion_find_qt)
| |
− | CMakeLists.txt:607 (include)
| |
− | | |
− | Solution:
| |
− | sudo apt-get -y install libqtwebkit-dev
| |
− | | |
− | Details:
| |
− | * http://slicer-devel.65872.n3.nabble.com/Re-slicer-devel-Digest-Vol-143-Issue-39-td4037122.html
| |
− | | |
− | === error when starting Slicer: NameError: name 'getSlicerRCFileName' is not defined ===
| |
− | | |
− | ./Slicer
| |
− | Traceback (most recent call last):
| |
− | File "<string>", line 7, in <module>
| |
− | File "/home/fbudin/Devel/Slicer-SuperBuild-Release/Slicer-build/bin/Python/slicer/slicerqt.py", line 6, in <module>
| |
− | import vtk
| |
− | File "/home/fbudin/Devel/Slicer-SuperBuild-Release/VTKv7-build/Wrapping/Python/vtk/__init__.py", line 41, in <module>
| |
− | from .vtkCommonKit import *
| |
− | File "/home/fbudin/Devel/Slicer-SuperBuild-Release/VTKv7-build/Wrapping/Python/vtk/vtkCommonKit.py", line 9, in <module>
| |
− | from vtkCommonKitPython import *
| |
− | ImportError: /home/fbudin/Devel/Slicer-SuperBuild-Release/VTKv7-build/lib/./libvtkCommonKitPython27D-7.1.so.1: undefined symbol: PyUnicodeUCS2_DecodeUTF8
| |
− | Traceback (most recent call last):
| |
− | File "<string>", line 1, in <module>
| |
− | NameError: name 'getSlicerRCFileName' is not defined
| |
− | Number of registered modules: 138
| |
− | error: [/home/fbudin/Devel/Slicer-SuperBuild-Release/Slicer-build/bin/./SlicerApp-real] exit abnormally - Report the problem.
| |
− | | |
− | Solution [http://na-mic.org/Mantis/view.php?id=3574 here]
| |
− | | |
− | == 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 Slicer
| |
− | mkdir Slicer-SuperBuild-Debug
| |
− | cd Slicer-SuperBuild-Debug
| |
− | cmake ../Slicer
| |
− | make -j5
| |
− |
| |
− | # runtime dependency:
| |
− | sudo aptitude install python-tk
| |
− | | |
− | | |
− | == Quick Build on Fedora 20 == | |
− | | |
− | Thanks to Bill Lorensen, you will find below the instruction to quickly build Slicer on Fedora 20:
| |
− | | |
− | yum groupinstall "C Development Tools"
| |
− | yum install git-core
| |
− | yum install svn
| |
− | yum install libX11-devel
| |
− | yum install libXt-devel
| |
− | yum install mesa-libGL-devel
| |
− | yum install mesa-libGLU-devel
| |
− | yum install cmake
| |
− | yum install tcl-devel
| |
− | yum install python-devel
| |
− | yum install qt-devel
| |
− | yum install qt-webkit-devel
| |
− | | |
− | svn co http://svn.slicer.org/Slicer4/trunk Slicer
| |
− | mkdir Slicer-SuperBuild-Debug
| |
− | cd Slicer-SuperBuild-Debug
| |
− | cmake ../Slicer
| |
− | make -j5
| |
− | | |
− | Reference: http://slicer-devel.65872.n3.nabble.com/Fedora-20-Slicer-Experience-tt4030845.html
| |