Any one up for OSX work.

Return to Compiling or Editing the Panda Source

Postby Josh Yelon » Tue Nov 28, 2006 4:26 pm

Toontown was released for mac? Interesting. Does this mean that panda3d-OSX is now stable and reliable?

If so, maybe it's time to put a little more effort into releasing a mac distro.
Josh Yelon, Teacher, Carnegie Mellon Entertainment Technology Center
Josh Yelon
 
Posts: 1360
Joined: Wed Mar 30, 2005 8:30 pm

Postby drwr » Tue Jan 16, 2007 7:25 pm

Yep, the head of the CVS tree is nice and robust on OSX, at least insofar as we build it here at the VR Studio.

Toontown has been released for well over a month on OSX, and the only real difficulties we had were in writing a new web launcher.

David
drwr
 
Posts: 11425
Joined: Fri Feb 13, 2004 12:42 pm
Location: Glendale, CA

Postby Hypnos » Wed Feb 21, 2007 4:55 am

I have 2 questions.

1st As mentioned in the other osx build thread, networking seems to be missing in the build.

2nd I have been trying to use a directentry. Which does not seem to accept inputs on osx (works well on windows). Can this be verified by anyone else?

Thanks
Hypnos
 
Posts: 585
Joined: Sat Sep 11, 2004 8:07 am
Location: Zürich, Switzerland

Postby Hypnos » Tue Apr 17, 2007 1:15 pm

Hello again,

Im wondering if anybody had a running Config.pp which he could post here? Im trying to compile on OSX but yet had no luck doing so... (As most setups should be the same on a intel mac this would definately help me a lot)

Thanks in advance
Hypnos
 
Posts: 585
Joined: Sat Sep 11, 2004 8:07 am
Location: Zürich, Switzerland

Postby drwr » Tue Apr 17, 2007 1:19 pm

For me, it builds out of the box with an empty Config.pp. What sort of problems are you having?

David
drwr
 
Posts: 11425
Joined: Fri Feb 13, 2004 12:42 pm
Location: Glendale, CA

Postby Hypnos » Tue Apr 17, 2007 1:41 pm

I have just tried with a empty Config.pp (havent tought about doing that before :).

However starting ppremake in dtool woudnt use libjpeg, libpng, libtiff, NVidia Shading, CG OpenGL API, FMOD. With a customomized Config.pp (mostly like http://panda3d.org/phpbb2/viewtopic.php?start=90&t=1193 (post from kaweh)) it would would include these, but a "make" in panda gives the following error:

g++ -undefined dynamic_lookup -dynamic -dynamiclib -o Opt2-OSX/libgobj.dylib -install_name libgobj.dylib Opt2-OSX/gobj_gobj_composite1.o Opt2-OSX/gobj_gobj_composite2.o Opt2-OSX/libgobj_igate.o -L../event/Opt2-OSX -L../express/Opt2-OSX -L../gsgbase/Opt2-OSX -L../linmath/Opt2-OSX -L../mathutil/Opt2-OSX -L../nativenet/Opt2-OSX -L../net/Opt2-OSX -L../pandabase/Opt2-OSX -L../pipeline/Opt2-OSX -L../pnmimage/Opt2-OSX -L../pstatclient/Opt2-OSX -L../putil/Opt2-OSX -L/usr/local/panda//lib -L/usr/local/panda//lib -L/Library/Frameworks/Python.framework/Versions/2.4/lib -L/System/Library/Frameworks/Cg.framework/Versions/1.0 -L/opt/local/lib -lpstatclient -levent -llinmath -lmathutil -lpnmimage -lgsgbase -lputil -lnet -lexpress -lpandabase -lpipeline -lnativenet -linterrogatedb -ldconfig -ldtoolutil -ldtoolbase -lprc -lCg -lz -framework Python
/usr/bin/libtool: can't locate file for: -lCg
/usr/bin/libtool: file: -lCg is not an object file (not allowed in a library)
make[1]: *** [Opt2-OSX/libgobj.dylib] Error 1
make: *** [gobj] Error 2


Edit:
Im using the current CVS version.
Hypnos
 
Posts: 585
Joined: Sat Sep 11, 2004 8:07 am
Location: Zürich, Switzerland

Postby drwr » Tue Apr 17, 2007 2:10 pm

I haven't tried getting Cg to work under OSX yet. Try removing references to that from your Config.pp.

It shouldn't be hard to use Cg under OSX, since NVidia now provides a Cg framework, but you'd have to figure out the appropriate lines to add to Config.pp. It might be best if you first got Panda building properly without this monkey wrench.

David
drwr
 
Posts: 11425
Joined: Fri Feb 13, 2004 12:42 pm
Location: Glendale, CA

Postby Hypnos » Wed Apr 18, 2007 9:37 am

1st: I have now successfully compiled most of the things, however mouse-movement is not recognized and other events also do not seem to work correctly ("escape" press is not recognized). I remember reading a post about some mouse issues, however i could not find it again.

2nd: I also cant compile the pandaapp's. It tells me about missing dynamic library's. But actually they are where they should (/usr/local/panda/lib):

[code]
g++ -o Opt3-OSX/httpbackup Opt3-OSX/httpbackup_backupCatalog.o Opt3-OSX/httpbackup_httpBackup.o -L../pandaap
pbase/Opt3-OSX -L/usr/local/panda/lib -L/usr/local/panda/lib -L/usr/local/panda/lib -L/usr/local/panda/lib -L/Li
brary/Frameworks/Python.framework/Versions/2.4/lib -lpandaappbase -lprogbase -lpandatoolbase -lexpress -ldownloa
der -lpystub
/usr/bin/ld: warning can't open dynamic library: libpipeline.dylib referenced from: /usr/local/panda/lib/libprog
base.dylib (checking for undefined symbols may be affected) (No such file or directory, errno = 2)
[/code]

my current Config.pp is:
[code]#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 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
[/code]

3th: I also tried to import the QueuedConnectionManager which cant be found (import direct.interval.IntervalGlobal.QuueuedConnectionManager). I actually think all the network stuff is missing...
Hypnos
 
Posts: 585
Joined: Sat Sep 11, 2004 8:07 am
Location: Zürich, Switzerland

Postby drwr » Wed Apr 18, 2007 12:15 pm

1. Strange. I assume you're compiling against the CVS trunk, and not the 1.3.2 source. Have you tried messenger.toggleVerbose() to see what event is generated when you press the escape key? Precisely what do you mean by "mouse movement is not recognized"?

2. Don't attempt to compile the pandaapp directory. We don't really use it, and forget about it often. We never attempted to build it under OSX, so I doubt it will build. (OSX is really fussy about forcing us to explicitly name all of the required libraries, even those it should be able to find by itself.) There's nothing useful in pandaapp anyway.

3. That's not the way to import QueuedConnectionManager. This symbol, like all C++ symbols, is defined in PandaModules; import it from there: from pandac.PandaModules import QueuedConnectionManager

David
drwr
 
Posts: 11425
Joined: Fri Feb 13, 2004 12:42 pm
Location: Glendale, CA

Postby Hypnos » Wed Apr 18, 2007 1:01 pm

1. Yes i checked out the latest CVS version and im using it. Reading trought the previous messages i already decided trying out messenger.toggleVerbose():
- Pressing Escape returns me only the release events:
[code]:04-18-2007 19:44:05 Messenger(debug): sent event: escape-up sentArgs: []
:04-18-2007 19:44:05 Messenger(debug): sent event: time-escape-up sentArgs: [7.5023310000000007]
:04-18-2007 19:44:05 Messenger(debug): sent event: escape-up sentArgs: []
:04-18-2007 19:44:05 Messenger(debug): sent event: time-escape-up sentArgs: [7.7499400000000005][/code]

- Regarding the mouse problem i have found out that i relied on functions that does not work the same as before. base.win.getPointer(0).getX() does not return the pixel-position of the mouse. Using the base.mouseWatcherNode.getMouse().getX() works fine.
- However resetting the mouse position using [code]base.win.movePointer(0, base.win.getXSize()/2, base.win.getYSize()/2) [/code]
makes the mouse reading unusable, its had to explain how it behaves. I'll try to upload an example.

2. Didnt know about this :)

3. Thats seems to have fixed this problem.

And a new problem i have never experienced before:
Previously i could load a model just using the path to the model and the filename (no extension aka .bam or .egg), now i get a errormessage:
[code]:loader(error): Cannot load data/models/buildings/myhouse/myhouse without filename extension. Loading of model filenames with an implicit extension is deprecated in Panda3D. Please correct the filename reference. If necessary, you may put the line "default-model-extension .bam" or "default-model-extension .egg" in your Config.prc to globally assume a particular model filename extension.[/code]
I do understand the errormessage. However i have been using the binary version in this thread, which afaik does not require the filename extensions.

Thanks a lot for your effort.
Hypnos
 
Posts: 585
Joined: Sat Sep 11, 2004 8:07 am
Location: Zürich, Switzerland

Postby drwr » Wed Apr 18, 2007 2:15 pm

1. You're absolutely right--I was losing the escape key too. I guess we just never noticed. It appears that the OS was returning the "this event was already handled" value for the escape key for some reason, but not for other keys. I just checked in a "fix" to ignore the return value from the OS and process the key anyway.

2. base.win.getPointer(0).getX() will return the raw mouse data from the window, which is usually the position of the mouse in pixels. This appears to work fine for me. This is different from base.mouseWatcherNode.getMouse().getX(), which returns the mouse in the [-1 .. 1] range. The former should be used to be compatible with movePointer().

4. This is a recent change in Panda itself. We have decided to deprecate the ability to load a model without specifying a filename extension; this feature was causing problems. If you still want to load models without specifying a filename extension, you have to set the Config.prc variable as suggested by the error message.

David
drwr
 
Posts: 11425
Joined: Fri Feb 13, 2004 12:42 pm
Location: Glendale, CA

Postby Hypnos » Wed Apr 18, 2007 2:34 pm

2. I have finally found out what was causing my real headaches with my 1st person mode camera.
base.win.movePointer(0, base.win.getXSize()/2, base.win.getYSize()/2)
causes the mouse to behave very curious. It seems to reset the mouse position for a longer time, calling it every frame makes mousemovement impossible. It will stay in the center not only for this single frame.
As you wrote both modes base.win.getPointer(0).getX() and base.mouseWatcherNode.getMouse().getX() return the correct values for me as well.

4. Thats resolved as well in this case :)
Hypnos
 
Posts: 585
Joined: Sat Sep 11, 2004 8:07 am
Location: Zürich, Switzerland

Postby drwr » Wed Apr 18, 2007 3:26 pm

Ah! I forgot about this detail. Because of a difference in the way OSX handles the mouse messages, you have to specifically put the mouse into "relative" mode before you can do the trick of banging the mouse back to the center to get the mouse delta each frame.

Use code like this:
Code: Select all
wp = WindowProperties()
wp.setMouseMode(WindowProperties.MRelative)
base.win.requestProperties(wp)

This code will be work on all platforms, and is the new official cross-platform way to engage this mode. Since you are probably also setting the mouse pointer invisible, you can use the same WindowProperties structure and the same requestProperties() call, e.g.:
Code: Select all
wp = WindowProperties()
wp.setCursorHidden(True)
wp.setMouseMode(WindowProperties.MRelative)
base.win.requestProperties(wp)


Note that I only just checked in a change to rename this symbol from WindowProperties.MOUSERelative, to make it more consistent with the rest of the Panda API.

David
drwr
 
Posts: 11425
Joined: Fri Feb 13, 2004 12:42 pm
Location: Glendale, CA

Postby Hypnos » Wed Apr 18, 2007 4:28 pm

Great, that fixed this last problem as well.

There is just a last bug i know about, the event mouse3 is the middle mouse button under osx, while its the right mouse button under windows.

Thanks again for your support.
Hypnos
 
Posts: 585
Joined: Sat Sep 11, 2004 8:07 am
Location: Zürich, Switzerland

Postby drwr » Wed Apr 18, 2007 4:36 pm

I'll have to take your word for that--I only have a one-button mouse. I just checked in the code that ought to fix this.

David
drwr
 
Posts: 11425
Joined: Fri Feb 13, 2004 12:42 pm
Location: Glendale, CA

Postby Hypnos » Thu Apr 19, 2007 7:00 am

Another thing i just observed, the mouse-wheel also does not generate any events.
Hypnos
 
Posts: 585
Joined: Sat Sep 11, 2004 8:07 am
Location: Zürich, Switzerland

Postby Hypnos » Wed May 16, 2007 9:49 am

I have successfully compiled panda3d on osx including shaders, fmod_ex. using some hints in this thread the sound also worked with a single channel.

However i have had lots of compile errors, which were caused by different "invalid" compile arguments.

Most of the time the
Code: Select all
-framework Cg
was missing, this happended in the following folders:

direct/src/interval
direct/src/motiontrail
direct/src/showbase
direct/metalibs/direct
panda/src/pgraph
panda/src/chan
panda/src/char
panda/src/dgraph
panda/src/cull
panda/src/display
panda/src/device
panda/src/parametrics
panda/src/text
panda/src/grutil
panda/src/tform
panda/src/collide
panda/src/recorder
panda/metalibs/panda
panda/src/distort
panda/src/effects
panda/src/egg2pg
panda/src/framework
panda/metalibs/pandafx
panda/src/glstuff
panda/src/osxdisplay
panda/src/pandaegg
panda/metalibs/pandagl
panda/src/physics
panda/src/particlesystem
panda/metalibs/pandaphysics
panda/src/testbed
panda/src/gobj
and probably even more...


Also, sometimes the parameter -lCg was given, which does not work for me... (i think -l only works for lib's installed using darwinports/macports)

Im not sure anymore if the "-framework OpenGL" is required sometimes as well... (i created some custom compile script which fixes the described errors itself, and i dont really remember what g++ calls i had modified)


If anybody knows how to fix there problems it would be great...



This is my Config.pp maybe there is something wrong with this?
Code: Select all
// 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

// 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_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/rspoerri/Devel/fmodapi40616/api/inc
#define FMODEX_LPATH /Users/rspoerri/Devel/fmodapi40616/api/lib
#define FMOD_LIBS fmodex
Hypnos
 
Posts: 585
Joined: Sat Sep 11, 2004 8:07 am
Location: Zürich, Switzerland

Postby kaweh » Wed Jun 20, 2007 9:10 am

heya,

i'm back and i'm going to try to compile Panda3D for OS X again, and update the package on http://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

Code: Select all
# 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):

Code: Select all
// 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

Code: Select all
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

Code: Select all
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

Code: Select all
cd panda3d/dtool
ppremake


which outputs

Code: Select all
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.


Code: Select all
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

Code: Select all
NeverFreeMemory * TVOLATILE NeverFreeMemory::_global_ptr;


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

try to re-compile, will halt the process:

Code: Select all
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
kaweh
 
Posts: 173
Joined: Thu Mar 30, 2006 7:15 am
Location: Vienna, Austria

Postby drwr » Wed Jun 20, 2007 11:34 am

I think your problem was back when you built ppremake. Instead of doing:
Code: Select all
./configure -with-platform=osx

Just do:
Code: Select all
./configure

The default platform name is OSX, which is now autodetected correctly. However, if you override it to set it to lowercase osx, this will break some of the ppremake scripts that are looking for uppercase OSX.

Also, note that you no longer need to declare:
Code: Select all
#define USE_MEMORY_MALLOC 1

in your Config.pp file.

I have corrected the missing TVOLATILE keyword in neverFreeMemory.cxx. Thanks! :)

David
drwr
 
Posts: 11425
Joined: Fri Feb 13, 2004 12:42 pm
Location: Glendale, CA

Postby kaweh » Wed Jun 20, 2007 2:07 pm

thanks a lot, dave. this was of great help.

dtool compiles fine and step 6 is done.

step 7) create and install panda3d core

Code: Select all
cd panda3d/panda
ppremake
make install


seems to compile fine. but stops here:

Code: Select all
g++ -ftemplate-depth-30  -c -o Opt3-OSX/libgobj_igate.o -I. -I/Users/kaweh/Projects/panda3d/panda -I../event -I../express -I../gsgbase -I../linmath -I../mathutil -I../nativenet -I../net -I../pandabase -I../pipeline -I../pnmimage -I../pstatclient -I../putil -I/usr/local/panda/include -I/Library/Frameworks/Python.framework/Versions/2.4/include/python2.4 -I/Library/Frameworks/Cg.framework/Versions/1.0/Headers -I/opt/local/include    -g -O2 -fPIC Opt3-OSX/libgobj_igate.cxx
g++  -undefined dynamic_lookup -dynamic -dynamiclib -o Opt3-OSX/libgobj.dylib -install_name libgobj.dylib Opt3-OSX/gobj_gobj_composite1.o Opt3-OSX/gobj_gobj_composite2.o Opt3-OSX/libgobj_igate.o -L../event/Opt3-OSX -L../express/Opt3-OSX -L../gsgbase/Opt3-OSX -L../linmath/Opt3-OSX -L../mathutil/Opt3-OSX -L../nativenet/Opt3-OSX -L../net/Opt3-OSX -L../pandabase/Opt3-OSX -L../pipeline/Opt3-OSX -L../pnmimage/Opt3-OSX -L../pstatclient/Opt3-OSX -L../putil/Opt3-OSX -L/usr/local/panda/lib -L/usr/local/panda/lib -L/Library/Frameworks/Python.framework/Versions/2.4/lib -L/opt/local/lib -lpstatclient -levent -llinmath -lmathutil -lpnmimage -lgsgbase -lputil -lnet -lexpress -lpandabase -lpipeline -lnativenet -linterrogatedb -ldconfig -ldtoolutil -ldtoolbase -lprc -lCg -lz -framework Python
/usr/bin/libtool: can't locate file for: -lCg
/usr/bin/libtool: file: -lCg is not an object file (not allowed in a library)
make[1]: *** [Opt3-OSX/libgobj.dylib] Error 1
make: *** [install-gobj] Error 2


i believe that's what hypnos was refering to. Cg is a framework and i think frameworks need to be linked differently. -framework Cg.

anything we can do about this, or is that a problem with dtool?

cheers,
kaweh.
kaweh
 
Posts: 173
Joined: Thu Mar 30, 2006 7:15 am
Location: Vienna, Austria

Postby drwr » Wed Jun 20, 2007 2:17 pm

I haven't yet had a chance to try to get Cg compiling on OSX. It might be as simple as adding the lines:
Code: Select all
#define CG_LIBS
#define CG_FRAMEWORK Cg
#define HAVE_CG 1

to your Config.pp. If that doesn't work, you can always bail on Cg with:
Code: Select all
#define HAVE_CG


David
drwr
 
Posts: 11425
Joined: Fri Feb 13, 2004 12:42 pm
Location: Glendale, CA

Postby Hypnos » Fri Jun 22, 2007 5:32 am

One idea for the Config.pp:

#define GL_FRAMEWORK OpenGL

If the CG_FRAMEWORK solves the other problems, this will probably help later on...

(edit: this is most probably solved, it seems a old version of this lib was causing the problem)

However i cannot compile direct, it seems dtool has some stuff missing (just because something seems to be missing in libdtoolbase)?

cd ./src/dcparser && make all
g++ -undefined dynamic_lookup -dynamic -dynamiclib -o Opt3-OSX/libdcparser.dylib -install_name libdcparser.dylib Opt3-OSX/dcparser_dcparser_composite1.o Opt3-OSX/dcparser_dcparser_composite2.o Opt3-OSX/dcparser_dcParser.o Opt3-OSX/dcparser_dcLexer.o Opt3-OSX/libdcparser_igate.o -L../directbase/Opt3-OSX -L/usr/local/panda/lib -L/usr/local/panda/lib -L/usr/local/panda/lib -L/Library/Frameworks/Python.framework/Versions/2.4/lib -L/Library/Frameworks/Python.framework/Versions/2.4/lib -ldirectbase -lexpress -lpstatclient -lpipeline -linterrogatedb -ldconfig -ldtoolutil -ldtoolbase -lprc -lpandabase -lnet -lnativenet -llinmath -lputil -framework Python
ld: Undefined symbols:
__ZN10TypeHandle16dec_memory_usageENS_11MemoryClassEm referenced from libexpress expected to be defined in libdtoolbase
__ZN10TypeHandle16inc_memory_usageENS_11MemoryClassEm referenced from libexpress expected to be defined in libdtoolbase
/usr/bin/libtool: internal link edit command failed
make[1]: *** [Opt3-OSX/libdcparser.dylib] Error 1
make: *** [dcparser] Error 2

Any idea's what's causing this problem?
Thanks
Last edited by Hypnos on Fri Jun 22, 2007 3:58 pm, edited 1 time in total.
Hypnos
 
Posts: 585
Joined: Sat Sep 11, 2004 8:07 am
Location: Zürich, Switzerland

Postby kaweh » Fri Jun 22, 2007 5:40 am

i didn't have problems with direct, after solving the Cg issue. i will have a patch and instructions available later today to compile panda3d from cvs on OS X. i also added a change in the dtool Config templates to allow correct compilation of executables (pview), because needed frameworks (Cg triggered the problem for me) weren't included as needed.

i want to forward the patch/instructions how_to.txt to david, hopeing that he'll be able to test, confirm and incorporate these changes into CVS.

i'm now fighting my way through pandatools, CVS has a couple of link problems, which i had solved previously for my OS X panda3d package. i'll try to provide a more general patch for this too.

cheers,
kw.
kaweh
 
Posts: 173
Joined: Thu Mar 30, 2006 7:15 am
Location: Vienna, Austria

Postby Hypnos » Sat Jun 23, 2007 10:54 am

By the way kaweh, if you are going to create a new osx installer for panda3d it would be great if you could include the networking as well. The only reason a compiled a version myself was because i missed that in your installer.

Thanks
Hypnos
 
Posts: 585
Joined: Sat Sep 11, 2004 8:07 am
Location: Zürich, Switzerland

Postby drwr » Sat Jun 23, 2007 11:31 am

Note that the latest version of Panda no longer depends on NSPR for networking, and will build networking interfaces automatically.

David
drwr
 
Posts: 11425
Joined: Fri Feb 13, 2004 12:42 pm
Location: Glendale, CA

Postby Hypnos » Sat Jun 23, 2007 1:53 pm

I have now successfully compiled panda & direct however there are still a lot of compile errors i have to fix manually. i put together a script with all fixed compile commands, it adds a "-framework Cg" to all changed lines.

http://www.pastebin.be/3156

This is the Config.pp i am using

http://www.pastebin.be/3152

It would be great if that could be incorporated into the compile scripts.
Hypnos
 
Posts: 585
Joined: Sat Sep 11, 2004 8:07 am
Location: Zürich, Switzerland

Postby kaweh » Sat Jun 23, 2007 3:31 pm

Hypnos wrote:I have now successfully compiled panda & direct however there are still a lot of compile errors i have to fix manually. i put together a script with all fixed compile commands, it adds a "-framework Cg" to all changed lines.

http://www.pastebin.be/3156


thanks for that. i have a patch, that will correct the approriate Sources.pp. i"ll create one and release it hoepfully on monday (wanted to do so on friday, but didn't get around to finish that).

cheers,
kw.
kaweh
 
Posts: 173
Joined: Thu Mar 30, 2006 7:15 am
Location: Vienna, Austria

Postby treeform » Wed Jun 27, 2007 12:43 am

make this work some how OSX will be great!
User avatar
treeform
 
Posts: 2106
Joined: Sat May 05, 2007 5:15 pm
Location: SF, CA

Any update?

Postby matt_r » Fri Jun 29, 2007 7:16 am

Hi.

I was just wondering how this is going. I'm planning on doing my final year University project using Panda3d and I only have a Mac at the moment.

Do you think I should be safe and buy a PC with Linux or Win, or will this run on a Mac properly once set up?

Thanks to everyone who is working on this.

Matt
matt_r
 
Posts: 2
Joined: Fri Jun 29, 2007 7:11 am

Postby drwr » Fri Jun 29, 2007 8:02 am

Panda runs great on a Mac. In fact, I've been doing more and more of my primary development on the Panda3D code itself on my iMac, since it's the fastest computer on my desktop right now. Then I commit it and see if it still runs on Windows. :)

David
drwr
 
Posts: 11425
Joined: Fri Feb 13, 2004 12:42 pm
Location: Glendale, CA

PreviousNext

Return to Compiling or Editing the Panda Source

Who is online

Users browsing this forum: No registered users and 0 guests