Any one up for OSX work.

heya,

i’m back and i’m going to try to compile Panda3D for OS X again, and update the package on knuddl.net/moin.cgi/InstallPanda3d, which is already quite out-of-date (though it still works fine for development).

i will document my steps so others might follow and see if i’m missing something. currently it’s not possible to compile vanilla CVS (given installed premises as previously) for OS X.

step 1) get latest version from cvs, fresh and clean (it’s located at ~/Projects/panda3d in my development environment)

step 2) check development environment: i made sure my development environment is setup correctly and the various premises are installed and using latest versions where approriate (Cg, libpng, libtiff, libjpeg, zlib,…)

~/.profile

# panda dev environment
PYTHONPATH=/usr/local/panda/lib:$PYTHONPATH; export PYTHONPATH 
LOCAL_PPREMAKE_CONFIG=/Users/kaweh/Projects/panda3d/Config.pp ; export LOCAL_PPREMAKE_CONFIG 
PPREMAKE_CONFIG=/Users/kaweh/Projects/panda3d/Config.pp ; export PPREMAKE_CONFIG 
DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:/usr/local/panda/lib:/Users/kaweh/Projects/fmod/api/lib ; export DYLD_LIBRARY_PATH
DTOOL=/Users/kaweh/Projects/panda3d/ppremake

# maya dev environment
DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:/Applications/Alias/maya7.0/Maya.app/Contents/MacOS ; export DYLD_LIBRARY_PATH
MAYA_LOCATION=/Applications/Alias/maya7.0/Maya.app/Contents; export MAYA_LOCATION

step 3) create panda3d/Config.pp (based on Hypnos version and my previous Config.pp):

// python bindings 
#define HAVE_PYTHON 1 
#define PYTHON_FRAMEWORK Python 
#define PYTHON_IPATH /Library/Frameworks/Python.framework/Versions/2.4/include/python2.4
#define PYTHON_LPATH /Library/Frameworks/Python.framework/Versions/2.4/lib
#define INSTALL_PYTHON_SOURCE 1

// addon librarys 
//#define HAVE_NET 1 
//#define NET_IPATH /opt/local/include/nspr 
//#define NET_LPATH /opt/local/lib 

#define ZLIB_IPATH /opt/local/include 
#define ZLIB_LPATH /opt/local/lib 

#define JPEG_IPATH /opt/local/include 
#define JPEG_LPATH /opt/local/lib 

#define PNG_IPATH /opt/local/include 
#define PNG_LPATH /opt/local/lib 

#define HAVE_TAR 1 
#define TAR_IPATH /opt/local/include 
#define TAR_LPATH /opt/local/lib 

#define TIFF_IPATH /opt/local/include 
#define TIFF_LPATH /opt/local/lib 

#define HAVE_GL 1
#define HAVE_CG 1 
#define CG_IPATH /Library/Frameworks/Cg.framework/Versions/1.0/Headers 
#define HAVE_CGGL 1 

#define HAVE_FMODEX 1 
#define FMODEX_IPATH /Users/kaweh/Projects/fmod/api/inc 
#define FMODEX_LPATH /Users/kaweh/Projects/fmod/api/lib 
#define FMOD_LIBS fmodex

#define HAVE_MAYA 1

#define HAVE_THREADS 1
#define USE_MEMORY_MALLOC 1

#define GENPYCODE_LIBS libpandaexpress libpanda libpandaphysics libdirect libpandafx 
#define PRC_PATH_ENVVARS CFG_PATH ETC_PATH 
#define DEFAULT_PATHSEP : : 

step 4) create the install directory

sudo mkdir /usr/local/panda
sudo chmod 777 /usr/local/panda

step 5) create and install ppremake - i am using the ppremake system to install Panda3D on OS X, not the makepanda system

cd panda3d/ppremake
aclocal
autoheader
automake --foreign -a
autoconf
./configure -with-platform=osx
make install

ppremake builds without any problems and is installed to /usr/local/panda/bin as expected

step 6) create and install dtool

cd panda3d/dtool
ppremake

which outputs

Root is /Users/kaweh/Projects/panda3d/dtool
Reading /Users/kaweh/Projects/panda3d/Config.pp (referred to by PPREMAKE_CONFIG)
Generating src/dtoolutil/pandaVersion.h
Generating src/dtoolutil/checkPandaVersion.h
Generating src/dtoolutil/checkPandaVersion.cxx
Generating src/prc/prc_parameters.h
Read 18 Sources.pp files.
Generating Makefile

Configuring support for the following optional third-party packages:
- Did not find OpenSSL
+ libjpeg
+ libpng
+ libtiff
+ libtar
- Did not find fftw
- Did not find Berkeley DB
+ Nvidia Cg High Level Shading Language
+ Cg OpenGL API
- Did not find Cg DX8 API
- Did not find Cg DX9 API
- Did not find Cg DX10 API
- Did not find VRPN
+ zlib
- Did not find Miles Sound System
+ FMOD Ex sound library
- Did not find gtk+-2
+ Freetype
+ OpenGL
- Did not find DirectX8
- Did not find DirectX9
- Did not find OpenCV
- Did not find FFMPEG
- Did not find ODE
+ OpenMaya

Compilation will generate Python interfaces.

See dtool_config.h for more details about the specified configuration.

Generating dtool_config.h
Generating metalibs/dtool/Makefile
Generating metalibs/dtoolconfig/Makefile
Generating src/attach/Makefile
Generating src/cppparser/Makefile
Generating src/dconfig/Makefile
Generating src/dtoolbase/Makefile
Generating src/dtoolutil/Makefile
Generating src/interrogate/Makefile
Generating src/interrogatedb/Makefile
Generating src/newheader/Makefile
Generating src/parser-inc/Makefile
Generating src/prc/Makefile
Generating src/prckeys/Makefile
Generating src/pystub/Makefile
Generating src/test_interrogate/Makefile
No errors.

seems everything (i want) is there as expected.

let’s start compiling dtool.

g5:~/Projects/panda3d/dtool kaweh$ make install
install -m 644  dtool_config.h /usr/local/panda/include/
cd ./src/dtoolbase && make install
cc   -c -o Opt3-osx/dtoolbase_dlmalloc.o -I. -I/Users/kaweh/Projects/panda3d/dtool -I/Library/Frameworks/Python.framework/Versions/2.4/include/python2.4    -g -O2 -fPIC dlmalloc.c
cc   -c -o Opt3-osx/dtoolbase_lookup3.o -I. -I/Users/kaweh/Projects/panda3d/dtool -I/Library/Frameworks/Python.framework/Versions/2.4/include/python2.4    -g -O2 -fPIC lookup3.c
CC   -c -o Opt3-osx/dtoolbase_indent.o -I. -I/Users/kaweh/Projects/panda3d/dtool -I/Library/Frameworks/Python.framework/Versions/2.4/include/python2.4    -g -O2 -fPIC indent.cxx
CC   -c -o Opt3-osx/dtoolbase_dtoolbase_composite1.o -I. -I/Users/kaweh/Projects/panda3d/dtool -I/Library/Frameworks/Python.framework/Versions/2.4/include/python2.4    -g -O2 -fPIC dtoolbase_composite1.cxx
CC   -c -o Opt3-osx/dtoolbase_dtoolbase_composite2.o -I. -I/Users/kaweh/Projects/panda3d/dtool -I/Library/Frameworks/Python.framework/Versions/2.4/include/python2.4    -g -O2 -fPIC dtoolbase_composite2.cxx
neverFreeMemory.cxx:37: error: conflicting declaration ‘NeverFreeMemory* NeverFreeMemory::_global_ptr’
neverFreeMemory.h:76: error: ‘NeverFreeMemory::_global_ptr’ has a previous declaration as ‘NeverFreeMemory* volatile NeverFreeMemory::_global_ptr’
neverFreeMemory.cxx:37: error: declaration of ‘NeverFreeMemory* volatile NeverFreeMemory::_global_ptr’ outside of class is not definition
make[1]: *** [Opt3-osx/dtoolbase_dtoolbase_composite2.o] Error 1
make: *** [install-dtoolbase] Error 2

ok, seems to be a small problem in current CVS (as of 06/20/07) which is easily fixed.

make sure it says

NeverFreeMemory * TVOLATILE NeverFreeMemory::_global_ptr;

in line 37 of neverFreeMemory.cxx (the TVOLATILE is missing).

try to re-compile, will halt the process:

g5:~/Projects/panda3d/dtool kaweh$ make install
cd ./src/dtoolbase && make install
CC   -c -o Opt3-osx/dtoolbase_dtoolbase_composite2.o -I. -I/Users/kaweh/Projects/panda3d/dtool -I/Library/Frameworks/Python.framework/Versions/2.4/include/python2.4    -g -O2 -fPIC dtoolbase_composite2.cxx
CC -shared  -o Opt3-osx/libdtoolbase.dylib Opt3-osx/dtoolbase_dlmalloc.o Opt3-osx/dtoolbase_lookup3.o Opt3-osx/dtoolbase_indent.o Opt3-osx/dtoolbase_dtoolbase_composite1.o Opt3-osx/dtoolbase_dtoolbase_composite2.o -L/usr/local/panda/lib -L/Library/Frameworks/Python.framework/Versions/2.4/lib -lpthread
powerpc-apple-darwin8-gcc-4.0.1: unrecognized option '-shared'
/usr/bin/ld: Undefined symbols:
_main
std::ios_base::Init::Init()
std::ios_base::Init::~Init()
std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char)
___gxx_personality_v0
std::cerr
std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)
__gnu_cxx::__exchange_and_add(int volatile*, int)
std::basic_ostream<char, std::char_traits<char> >::operator<<(bool)
std::basic_ostream<char, std::char_traits<char> >::operator<<(long)
std::basic_ostream<char, std::char_traits<char> >::operator<<(unsigned long)
std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_destroy(std::allocator<char> const&)
std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage
std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)
std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()
std::__throw_bad_alloc()
std::_Rb_tree_decrement(std::_Rb_tree_node_base*)
std::_Rb_tree_increment(std::_Rb_tree_node_base*)
std::__throw_length_error(char const*)
std::_Rb_tree_rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)
std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)
std::basic_ostream<char, std::char_traits<char> >& std::operator<< <char, std::char_traits<char>, std::allocator<char> >(std::basic_ostream<char, std::char_traits<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
vtable for __cxxabiv1::__class_type_info
vtable for __cxxabiv1::__si_class_type_info
operator delete(void*)
operator new(unsigned long)
___cxa_begin_catch
___cxa_end_catch
___cxa_pure_virtual
___cxa_rethrow
collect2: ld returned 1 exit status
make[1]: *** [Opt3-osx/libdtoolbase.dylib] Error 1
make: *** [install-dtoolbase] Error 2

now there seems to be something wrong with Config.pp or Config.OSX.pp (or any of these) regarding compiling on OS X.

dtool_config.h has correctly defined IS_OSX, so it seems the correct architecture has been detected. but gcc OS X does not know about -shared, but needs -dynamiclib -dynamic and such. the structure of these files seems to have changed since the last time i looked at them, they have been cleaned-up and OS X has been integrated more cleanly, still i’m not able to compile the current CVS version.

what have i missed to get vanilla CVS to compile on OS X?

any help is appreciated.

thanks,
kaweh