Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

question about BUILD_CYTHON_MODULES when building with cmake #15263

Open
hubutui opened this issue Jun 18, 2019 · 3 comments
Open

question about BUILD_CYTHON_MODULES when building with cmake #15263

hubutui opened this issue Jun 18, 2019 · 3 comments
Labels
Build CMake CMake related bugs/issues/improvements Feature request

Comments

@hubutui
Copy link

hubutui commented Jun 18, 2019

Description

make install doesn't install python binding properly when building with cmake.

Environment info (Required)

Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
Address sizes:       46 bits physical, 48 bits virtual
CPU(s):              24
On-line CPU(s) list: 0-23
Thread(s) per core:  2
Core(s) per socket:  6
Socket(s):           2
NUMA node(s):        2
Vendor ID:           GenuineIntel
CPU family:          6
Model:               63
Model name:          Intel(R) Xeon(R) CPU E5-2620 v3 @ 2.40GHz
Stepping:            2
CPU MHz:             1200.000
CPU max MHz:         2600.0000
CPU min MHz:         1200.0000
BogoMIPS:            4801.92
Virtualization:      VT-x
L1d cache:           32K
L1i cache:           32K
L2 cache:            256K
L3 cache:            15360K
NUMA node0 CPU(s):   0,2,4,6,8,10,12,14,16,18,20,22
NUMA node1 CPU(s):   1,3,5,7,9,11,13,15,17,19,21,23
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm cpuid_fault epb invpcid_single pti tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm xsaveopt cqm_llc cqm_occup_llc dtherm ida arat pln pts
----------Python Info----------
Version      : 3.7.3
Compiler     : GCC 8.2.1 20181127
Build        : ('default', 'Mar 26 2019 21:43:19')
Arch         : ('64bit', 'ELF')
------------Pip Info-----------
No corresponding pip install for current python.
----------MXNet Info-----------
No MXNet installed.
----------System Info----------
Platform     : Linux-4.18.5-arch1-1-ARCH-x86_64-with-arch
system       : Linux
node         : hubutui
release      : 4.18.5-arch1-1-ARCH
version      : #1 SMP PREEMPT Fri Aug 24 12:48:58 UTC 2018
----------Hardware Info----------
machine      : x86_64
processor    : 
----------Network Test----------
Setting timeout: 10
Timing for MXNet: https://github.com/apache/incubator-mxnet, DNS: 0.0062 sec, LOAD: 0.4946 sec.
Timing for Gluon Tutorial(en): http:https://gluon.mxnet.io, DNS: 0.2516 sec, LOAD: 0.7011 sec.
Timing for Gluon Tutorial(cn): https://zh.gluon.ai, DNS: 0.0924 sec, LOAD: 0.7636 sec.
Timing for FashionMNIST: https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/fashion-mnist/train-labels-idx1-ubyte.gz, DNS: 0.0213 sec, LOAD: 0.9804 sec.
Timing for PYPI: https://pypi.python.org/pypi/pip, DNS: 0.0024 sec, LOAD: 0.2850 sec.
Timing for Conda: https://repo.continuum.io/pkgs/free/, DNS: 0.0035 sec, LOAD: 0.0291 sec.

Package used (Python/R/Scala/Julia):
I'm using python 3,7

Build info (Required if built from source)

Compiler (gcc/clang/mingw/visual studio): gcc 8.3

MXNet commit hash:
(Paste the output of git rev-parse HEAD here.) 1.5.0.rc0

Build config:

cmake -DUSE_NCCL:BOOL=ON \
    -DUSE_BLAS=open \
    -DCMAKE_SHARED_LINKER_FLAGS=-lcblas \
    -DCMAKE_EXE_LINKER_FLAGS=-lcblas \
    -DUSE_MKL_IF_AVAILABLE:BOOL=OFF \
    -DBUILD_CYTHON_MODULES:BOOL=ON \
    -DCMAKE_BUILD_TYPE:String=Release \
    -DCMAKE_INSTALL_PREFIX:PATH=/usr \
    -DCMAKE_INSTALL_LIBDIR:PATH=lib \
          ..
make
make install

What have you tried to solve it?

  1. I check pr [MXNET-545] Fix broken cython build #10951, which adds BUILD_CYTHON_MODULES. But it seems that it only build the cython module, but no install target for it?
  2. Of course, I could manually run
python setup --with-cython install

to install the python module.

@mxnet-label-bot
Copy link
Contributor

Hey, this is the MXNet Label Bot.
Thank you for submitting the issue! I will try and suggest some labels so that the appropriate MXNet community members can help resolve it.
Here are my recommended labels: Build

@leleamol
Copy link
Contributor

@mxnet-label-bot add [Build, Cython]

@hubutui
Copy link
Author

hubutui commented Jun 28, 2019

In addition, it seems that make or python setup.py --with-cython build does not copy the libmxnet.so to proper place, mxnetosrc/python/build/lib.linux-x86_64-3.7/mxnet. Then the python test will fail, complaining that libmxnet.so is not found. And python setup.py install --with-cython --root=tmpdir will install libmxnet.so to tmpdir/usr/mxnet/libmxnet.so. This is not a typical place to install so files, and mxnet does not find lib from this location, either.

@leezu leezu added CMake CMake related bugs/issues/improvements Feature request labels Jan 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Build CMake CMake related bugs/issues/improvements Feature request
Projects
None yet
Development

No branches or pull requests

5 participants