Basic usage

80 views
Skip to first unread message

ethanhs

unread,
Sep 29, 2016, 5:18:30 PM9/29/16
to scikit-build
So I found your awesome project and want to get started with using it. Are there any examples of libraries that use it?

Also, I have a CMakeLists.txt like:

cmake_minimum_required(VERSION 3.3.0)
project
(svg)
# find the cython info we need
find_package
(Cython)
# add cython target to be built
add_cython_target
(svg svg.pyx)
# build a library
add_library
(svg MODULE ${svg})

And then I configure and make using cmaker in setup.py, however:

1. scikit-build tries to build a target install, which doesn't exist, the target is the name svg (so msbuild can't find an install.vcxproj).

2. Even if I manually run the build, it appears that Python was not added to the include path, as it complains that the generated C file from the pyx cannot find Python.h.... does find_package Cython not take care of finding the Python includes, etc?


Matt McCormick

unread,
Sep 29, 2016, 5:38:52 PM9/29/16
to ethanhs, scikit-build
Hi Ethan,

Welcome to scikit-build!

Here is the list of projects we are working on adding scikit-build support:

https://github.com/scikit-build/scikit-build/issues/79

But here is a simple example Cython project that should help:

https://github.com/scikit-build/scikit-build-sample-projects/tree/653d7d22b3372d7ff469b3e4e5aee4bd1e10e92c/projects/pen2-cython

We will be simplifying the required CMake configuration in the future.

Cheers,
Matt
> --
> You received this message because you are subscribed to the Google Groups
> "scikit-build" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to scikit-build...@googlegroups.com.
> To post to this group, send email to scikit...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/scikit-build/b2dba990-f0ca-4b93-acb4-ff61432e0c1a%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

ethanhs

unread,
Sep 29, 2016, 6:35:44 PM9/29/16
to scikit-build
Thanks! It seems that you call FindPythonLibs and Interp multiple times, which CMake doesn't like. I found doing:
 
IF(NOT PYTHONINTERP_FOUND)
     find_package
(PythonInterp REQUIRED)
ENDIF
()

And similar for PythonLibs useful to avoid CMake giving errors about libs. The main change I had to make was in FindPythonExtensions.cmake, to guard PythonInterp and Libs to not be found again.
I suppose since I found Cython first, that will need to have the checking added.

I can submit a PR with the proposed changes if you want.

Matthew McCormick

unread,
Sep 29, 2016, 10:29:48 PM9/29/16
to ethanhs, scikit-build
There should be no errors calling find_package(PythonInterp REQUIRED)
multiple times. What errors are you getting?
> https://groups.google.com/d/msgid/scikit-build/8ef85c9a-3596-4012-b0fb-0b36a2cc5dc1%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages