Skip to content
Closed
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
38 changes: 19 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,59 +44,59 @@ endif()


if (MULTI_STAGE_BUILD)
find_package(dpct_core REQUIRED)
find_package(dpct REQUIRED)
else()
find_package(Lemon REQUIRED)
file(GLOB_RECURSE SOURCES src/*.cpp)
file(GLOB_RECURSE HEADERS include/*.h)
include_directories(${Lemon_INCLUDE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/)
add_library(dpct_core SHARED ${SOURCES} ${HEADERS})
target_link_libraries(dpct_core ${Lemon_LIBRARIES})
add_library(dpct SHARED ${SOURCES} ${HEADERS})
target_link_libraries(dpct ${Lemon_LIBRARIES})

target_include_directories(dpct_core
target_include_directories(dpct
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)

set_target_properties(dpct_core PROPERTIES
EXPORT_NAME dpct_core
set_target_properties(dpct PROPERTIES
EXPORT_NAME dpct
)

# installation
install(TARGETS dpct_core
EXPORT dpct_coreTargets
install(TARGETS dpct
EXPORT dpctTargets
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
)
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/"
DESTINATION include/dpct_core
DESTINATION include/dpct
FILES_MATCHING PATTERN "*.h"
)

install(EXPORT dpct_coreTargets
FILE dpct_coreTargets.cmake
DESTINATION lib/cmake/dpct_core
install(EXPORT dpctTargets
FILE dpctTargets.cmake
DESTINATION lib/cmake/dpct
)

write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/dpct_coreConfigVersion.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/dpctConfigVersion.cmake"
VERSION 1.5.0
COMPATIBILITY SameMajorVersion
)
configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/dpct_coreConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/dpct_coreConfig.cmake"
INSTALL_DESTINATION lib/cmake/dpct_core
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/dpctConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/dpctConfig.cmake"
INSTALL_DESTINATION lib/cmake/dpct
)

install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/dpct_coreConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/dpct_coreConfigVersion.cmake"
DESTINATION lib/cmake/dpct_core
"${CMAKE_CURRENT_BINARY_DIR}/dpctConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/dpctConfigVersion.cmake"
DESTINATION lib/cmake/dpct
)


Expand Down
2 changes: 1 addition & 1 deletion bin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ file(GLOB BIN_SRCS *.cpp)
foreach(src ${BIN_SRCS})
get_filename_component(bin_name ${src} NAME_WE)
add_executable(${bin_name} ${src})
target_link_libraries(${bin_name} dpct_core ${Boost_LIBRARIES})
target_link_libraries(${bin_name} dpct ${Boost_LIBRARIES})
target_compile_definitions(${bin_name} PRIVATE -DBOOST_ALL_NO_LIB -DBOOST_ALL_DYN_LINK)
install(TARGETS ${bin_name}
ARCHIVE DESTINATION lib
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
include(CMakeFindDependencyMacro)
find_dependency(Lemon REQUIRED)

include("${CMAKE_CURRENT_LIST_DIR}/dpct_coreTargets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/dpctTargets.cmake")
31 changes: 27 additions & 4 deletions conda-recipe/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ source:

outputs:
- package:
name: dpct-core
name: libdpct
version: ${{ version }}

build:
Expand All @@ -32,8 +32,31 @@ outputs:
- lemon ${{ lemon }}*
run_exports:
weak:
- ${{ pin_subpackage("dpct-core", exact=True) }}
- ${{ pin_subpackage("libdpct", exact=True) }}

tests:
- script:
- if: not win
then: test -d ${PREFIX}/include/dpct
else: if not exist %LIBRARY_INC%\dpct exit 1
- if: osx
then: test -f ${PREFIX}/lib/libdpct.dylib
- if: linux
then: test -f ${PREFIX}/lib/libdpct.so
- if: win
then: if not exist %LIBRARY_BIN%\dpct.dll exit 1
- if: not win
then: test -f ${PREFIX}/lib/cmake/dpct/dpctTargets.cmake
else: if not exist %LIBRARY_LIB%\cmake\dpct\dpctTargets.cmake exit 1
- if: not win
then: test -f ${PREFIX}/lib/cmake/dpct/dpctTargets-release.cmake
else: if not exist %LIBRARY_LIB%\cmake\dpct\dpctTargets-release.cmake exit 1
- if: not win
then: test -f ${PREFIX}/lib/cmake/dpct/dpctConfig.cmake
else: if not exist %LIBRARY_LIB%\cmake\dpct\dpctConfig.cmake exit 1
- if: not win
then: test -f ${PREFIX}/lib/cmake/dpct/dpctConfigVersion.cmake
else: if not exist %LIBRARY_LIB%\cmake\dpct\dpctConfigVersion.cmake exit 1

- package:
name: dpct
Expand Down Expand Up @@ -63,10 +86,10 @@ outputs:
- pybind11
- lemon ${{ lemon }}*
- python
- ${{ pin_subpackage("dpct-core", exact=True) }}
- ${{ pin_subpackage("libdpct", exact=True) }}
run:
- python
- ${{ pin_subpackage("dpct-core", upper_bound="x.x") }}
- ${{ pin_subpackage("libdpct", upper_bound="x.x") }}

tests:
- script:
Expand Down
2 changes: 1 addition & 1 deletion include/config.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once
#ifdef _MSC_VER
#ifdef dpct_core_EXPORTS
#ifdef dpct_EXPORTS
#define DPCT_API __declspec(dllexport)
#else
#define DPCT_API __declspec(dllimport)
Expand Down
11 changes: 6 additions & 5 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ find_package(Python REQUIRED Interpreter Development)
find_package(pybind11 CONFIG)

# include external headers as system includes so we do not have to cope with their warnings
include_directories( SYSTEM ${PYTHON_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} )
include_directories(SYSTEM ${PYTHON_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS})

set(PYDPCT_SRCS pydpct.cpp pythongraphreader.cpp)
pybind11_add_module(dpct ${PYDPCT_SRCS})
target_link_libraries(dpct PRIVATE dpct_core)
target_include_directories(dpct PRIVATE ${DPCT_CORE_INCLUDE_DIR})
pybind11_add_module(dpct_python ${PYDPCT_SRCS})
set_target_properties(dpct_python PROPERTIES OUTPUT_NAME dpct)
target_link_libraries(dpct_python PRIVATE dpct)
target_include_directories(dpct_python PRIVATE ${DPCT_CORE_INCLUDE_DIR})

install(TARGETS dpct
install(TARGETS dpct_python
LIBRARY DESTINATION ${Python_SITELIB}
RUNTIME DESTINATION ${Python_SITELIB})
10 changes: 5 additions & 5 deletions python/pydpct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
#include <pybind11/stl.h>


#include <dpct_core/flowgraph.h>
#include <dpct_core/flowgraphbuilder.h>
#include <dpct_core/graph.h>
#include <dpct_core/magnusson.h>
#include <dpct_core/magnussongraphbuilder.h>
#include <dpct/flowgraph.h>
#include <dpct/flowgraphbuilder.h>
#include <dpct/graph.h>
#include <dpct/magnusson.h>
#include <dpct/magnussongraphbuilder.h>
#include "pythongraphreader.h"

using namespace dpct;
Expand Down
4 changes: 2 additions & 2 deletions python/pythongraphreader.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

#include <dpct_core/graphbuilder.h>
#include <dpct_core/graphreader.h>
#include <dpct/graphbuilder.h>
#include <dpct/graphreader.h>

namespace dpct {

Expand Down
Loading