tbeu / matio

MATLAB MAT File I/O Library
https://matio.sourceforge.io
BSD 2-Clause "Simplified" License
330 stars 97 forks source link

Problem during the linkage #136

Closed bkaangorur closed 4 years ago

bkaangorur commented 4 years ago

Hello,

I can use the matio library by compiling source files in my development environment without zlib and hdf5 libraries. Now, I would like to use it with zlib and I tried to build it by using ./configure and make commands. However, I am getting "libtool: line 1727: lib: command not found" error when I run the make command. The following messages are the results of ./configure and make commands respectively.

I am trying to build the matio library in an 64-bit Windows OS. My compiler is gcc (MinGW) and I use Cygwin. I have already built the zlib from source, so I have "libzlib.dll", "libzlib.dll.a", and "libzlibstatic.a" libraries. My path variables also cover these libraries. So, I could not figure out how to overcome this installation issue and will be very pleased if you can help.

   MATIO Configuration Summary
==============================================================
           C Compiler: gcc
               CFLAGS:  -g -O2
     Shared Libraries: yes
     Static Libraries: yes
  default MAT version: MAT_FT_MAT5

Features --------------------------------------------
  MAT v7.3 file support: no
Extended sparse support: yes

Packages --------------------------------------------
                 zlib: -LD:/workspace/cppLibraries/zlib/lib -lz
                 hdf5:
               MATLAB:
Making all in src
make[1]: Entering directory '/home/kgorur/matio-master/src'
make  all-am
make[2]: Entering directory '/home/kgorur/matio-master/src'
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I.  -ID:/workspace/cppLibraries/zlib/include  -g -O2 -c -o snprintf.lo snprintf.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -ID:/workspace/cppLibraries/zlib/include -g -O2 -c snprintf.c  -DDLL_EXPORT -DPIC -o .libs/snprintf.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -ID:/workspace/cppLibraries/zlib/include -g -O2 -c snprintf.c -o snprintf.o >/dev/null 2>&1
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I.  -ID:/workspace/cppLibraries/zlib/include  -g -O2 -c -o endian.lo endian.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -ID:/workspace/cppLibraries/zlib/include -g -O2 -c endian.c  -DDLL_EXPORT -DPIC -o .libs/endian.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -ID:/workspace/cppLibraries/zlib/include -g -O2 -c endian.c -o endian.o >/dev/null 2>&1
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I.  -ID:/workspace/cppLibraries/zlib/include  -g -O2 -c -o io.lo io.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -ID:/workspace/cppLibraries/zlib/include -g -O2 -c io.c  -DDLL_EXPORT -DPIC -o .libs/io.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -ID:/workspace/cppLibraries/zlib/include -g -O2 -c io.c -o io.o >/dev/null 2>&1
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I.  -ID:/workspace/cppLibraries/zlib/include  -g -O2 -c -o inflate.lo inflate.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -ID:/workspace/cppLibraries/zlib/include -g -O2 -c inflate.c  -DDLL_EXPORT -DPIC -o .libs/inflate.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -ID:/workspace/cppLibraries/zlib/include -g -O2 -c inflate.c -o inflate.o >/dev/null 2>&1
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I.  -ID:/workspace/cppLibraries/zlib/include  -g -O2 -c -o read_data.lo read_data.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -ID:/workspace/cppLibraries/zlib/include -g -O2 -c read_data.c  -DDLL_EXPORT -DPIC -o .libs/read_data.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -ID:/workspace/cppLibraries/zlib/include -g -O2 -c read_data.c -o read_data.o >/dev/null 2>&1
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I.  -ID:/workspace/cppLibraries/zlib/include  -g -O2 -c -o mat5.lo mat5.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -ID:/workspace/cppLibraries/zlib/include -g -O2 -c mat5.c  -DDLL_EXPORT -DPIC -o .libs/mat5.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -ID:/workspace/cppLibraries/zlib/include -g -O2 -c mat5.c -o mat5.o >/dev/null 2>&1
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I.  -ID:/workspace/cppLibraries/zlib/include  -g -O2 -c -o mat4.lo mat4.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -ID:/workspace/cppLibraries/zlib/include -g -O2 -c mat4.c  -DDLL_EXPORT -DPIC -o .libs/mat4.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -ID:/workspace/cppLibraries/zlib/include -g -O2 -c mat4.c -o mat4.o >/dev/null 2>&1
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I.  -ID:/workspace/cppLibraries/zlib/include  -g -O2 -c -o mat.lo mat.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -ID:/workspace/cppLibraries/zlib/include -g -O2 -c mat.c  -DDLL_EXPORT -DPIC -o .libs/mat.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -ID:/workspace/cppLibraries/zlib/include -g -O2 -c mat.c -o mat.o >/dev/null 2>&1
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I.  -ID:/workspace/cppLibraries/zlib/include  -g -O2 -c -o matvar_cell.lo matvar_cell.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -ID:/workspace/cppLibraries/zlib/include -g -O2 -c matvar_cell.c  -DDLL_EXPORT -DPIC -o .libs/matvar_cell.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -ID:/workspace/cppLibraries/zlib/include -g -O2 -c matvar_cell.c -o matvar_cell.o >/dev/null 2>&1
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I.  -ID:/workspace/cppLibraries/zlib/include  -g -O2 -c -o matvar_struct.lo matvar_struct.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -ID:/workspace/cppLibraries/zlib/include -g -O2 -c matvar_struct.c  -DDLL_EXPORT -DPIC -o .libs/matvar_struct.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -ID:/workspace/cppLibraries/zlib/include -g -O2 -c matvar_struct.c -o matvar_struct.o >/dev/null 2>&1
/bin/sh ../libtool  --tag=CC   --mode=link gcc -I.  -ID:/workspace/cppLibraries/zlib/include  -g -O2 -no-undefined -export-symbols ./matio.sym -version-info 10:2       :1   -o libmatio.la -rpath /usr/local/lib snprintf.lo endian.lo io.lo inflate.lo read_data.lo mat5.lo mat4.lo mat.lo matvar_cell.lo matvar_struct.lo   -LD:/workspace/cppLibraries/zlib/lib -lz -lm

*** Warning: linker path does not have real file for library -lz.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libz but no candidates were found. (...for file magic test)
*** The inter-library dependencies that have been dropped here will be
*** automatically added whenever a program is linked with this library
*** or is declared to -dlopen it.

*** Since this library must not contain undefined symbols,
*** because either the platform does not support them or
*** it was explicitly requested with -no-undefined,
*** libtool will only create a static version of it.
libtool: link: lib -OUT:.libs/libmatio.lib  snprintf.o endian.o io.o inflate.o read_data.o mat5.o mat4.o mat.o matvar_cell.o matvar_struct.o
../libtool: line 1727: lib: command not found
make[2]: *** [Makefile:482: libmatio.la] Error 127
make[2]: Leaving directory '/home/kgorur/matio-master/src'
make[1]: *** [Makefile:389: all] Error 2
make[1]: Leaving directory '/home/kgorur/matio-master/src'
make: *** [Makefile:505: all-recursive] Error 1
tbeu commented 4 years ago

You can see in .appveyor.yml how I build it with Cywin using the installed version libhdf5-devel and zlib-devel. I believe the link error for you is due to incorrect builds of these dependencies.

tbeu commented 4 years ago

Closing now, since there is no more progress to expect.