Skip to content

Commit

Permalink
Merge pull request #24 from noobaldrin/master
Browse files Browse the repository at this point in the history
Add OpenCL_LIBRARY auto detection for linux.
Fix error when writting on newly preallocated plot.
  • Loading branch information
bhamon authored Jan 8, 2018
2 parents b415d96 + 51991b5 commit d93604e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion PlotsFile-linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace cryo {
namespace gpuPlotGenerator {

void PlotsFile::preallocate(const std::string& p_path, unsigned long long p_size) throw (std::exception) {
int fd = open(p_path.c_str(), O_RDWR | O_CREAT | O_TRUNC);
int fd = open(p_path.c_str(), O_RDWR | O_CREAT | O_TRUNC, 0644);
if(fd == -1) {
throw std::runtime_error("Unable to open the output file");
}
Expand Down
7 changes: 7 additions & 0 deletions cmake/FindOpenCL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
lib/x64
OpenCL/common/lib/x64)
endif()
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
find_library(OpenCL_LIBRARY
NAMES libOpenCL.so
PATHS
ENV AMDAPPSDKROOT
PATH_SUFFIXES
lib/x86_64)
else()
find_library(OpenCL_LIBRARY
NAMES OpenCL)
Expand Down

0 comments on commit d93604e

Please sign in to comment.