Comments (3)
Hi, this is old known issue with Matlab in Linux. As it is distributed as a binary blob, it is usually compiled with a GCC which Mathworks decides to use (usually much older than the one distributed in Ubuntu's LTS releases, usually so old that it's not even in repositories among the older gcc version). Main problem arises especially with libstdc++ library as Matlab is distributed with its own version, therefore anything written in C++ and compiled in system (newer) version of GCC is not able to link in Matlab by default. That is why mathworks sets the compiler to be the recommended version (in this case to gcc-4.4
).
However there are other solutions than compiling it's own version of GCC. First thing is to set proper version of gcc, which you can usually do by 'mex -setup' and then check the settings in ~/.matlab/<version>/mexopts.sh
. I usually set it just to gcc
or g++
without a version specification.
Then it is possible to force Matlab to link against the system version of libstdc++ by using the LD_PRELOAD trick, e.g. by running Matlab with:
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6 matlab
This is sort of dirty solution too, but to me it has shown to be the most versatile as then you can run any system commands written in C++ in Matlab without getting linker error.
I hope that someone will find it useful, maybe in the future :)
from matconvnet.
SOLVED !
I had to do a pretty drastic fix. I installed the older version of gcc(i.e. gcc-4.4) alongside the existing version by following the instructions here : http://xlcwu.wordpress.com/2012/07/24/ubuntu-12-04-gcc-4-4/
The instructions also specify how to make gcc-4.4 the default compiler. Then, in MATLAB, I ran
mex -setup
and chose option 1(create mexopts.sh) file in my home directory. I edited the mexopts.sh file as described in http://stackoverflow.com/questions/8524235/how-to-provide-matlab-with-the-old-gcc-version-it-wants
Voila ! The compilation went through. I am not too happy with the fact that I changed the default version from my current(gcc-4.8) to 4.4 but whatever !
from matconvnet.
On another machine, I installed gcc-4.4 and modified mexopts.sh to use gcc-4.4. That worked as well. I did not have to resort to LD_PRELOAD trick. Good to know, though.
from matconvnet.
Related Issues (20)
- Latest versions vl_compilenn fail
- vl_compilenn directory
- Error in vl_testnn('gpu', true). MATLAB: mex: ErrInvalidMEXFile
- Error vl_compilenn('enableGpu', true) HOT 1
- cuda11.1 HOT 1
- 未定义的函数 'vl_testnn'
- this is why
- D:\Software\matconvnet-1.0-beta25\matlab\src\bits\datacu.hpp(89): error: identifier "cudnnConvolutionFwdPreference_t" is undefined D:\Software\matconvnet-1.0-beta25\matlab\src\bits\datacu.hpp(94): error: identifier "cudnnConvolutionBwdFilterPreference_t" is undefined D:\Software\matconvnet-1.0-beta25\matlab\src\bits\datacu.hpp(99): error: identifier "cudnnConvolutionBwdDataPreference_t" is undefined D:\Software\matconvnet-1.0-beta25\matlab\src\bits\datacu.hpp(141): error: identifier "cudnnConvolutionFwdPreference_t" is undefined D:\Software\matconvnet-1.0-beta25\matlab\src\bits\datacu.hpp(147): error: identifier "cudnnConvolutionBwdFilterPreference_t" is undefined D:\Software\matconvnet-1.0-beta25\matlab\src\bits\datacu.hpp(153): error: identifier "cudnnConvolutionBwdDataPreference_t" is undefined 6 errors detected in the compilation of "D:/Software/matconvnet-1.0-beta25/matlab/src/bits/data.cu". HOT 1
- every time i reopen the matlab porject,need to recompile the matconvnet,why?
- Question about the matrix format of vgg19
- Error in vl_compilenn>mex_compile (line 583) and vl_compilenn (line 492) HOT 1
- How to solve?
- The NVCC compiler 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin\nvcc' does not appear to be valid. HOT 1
- Issue when compiling with GPU enabled HOT 1
- error in vl_compilenn HOT 1
- Is vl_nnconv implemented based on the FFT operator? HOT 1
- Convert pytorch model to matconvnet model
- Matlab crack after run again Matconvnet
- Reference to non-existent field ‘dilate‘.
- Have trouble compiling MatConvNet
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from matconvnet.