Difference between revisions of "Configure PLplot for Visual CXX CLI"

From PLplotWiki
Jump to: navigation, search
(Explain the importance of setting the PATH before building and mention that wxWidgets DLLs should be in the PATH as well if you use them.)
Line 5: Line 5:
 
  cd buildnmake
 
  cd buildnmake
 
  cmake -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=install ..
 
  cmake -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=install ..
  path=...\plplot\buildnmake\dll;%PATH%
+
  set PATH=C:\plplot\buildnmake\dll;%PATH%
 
  nmake
 
  nmake
 
  nmake install
 
  nmake install
Line 11: Line 11:
 
This will build a shared plplot library and install all files into the directory <tt>plplot\buildnmake\install</tt>.  
 
This will build a shared plplot library and install all files into the directory <tt>plplot\buildnmake\install</tt>.  
  
'''Note''': during the build the various DLLs are put in the subdirectory "dll" under the build directory. It is important
+
'''Note''': during the build the various DLLs are put in the subdirectory "dll" under the build directory. It is important that this directory is contained in the path during the build, if you use the dynamic drivers facility as otherwise calls to get-drv-info will fail and the drivers won't be installed successfully. In addition, if you use wxWidgets driver you also must ensure that the wxWidgets DLL itself is in the path as well.
that this directory is contained in the path during the build, if you use the dynamic drivers facility as otherwise calls to get-drv-info will fail and the drivers won't be installed successfully. In addition, if you use wxWidgets driver you also must ensure that the wxWidgets DLL itself is in the path as well.
+
 
   
 
   
 
Alternatively you can use the GUI version of CMake, an easy-to-use user-interface that presents the available build options
 
Alternatively you can use the GUI version of CMake, an easy-to-use user-interface that presents the available build options

Revision as of 04:24, 10 September 2009

You need a working Visual C++ installation. Start the command line interface and issue the following commands:

cd plplot
mkdir buildnmake
cd buildnmake
cmake -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=install ..
set PATH=C:\plplot\buildnmake\dll;%PATH%
nmake
nmake install

This will build a shared plplot library and install all files into the directory plplot\buildnmake\install.

Note: during the build the various DLLs are put in the subdirectory "dll" under the build directory. It is important that this directory is contained in the path during the build, if you use the dynamic drivers facility as otherwise calls to get-drv-info will fail and the drivers won't be installed successfully. In addition, if you use wxWidgets driver you also must ensure that the wxWidgets DLL itself is in the path as well.

Alternatively you can use the GUI version of CMake, an easy-to-use user-interface that presents the available build options and lets you set them. It is mostly a matter of taste, but:

  • The GUI version provides an overview of the build opions that are available
  • The command-line version is particularly useful if you are experimenting with these options, as it can be run from a batchfile

Some of the options that are available for cmake:

  • -DBUILD_SHARED_LIBS=OFF: static build of plplot
  • -DCMAKE_VERBOSE_MAKEFILE=ON: makefiles provide verbose informations
  • -DBUILD_TEST=ON: all examples will be built also (for test purposes)
  • Configuration of wxWidgets driver

If you used the -DBUILD_TEST=ON option, you need to copy some files in order to run the examples:

cd examples\c
copy ..\..\..\data\*.fnt .

and additionally some dlls for a shared plplot built:

copy ..\..\dll\plplotd.dll .
copy ..\..\dll\plplotcxxd.dll . (for c++ examples)
copy ..\..\dll\csirocsa.dll . (if library was built)

and for the wxWidgets driver (if wxWidgets library is shared):

copy %WXWIN%\lib\gcc_dll\wxmsw26d_vc_custom.dll .

if this dll is not in the path.