Fixed Python link bug in CMakeLists
This commit is contained in:
@@ -37,7 +37,7 @@ if(WIN32)
|
||||
add_subdirectory(deps/dlfcn-win32/src ${CMAKE_BINARY_DIR}/dlfcn-win32)
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_FORMAT_MACROS -std=gnu++17")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_FORMAT_MACROS -fPIC -std=gnu++17")
|
||||
|
||||
|
||||
##########
|
||||
@@ -162,7 +162,7 @@ list(APPEND CMAKE_MODULE_PATH ${LLVM_LIBRARY_DIR}/cmake/mlir)
|
||||
include(TableGen) # required by AddMLIR
|
||||
include(AddLLVM)
|
||||
include(AddMLIR)
|
||||
include(HandleLLVMOptions) # human-friendly error message
|
||||
# include(HandleLLVMOptions) # human-friendly error message
|
||||
|
||||
include_directories(${MLIR_INCLUDE_DIRS})
|
||||
include_directories(${PROJECT_SOURCE_DIR}/include)
|
||||
@@ -174,18 +174,15 @@ add_subdirectory(lib)
|
||||
|
||||
add_library(triton SHARED ${PYTHON_SRC})
|
||||
|
||||
find_package(PythonLibs REQUIRED)
|
||||
# find_package(PythonLibs REQUIRED)
|
||||
|
||||
target_link_libraries(triton
|
||||
${PYTHON_LIBRARIES}
|
||||
TritonIR
|
||||
TritonDriver
|
||||
# TritonCodeGen
|
||||
|
||||
# optimizations
|
||||
MLIRPass
|
||||
MLIRTransforms
|
||||
|
||||
${PYTHON_LIBRARIES}
|
||||
)
|
||||
|
||||
target_link_options(triton PRIVATE ${LLVM_LDFLAGS})
|
||||
|
@@ -19,7 +19,8 @@ namespace triton
|
||||
namespace nvrtc
|
||||
{
|
||||
|
||||
#define TRITON_CREATE_NVRTC_EXCEPTION(name, msg) class name: public std::exception { public: const char * what() const throw(){ return "NVRTC: Error- " msg; } }
|
||||
#define TRITON_CREATE_NVRTC_EXCEPTION(name, msg) \
|
||||
class name: public std::exception { public: const char * what() const throw() override { return "NVRTC: Error- " msg; } }
|
||||
|
||||
TRITON_CREATE_NVRTC_EXCEPTION(out_of_memory ,"out of memory");
|
||||
TRITON_CREATE_NVRTC_EXCEPTION(program_creation_failure ,"program creation failure");
|
||||
@@ -38,7 +39,8 @@ namespace triton
|
||||
{
|
||||
class base: public std::exception{};
|
||||
|
||||
#define TRITON_CREATE_CUDA_EXCEPTION(name, msg) class name: public base { public:const char * what() const throw(){ return "CUDA: Error- " msg; } }
|
||||
#define TRITON_CREATE_CUDA_EXCEPTION(name, msg) \
|
||||
class name: public base { public:const char * what() const throw() override { return "CUDA: Error- " msg; } }
|
||||
|
||||
|
||||
TRITON_CREATE_CUDA_EXCEPTION(invalid_value ,"invalid value");
|
||||
@@ -106,7 +108,8 @@ namespace triton
|
||||
{
|
||||
class base: public std::exception{};
|
||||
|
||||
#define TRITON_CREATE_CUBLAS_EXCEPTION(name, msg) class name: public base { public: const char * what() const throw(){ return "CUBLAS: Error- " msg; } }
|
||||
#define TRITON_CREATE_CUBLAS_EXCEPTION(name, msg) \
|
||||
class name: public base { public: const char * what() const throw() override { return "CUBLAS: Error- " msg; } }
|
||||
|
||||
TRITON_CREATE_CUBLAS_EXCEPTION(not_initialized ,"not initialized");
|
||||
TRITON_CREATE_CUBLAS_EXCEPTION(alloc_failed ,"alloc failed");
|
||||
@@ -124,7 +127,8 @@ namespace triton
|
||||
|
||||
namespace cudnn
|
||||
{
|
||||
#define TRITON_CREATE_CUDNN_EXCEPTION(name, msg) class name: public std::exception { public: const char * what() const throw(){ return "CUDNN: Error- " msg; } }
|
||||
#define TRITON_CREATE_CUDNN_EXCEPTION(name, msg) \
|
||||
class name: public std::exception { public: const char * what() const throw() override { return "CUDNN: Error- " msg; } }
|
||||
|
||||
TRITON_CREATE_CUDNN_EXCEPTION(not_initialized ,"not initialized");
|
||||
TRITON_CREATE_CUDNN_EXCEPTION(alloc_failed ,"allocation failed");
|
||||
@@ -148,7 +152,8 @@ namespace triton
|
||||
{
|
||||
class base: public std::exception{};
|
||||
|
||||
#define TRITON_CREATE_HIP_EXCEPTION(name, msg) class name: public base { public:const char * what() const throw(){ return "HIP: Error- " msg; } }
|
||||
#define TRITON_CREATE_HIP_EXCEPTION(name, msg) \
|
||||
class name: public base { public:const char * what() const throw() override { return "HIP: Error- " msg; } }
|
||||
|
||||
|
||||
TRITON_CREATE_HIP_EXCEPTION(invalid_value ,"invalid value");
|
||||
|
Reference in New Issue
Block a user