Skip to content

Commit

Permalink
we can work with extention now!
Browse files Browse the repository at this point in the history
  • Loading branch information
weihuayi committed Jun 6, 2020
1 parent 7bbbf9b commit b56bf7a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
Empty file added fealpy/extent/__init__.py
Empty file.
4 changes: 2 additions & 2 deletions setup_linux_with_extent.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __str__(self):

ext_modules = [
Extension(
"fealpy.cgal",
"fealpy.extent.cgal",
[
"src/cgal/cgal.cpp",
],
Expand All @@ -37,7 +37,7 @@ def __str__(self):
author='Huayi Wei',
author_email='[email protected]',
license='GNU',
packages=['fealpy', 'fealpy.cgal'],
packages=['fealpy'],
install_requires=[
'numpy',
'scipy',
Expand Down
7 changes: 2 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
find_package(pybind11 REQUIRED)

find_package(CGAL REQUIRED)
include(${CGAL_USE_FILE})

file(GLOB SRCS "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
pybind11_add_module(fealpy_extent ${SRCS})
add_subdirectory(cgal)
#add_subdirectory(detri2)

target_link_libraries(fealpy_extent PRIVATE ${CGAL_LIBRARIES})
7 changes: 7 additions & 0 deletions src/cgal/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
find_package(CGAL REQUIRED)
include(${CGAL_USE_FILE})

#file(GLOB SRCS "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
pybind11_add_module(cgal cgal.cpp)
target_link_libraries(cgal PRIVATE ${CGAL_LIBRARIES})
set_target_properties(cgal PROPERTIES OUTPUT_NAME fealpy/cgal)
3 changes: 2 additions & 1 deletion src/cgal/cgal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ int add(int i, int j)
return i + j;
}

PYBIND11_MODULE(fealpy_extent, m){
PYBIND11_MODULE(cgal, m){
//m.attr("__name__") = "fealpy.cgal";
m.doc() = "This is a module extent of fealpy package!";
m.def("add", &add, "A function which adds two numbers");
m.def("generate_surface_mesh",
Expand Down

0 comments on commit b56bf7a

Please sign in to comment.