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

Error During Make - undefined reference #11890

Closed
elofgren opened this issue Jul 25, 2018 · 11 comments
Closed

Error During Make - undefined reference #11890

elofgren opened this issue Jul 25, 2018 · 11 comments
Labels

Comments

@elofgren
Copy link

Trying to install the mxnet library on Scientific Linux 7. I've changed the flag in mshadow/make/mshadow.mk to use -lsatlas.

This has allowed the installation to progress considerably further, but it still ends with a 1 exit status. The error I'm getting now is below:

c/c_api/c_api_error.o build/src/executor/inplace_addto_detect_pass.o build/src/executor/graph_executor.o build/src/executor/infer_graph_attr_pass.o build/src/executor/attach_op_execs_pass.o build/src/executor/attach_op_resource_pass.o build/src/kvstore/gradient_compression.o build/src/kvstore/kvstore_utils.o build/src/kvstore/kvstore.o build/src/resource.o build/src/initialize.o /home/elofgren/mxnet/3rdparty/dmlc-core/libdmlc.a /home/elofgren/mxnet/3rdparty/tvm/nnvm/lib/libnnvm.a -pthread -lm -lsatlas -L/usr/lib64/atlas -fopenmp -lrt -lopencv_calib3d -lopencv_contrib -lopencv_core -lopencv_features2d -lopencv_flann -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_objdetect -lopencv_photo -lopencv_stitching -lopencv_superres -lopencv_video -lopencv_videostab -llapack
a - build/src/operator/leaky_relu.o
a - build/src/operator/identity_attach_KL_sparse_reg.o
a - build/src/operator/make_loss.o
a - build/src/operator/operator.o
a - build/src/operator/operator_tune.o
a - build/src/operator/correlation.o
a - build/src/operator/operator_util.o
a - build/src/operator/spatial_transformer.o
a - build/src/operator/slice_channel.o
a - build/src/operator/sequence_mask.o
a - build/src/operator/optimizer_op.o
a - build/src/engine/naive_engine.o
a - build/src/engine/openmp.o
a - build/src/engine/threaded_engine_pooled.o
a - build/src/engine/threaded_engine.o
a - build/src/engine/engine.o
a - build/src/engine/threaded_engine_perdevice.o
a - build/src/storage/storage.o
a - build/src/c_api/c_api_executor.o
a - build/src/c_api/c_api_symbolic.o
a - build/src/c_api/c_api_profile.o
a - build/src/c_api/c_api_ndarray.o
a - build/src/c_api/c_predict_api.o
a - build/src/c_api/c_api_function.o
a - build/src/c_api/c_api.o
a - build/src/c_api/c_api_error.o
a - build/src/executor/inplace_addto_detect_pass.o
a - build/src/executor/graph_executor.o
a - build/src/executor/infer_graph_attr_pass.o
a - build/src/executor/attach_op_execs_pass.o
a - build/src/executor/attach_op_resource_pass.o
a - build/src/kvstore/gradient_compression.o
a - build/src/kvstore/kvstore_utils.o
a - build/src/kvstore/kvstore.o
a - build/src/resource.o
a - build/src/initialize.o
/tmp/ccFF5lC6.o: In function main': im2rec.cc:(.text.startup+0x28fb): undefined reference to cv::imencode(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, cv::_InputArray const&, std::vector<unsigned char, std::allocator >&, std::vector<int, std::allocator > const&)'
collect2: error: ld returned 1 exit status
make: *** [bin/im2rec] Error 1

Any idea what's generating this, or how to fix it?

Below are the results of diagnose.py, for reference:

----------Python Info----------
('Version :', '2.7.15')
('Compiler :', 'GCC 7.2.0')
('Build :', ('default', 'May 1 2018 23:32:55'))
('Arch :', ('64bit', ''))
------------Pip Info-----------
('Version :', '10.0.1')
('Directory :', '/home/user/anaconda2/lib/python2.7/site-packages/pip')
----------MXNet Info-----------
No MXNet installed.
----------System Info----------
('Platform :', 'Linux-3.10.0-862.6.3.el7.x86_64-x86_64-with-redhat-7.4-Nitrogen')
('system :', 'Linux')
('node :', 'thisisnottherealname.wsu.edu')
('release :', '3.10.0-862.6.3.el7.x86_64')
('version :', '#1 SMP Tue Jun 26 12:13:22 CDT 2018')
----------Hardware Info----------
('machine :', 'x86_64')
('processor :', 'x86_64')
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 16
On-line CPU(s) list: 0-15
Thread(s) per core: 2
Core(s) per socket: 8
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 63
Model name: Intel(R) Core(TM) i7-5960X CPU @ 3.00GHz
Stepping: 2
CPU MHz: 1385.009
CPU max MHz: 3300.0000
CPU min MHz: 1200.0000
BogoMIPS: 7496.74
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 20480K
NUMA node0 CPU(s): 0-15
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 aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx 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 epb intel_ppin ibrs ibpb stibp 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 spec_ctrl intel_stibp
----------Network Test----------
Setting timeout: 10
Timing for MXNet: https://github.com/apache/incubator-mxnet, DNS: 0.0032 sec, LOAD: 0.5423 sec.
Timing for PYPI: https://pypi.python.org/pypi/pip, DNS: 0.0234 sec, LOAD: 0.6100 sec.
Timing for FashionMNIST: https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/fashion-mnist/train-labels-idx1-ubyte.gz, DNS: 0.1200 sec, LOAD: 0.2219 sec.
Timing for Conda: https://repo.continuum.io/pkgs/free/, DNS: 0.0230 sec, LOAD: 0.6329 sec.
Timing for Gluon Tutorial(en): http://gluon.mxnet.io, DNS: 0.1685 sec, LOAD: 0.3532 sec.
Timing for Gluon Tutorial(cn): https://zh.gluon.ai, DNS: 1.2911 sec, LOAD: 1.1775 sec.

@sandeep-krishnamurthy
Copy link
Contributor

Hello @elofgren - Have you installed OpenCV?

@elofgren
Copy link
Author

Yes, via sudo yum install opencv-devel

@elofgren
Copy link
Author

Just attempted to reinstall OpenCV following this guide: https://gist.github.com/dnordgren/665af430064cdbaa9a31

The error that followed:

tools/im2rec.cc: In function ‘int main(int, char**)’:
tools/im2rec.cc:88:20: error: ‘CV_LOAD_IMAGE_COLOR’ was not declared in this scope
int color_mode = CV_LOAD_IMAGE_COLOR;
^
tools/im2rec.cc:90:22: error: ‘CV_INTER_LINEAR’ was not declared in this scope
int inter_method = CV_INTER_LINEAR;
^
tools/im2rec.cc:195:31: error: ‘CV_IMWRITE_PNG_COMPRESSION’ was not declared in this scope
encode_params.push_back(CV_IMWRITE_PNG_COMPRESSION);
^
tools/im2rec.cc:199:31: error: ‘CV_IMWRITE_JPEG_QUALITY’ was not declared in this scope
encode_params.push_back(CV_IMWRITE_JPEG_QUALITY);
^
make: *** [bin/im2rec] Error 1

This seems like it's pretty clearly an OpenCV problem?

@sandeep-krishnamurthy
Copy link
Contributor

Yes it looks like your OpenCV installation and for MXNet to find it is having issue. Can you try commands here - https://github.com/apache/incubator-mxnet/blob/master/setup-utils/install-mxnet-amz-linux.sh#L48

@elofgren
Copy link
Author

Same general error, with and without setting the path in the line below that highlighted section of the script. I didn't see any errors in the OpenCV installation itself.

tools/im2rec.cc: In function ‘int main(int, char**)’:
tools/im2rec.cc:88:20: error: ‘CV_LOAD_IMAGE_COLOR’ was not declared in this scope
int color_mode = CV_LOAD_IMAGE_COLOR;
^
tools/im2rec.cc:90:22: error: ‘CV_INTER_LINEAR’ was not declared in this scope
int inter_method = CV_INTER_LINEAR;
^
tools/im2rec.cc:195:31: error: ‘CV_IMWRITE_PNG_COMPRESSION’ was not declared in this scope
encode_params.push_back(CV_IMWRITE_PNG_COMPRESSION);
^
tools/im2rec.cc:199:31: error: ‘CV_IMWRITE_JPEG_QUALITY’ was not declared in this scope
encode_params.push_back(CV_IMWRITE_JPEG_QUALITY);
^
make: *** [bin/im2rec] Error 1

@liangxi627
Copy link

@elofgren Hello, I met the same error, have you solved the problem?

@elofgren
Copy link
Author

Nope. General consensus is it's an OpenCV problem, but I've made no headway since.

@liangxi627
Copy link

I just found the solution. I replaced the "CV_LOAD_IMAGE_COLOR" with "cv::IMREAD_COLOR", and other symbols should should remove the CV_ prefix, such as "CV_INTER_LINEAR" to "cv::INTER_LINEAR"

@sandeep-krishnamurthy
Copy link
Contributor

@liangxi627 - can you please give more details? Is it due to version mis-match of OpenCV?

@liangxi627
Copy link

@sandeep-krishnamurthy
Copy link
Contributor

Great. It is openCV version that caused the issue. Thanks for sharing the links.
Resolving the issue. Please reopen if closed in error.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants