Skip to content

Commit

Permalink
Merge pull request #65 from owl-project/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
natevm authored Oct 22, 2020
2 parents 6e77681 + a867757 commit 43bf786
Show file tree
Hide file tree
Showing 94 changed files with 10,730 additions and 6,095 deletions.
79 changes: 0 additions & 79 deletions .github/workflows/linux.yml

This file was deleted.

5 changes: 3 additions & 2 deletions .github/workflows/manylinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,12 @@ jobs:
PY=${{ matrix.python-version }}
PYVER=${PY:2:1}.${PY:3:1}
PYTHONXDOTYMU=python${PY:2:1}.${PY:8:3}
PYTHONXDOTY=python${PY:2:1}.${PY:3:1}
echo $PYTHONXDOTYMU
PYEXEC=/opt/python/${{ matrix.python-version }}/bin/python
echo $PYTHONXDOTYMU
$PYEXEC -m pip install numpy
$PYEXEC -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())"
$PYEXEC -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('LIBDIR'))"
Expand All @@ -113,6 +115,7 @@ jobs:
-DSWIG_DIR="./swig-4.0.2/share/swig/4.0.2/" \
-DSWIG_EXECUTABLE="swig-4.0.2/bin/swig" \
-DPython_INCLUDE_DIRS=/opt/python/${{ matrix.python-version }}/include/$PYTHONXDOTYMU/ \
-DPython_NumPy_INCLUDE_DIRS=/opt/python/${{ matrix.python-version }}/lib/$PYTHONXDOTY/site-packages/numpy/core/include/ \
-DPython_VERSION_MAJOR=${PY:2:1} \
-DPython_VERSION_MINOR=${PY:3:1} \
-DCMAKE_BUILD_TYPE=Release \
Expand All @@ -123,7 +126,6 @@ jobs:

# need to temporarily remove libcuda.so.1 from library
cd visii
patchelf --remove-needed libcuda.so.1 libvisii_lib.so
patchelf --remove-needed libcuda.so.1 _visii.so
cd ../

Expand All @@ -140,7 +142,6 @@ jobs:
unar -d *.whl
cd visii*
cd visii
patchelf --add-needed libcuda.so.1 libvisii_lib.so
patchelf --add-needed libcuda.so.1 _visii.so
cd ..
cd ..
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@ jobs:
- name: Download Dependencies
run: |
choco install cuda --version=10.2.89.20191206
choco install cuda --version=10.2.89.20191206 --execution-timeout=3000
refreshenv
- name: Windows configure/install cmake project
run: |
pip install numpy
mkdir build
cd build
cmake ../ -DCUDA_TOOLKIT_ROOT_DIR="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2" -DPYTHON_VERSION="${{matrix.python-version}}"
Expand Down
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
build
*.ptx
tests
*.c
*.cmake
install
Expand All @@ -13,4 +14,8 @@ data
*.mp4
*.hdr
*.jpg
*.mtl
*.mtl
*.zip
*__pycache__
examples/content
examples\content
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[submodule "externals/owl"]
path = externals/owl
url = https://github.com/owl-project/owl.git
[submodule "externals/assimp"]
path = externals/assimp
url = https://github.com/n8vm/assimp.git
58 changes: 39 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ endif(APPLE)

# If on windows, use c++14 (oldest available by modern msvc)
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++14")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++14" CACHE STRING "" FORCE)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
add_definitions(-D_ENABLE_EXTENDED_ALIGNED_STORAGE)
endif(MSVC)

if(UNIX)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14" CACHE STRING "" FORCE)
endif(UNIX)

# Set the default install prefix path
Expand Down Expand Up @@ -97,7 +97,8 @@ option(NVCC_VERBOSE "verbose cuda -> ptx -> embedded build" OFF)

if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
# Enable c++11 and hide symbols which shouldn't be visible
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
message(WARN "ENABLING FPIC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC" CACHE STRING "" FORCE)
endif()

# ┌──────────────────────────────────────────────────────────────────┐
Expand Down Expand Up @@ -163,9 +164,9 @@ endif()
if(WIN32 OR NOT Python_INCLUDE_DIRS)
set(PYTHON_VERSION "" CACHE STRING "Optional user-selected Python version")
if(PYTHON_VERSION)
find_package(Python ${PYTHON_VERSION} EXACT COMPONENTS Development)
find_package(Python ${PYTHON_VERSION} EXACT COMPONENTS Development NumPy)
else()
find_package(Python COMPONENTS Development)
find_package(Python COMPONENTS Development NumPy)
endif()
endif()

Expand All @@ -187,14 +188,23 @@ if (MSVC AND NOT Python_LIBRARIES)
"in the \"Advanced Options\" tab of the Python installation wizard, and to run with python_d.exe")
endif()
include_directories(SYSTEM ${Python_INCLUDE_DIRS})
include_directories(SYSTEM ${Python_NumPy_INCLUDE_DIRS})
message(WARN "Numpy Include Dir is: ")
message(WARN ${Python_NumPy_INCLUDE_DIRS})
if (NOT EXISTS ${Python_NumPy_INCLUDE_DIRS})
message(ERROR "ERROR, numpy include dir does not exist!")
endif()

if (NOT EXISTS ${Python_NumPy_INCLUDE_DIRS}/numpy/arrayObject.h)
message(ERROR "ERROR, arrayObject does not exist!")
endif()

# # glm
# glm
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/externals/glm)

# geometry generator
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/externals/generator)
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/externals/generator/include)
set_property(TARGET generator PROPERTY FOLDER "${CMAKE_CURRENT_SOURCE_DIR}/externals/generator")

# glad
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/externals/glad/include)
Expand Down Expand Up @@ -232,6 +242,13 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/externals/stb/)
# tiny things
include_directories(SYSTEM externals/tiny/)

# assimp
set(ASSIMP_BUILD_ASSIMP_TOOLS OFF CACHE STRING "" FORCE)
set(ASSIMP_BUILD_TESTS OFF CACHE STRING "" FORCE)
set(ASSIMP_INSTALL OFF CACHE STRING "" FORCE)
add_subdirectory (externals/assimp EXCLUDE_FROM_ALL)
set(assimp_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/externals/assimp/include/" "${CMAKE_CURRENT_BINARY_DIR}/externals/assimp/include/")

# ImGUI
add_definitions(-D IMGUI_IMPL_OPENGL_LOADER_GLAD)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/externals/imgui/)
Expand Down Expand Up @@ -298,6 +315,7 @@ set(
# ${TBB_LIBRARIES}
#owl
${OWL_LIBRARIES}
assimp
)

set (
Expand Down Expand Up @@ -355,7 +373,7 @@ endif()

macro(cuda_compile_and_embed output_var cuda_file)
set(var_name ${output_var})
cuda_compile_ptx(ptx_files ${cuda_file} OPTIONS -Xcudafe --diag_suppress=esa_on_defaulted_function_ignored --keep ${NVCC_VERBOSE_FLAG})
cuda_compile_ptx(ptx_files ${cuda_file} OPTIONS --generate-line-info -use_fast_math -Xcudafe --diag_suppress=esa_on_defaulted_function_ignored --keep ${NVCC_VERBOSE_FLAG})
list(GET ptx_files 0 ptx_file)
set(embedded_file ${ptx_file}_embedded.c)
add_custom_command(
Expand Down Expand Up @@ -394,7 +412,8 @@ cuda_compile_and_embed(ptxCode ${SRC_CU})
# ┌──────────────────────────────────────────────────────────────────┐
# │ ViSII Library │
# └──────────────────────────────────────────────────────────────────┘
cuda_add_library(visii_lib SHARED ${SRC} ${HDR} ${ptxCode} OPTIONS --expt-relaxed-constexpr -Xcudafe --diag_suppress=esa_on_defaulted_function_ignored)
cuda_add_library(visii_lib STATIC ${SRC} ${HDR} ${ptxCode} OPTIONS --expt-relaxed-constexpr -Xcudafe --diag_suppress=esa_on_defaulted_function_ignored)
set_target_properties(visii_lib PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_link_libraries(visii_lib ${LIBRARIES})
set_target_properties(visii_lib PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS true)
install(TARGETS visii_lib
Expand Down Expand Up @@ -441,21 +460,22 @@ install(FILES ${CMAKE_BINARY_DIR}/bin/_visii.pyd DESTINATION ${CMAKE_INSTALL_PRE
install(FILES ${CMAKE_BINARY_DIR}/lib/_visii.so DESTINATION ${CMAKE_INSTALL_PREFIX}/visii/ OPTIONAL)
install(FILES ${CMAKE_BINARY_DIR}/bin/_visii.pyd CONFIGURATIONS Debug DESTINATION ${CMAKE_INSTALL_PREFIX}/visii/ OPTIONAL RENAME _visii_d.pyd)
install(FILES ${CMAKE_BINARY_DIR}/bin/_visii.pdb CONFIGURATIONS Debug DESTINATION ${CMAKE_INSTALL_PREFIX}/visii/ OPTIONAL RENAME _visii_d.pdb)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/setup.py DESTINATION ${CMAKE_INSTALL_PREFIX})
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/python/setup.py DESTINATION ${CMAKE_INSTALL_PREFIX})
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/python/importers DESTINATION ${CMAKE_INSTALL_PREFIX}/visii/)

# # TBB DLL for windows
# if (WIN32)
# install(FILES ${PROJECT_SOURCE_DIR}/external/tbb/vc14/tbb.dll DESTINATION ${CMAKE_INSTALL_PREFIX})
# install(FILES ${PROJECT_SOURCE_DIR}/external/tbb/vc14/tbb_debug.dll DESTINATION ${CMAKE_INSTALL_PREFIX})
# endif(WIN32)




# If we want apps using visii to be able to also use OWL, we have to export these:
set(OWL_INCLUDES ${OWL_INCLUDES} PARENT_SCOPE)
set(OWL_VIEWER_INCLUDES ${OWL_VIEWER_INCLUDES} PARENT_SCOPE)
set(OWL_LIBRARIES ${OWL_LIBRARIES} PARENT_SCOPE)
set(OWL_VIEWER_LIBRARIES ${OWL_VIEWER_LIBRARIES} PARENT_SCOPE)
set(OWL_HAVE_TBB ${OWL_HAVE_TBB} PARENT_SCOPE)
set(OWL_CXX_FLAGS ${OWL_CXX_FLAGS} PARENT_SCOPE)
get_directory_property(hasParent PARENT_DIRECTORY)
if(hasParent)
set(OWL_INCLUDES ${OWL_INCLUDES} PARENT_SCOPE)
set(OWL_VIEWER_INCLUDES ${OWL_VIEWER_INCLUDES} PARENT_SCOPE)
set(OWL_LIBRARIES ${OWL_LIBRARIES} PARENT_SCOPE)
set(OWL_VIEWER_LIBRARIES ${OWL_VIEWER_LIBRARIES} PARENT_SCOPE)
set(OWL_HAVE_TBB ${OWL_HAVE_TBB} PARENT_SCOPE)
set(OWL_CXX_FLAGS ${OWL_CXX_FLAGS} PARENT_SCOPE)
endif()
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ We highly recommend that you use the pre-built wheels for python as follow:
```
pip install visii
```
Also make sure the NVIDIA drivers 451 (or above) are installed as well as CUDA 10.2 (or above) is installed.
If you need more information about how to install NVIDIA drivers and CUDA on Ubuntu please consult
Also make sure your NVIDIA drivers are up to date (R435 or above).
If you need more information about how to install NVIDIA drivers on Ubuntu please consult
[this](https://ingowald.blog/installing-the-latest-nvidia-driver-cuda-and-optix-on-linux-ubuntu-18-04/).


Expand All @@ -41,7 +41,8 @@ You can also find more extensive documentation [here](https://owl-project.github

## Building

Information on how to build to be added in near future.
Exact commands used to ViSII can be found in .github/manylinux.yml and .github/windows.yml.
More information on how to build will be added in the near future.

<!-- Although we do not recommend building visii from scratch. Here are the rudimentary
requirements:
Expand Down
2 changes: 1 addition & 1 deletion examples/00.helloworld.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# this will create a window where you should
# only see gaussian noise pattern
visii.initialize_interactive()
visii.initialize()

input("Press Enter to continue...")

Expand Down
Loading

0 comments on commit 43bf786

Please sign in to comment.