Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

VTGuitarMan

macrumors newbie
Original poster
May 14, 2008
7
0
Hi all,

I'm trying to install a data analysis program called Matpack on my MacBook (running 10.5.2 Leopard). I've successfully installed it on both Fedora and Ubuntu Linux systems in the lab, but I'd like it on my laptop, too. The process was cake on the Linux boxes, just type 'make' and everything flies. When I do the same on my MacBook, the 'make' step fails with the following:

Code:
Undefined symbols:
  "_png_mmx_support", referenced from:
      _png_init_mmx_flags in matpack.a(png.o)
  "_png_read_filter_row", referenced from:
      _png_read_row in matpack.a(pngread.o)
  "_png_do_read_interlace", referenced from:
      _png_read_row in matpack.a(pngread.o)
  "_png_combine_row", referenced from:
      _png_read_row in matpack.a(pngread.o)
      _png_read_row in matpack.a(pngread.o)
      _png_read_row in matpack.a(pngread.o)
      _png_read_row in matpack.a(pngread.o)
      _png_read_row in matpack.a(pngread.o)
      _png_read_row in matpack.a(pngread.o)
      _png_read_row in matpack.a(pngread.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[3]: *** [../../bin/elements] Error 1
make[2]: *** [ALL] Error 2
make[1]: *** [thetools] Error 2
make: *** [allstatic] Error 2

I've searched quite a bit online and found that everyone's solution to this problem was to either install libpng from source or to install it via Fink. I've done both, but neither has worked. I currently have the Fink-installed libpng3 (version 1.2.29-1) installed. I was hoping that the newest available version would do the trick for me. No dice.

Any ideas? Thanks in advance for your attention.
 

VTGuitarMan

macrumors newbie
Original poster
May 14, 2008
7
0
By default, Fink installed libpng in /usr/local/lib, and I have tried the 'make' stage with no special settings and with

export LDFLAGS=-L/usr/local/lib

to see if that was necessary to find the libraries. Is there anything else I should set in terms of PATHs or compiler options?

Thanks for the reply!
 

VTGuitarMan

macrumors newbie
Original poster
May 14, 2008
7
0
You'll have to pass the link flag

-lpng

on the compile line or in the makefile wherever the linker options are listed.

Thanks, that gives me a little progress. Adding -lpng within the Makefile gets rid of the _png_mmx_support problem, but these still remain:

Code:
Undefined symbols:
  "_png_read_filter_row", referenced from:
      _png_read_row in matpack.a(pngread.o)
  "_png_do_read_interlace", referenced from:
      _png_read_row in matpack.a(pngread.o)
  "_png_combine_row", referenced from:
      _png_read_row in matpack.a(pngread.o)
      _png_read_row in matpack.a(pngread.o)
      _png_read_row in matpack.a(pngread.o)
      _png_read_row in matpack.a(pngread.o)
      _png_read_row in matpack.a(pngread.o)
      _png_read_row in matpack.a(pngread.o)
      _png_read_row in matpack.a(pngread.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[3]: *** [../../bin/elements] Error 1
make[2]: *** [ALL] Error 2
make[1]: *** [thetools] Error 2
make: *** [allstatic] Error 2

Thanks again for your attention and suggestions.
 

alastor

macrumors newbie
Jun 18, 2008
4
0
Sorry

Edit:

I'm so sorrry that I have to "reanimate" an 1-month-old topic, but I have the same problem and I'm a total newbie with MacOsX(fresh switcher..)
I got the latest MacBook pro with macosx 10.5.2, fully updated.
I did:
1) downloaded the Matpack c++
2) installed Libpng from http://ethan.tira-thompson.com/Mac OS X Ports.html
using the command
CPPFLAGS="-DPNG_NO_MMX_CODE" make
I obtain the static Library matpack.a . How can it be used in Eclipse?


I want a dynamic library, accordingly to the installation guide

Code:
 2b) If you want to install Matpack as a shared library then 
     - login as root
     - unpack the library in /opt (or move the directory matpack to /opt/matpack)
     - call "make install" in /opt/matpack.
       The shared library "libmatpack.so.1.9.0" is created in the "matpack" directory
       and then automatically moved to /usr/lib (two links "libmatpack.so.1" and
       "libmatpack.so" are also created in /usr/lib).
     - Before compiling the tools and the demos you have to replace the line
       LINKLIBS= ${MATLIB} ${BLASLIB} -L/usr/X11/lib -lXpm -lX11 -lm
       in file "Makefile.common" by
       LINKLIBS= ${BLASLIB} -L/usr/X11/lib -lXpm -lX11 -lmatpack -lm
       to link all applications versus the shared library (-lmatpack)
     - call "make tools"
     - Each user must set the environment variable MATPACK to /opt/matpack
       and add /opt/matpack/bin to the PATH variable (the best place is the 
       the shell startup script .bashrc or .cshrc).


I followed the steps but I obtain such error:
Code:
=====================================================================
sucessfully created shared library libmatpack.so.1.9.0
=====================================================================
=====================================================================
Install shared library in /usr/lib (you must be root)
=====================================================================
mv libmatpack.so.1.9.0 /usr/lib
mv: rename libmatpack.so.1.9.0 to /usr/lib/libmatpack.so.1.9.0: No such file or directory
make: *** [install] Error 1
Thanks a lot,
Enzo
 

VTGuitarMan

macrumors newbie
Original poster
May 14, 2008
7
0
I tried using the libpng from the site you mentioned at one point, and it failed. Use the libpng3 version that you can install from Fink/FinkCommander. Then things should work alright.
 

alastor

macrumors newbie
Jun 18, 2008
4
0
I tried using the libpng from the site you mentioned at one point, and it failed. Use the libpng3 version that you can install from Fink/FinkCommander. Then things should work alright.
I was able to compile the static library.. How can it be used in Eclipse? I'm new to that IDE.
Any Idea how to solve the problem about the dynamic one?
thank you.
Enzo
 

VTGuitarMan

macrumors newbie
Original poster
May 14, 2008
7
0
I was able to compile the static library.. How can it be used in Eclipse? I'm new to that IDE.
Any Idea how to solve the problem about the dynamic one?
thank you.
Enzo

My suggestion was in reference to solving the dynamic library problem. I have no idea how to use Eclipse, and if you want help with that, you'll probably have to start a new thread to that effect, or search in the Eclipse documentation.
 

alastor

macrumors newbie
Jun 18, 2008
4
0
I've installed Fink and Libpng.. Still not working!
Code:
=====================================================================
sucessfully created shared library libmatpack.so.1.9.0
=====================================================================
=====================================================================
Install shared library in /usr/lib (you must be root)
=====================================================================
mv libmatpack.so.1.9.0 /usr/lib
mv: rename libmatpack.so.1.9.0 to /usr/lib/libmatpack.so.1.9.0: No such file or directory
make: *** [install] Error 1
localhost:matpack root#
hankyou anyway for the help!
 

VTGuitarMan

macrumors newbie
Original poster
May 14, 2008
7
0
I've installed Fink and Libpng.. Still not working!
Code:
=====================================================================
sucessfully created shared library libmatpack.so.1.9.0
=====================================================================
=====================================================================
Install shared library in /usr/lib (you must be root)
=====================================================================
mv libmatpack.so.1.9.0 /usr/lib
mv: rename libmatpack.so.1.9.0 to /usr/lib/libmatpack.so.1.9.0: No such file or directory
make: *** [install] Error 1
localhost:matpack root#
hankyou anyway for the help!

Out of curiosity, what are the errors that show up before the erroneous claim that the library was successfully created? Are you sure this problem is even linked to libpng? Are the error messages you are seeing the same as the ones I saw and posted above?
 

alastor

macrumors newbie
Jun 18, 2008
4
0
Out of curiosity, what are the errors that show up before the erroneous claim that the library was successfully created? Are you sure this problem is even linked to libpng? Are the error messages you are seeing the same as the ones I saw and posted above?

In the origin I had the some errors you had, but I managed to solve it, leading to the creation of a static library.
I edited my previous post since I had already bumped an old topic, and for a matter of forum orderliness I didn't create a new topic.

Actually, I think is not (or at least no more ) related to the Libpng problem, but since I'm a newbye I try everything!

thanks a lot
Enzo
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.