mexnc-i64 with matlab7(r14) and FedoraCore5 64 bit

Discussion about analysis, visualization, and collaboration tools and techniques

Moderators: arango, robertson

Post Reply
Message
Author
DTokarev

mexnc-i64 with matlab7(r14) and FedoraCore5 64 bit

#1 Unread post by DTokarev »

Hi All,

I am trying to install ncview i64 on fedora core 5 64 bit with matlab 7 (r14)
64 bit but I have recieved next message:

/usr/bin/ld: /usr/local/lib/libnetcdf.a(attr.o): relocation R_X86_64_32
against `a local symbol' can not be used when making a shared object;
recompile with -fPIC
/usr/local/lib/libnetcdf.a: could not read symbols: Bad value
collect2: ld returned 1 exit status

mex: link of 'mexnc.mexa64' failed.

I found some recommendation here:

http://mexcdf.sourceforge.net/downloads/source.html

but it does not match with my case.

I will appreciate if somebody help me.

Thanks in advance,

Dmitry.

RubenDiez-Lazaro

#2 Unread post by RubenDiez-Lazaro »

Try this:

In the netcdf sources, edit the file"macros.make.in" and change the line 36:

CFLAGS = @CFLAGS@

by

CFLAGS = -fPIC @CFLAGS@

then run "./configure", "make" "make install"....

DTokarev

#3 Unread post by DTokarev »

Thank you for help.

I use netcdf3.6.2 with ifort 9.1.043 and I see no src directory in the
netcdf.

Where must I do this changes?

Thanks,

Dmitry

RubenDiez-Lazaro

#4 Unread post by RubenDiez-Lazaro »

Are you using the source distribution or a binary distribution?
You must recompile the netcdf library, so you need the source distribution...

I use the the 3.6.1 version of netcdf, and the things seems to be a little different in the 3.6.2 release.
In the 3.6.2 version you must edit the "Makefile.in" file, find the string

Code: Select all

"CFLAGS = @CFLAGS@" 
(line 126)
and change it by

Code: Select all

"CFLAGS = -fPIC @CFLAGS@"
Then you compile it with (in the netcdf source dir):

Code: Select all

./configure
make
make install
Note that you can make a specific matlab netcdf compilation and put it in a specific dir,
by done (for example):

Code: Select all

./configure --prefix=/home/myuser/netcdf_matlab
then, at the end of the "mexopts.sh" you must match the correct dir (in the example,
"/home/myuser/netcdf_matlab")

DTokarev

#5 Unread post by DTokarev »

Thank you very much,

Now it's work

Post Reply