-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mac OS X 10.9.1 Compilation failure #1
Comments
Now I understand which Maverick you were referring to. I have practically no OSX experience and keep mostly to Linux and for the sake cross-platform support, Windows as well. I'm in the middle of moving the project away from autotools to cmake. Once I'm sure that things are sane and can compile on both debian/ubuntu/windows(32) I'll tag a release, likely 0.3.0.0 and then we can have a deeper look at the problem with WMSampleRate. In the mean time, an you post what GCC version you are running? Also, would you mind helping me in releasing OSX binaries for this and possibly getting it into mainstream packages for OSX? |
You can see that it is building now: https://travis-ci.org/psi29a/wildmidi Please try the latest from master to see if builds for you. If you are not familiar with cmake, just make a build directory next to wildmidi dir, cd into build, then cmake ../wildmidi and it should auto generate everything for you. "make -j4" and you are on your way. Bug reports welcome. |
I'll be happy to help with Mac. I will have a look at cmake also. Ozkan Sezer published a patch regarding WMSampleRate here: |
Just a heads up, many of your fixes in your branch I've push into my own. Thanks! :) https://travis-ci.org/psi29a/wildmidi |
I have managed have it all compile now with a warning (C99 nanosleep) with cmake/make and a strange (missing libwildmidi.a) additional error linking with cmake/Xcode. Now I just have to make github receive the patch... |
Can you give me the complete output of a fresh cmake and a make so I can see what warnings you get? You can stick the output in postbin or put it here as an attachment (I think?). |
Only one warning, included below. Postbin? Seems I can only attach images... never mind! Good work! :) src/wildmidi.c:1174:9: warning: implicit declaration of function 'nanosleep' is invalid in C99 [-Wimplicit-function-declaration] |
I noticed yesterday that cmake; make; make install didn't copy the library file to /usr/local/lib just the .h file to /usr/local/include. So I had to do that part by hand before trying to compile thirdeye. |
Xcode (cmake -G Xcode) on the other hand also gives a link error: |
I meant http://pastebin.com/ make install hasn't been setup yet... I'm planning on using cpack to help with building packages on Windows and I have a notion that I can also use it for making OSX .app packages. If you would like to work on getting make install working, by all means. :) Yes, in the cmake file I check for windows, then else for everything else... you'll need to add an (APPLE) section to make sure the linker knows which lib to use, either dynamic or static for your purposes. I'll be adding later options to specify to build everything or only certain parts. |
Well... All this compiling (has been 10 years since I did something like this) has made me wondering if it's needed. Is wildmidi just used as a regular MIDI player in ThirdEYE? I wonder if it could then just be exchanged for Core MIDI on Mac OS X. Like if the work tweaking to get it to compile on Mac is bigger than writing some real code to call Core MIDI instead on Mac. |
Wildmidi just takes your midi, decodes it, plays a soundfont/patch and outputs to your audio subsystem. Many projects already depend on it, most heavily is gstreamer so that you can use a browser to play back embedded midi. Another would be Rhythmbox, which also uses it to play midi. If your media player already can decode and play back midi, then you don't need this lib. If your player can't, then it needs this lib or one similar. Thirdeye needs to be cross-platform, so it can't rely on a system's implementation which would be non-portable. I thought wildmidi worked already on OSX with auto tools? I just choose cmake because it is easier to deal with, but yeah... there is work to make sure every system is satisfied. :) |
BTW... wildmidi is a player, just like any other out there. wildmidi_lib (libwildmidi.so or .a) is the lib. Thirdeye links against the lib and uses it to stream midi in and a buffer out. I take the buffer into thirdeye's internal mixer with sound effects and other bits and push to OpenAL to handle all the noise making. |
BTW2: The problem you had with nanosleep, I think it is because I didn't add the time.h at the top... so no forward deceleration. GCC and Clang just worked around it... Please test my master branch again. |
make: Clean... no warnings whatsoever! :) |
|
Both libwildmidi.a and .dylib are to be found in Debug/ after building. "Other linker flags" (in Xcode) for the wildmidi binary want to link against it as being found in ".". |
Current cmake code does this: As you can see... if it isn't windows... then we just try it in /libwildmidi.a So... the point is, everything works fine with Clang/GCC as your compiler. If you try it with XCode, you get the linking error right? I'll try to come up with something for you around lunch. |
can you run your cmake command again but this time with this: -DCMAKE_BUILD_TYPE=Release |
well... I tried with Release for both gcc and clang. gcc compiles with warnings, and clang fails to compile. I'll look into those. Debug, for whatever reason, seems to compile just fine for both. This will take some time. |
Pushed some code fixes, there is still one more warning in the Release build from gcc but clang should be good for both. I also added some apple specific code to link to the right directory. I can't test this directly, but please try it on your end! |
cmake -DCMAKE_BUILD_TYPE=Release and then make gives: |
cmake -DCMAKE_BUILD_TYPE=Debug and then make gives: |
no -DCMAKE_BUILD_TYPE gives the same as Debug above. |
Xcode build now gives a lot of "Unknown symbol for architecture x86_64" pointing to libraries perhaps only being built 32-bit? |
Interesting... it doesn't matter what bit-ness. Win32 or Linux x86_64... but I've never seen the last error. |
cmake -G Xcode -DCMAKE_BUILD_TYPE=Release almost works, only complaining not finding "Release/libwildmidi.a" not complaining about x86_64 symbols at all. |
Can you give the full pathname of where your libwildmidi.a file is? Can you also put this in cmake, just above TARGET_LINK_LIBRARIES(wildmidi Clean your build directory then rerun: cmake -G Xcode -DCMAKE_BUILD_TYPE=Release What does it print out? |
Did another push, might have fixed problem... please test. |
cmake -G Xcode and building now works perfect! :) cmake -G Xcode with Release and bulding can't find "Release/libwildmidi.a" cmake -G Xcode with Debug and bulding now works perfect! :) |
When you do the Release build, can you give me the output of what I asked you above? Can you also give me the full path to the libwildmidi.a file... where ever it exists. I'm trying to track down if there is a difference. They should be the same. |
Release with make or Xcode? Have to eat now with enough time before choir practice... |
cmake -G Xcode with Release and bulding can't find "Release/libwildmidi.a" please, but the other output would be nice as well. |
I now get 2 errors: Check dependencies error: (null) Ld /Users/rrrrrrr/src/build/Debug/libwildmidi.dylib normal x86_64 ld: -filelist file '/Users/rrrrrrr/src/build/src/wildmidi.build/Debug/wildmidi_dynamic.build/Objects-normal/x86_64/wildmidi.LinkFileList' could not be opened, errno=2 (No such file or directory) clang: error: linker command failed with exit code 1 (use -v to see invocation) $ find . | grep lib |
I'm still not seeing the output from the thing I posted to you. I just need the full path to your libwildmidi.a file used for "Release" and can you also put this in cmake, just above TARGET_LINK_LIBRARIES(wildmidi Clean your build directory then rerun: cmake -G Xcode -DCMAKE_BUILD_TYPE=Release Tell me what cmake outputs |
-- The C compiler identification is Clang 5.0.0 |
It's blank.. telling me it isn't being set. |
If I put it below it gives: CMake Error at src/CMakeLists.txt:24 (ADD_LIBRARY): CMake Error at src/CMakeLists.txt:24 (ADD_LIBRARY): CMake Error at src/CMakeLists.txt:24 (ADD_LIBRARY): |
Yeah... wrong place. MESSAGE(STATUS "TELL psi29a: ${WILDMIDILIB}") needs to go after all the if cmake release/debug stuff, just before target_link_libraries(wildmidi line... at line 94. Put it there between add_dependencies and target_link_libraries |
Just so you know, I'm trying to track down where your Release static lib is located on your filesystem, and where the cmake system is looking. |
It isn't being set then... |
And if you set this: |
-- The C compiler identification is Clang 5.0.0 |
and now building? |
It can't find Release/libwildmidi.a |
And if you try ls -al /Users/rrrrrrr/src/build/Release/libwildmidi.a ? |
$ find . | grep lib |
Yes, you already posted that... so /Users/rrrrrrr/src/build/Release/libwildmidi.a doesn't exist for you. This means that even after telling it to build "Release" build... xcode isn't making "Release" libs, only Debug. Possible problem on cmake on mac? I don't know, can you bundle up your build directory and post it somewhere so I can have a look inside please? Did you make sure to remove everything in your build directory before you ran the cmake command again? I had this issue on windows where it didn't recognize the change and had to purge every file and re-run cmake. This was with the cmake-gui application. |
At least it works with Debug builds. No worries, we'll figure the cmake/release builds problem out eventually. :) I plan on setting up a hackintosh in the future. I'm committed to getting this working on all three target platforms. |
Sent build to what I think is your email... |
I think I might have an idea of what is going on: http://www.cmake.org/pipermail/cmake/2009-March/027953.html With Xcode, you can't tell it specifically with cmake what to build directly.... well you can, but it is hack-ish because it was never meant to do that. Now I understand why VS2010 does the same thing as Xcode in defaulting to debug. After running cmake, you have to specifically tell Xcode what type to build. If nothing is specified, it defaults to Debug anyway. |
Re-wrote some stuff in cmake, try it out please. If you set the build type with cmake, then it should now force it on VCS and Xcode. |
Works perfectly with cmake/make, cmake/Xcode without option, Debug and Release! Great work! |
Need to update my source from yours
After changing some && to & in src/wildmidi_lib.c and doing "./bootstrap ; ./configure --disable-optimize ; make", I got this error related to WM_SampleRate being used in both src/gus_pat.c and src/wildmidi_lib.c:
Making all in src
/bin/sh ../libtool --tag=CC --mode=link gcc -std=c99 -U__STRICT_ANSI__ -Wall -Wextra -pedantic -Werror -version-info 2:0:1 -shared -lm -lc -no-undefined -export-symbols-regex '^WildMidi.' -lm -lc -o libWildMidi.la -rpath /usr/local/lib libWildMidi_la-wm_error.lo libWildMidi_la-file_io.lo libWildMidi_la-reverb.lo libWildMidi_la-lock.lo libWildMidi_la-gus_pat.lo libWildMidi_la-wildmidi_lib.lo -lm -lc
libtool: link: rm -fr .libs/libWildMidi.exp
libtool: link: /usr/bin/nm .libs/libWildMidi_la-wm_error.o .libs/libWildMidi_la-file_io.o .libs/libWildMidi_la-reverb.o .libs/libWildMidi_la-lock.o .libs/libWildMidi_la-gus_pat.o .libs/libWildMidi_la-wildmidi_lib.o | sed -n -e 's/^. [ ][ ]__([_A-Za-z][A-Za-z0-9])$/\1 \2 \2/p' | sed '/ _gnu_lto/d' | /usr/bin/sed 's/. //' | sort | uniq > .libs/libWildMidi.exp
libtool: link: /usr/bin/grep -E -e "^WildMidi.*" ".libs/libWildMidi.exp" > ".libs/libWildMidi.expT"
libtool: link: mv -f ".libs/libWildMidi.expT" ".libs/libWildMidi.exp"
libtool: link: sed 's,^,,' < .libs/libWildMidi.exp > .libs/libWildMidi-symbols.expsym
libtool: link: gcc -dynamiclib -o .libs/libWildMidi.1.dylib .libs/libWildMidi_la-wm_error.o .libs/libWildMidi_la-file_io.o .libs/libWildMidi_la-reverb.o .libs/libWildMidi_la-lock.o .libs/libWildMidi_la-gus_pat.o .libs/libWildMidi_la-wildmidi_lib.o -lm -lc -install_name /usr/local/lib/libWildMidi.1.dylib -compatibility_version 3 -current_version 3.0 -Wl,-single_module -Wl,-exported_symbols_list,.libs/libWildMidi-symbols.expsym
duplicate symbol _WM_SampleRate in:
.libs/libWildMidi_la-gus_pat.o
.libs/libWildMidi_la-wildmidi_lib.o
ld: 1 duplicate symbol for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [libWildMidi.la] Error 1
make: *** [all-recursive] Error 1
The text was updated successfully, but these errors were encountered: