[mlpack] issue with mlpack Python bindings on Mac OsX

Ryan Curtin ryan at ratml.org
Fri Dec 14 00:34:36 EST 2018


On Thu, Dec 13, 2018 at 10:26:24AM +0000, Frodo Jedi wrote:
> Hi Ryan,
> many thanks for your quick reply.
> 
> When running "make python"  I get the following error:
>
> clang -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g -fwrapv
> -O3 -Wall -Wstrict-prototypes
> -I/usr/local/lib/python2.7/site-packages/numpy/core/include
> -I/Users/frodo/Documents/Machine_learning/mlpack-3.0.4/build/src/mlpack/bindings/python/
> -I/Users/frodo/Documents/Machine_learning/mlpack-3.0.4/src
> -I/usr/local/include -I/usr/local/include
> -I/Users/frodo/Documents/Machine_learning/mlpack-3.0.4/build/src/mlpack/..
> -I/usr/local/include -I/usr/local/opt/openssl/include
> -I/usr/local/opt/sqlite/include
> -I/usr/local/Cellar/python at 2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/include/python2.7
> -c
> /Users/frodo/Documents/Machine_learning/mlpack-3.0.4/build/src/mlpack/bindings/python/mlpack/arma_numpy.cpp
> -o
> build/temp.macosx-10.12-x86_64-2.7/Users/frodo/Documents/Machine_learning/mlpack-3.0.4/build/src/mlpack/bindings/python/mlpack/arma_numpy.o
> -DBINDING_TYPE=BINDING_TYPE_PYX -std=c++11 -O3 -Wno-unknown-pragmas
> error: unable to open output file
> 
> 'build/temp.macosx-10.12-x86_64-2.7/Users/frodo/Documents/Machine_learning/mlpack-3.0.4/build/src/mlpack/bindings/python/mlpack/arma_numpy.o':
>       'Operation not permitted'
> 1 error generated.
> error: command 'clang' failed with exit status 1

So, this is the actual error here.  Don't worry about the numpy
warnings, they are expected.  I think this is actually a result of
Cython continuing to use deprecated numpy functionality.  I am not sure
when (or if) that will be fixed.

In any case, it's rather strange for clang to fail claiming 'operation
not permitted' on simply building a .o file.  It's also written "error:
unable to open output file", so is it possible that there is a
permissions issue?  Are you building as the same user that you
configured the project with?

Some brief StackOverflow searches suggest that this could have something
to do with 'csrutil', but I am not an OS X expert so make sure you do
some reading before attempting anything there.  Another thing to try
might be to try and create the file 'arma_numpy.o' (just as an empty
file or whatever, with the 'touch' command) in the directory that CMake
is trying to build it in.  That might give some more information about
the problem, and you might be able to diagnose and fix it from there.

> Notably, there are some issues when running cmake whit a completely clean
> (i.e. new) build directory:
> 
> -- Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES)
> -- Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS
> OpenMP_CXX_LIB_NAMES)
> -- Could NOT find OpenMP (missing: OpenMP_C_FOUND OpenMP_CXX_FOUND)

Don't worry about those, it means your compiler does not seem to have
adequate OpenMP support.  That's ok, and mlpack will still compile just
fine.  If it was an error, it would have stopped configuration and you
would not be able to compile.

> What do you suggest should I do? Any flag for cmake you reccommend me to
> use?

Everything else in the output looks okay to me, so no recommendations
for changed CMake flags or anything.  The actual build failure you were
seeing is strange to me and suggests some issue on the system itself (at
least that it was it looks like to me).

In any case, I'm happy to see that CMake has correctly found the right
Python packages during the configuration step.

Hope that this helps!

Thanks,

Ryan

-- 
Ryan Curtin    | "So I got that going for me, which is nice."
ryan at ratml.org |   - Carl Spackler


More information about the mlpack mailing list