Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Reorganization #14

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ nvFlexDop/**/*.o
!examples
!examples/*

!otls
!otls/*
!package
!package/**

!README.md
!Makefile
!linux_build*.sh
!buildhelper.sh

!CMakeLists.txt
!windowsbuild.bat
**.vcxproj.user
nvFlexDop/x64/

42 changes: 42 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
cmake_minimum_required(VERSION 3.28)

# Project name and languages ( this makes cuda avaliable )
project(nvFlexDop LANGUAGES CXX CUDA)

# Locate Houdini's libraries and header files.
find_package( Houdini REQUIRED )

# Define the sources
file(GLOB SOURCES "nvFlexDop/*.cpp")

# Include directories
include_directories(${NVFLEX_DIR}/include)

# Library directories
link_directories(${NVFLEX_DIR}/lib/win64)

# Define the executable
add_library(${PROJECT_NAME} SHARED ${SOURCES})

# Link the libraries
target_link_libraries(${PROJECT_NAME}
NvFlexReleaseCUDA_x64.lib
NvFlexDeviceRelease_x64.lib
NvFlexExtReleaseCUDA_x64.lib
cuda
cudart_static
Houdini
)

# Set the output directory for the built library
set_target_properties(${PROJECT_NAME} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_SOURCE_DIR}/package/NvFlexDop/dso/Release_${Houdini_VERSION_MAJOR}${Houdini_VERSION_MINOR}/
)

# Set Houdini version to be part of the output name:
set_target_properties(${PROJECT_NAME} PROPERTIES
OUTPUT_NAME "nvFlexDop_${Houdini_VERSION_MAJOR}${Houdini_VERSION_MINOR}"
)

# Configure several common target properties, such as its output directory.
#houdini_configure_target( ${PROJECT_NAME} )
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ DSONAME = nvFlexDop_$(HOUDINI_MAJOR_RELEASE)$(HOUDINI_MINOR_RELEASE).so
SOURCES = $(addprefix $(PWD)/, $(shell echo nvFlexDop/*.cpp))
CC = $(CXX)

INSTDIR = $(PWD)/x64/linux64
INSTDIR = $(PWD)/package/NvFlexDop/dso/linux64/Release_$(HOUDINI_MAJOR_RELEASE)$(HOUDINI_MINOR_RELEASE)
INCDIRS = -I$(NVFLEX_DIR)/include
LIBDIRS = -L$(NVFLEX_DIR)/lib/linux64
LIBS = $(NVFLEX_DIR)/lib/linux64/NvFlexReleaseCUDA_x64.a $(NVFLEX_DIR)/lib/linux64/NvFlexDeviceRelease_x64.a $(NVFLEX_DIR)/lib/linux64/NvFlexExtReleaseCUDA_x64.a -lcuda -lcudart_static
Expand Down
39 changes: 17 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,27 @@ simple integration of Nvidia Flex technology into SideFX Houdini

![preview](https://i.imgur.com/rKzsk49.gif)

## installation (Windows):
* copy dll from x64 folder (nvFlexDop_165.dll for houdini 16.5, nvFlexDop_160.dll for houdini 16.0) to any dso location, like for example into **C:\Users\\\<YOUR USER\>\Documents\houdini16.5\dso\\**
* copy all *.otl files from otls folder to your otls folder, like for example into **C:\Users\\\<YOUR USER\>\Documents\houdini16.5\otls\\**
* copy all *.dll files from dll folder to any path in your system PATH environment variable.
The most straightforward way would be to copy them into your **system32** folder, like **C:\Windows\system32\\** ,
but i would suggest to copy them into a new folder, for example **C:\mystuff\bin\nvflex\\** and add that path to system PATH variable.
Please, see [here](https://superuser.com/questions/949560/how-do-i-set-system-environment-variables-in-windows-10) for instructions how to access environment variables.
just add your folder to the end of the **PATH** variable. So with example folder above it will looks like **\<CONTENT OF YOUR PATH VARIABLE\>;C:\mystuff\bin\nvflex\\**

## installation (Linux):
* copy so appropriate for your houdini version from **x64/linux64/dso** folder to your **\<home\>/houdini16.X/dso/** folder (create **dso** subfolder if necessary). These so were compiled with gcc 6.3.0, glibc 2.24-11.

* if you want to compile it yourself:
* edit **linux_build_16X.sh** so the helper variables point to the locations of the libraries it requires
* launch **linux_build_16X.sh** and if you have all dependencies - build will succeed, and your new so will be put into **x64/linux64/dso** folder
* note: depending on your linux distribution you might require different packages. You might also require full Cuda Toolkit **8.0.44** to be able to build, in this case you will have to add paths to your Cuda toolkit to the Makefile. Although some distributions, like debian, have core libs from that toolkit available in reps, so for example for debian - package nvidia-cuda-dev will be enough and you don't have to download full Cuda Toolkit and set any paths manually.

That should do it.
## installation (Windows and Linux):
* copy the file [nvFlex.json](package/NvFlexDop/nvFlex.json) into your packages folder **C:\Users\\\<YOUR USER\>\Documents\houdiniX.X\packages\\**
* adjust the "NV_FLEX" variable correctly to point to where you downloaded the [NvFlexDop](package/NvFlexDop) folder.
* **Linux Note** These so were compiled with gcc 6.3.0, glibc 2.24-11.

## Building:

If you encounter problems, like houdini crashes on startup or plugin not working in general: try [this work in progress branch](https://github.com/pedohorse/Houdini-NvFlex/tree/work-in-progress)
### Windows:
* Make sure you have Cmake and its on the PATH
* Make sure you have some Cuda toolkit
* Make sure to have a compiler, I'm working with "Visual Studio 16 2019"
* Edit the **HOUDINI_PATH** and **NVFLEX_DIR** variables in [windowsbuild.bat](windowsbuild.bat) to match your dev environment
* Launch [windowsbuild.bat](windowsbuild.bat)

it will at least print out the problem into the console
### Linux:
* edit **linux_build_16X.sh** so the helper variables point to the locations of the libraries it requires
* launch **linux_build_16X.sh** and if you have all dependencies - build will succeed, and your new so will be put into **package/NvFlexDop/dso/linux64** folder
* note: depending on your linux distribution you might require different packages. You might also require full Cuda Toolkit **8.0.44** to be able to build, in this case you will have to add paths to your Cuda toolkit to the Makefile. Although some distributions, like debian, have core libs from that toolkit available in reps, so for example for debian - package nvidia-cuda-dev will be enough and you don't have to download full Cuda Toolkit and set any paths manually.

If the plugin does not load and no console message is printed, but houdini itself launches - you probably forgot to make some of dlls from the **bin** folder available (see pt.3 of installation guide, and make sure you have microsoft vc 2015 redistributable installed (it would be fun if you don't cuz houdini needs it to launch as well))
That should do it.

## Examples

please, see hip files in **examples** folder
please, see hip files in [examples](package/NvFlexDop/examples) folder
20 changes: 0 additions & 20 deletions nvFlexDop/PathsConfig160.props

This file was deleted.

20 changes: 0 additions & 20 deletions nvFlexDop/PathsConfig165.props

This file was deleted.

20 changes: 0 additions & 20 deletions nvFlexDop/PathsConfig175.props

This file was deleted.

51 changes: 0 additions & 51 deletions nvFlexDop/nvFlexDop.vcxproj.filters

This file was deleted.

149 changes: 0 additions & 149 deletions nvFlexDop/nvFlexDop_160.vcxproj

This file was deleted.

Loading