Skip to content

Commit

Permalink
fixes for centos 7
Browse files Browse the repository at this point in the history
  • Loading branch information
Ingo Wald committed Jan 3, 2020
1 parent ba61388 commit b829d0c
Show file tree
Hide file tree
Showing 15 changed files with 41 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ endif (POLICY CMP0048)
project(optix7course)

cmake_minimum_required(VERSION 2.8)
set (CMAKE_CXX_FLAGS "--std=c++11")
set (CUDA_PROPAGATE_HOST_FLAGS ON)

# ------------------------------------------------------------------
# first, include gdt project to do some general configuration stuff
Expand Down
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Latest Updates:

* 1/3/2020: Several fixes and documentation adds to make project
compile with CentOS 7 (ie, oder gcc)

* 1/1/2020: Changed all examples to enable full optimization level
and most appropriate pipeline config for the specific example (single GAS)

Expand Down Expand Up @@ -71,8 +74,14 @@ Detailed steps below:
## Building under Linux

- Install required packages

- on Debian/Ubuntu:
```
sudo apt install libglfw3-dev cmake-curses-gui
```
- on RedHat/CentOS/Fedoral (tested CentOS 7.7):
```
sudo yum install cmake3 glfw-devel freeglut-devel
```
- Clone the code
```
Expand All @@ -87,8 +96,13 @@ Detailed steps below:
```

- configure with cmake
- Ubuntu:
```
cmake ..
```
- CentOS 7:
```
ccmake ..
cmake3 ..
```

- and build
Expand Down
16 changes: 11 additions & 5 deletions common/gdt/gdt/gdt.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@
#endif
#include <algorithm>
#ifdef __GNUC__
#include <sys/time.h>
# include <sys/time.h>
# include <stdint.h>
#endif
#include <stdexcept>

#ifdef _WIN32
#ifndef WIN32_LEAN_AND_MEAN
Expand Down Expand Up @@ -154,11 +156,15 @@ namespace gdt {
#endif

// #ifdef __CUDA_ARCH__
using ::sqrt;
using ::sqrtf;
// using ::sqrt;
// using ::sqrtf;
// #else
// inline __both__ float sqrt(const float f) { return sqrtf(f); }
// inline __both__ double sqrt(const double d) { return sqrt(d); }
namespace overloaded {
/* move all those in a special namespace so they will never get
included - and thus, conflict with, the default namesapce */
inline __both__ float sqrt(const float f) { return ::sqrtf(f); }
inline __both__ double sqrt(const double d) { return ::sqrt(d); }
}
// #endif
// inline __both__ float rsqrt(const float f) { return 1.f/sqrtf(f); }
// inline __both__ double rsqrt(const double d) { return 1./sqrt(d); }
Expand Down
4 changes: 2 additions & 2 deletions common/gdt/gdt/math/vec.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,14 +305,14 @@ namespace gdt {
template<typename T>
inline __both__ vec_t<T,3> normalize(const vec_t<T,3> &v)
{
return v * 1.f/gdt::sqrt(dot(v,v));
return v * 1.f/gdt::overloaded::sqrt(dot(v,v));
}

/*! vector cross product */
template<typename T>
inline __both__ T length(const vec_t<T,3> &v)
{
return gdt::sqrt(dot(v,v));
return gdt::overloaded::sqrt(dot(v,v));
}

template<typename T>
Expand Down
1 change: 1 addition & 0 deletions example02_pipelineAndRayGen/optix7.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <optix.h>
#include <optix_stubs.h>
#include <sstream>
#include <stdexcept>

#define CUDA_CHECK(call) \
{ \
Expand Down
1 change: 1 addition & 0 deletions example03_inGLFWindow/optix7.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <optix.h>
#include <optix_stubs.h>
#include <sstream>
#include <stdexcept>

#define CUDA_CHECK(call) \
{ \
Expand Down
1 change: 1 addition & 0 deletions example04_firstTriangleMesh/optix7.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <optix.h>
#include <optix_stubs.h>
#include <sstream>
#include <stdexcept>

#define CUDA_CHECK(call) \
{ \
Expand Down
1 change: 1 addition & 0 deletions example05_firstSBTData/optix7.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <optix.h>
#include <optix_stubs.h>
#include <sstream>
#include <stdexcept>

#define CUDA_CHECK(call) \
{ \
Expand Down
1 change: 1 addition & 0 deletions example06_multipleObjects/optix7.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <optix.h>
#include <optix_stubs.h>
#include <sstream>
#include <stdexcept>

#define CUDA_CHECK(call) \
{ \
Expand Down
1 change: 1 addition & 0 deletions example07_firstRealModel/optix7.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <optix.h>
#include <optix_stubs.h>
#include <sstream>
#include <stdexcept>

#define CUDA_CHECK(call) \
{ \
Expand Down
1 change: 1 addition & 0 deletions example08_addingTextures/optix7.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <optix.h>
#include <optix_stubs.h>
#include <sstream>
#include <stdexcept>

#define CUDA_CHECK(call) \
{ \
Expand Down
1 change: 1 addition & 0 deletions example09_shadowRays/optix7.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <optix.h>
#include <optix_stubs.h>
#include <sstream>
#include <stdexcept>

#define CUDA_CHECK(call) \
{ \
Expand Down
1 change: 1 addition & 0 deletions example10_softShadows/optix7.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <optix.h>
#include <optix_stubs.h>
#include <sstream>
#include <stdexcept>

#define CUDA_CHECK(call) \
{ \
Expand Down
1 change: 1 addition & 0 deletions example11_denoiseColorOnly/optix7.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <optix.h>
#include <optix_stubs.h>
#include <sstream>
#include <stdexcept>

#define CUDA_CHECK(call) \
{ \
Expand Down
1 change: 1 addition & 0 deletions example12_denoiseSeparateChannels/optix7.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <optix.h>
#include <optix_stubs.h>
#include <sstream>
#include <stdexcept>

#define CUDA_CHECK(call) \
{ \
Expand Down

0 comments on commit b829d0c

Please sign in to comment.