Opened 16 years ago

Closed 16 years ago

#2278 closed defect (fixed)

Make install failure 64-bit OS X

Reported by: jctull Owned by: Even Rouault
Priority: normal Milestone: 1.6.0
Component: ConfigBuild Version: svn-trunk
Severity: normal Keywords: install 64-bit macosx
Cc: warmerdam

Description (last modified by warmerdam)

I was able to successfully configure and compile 64-bit gdal as a framework for OS X 10.5.2 using svn revision 14012. When I try to install, the script moves into the 'port' directory, begins compiling, and fails. Here is the output from the 'sudo make install' command.

(cd port; make)
/bin/sh /Users/jctull/sources/gdal/libtool --mode=compile --tag=CXX g++ -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk -g -O2  -Wall  -DOGR_ENABLED -I/Users/jctull/sources/gdal/port 	 -DHAVE_CURL  -c -o cpl_hash_set.o cpl_hash_set.cpp
libtool: compile:  g++ -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk -g -O2 -Wall -DOGR_ENABLED -I/Users/jctull/sources/gdal/port -DHAVE_CURL -c cpl_hash_set.cpp  -fno-common -DPIC -o .libs/cpl_hash_set.o
cpl_hash_set.cpp: In function 'unsigned int CPLHashSetHashPointer(const void*)':
cpl_hash_set.cpp:385: error: cast from 'const void*' to 'int' loses precision
make[1]: *** [cpl_hash_set.o] Error 1
make: *** [port-target] Error 2

Change History (5)

comment:1 by warmerdam, 16 years ago

Cc: warmerdam added
Component: defaultConfigBuild
Description: modified (diff)
Owner: changed from warmerdam to roualt

Even,

I think this is yours? I see the same problem on my system.

I think you may need to cast a pointer to a long, and then int if you really need it as int.

I'll take care of this if you aren't able to fix it conveniently in the next couple hours.

comment:2 by nowakpl, 16 years ago

The function should use #ifdef's instead of "if (sizeof(void*) == 8)". "return (int) elt" would never be executed but the compiler isn't smart enough.

comment:3 by Even Rouault, 16 years ago

Owner: changed from roualt to Even Rouault

comment:4 by Even Rouault, 16 years ago

I've changed the type of the return value of the hash function to 'unsigned long' in r14021.

Could you confirm that it fixes the problem ?

comment:5 by jctull, 16 years ago

Resolution: fixed
Status: newclosed

The problem is now fixed. I successfully compiled and installed. Thanks!

Note: See TracTickets for help on using tickets.