mywave82 / opencubicplayer

Open Cubic Player (unix fork). Music visualizer for various tracked music formats (amiga modules, S3M, IT), chiptunes and other formats related to demoscene
https://stian.cubic.org/project-ocp.php
GNU General Public License v2.0
280 stars 19 forks source link

OCP fails to launch with libjpeg-turbo library (macOS Ventura) #102

Closed chiefjazzdiewltr closed 1 year ago

chiefjazzdiewltr commented 1 year ago
Screenshot 2023-07-04 at 10 12 11 PM

libjpeg-turbo (along with every other dependency) is install with the prefix '/opt/local' as I use MacPorts for my package manager. The configure flags I used are below

PATH=$PATH LDFLAGS=-L/opt/local/lib CFLAGS=-I/opt/local/include CXXFLAGS=-I/opt/local/include CPPFLAGS=-I/opt/local/include CPPCXXFLAGS=-I/opt/local/include LD_LIBRARY_PATH=-L/opt/local/lib ./configure \
--prefix=/opt/local \
--exec-prefix=/opt/local 
--libdir=/opt/local/lib 
--includedir=/opt/local/include \
--with-coreaudio \
--with-ncurses \
--without-desktop_file_install \
--without-update-desktop-database --without-update-mime-database \
--without-x11 \
--with-unifontdir-ttf=/Library/Fonts
mywave82 commented 1 year ago

(I am not a regular MacOS user myself, so this is from searching online)

When you have dylib files outside the normal search paths, it seems that you have two choices: a) update DYLD_LIBRARY_PATH in your shell (this is just temporary)

export DYLD_LIBRARY_PATH=/opt/local/lib:$DYLD_LIBRARY_PATH TERM=xterm-color ocp-curses

b) use otool and install_name_tool to inspect and modify the .dylib files that needs modifications https://www.fullstaq.com/knowledge-hub/blogs/an-alternative-to-macos-dyld-library-path

chiefjazzdiewltr commented 1 year ago
Screenshot 2023-07-05 at 8 56 18 PM

I changed all the dylib paths in the libocp.dylib to their full paths and while it fixed the libjpeg issue I have this one now:

Screenshot 2023-07-05 at 8 57 26 PM
mywave82 commented 1 year ago

Please provide config.log, config.h and Rules.make, so I can see what was detected regarding iconv/libiconv. I know that ocp in general works when compiled by HomeBrew

chiefjazzdiewltr commented 1 year ago

config.log Rules.make.log config.h.log These are the 3 files, I did have to append .log to the Rules.make and config.h files as github comments don't support those types apparently.

mywave82 commented 1 year ago

SDL2 expects to find libiconv.2.dylib (notice the .2. , do you have that file? I would probably expect it to be a symlink to libiconv.dylib)

chiefjazzdiewltr commented 1 year ago
Screenshot 2023-07-06 at 12 15 24 AM

I do have that file and I changed it back to that use that specific one but no dice. Also I looked at the libSDL2 dylib and saw it was looking for a /usr/lib/libiconv dylib so I changed that to use the one in my /opt/local folder and that didn't help either.

mywave82 commented 1 year ago

Why your copy of libSDL2-2.0.0.0.dylib does not accept your libiconv.2.dylib I do not fully know. There might be some versioning on the symbols it expects. Where did your copies of libSDL2-2.0.0.dylib and libiconv.dylib come from?

Beware that there are multiple implementations of iconv with different companioned header files that might not be binary compatible with each-others.

chiefjazzdiewltr commented 1 year ago

Both of them are from MacPorts so I'm not sure either, there is a libsdl-framework port on MacPorts but I don't know if that would matter

mywave82 commented 1 year ago

Can I suggest that you inquire MacPorts about the problem getting libSDL2 + iconv to work in a third party project?

mywave82 commented 1 year ago

(or compile without SDL support, so that only Open Cubic Player needs iconv, which should match the header files provided by MacPorts). Open Cubic Player can display visual using text/curses only and has native audio support on MacOS.

make uninstall make clean ./configure --help # check for configure options that disables SDL1.x and SDL2.x support

chiefjazzdiewltr commented 1 year ago

Yea it actually runs if I compile it without SDL1.x and SDL2.x, so I'll send an enquiry to MacPorts about it in the morning.

mywave82 commented 1 year ago

I am closing this issue as I do not believe the problem is OpenCubicPlayer, but the configuration of the build-system.

If you however find details that are wrong: please re-open and provide new new information or create a PullRequest

ryandesign commented 1 year ago

I'm working on adding ocp to MacPorts so that it will be easier for users to install there.

I agree with your assessment and can provide some further information later.