title: Installation forcing the use of python static archive rather than shared object
body: <p>I've updated this question and the error it is giving me now, though I can't be certain whether I'm working towards or away from a solution, as I've little knowledge of cmake!</p>
  
  <p>When trying to install a python program, I'm running into an error I'm uncertain how to fix. The program is as follows:</p>
  
  <pre><code>os.chdir("spenvis_csv")
  if not os.path.exists("build"):
      os.mkdir("build")
  
  os.chdir("build")
  call("cmake ../", shell=True)
  call("make")
  os.chdir(loc_dir)
  os.chdir("python_utilities")
  if not os.path.exists("lib"):
      os.mkdir("lib")
  
  for file_name in os.listdir("spenvis_csv/build/source"):
      if file_name.find("libSpenvis.") !=-1:
          shutil.move("spenvis_csv/build/source/%s" %   
  
  (file_name),"lib/Spenvis.so") 
      os.chdir("..")
  </code></pre>
  
  <p>And the error output is as follows:</p>
  
  <pre><code>-- Configuring done
  -- Generating done
  -- Build files have been written to: /home/smh/Linux/Desktop/gras original/gras-03-03/python/python_utilities/spenvis_csv/build
  Scanning dependencies of target Spenvis
  [ 33%] Building CXX object source/CMakeFiles/Spenvis.dir/pySpenvisCSV.cc.o
  [ 66%] Building CXX object source/CMakeFiles/Spenvis.dir/SpenvisCSV.cc.o
  [100%] Building CXX object source/CMakeFiles/Spenvis.dir/SpenvisCSVCollection.cc.o
  Linking CXX shared library libSpenvis.so
  /usr/bin/ld: /usr/local/lib64/libpython2.7.a(abstract.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
  /usr/local/lib64/libpython2.7.a: could not read symbols: Bad value
  collect2: ld returned 1 exit status
  make[2]: *** [source/libSpenvis.so] Error 1
  make[1]: *** [source/CMakeFiles/Spenvis.dir/all] Error 2
  make: *** [all] Error 2
  </code></pre>
  
  <p>Ah, and I'm definitely a cmake scrub. In the source directory, methinks, lies the actual CMakeLists.txt, which is as follows:</p>
  
  <pre><code># Make sure the compiler can find include files
  include_directories (${PYSPENVIS_SOURCE_DIR})
  
  # get boost
  set(Boost_USE_STATIC_LIBS   OFF)
  #set(Boost_USE_MULTIEADED ON)
  find_package(Boost COMPONENTS
                  python
               REQUIRED)
  include_directories(${Boost_INCLUDE_DIRS})
  link_directories(${Boost_LIBRARY_DIRS})
  
  # get python
  include(FindPythonLibs)
  
  set(PythonLibs_USE_STATIC_LIBS   OFF)
  find_package(PythonInterp)
  find_package(PythonLibs)
  include_directories(${PYTHON_INCLUDE_DIRS})
  link_directories(${PYTHON_LIBRARIES})
  set_target_properties(${PYTHON_LIBRARIES} PROPERTIES POSITION_INDEPENDENT_CODE ON)
  
  
  add_library(Spenvis  SHARED pySpenvisCSV.cc SpenvisCSV.cc SpenvisCSVCollection.cc)
  TARGET_LINK_LIBRARIES(Spenvis ${Boost_LIBRARIES} ${PYTHON_LIBRARIES})
  </code></pre>
  
  <p>With special attention to those last few lines, as those were the lines I've edited to point towards the correct libraries. However, now I'm getting  a new error:</p>
  
  <pre><code>-- Configuring done
  -- Generating done
  -- Build files have been written to: /home/smh/Linux/Desktop/gras-03-03/python/python_utilities/spenvis_csv/build
  make[2]: *** No rule to make target `/usr/lib64/lib64/libboost_python-mt.so.5', needed by `source/libSpenvis.so'.  Stop.
  make[1]: *** [source/CMakeFiles/Spenvis.dir/all] Error 2
  make:
  </code></pre>
  
  <p>Particularly strange now is the <strong>/usr/lib64/lib64/</strong> , I'm not sure why it's trying to find that directory, as it doesn't exist.</p>
  
  <p>I apologize for the length. I've omitted the Internal cache entries, but can post these as well if they would be of use.</p>