OOF: Finite Element Analysis of Microstructures
Installing vtk 5.10.1 on OS X El Capitan with MacPorts
![]() |
|
vtk 5.10.1 is nominally available from MacPorts, but as of now (July 2016) doesn't build properly on OS X 10.11 (El Capitan). There is a bug report at https://trac.macports.org/ticket/49418. These are instructions for building vtk 5.10.1 on Macintosh OS X 10.11. They will build a version of vtk suitable for using with OOF3D, and install it in /usr/local. These instructions may not be suitable for other operating systems, other versions of OS X, or other applications using vtk. All lines beginning with % are meant to be typed in a terminal window. Don't type the %. Lines containing sudo do things that you need administrator privileges for. If you're not an administrator and can't use sudo, find an administrator and ask for help.
|
|
CommentsThe MacPorts distribution of vtk5 includes the output from ccmake, so its build process is basically just the "make" and "make install" steps above. Somehow it invokes a subshell that isn't getting the correct environment variables, and the build fails. (In El Capitan, DYLD_LIBRARY_PATH isn't exported to subshells.) I don't know why the steps outlined above don't have this problem. ccmake caches its settings in CMakeCache.txt. That file is included in the vtk5 port, and I compared it with the file I generated with ccmake to see which default values might need to be changed. The set listed above appears to be minimal. I can't promise that it's sufficient. MacPorts' vtk5 port changes SET(VTK_OBJCXX_FLAGS_DEFAULT "-fobjc-gc")to SET(VTK_OBJCXX_FLAGS_DEFAULT "")at line 24 in CMakeLists.txt in the top vtk directory. This appears to be unnecessary when VTK_USE_COCOA is OFF. If VTK_USE_COCOA is ON and this change is not made, compilation will fail with an error message about unsupported garbage collection. The following variables are set in the MacPorts' CMakeCache.txt but don't seem to be required (or don't require the values that macports uses): CMAKE_CXX_COMPILER /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ CMAKE_CXX_FLAGS -pipe -DUSE_INTERP_ERRORLINE -stdlib=libc++ -I/opt/local/include CMAKE_C_COMPILER /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang CMAKE_C_FLAGS -pipe -I/opt/local/include CMAKE_EXE_LINKER_FLAGS -L/opt/local/lib -Wl,-headerpad_max_install_names CMAKE_MODULE_LINKER_FLAGS -L/opt/local/lib -Wl,-headerpad_max_install_names CMAKE_OSX_ARCHITECTURES x86_64 CMAKE_OSX_DEPLOYMENT_TARGET 10.11 CMAKE_OSX_SYSROOT / CMAKE_SHARED_LINKER_FLAGS -L/opt/local/lib -L/usr/local/lib -Wl,-headerpad_max_install_names CMAKE_VERBOSE_MAKEFILE ON VTK_DATA_ROOT /opt/local/share/VTKData (git clone git://vtk.org/VTKData.git) VTK_USE_GL2PS ON VTK_WRAP_TCL ON The MacPorts' CMakeCache.txt says that these variables were set on the command line (with ccmake -D..., I assume), but I didn't set them and it didn't seem to cause a problem: CMAKE_FIND_FRAMEWORK = LAST CMAKE_INSTALL_NAME_DIR = /opt/local/lib/vtk-5.10 CMAKE_INSTALL_RPATH = /opt/local/lib/vtk-5.10 CMAKE_INSTALL_RPATH_USE_LINK_PATH = ON CMAKE_MODULE_PATH = /opt/local/share/cmake/Modules CMAKE_SYSTEM_PREFIX_PATH = /opt/local;/usr TCL_INCLUDE_PATH = /opt/local/include TCL_LIBRARY = /opt/local/lib/libtcl.dylib TK_INCLUDE_PATH = /opt/local/include TK_INTERNAL_PATH = something long TK_LIBARY = /opt/local/lib/libtk.dylib VTK_INSTALL_PREFIX = /opt/local VTK_USE_RPATH = ON These entries in MacPorts' CMakeCache.txt aren't available in ccmake when I run it with the files downloaded from www.vtk.org, but CMakeCache.txt doesn't say that they were set on the command line. I didn't set them: CPACK_BINARY_BUNDLE and other CPACK options VTK_TCL_TK_STATIC = OFF VTK_USE_SYSTEM_GL2PS = OFF VTK_USE_TK = ON X11_fontconfig_LIB = /opt/local/lib/libfontconfig.dylib |