Opened 12 years ago

Closed 12 years ago

#1119 closed defect (wontfix)

64 bits compile fails on OS X

Reported by: Geoffroy Owned by:
Priority: Nice to Have Milestone:
Component: Build & Packages Keywords:
Cc: Patch:

Description

Apparently libz.dylib and libjpeg.dylib installed from ports are 32 bits. I don't know if there is a way to pull 64 versions.

[ 46%] Built target nvmath Linking CXX shared library libnvimage.dylib ld: warning: ignoring file /usr/local/lib/libz.dylib, file was built for unsupported file format which is not the architecture being linked (x86_64) ld: warning: ignoring file /usr/local/lib/libjpeg.dylib, file was built for unsupported file format which is not the architecture being linked (x86_64) Undefined symbols for architecture x86_64:

"_jpeg_std_error", referenced from:

nv::ImageIO::loadJPG(nv::Stream&) in ImageIO.cpp.o

"_jpeg_CreateDecompress", referenced from:

nv::ImageIO::loadJPG(nv::Stream&) in ImageIO.cpp.o

"_jpeg_resync_to_restart", referenced from:

nv::ImageIO::loadJPG(nv::Stream&) in ImageIO.cpp.o

"_jpeg_read_header", referenced from:

nv::ImageIO::loadJPG(nv::Stream&) in ImageIO.cpp.o

"_jpeg_start_decompress", referenced from:

nv::ImageIO::loadJPG(nv::Stream&) in ImageIO.cpp.o

"_jpeg_read_scanlines", referenced from:

nv::ImageIO::loadJPG(nv::Stream&) in ImageIO.cpp.o

"_jpeg_finish_decompress", referenced from:

nv::ImageIO::loadJPG(nv::Stream&) in ImageIO.cpp.o

"_jpeg_destroy_decompress", referenced from:

nv::ImageIO::loadJPG(nv::Stream&) in ImageIO.cpp.o

ld: symbol(s) not found for architecture x86_64 collect2: ld returned 1 exit status make[3]: * [src/nvimage/libnvimage.dylib] Error 1 make[2]: * [src/nvimage/CMakeFiles/nvimage.dir/all] Error 2 make[1]: * [src/nvtt/CMakeFiles/nvtt.dir/rule] Error 2 make: * [nvtt] Error 2 ERROR: NVTT build failed

I know this is similar to http://trac.wildfiregames.com/ticket/660, but this ticket has been closed and the problem persists, or reappeared, with alpha 8.

Change History (5)

comment:1 by Juicyfruit, 12 years ago

Resolution: wontfix
Status: newclosed

Trunk compile fine for me. This is not really an 0ad bug as far as I am concerned.

You can look at: https://trac.macports.org/wiki/howto/buildUniversal to find out how to build universal. If your building with 10.6 or 10.7 you wont get powerpc but you will get i386 and x86_64 support.

in reply to:  description comment:2 by historic_bruno, 12 years ago

Resolution: wontfix
Status: closedreopened

Please don't close tickets until someone on the dev team has had a look.

Replying to Geoffroy:

Apparently libz.dylib and libjpeg.dylib installed from ports are 32 bits. I don't know if there is a way to pull 64 versions.

There is, but the question is why it wouldn't build on your system. Do you have the latest MacPorts, have you done sudo port selfupgrade and sudo port upgrade outdated? Of course if you only just installed MacPorts, that doesn't matter as much.

What's the result of running these commands:

uname -a
gcc --version
file /usr/local/lib/libjpeg.dylib

I had a strange problem building libVorbis from source on Lion, its configure script incorrectly detected a 32-bit architecture, despite the fact that every other lib I tried building detected 64-bit. That caused a few headaches.

comment:3 by Geoffroy, 12 years ago

I just installed macport, so I don't think this matter.

uname -a

Darwin Geoffroy.local 11.2.0 Darwin Kernel Version 11.2.0: Tue Aug  9 20:54:00 PDT 2011; root:xnu-1699.24.8~1/RELEASE_X86_64 x86_64


gcc --version

i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)

Copyright (C) 2007 Free Software Foundation, Inc.

This is free software; see the source for copying conditions.  There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


file /usr/local/lib/libjpeg.dylib

/usr/local/lib/libjpeg.dylib: Mach-O dynamically linked shared library i386

I tried to reinstall the concerned libraries, but that didn't changed anything.

comment:4 by historic_bruno, 12 years ago

This will hopefully be fixed by #1112. Until then, is MacPorts still broken? It really sounds like an autoconf problem with those packages, since I've built them as 64-bit with no problem (though not with MacPorts). In the meantime, you might try these alternate build instructions for Mac which use Homebrew instead: MacBuildInstructions.

comment:5 by historic_bruno, 12 years ago

Component: Core engineBuild & Packages
Milestone: Backlog
Resolution: wontfix
Status: reopenedclosed

Closing this as a build environment problem, see http://www.wildfiregames.com/forum/index.php?showtopic=16411. Mac Ports doesn't support other conflicting build systems and files in e.g. /usr/local, which is what is causing the above problem. You need to remove those files or force NVTT to build with Mac Ports libs somehow.

Note: See TracTickets for help on using tickets.