Programming:Compiling Paraview 3.8.1 for OS X 10.6.4: Difference between revisions

From Robupixipedia
Jump to navigationJump to search
m (added title to top and links to downloads)
m (tweaked instructions around ccmake)
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
==in the beginning==
=in the beginning=


Had to install xtools again, even though I thought I had already installed it.  This gave me the correct C and C++ compilers.
Had to install xtools again, even though I thought I had already installed it.  This gave me the correct C and C++ compilers.


Installed cmake binary, (and actually used ccmake)
Download and install [http://www.cmake.org/cmake/resources/software.html cmake and ccmake binary (version 2.8.2)].


Did *not* install separate version of VTK.  VTK is bundled with Paraview source.
Did *not* install separate version of VTK.  VTK is bundled with Paraview source.
Line 16: Line 16:
   drwxr-xr-x@ 22 thunderrabbit  staff        748 Oct 19 12:42 ParaView-3.8.1
   drwxr-xr-x@ 22 thunderrabbit  staff        748 Oct 19 12:42 ParaView-3.8.1
   -rw-r--r--@  1 thunderrabbit  staff  33123181 Oct 15 12:22 ParaView-3.8.1.tar.gz
   -rw-r--r--@  1 thunderrabbit  staff  33123181 Oct 15 12:22 ParaView-3.8.1.tar.gz
   drwxr-xr-x  28 thunderrabbit  staff       952 Oct 19 16:37 ParaView-bin
   drwxr-xr-x  28 thunderrabbit  staff         68 Oct 19 16:37 ParaView-bin


cd into the directory and run ccmake
cd into the directory and run ccmake
Line 23: Line 23:
   $ ccmake ../ParaView-3.8.1
   $ ccmake ../ParaView-3.8.1


===CMake Variables===
You should see a mostly white screen with Empty Cache at the top.


Press t when in ccmake to make all these variables visible.
[[File:Programming-Compiling_Paraview_3.8.1_for_OS_X_10.6.4_ccmake_empty_cache.png|thumb|Empty Cache]]


Taken from [http://www.paraview.org/Wiki/ParaView:Build_And_Install#CMake_Variables http://www.paraview.org/Wiki/ParaView:Build_And_Install#CMake_Variables], I used these values:
Type c to configure, and after a couple minutes you will see the ParaView Basic Variables.
 
[[File:Programming-Compiling_Paraview_3.8.1_for_OS_X_10.6.4_ccmake_paraview_basic_var_list_screenshot.png|thumb|ParaView Basic Variables]]
 
==adjust ParaView variables in ccmake==
 
Press t when in ccmake to Toggle advanced mode and display all these variables (and many more).
 
Press C-d to page down and C-u to page up.
 
Taken from [http://www.paraview.org/Wiki/ParaView:Build_And_Install#CMake_Variables http://www.paraview.org/Wiki/ParaView:Build_And_Install#CMake_Variables], I used these values (green means I had to change them):


{| border="0" cellpadding="4" cellspacing="4"
{| border="0" cellpadding="4" cellspacing="4"
Line 36: Line 46:
|-
|-
| BUILD_SHARED_LIBS
| BUILD_SHARED_LIBS
| ON
| bgcolor="#67F951" | ON
| Enables shared libraries (unless you are sure you want to do static builds)
| Enables shared libraries (unless you are sure you want to do static builds)
|-
|-
| CMAKE_BUILD_TYPE
| CMAKE_BUILD_TYPE
| Release
| bgcolor="#67F951" | Release
| Unless you want to end up with debug install, set this to Release
| Unless you want to end up with debug install, set this to Release
|-
|-
| PARAVIEW_USE_MPI
|PARAVIEW_BUILD_QT_GUI
| OFF
| ON
| Unless you are taking extra steps to ensure that the clients have the required MPI libraries, set this to OFF, since ParaView does not include rules to package MPI.
| To enable building the Qt client
|-
|-
| PARAVIEW_ENABLE_PYTHON
| PARAVIEW_ENABLE_PYTHON
Line 52: Line 62:
|-
|-
| PARAVIEW_GENERATE_PROXY_DOCUMENTATION
| PARAVIEW_GENERATE_PROXY_DOCUMENTATION
| ON
| OFF
| To ensure that the html documentation for the sources/filters/readers/writes is generated and packed into the application, turn the following flag ON.
| To ensure that the html documentation for the sources/filters/readers/writes is generated and packed into the application, turn the following flag ON.
|-
|-
| PARAVIEW_INSTALL_DEVELOPMENT
| PARAVIEW_INSTALL_DEVELOPMENT
| ON
| bgcolor="#67F951" | ON
| To package development files so that people can build plugins/custom-apps using the installation.
| To package development files so that people can build plugins/custom-apps using the installation.
|-
|-
|PARAVIEW_BUILD_QT_GUI
| PARAVIEW_USE_MPI
| ON
| OFF
| To enable building the Qt client
| Unless you are taking extra steps to ensure that the clients have the required MPI libraries, set this to OFF, since ParaView does not include rules to package MPI.
|}
|}


===building===
After setting the variables as above, type c to configure
 
then type g to generate.


c to configure
''For some reason, after Configuring with the variables listed above, I had to Quit without generating, run ccmake again, Configure again (all the above changes were already in place) and then I could Generate and exit.'' [[User:Thunderrabbit|Thunder Rabbit]] 18:25, 19 October 2010 (PDT)
g to generate and exit
 
==building==
 
Count how many cpu cores you have on your machine.
 
Then in your bash_profile or tcshrc or whatever, put this alias:
 
  make='make --jobs=NUM_CORES --load-average=NUM_CORES'
 
aka
 
  make='make -jNUM_CORES -lNUM_CORES'
 
This will tell make to use NUM_CORES many jobs when it makes, but not to start any new jobs if the load is already at NUM_CORES.
 
You might also try this: use NUM_CORES = number of cores + 1, for this reason: much of the compile time for small files is spent writing the object file to the disk, so you can get away with having more jobs than cores because of this.  ymmv.


   $ make
   $ make


and wait 3 hours.
=extra plugin=
 
==extra plugin==


   $ ls
   $ ls
Line 117: Line 142:
c to configure again, and then g to generate
c to configure again, and then g to generate


===make===
==make==


   $ pwd
   $ pwd
Line 159: Line 184:
It should take less than a minute to build; there is only one source file, plus plugin stuff.
It should take less than a minute to build; there is only one source file, plus plugin stuff.


===load===
==load==


Once compiled, run paraview,  
Once compiled, run paraview,  




tool/manage plugins
select Tools -> Manage Plugins


[[File:Programming-Compiling Paraview 3.8.1 for OS X 10.6.4 tools-manage plugins.png]]
[[File:Programming-Compiling Paraview 3.8.1 for OS X 10.6.4 tools-manage plugins.png]]


load new
Load New


[[File:Programming-Compiling Paraview 3.8.1 for OS X 10.6.4 tools-manage plugins - load new.png]]
[[File:Programming-Compiling Paraview 3.8.1 for OS X 10.6.4 tools-manage plugins - load new.png]]


select “auto load” once loaded.
select “Auto Load” once loaded.


[[File:Programming-Compiling Paraview 3.8.1 for OS X 10.6.4 tools-manage plugins - auto-load.png]]
[[File:Programming-Compiling Paraview 3.8.1 for OS X 10.6.4 tools-manage plugins - auto-load.png]]


===recreate JB's screenshot===
==recreate JB's screenshot==


You have to be careful to
You have to be careful to

Latest revision as of 17:25, 19 October 2010

in the beginning

Had to install xtools again, even though I thought I had already installed it. This gave me the correct C and C++ compilers.

Download and install cmake and ccmake binary (version 2.8.2).

Did *not* install separate version of VTK. VTK is bundled with Paraview source.

Installed Qt 4.6.2, as the latest version (4.7) was rejected by the compiler. Not sure how to override that.

Downloaded Paraview source code 3.8.1

created a new directory (ParaView-bin) beside the source

 $ ls
 drwxr-xr-x@ 22 thunderrabbit  staff        748 Oct 19 12:42 ParaView-3.8.1
 -rw-r--r--@  1 thunderrabbit  staff   33123181 Oct 15 12:22 ParaView-3.8.1.tar.gz
 drwxr-xr-x  28 thunderrabbit  staff         68 Oct 19 16:37 ParaView-bin

cd into the directory and run ccmake

 $ cd ParaView-bin
 $ ccmake ../ParaView-3.8.1

You should see a mostly white screen with Empty Cache at the top.

Empty Cache

Type c to configure, and after a couple minutes you will see the ParaView Basic Variables.

ParaView Basic Variables

adjust ParaView variables in ccmake

Press t when in ccmake to Toggle advanced mode and display all these variables (and many more).

Press C-d to page down and C-u to page up.

Taken from http://www.paraview.org/Wiki/ParaView:Build_And_Install#CMake_Variables, I used these values (green means I had to change them):

Variable Value Description
BUILD_SHARED_LIBS ON Enables shared libraries (unless you are sure you want to do static builds)
CMAKE_BUILD_TYPE Release Unless you want to end up with debug install, set this to Release
PARAVIEW_BUILD_QT_GUI ON To enable building the Qt client
PARAVIEW_ENABLE_PYTHON OFF Unless you are taking extra steps to ensure that clients have the rquired python libraries/modules.
PARAVIEW_GENERATE_PROXY_DOCUMENTATION OFF To ensure that the html documentation for the sources/filters/readers/writes is generated and packed into the application, turn the following flag ON.
PARAVIEW_INSTALL_DEVELOPMENT ON To package development files so that people can build plugins/custom-apps using the installation.
PARAVIEW_USE_MPI OFF Unless you are taking extra steps to ensure that the clients have the required MPI libraries, set this to OFF, since ParaView does not include rules to package MPI.

After setting the variables as above, type c to configure

then type g to generate.

For some reason, after Configuring with the variables listed above, I had to Quit without generating, run ccmake again, Configure again (all the above changes were already in place) and then I could Generate and exit. Thunder Rabbit 18:25, 19 October 2010 (PDT)

building

Count how many cpu cores you have on your machine.

Then in your bash_profile or tcshrc or whatever, put this alias:

 make='make --jobs=NUM_CORES --load-average=NUM_CORES'

aka

 make='make -jNUM_CORES -lNUM_CORES'

This will tell make to use NUM_CORES many jobs when it makes, but not to start any new jobs if the load is already at NUM_CORES.

You might also try this: use NUM_CORES = number of cores + 1, for this reason: much of the compile time for small files is spent writing the object file to the disk, so you can get away with having more jobs than cores because of this. ymmv.

 $ make

extra plugin

 $ ls
 -rw-r--r--@  1 thunderrabbit  staff       6148 Oct 15 20:18 .DS_Store
 drwxrwxr-x   3 thunderrabbit  staff        102 Oct 19 09:11 CMakeFiles
 drwxr-xr-x@ 22 thunderrabbit  staff        748 Oct 19 12:42 ParaView-3.8.1
 -rw-r--r--@  1 thunderrabbit  staff   33123181 Oct 15 12:22 ParaView-3.8.1.tar.gz
 drwxr-xr-x  28 thunderrabbit  staff        952 Oct 19 16:37 ParaView-bin
 $ git clone git://git.cscs.ch/ArrowGlyph.git vtkArrowGlyph
 $ mkdir vtkArrowGlyph-bin
 $ ls
 -rw-r--r--@  1 thunderrabbit  staff       6148 Oct 15 20:18 .DS_Store
 drwxrwxr-x   3 thunderrabbit  staff        102 Oct 19 09:11 CMakeFiles
 drwxr-xr-x@ 22 thunderrabbit  staff        748 Oct 19 12:42 ParaView-3.8.1
 -rw-r--r--@  1 thunderrabbit  staff   33123181 Oct 15 12:22 ParaView-3.8.1.tar.gz
 drwxr-xr-x  28 thunderrabbit  staff        952 Oct 19 16:37 ParaView-bin
 drwxr-xr-x   9 thunderrabbit  staff        306 Oct 19 17:14 vtkArrowGlyph
 drwxrwxr-x   2 thunderrabbit  staff         68 Oct 19 17:14 vtkArrowGlyph-bin
 $ cd vtkArrowGlyph-bin
 $ ccmake ../vtkArrowGlyph

You should see a mostly white screen with Empty Cache at the top.

Empty Cache

Type c to configure, and you should get some error messages saying it couldn't find CMAKE_MODULE_PATH.

missing CMAKE_MODULE_PATH

press e to exit help

arrow down then press return to edit the last item

Programming-Compiling Paraview 3.8.1 for OS X 10.6.4 ccmake ParaView DIR-NOTFOUND.png

and fill in ../ParaView-bin

Programming-Compiling Paraview 3.8.1 for OS X 10.6.4 ccmake ParaView-bin.png

c to configure again, and then g to generate

make

 $ pwd
 ~/yadda/yadda/yadda/paraview/vtkArrowGlyph-bin
 $ ls
 total 176
 -rw-rw-r--   1 thunderrabbit  staff    176 Oct 19 17:45 ArrowGlyph_plugin.qrc
 -rw-r--r--   1 thunderrabbit  staff    480 Oct 19 17:36 ArrowGlyph_pluginInit.cxx
 -rw-r--r--   1 thunderrabbit  staff   4342 Oct 19 17:36 ArrowGlyph_plugin_Plugin.cxx
 -rw-r--r--   1 thunderrabbit  staff   3813 Oct 19 17:36 ArrowGlyph_plugin_Plugin.h
 -rw-rw-r--   1 thunderrabbit  staff  35238 Oct 19 17:46 CMakeCache.txt
 drwxrwxr-x  20 thunderrabbit  staff    680 Oct 19 17:45 CMakeFiles
 -rw-rw-r--   1 thunderrabbit  staff  14196 Oct 19 17:45 Makefile
 -rw-rw-r--   1 thunderrabbit  staff   2435 Oct 19 17:45 cmake_install.cmake
 -rw-rw-r--   1 thunderrabbit  staff    406 Oct 19 17:36 vtkArrowGlyphConfigure.h
 -rw-r--r--   1 thunderrabbit  staff   1074 Oct 19 17:36 vtkSMArrowGlyph_pluginInstantiator.cxx
 -rw-r--r--   1 thunderrabbit  staff    478 Oct 19 17:36 vtkSMArrowGlyph_pluginInstantiator.h
 $ make
 -- Loading ParaView CMake commands
 -- Loading ParaView CMake commands - done
 -- Configuring done
 -- Generating done
 -- Build files have been written to: /Users/thunderrabbit/Documents/work/fred/paraview/vtkArrowGlyph-bin
 [  9%] Generating moc_ArrowGlyph_plugin_Plugin.cxx
 [ 18%] Generating qrc_ArrowGlyph_plugin.cxx
 [ 27%] Generating vtkArrowGlyphFilterClientServer.cxx
 [ 36%] Generating vtkSMXML_ArrowGlyph_plugin.h
 -- Generate module: vtkArrowGlyphFilter
 Scanning dependencies of target ArrowGlyph_plugin
 [ 45%] Building CXX object CMakeFiles/ArrowGlyph_plugin.dir/qrc_ArrowGlyph_plugin.cxx.o
 [ 54%] Building CXX object CMakeFiles/ArrowGlyph_plugin.dir/vtkArrowGlyphFilter.cxx.o
 [ 63%] Building CXX object CMakeFiles/ArrowGlyph_plugin.dir/vtkArrowGlyphFilterClientServer.cxx.o
 [ 72%] Building CXX object CMakeFiles/ArrowGlyph_plugin.dir/ArrowGlyph_pluginInit.cxx.o
 [ 81%] Building CXX object CMakeFiles/ArrowGlyph_plugin.dir/vtkSMArrowGlyph_pluginInstantiator.cxx.o
 [ 90%] Building CXX object CMakeFiles/ArrowGlyph_plugin.dir/ArrowGlyph_plugin_Plugin.cxx.o
 [100%] Building CXX object CMakeFiles/ArrowGlyph_plugin.dir/moc_ArrowGlyph_plugin_Plugin.cxx.o
 Linking CXX shared library libArrowGlyph_plugin.dylib
 [100%] Built target ArrowGlyph_plugin

It should take less than a minute to build; there is only one source file, plus plugin stuff.

load

Once compiled, run paraview,


select Tools -> Manage Plugins

Programming-Compiling Paraview 3.8.1 for OS X 10.6.4 tools-manage plugins.png

Load New

Programming-Compiling Paraview 3.8.1 for OS X 10.6.4 tools-manage plugins - load new.png

select “Auto Load” once loaded.

Programming-Compiling Paraview 3.8.1 for OS X 10.6.4 tools-manage plugins - auto-load.png

recreate JB's screenshot

You have to be careful to

  1. choose a time step with meaningful values
  2. choose variables with sensible ranges.
  3. If you see nothing, increase the scale factor for the array you selected.
JBs screenshot