MacRuby 0.10 HotCocoa unsupported file format which is not the architecture being linked (i386) - osx-snow-leopard

I've installed MacRuby (via rvm):
$ ruby -v
MacRuby 0.10 (ruby 1.9.2) [universal-darwin10.0, x86_64]
And LLVM (via homebrew):
$ llvmc --version
Low Level Virtual Machine (http://llvm.org/):
llvm version 2.9
Optimized build.
Built Jun 3 2011 (10:06:35).
Host: x86_64-apple-darwin10
Host CPU: corei7
Registered Targets:
(none)
When I run rake, I get an error:
$ rake
(in /Users/briankierstead/dev/kci/macruby/hourz)
ld: warning: in /Library/Frameworks//MacRuby.framework/MacRuby, file was built for
unsupported file format which is not the architecture being linked (i386)
Undefined symbols for architecture i386:
"_macruby_main", referenced from:
_main in ccvGpB6J.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/qm/qm1gYJL6Fa4uPhnq239pak+++TI/-Tmp-//ccS18qN4.out (No such file or directory)
I don't want to run xcode4, which allows you specify x86_64 as the output.
How can I resolve this issue? It looks like somewhere in the chain, 32-bit is being specified. I've tried compiling with flags, and running rake as:
env UNIVERSAL=1 UNIVERSAL_ARCH="x86_64" ENABLE_OPTIMIZED=1
and
RC_ARCHS=x86_64 rake
But none of these makes a difference. I get the same error.
I'm on Snow Leopard - 10.6.7.

Using hotcocoa from this repo solves the problem. The published version is outdated and ignores architecture.
Not ideal, but at least it works until the published version catches up.
Thanks goes to #watson1978
This worked, but gave rise to another error: LSOpenURLsWithRole() failed with error -10810
I had to install BridgeSupport and then everything worked fine.

Related

concorde with Apple Silicon M1

I am trying to install concorde linked with QSOPT following these instructions. Regarding QSOPT, I dowloaded files from section Intel MacOS 10.6 (64-Bit). But, as I have Apple M1 chip, it does not work. I think that the problem is in the arm64 architecture in terms of QS, however with other more commercial software for Intel processor, I do not face any issue thanks to Rosetta.
The error I am facing when I run
./configure --host=darwin --with-qsopt=fullpath/QS
is
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [concorde] Error 1
Cross-posted on Stack Exchange - Operation Research
Thanks to the support of Bill Cook, it is now available a version of qsopt.a for the M1 Apple Chip on the QSOPT download page. This perfectly worked for me by run
./configure --host=darwin --with-qsopt=fullpath/QS

Issue compiling with f77 on OSX 10.11

I have been trying to run this model, written some decades ago by someone else. I've built the libraries, but when I try to actually run the program, I get the following error:
f77 -o mimics1.5 ../source/*.o trunk_hght_f.f
trunk_hght_f.f:
trunk_hght_func:
Undefined symbols for architecture x86_64:
"MAIN__", referenced from:
-u command line option
(maybe you meant: _MAIN__)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am on MacOSX 10.11, and which f77 gives /usr/local/bin/f77 and f77 -v gives back:
Cynthias-MacBook-Pro-2:input_dir cynthiag$ f77 -v
/usr/local/bin/f77 script based on f2c:
f2c (Fortran to C Translator) version 20100827.
Should f77 be in /usr/bin/instead?
ld seems to be the problem, so I followed instruction from HERE to try to solve it, but it looks like my XCode is up to date, that my libraries are built and linked (as far as I can tell), and I even reinstalled binutils to make sure ld was in teh right place, but no success.
which ld gives : /usr/bin/ld and ld -v gives:
Cynthias-MacBook-Pro-2:input_dir cynthiag$ ld -v
#(#)PROGRAM:ld PROJECT:ld64-264.3.102
configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em (tvOS)
LTO support using: LLVM version 7.3.0
I am new to fortran, so I probably messed up when setting up f77, but I've been stuck on this problem for a few days now, so any help would be greatly appreciated!
In the end, it seem like the solution for me was just to use gfortran instead of f77. This involved carefully switching all the mentions to f77 in the model (i.e. in all the Makefiles) and replacing them by gfortran.
A clean install of the libraries was then necessary, since apparently a library compiled in f77 will not be compatible with gfortran.
Finally, the model was calling on some executable without ./ which caused the model to failed.
Unfortunately, I can't give an explanation as to why f77 was failing, but gfortran was a lot easier to set up than f77/f2c and worked great, so it's probably the way to go.

libiconv issue when compiling SDL 2.0 on Mac OS X 10.6

I'm trying to compile SDL 2.0 on OS X 10.6, but I've been getting this message:
Undefined symbols:
"_libiconv_open", referenced from:
_SDL_iconv_string in SDL_iconv.o
_SDL_iconv_string in SDL_iconv.o
"_libiconv", referenced from:
_SDL_iconv in SDL_iconv.o
_SDL_iconv_string in SDL_iconv.o
"_libiconv_close", referenced from:
_SDL_iconv_string in SDL_iconv.o
_SDL_iconv_string in SDL_iconv.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
I've read the issues over at https://github.com/mxcl/homebrew/issues/894 and How to replace MacPort's libiconv with Mac's default 64-bit version? to see if either of them help. I uninstalled everything that MacPorts had since those two seemed to suggest that the issue was related to multiple versions of the same library (libiconv it had installed had way too many dependencies to manually uninstall them all, and I didn't need them anymore), but am still getting the same error. Any ideas?
So it turns out after uninstalling the MacPorts copy, I still had 2 copies of libiconv on my computer that were different. One was in /usr/lib, and the other was in /usr/local/lib. Compiling with the one in /usr/lib produced the error above, however adding -L/usr/local/lib to the EXTRA_LDFLAGS variable in the Makefile worked.
I found a simple solution. Just add 2 more parameters when configure SDL source:
./configure CPPFLAGS='-I/opt/local/include' LDFLAGS='-L/opt/local/lib'

OpenSSL ecc function with macos xcode?

I am trying to use the function EC_KEY_new_by_curve_name(NID_secp256k1) present in openssl. However, when I compile, I get the following error:
undefined symbols for architecture x86_64:
"_EC_KEY_new_by_curve_name", referenced from:
CKey::CKey() in bitcoin.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have been hinted that macos openssl is not compile with the ECC extensions. Is the problem? If so, how do I correct it?
If you're using the OpenSSL library that comes with MacOS SDK, then it should automatically have 64-bit support built in.
Looking at the first hit on Google, I'm wondering if you are just not including the correct library in your XCode project. Did you get -lcrypto into the project settings, or forget to add libCrypto.dylib to your list of libraries in the project?
On my SnowLeopard (10.6) machine, I see the symbols are defined in libCrypto:
[/usr/lib]:; nm -arch x86_64 libcrypto.0.9.8.dylib | egrep -i new_by_curve
00000000000a4ac0 T _EC_GROUP_new_by_curve_name
00000000000ab540 T _EC_KEY_new_by_curve_name

Problem using C file and Cocoa classes together

I have imported the ffmpeg and SDL libraries into my Xcode project for a Cocoa application.
My project builds and runs successfully with these libraries when my project contains only Cocoa classes, but when I include a C file in my project, the build fails with one warning and 35 errors:
The warning is:
ld: warning: in /Developer/SDKs/MacOSX10.6.sdk/usr/lib/gcc/powerpc-apple-darwin10/4.2.1/libgcc.a, file was built for unsupported file format which is not the architecture being linked (x86_64)
and the errors:
"___gedf2", referenced from:
_eval_expr in libavcodec.a(eval.o)
_quantize_lpc_coefs in libavcodec.a(lpc.o)
_rc_2pass2_before in libxvidcore.a(plugin_2pass2.o)
"___ledf2", referenced from:
_qp2bits in libavcodec.a(ratecontrol.o)
_get_qscale in libavcodec.a(ratecontrol.o)
"___umodsi3", referenced from:
_vorbis_parse_setup_hdr_codebooks in libavcodec.a(vorbis_dec.o)
_vorbis_parse_setup_hdr_codebooks in libavcodec.a(vorbis_dec.o)
For running the code, these are the configuration settings:
Active architecture: x86_64
Architecture in project setting: Standard (32/64_bit universal)
Mac OS X version: 10.6.3
Xcode version: 3.2.3
Also, the same code is building and running successfully with the same settings on my other system, a Mac Mini.
If anyone has any idea what I am missing then please help. Thanks.
Read the error message carefully (emphasis mine):
ld: warning: in /Developer/SDKs/MacOSX10.6.sdk/usr/lib/gcc/powerpc-apple-darwin10/4.2.1/libgcc.a, file was built for unsupported file format which is not the architecture being linked (x86_64)
Looks like you're mixing PowerPC and Intel libraries somehow. You're compiling for x86_64 but you're picking up a libgcc.a for PowerPC.
Those symbols with all the leading underscores are probably supposed to come from libgcc.a but you're not linking the x86_64 version of libgcc.a so they're missing in action and chaos ensues. Sounds like something in your xcode configuration is confused.

Resources