Skip to content

Instantly share code, notes, and snippets.

@sterin
sterin / opengl-ubuntu-ec2-install.md
Created Sep 14, 2017 — forked from dgoguerra/opengl-ubuntu-ec2-install.md
Set up OpenGL on a Ubuntu 16.04 g2.2xlarge EC2 machine (following https://stackoverflow.com/q/19856192)
View opengl-ubuntu-ec2-install.md

Steps from https://stackoverflow.com/q/19856192 with minor changes to work on Ubuntu 16.04.

# Install the Nvidia driver
sudo apt-add-repository ppa:ubuntu-x-swat/updates
sudo apt-get update
sudo apt-get install nvidia-current

# Driver installation needs reboot
sudo reboot now
View CMakeLists.txt
cmake_minimum_required(VERSION 3.8)
project(dummy)
find_package(PythonLibs 3 REQUIRED)
find_package(PythonInterp ${PYTHONLIBS_VERSION_STRING} REQUIRED)
find_package(SWIG REQUIRED)
include(${SWIG_USE_FILE})
View CMakeLists.txt
cmake_minimum_required(VERSION 3.0.0)
project(so_example)
# needed to link with Python
find_package(PythonLibs REQUIRED)
# a simple shared library
add_library(shared SHARED shared.cpp)
View CMakeLists.txt
cmake_minimum_required(VERSION 2.8.4)
project(so_31581722)
find_package(PythonLibs REQUIRED)
include_directories(${PYTHON_INCLUDE_DIRS})
set(SOURCE_FILES main.cpp)
View CMakeLists.txt
cmake_minimum_required(VERSION 2.8.4)
project(so29595222)
find_package(PythonLibs REQUIRED)
include_directories(${PYTHON_INCLUDE_DIRS})
ADD_DEFINITIONS( -std=c++11 )
set(SOURCE_FILES python_threading_example_so29595222.cpp)
@sterin
sterin / CMakeLists.txt
Last active Aug 25, 2022
An example showing how to use sub interpreters and threads in Python
View CMakeLists.txt
cmake_minimum_required(VERSION 2.8.4)
project(py1)
find_package(PythonLibs REQUIRED)
include_directories(${PYTHON_INCLUDE_DIRS})
ADD_DEFINITIONS( -std=c++11 )
set(SOURCE_FILES main.cpp)