how to compile 1.7.2 on linux mint 13

It took me some hours to get this done, so I am going to share my experiences. It already takes some time just to match dependency names to package names. :slight_smile:

I compiled the SDK Version 1.7.2 on a linux mint 13 x86_64. I assume you already have a working toolchain.

  1. Install dependencies from packages
# apt-get install zlib1g-dev python-dev flex bison libgles1-mesa-dev libgles2-mesa-dev 
# apt-get install freeglut3-dev libosmesa6-dev libxrandr-dev libxxf86dga-dev libxcursor-dev
# apt-get install libfreetype6-dev libopenal-dev libpng++-dev libgtk2.0-dev libode-dev
  1. Install dependencies from source
    2a. jpeg

None of those jpeg-dev packages worked for me, there are plenty, though. So…

# wget http://www.ijg.org/files/jpegsrc.v8d.tar.gz
# tar xf jpegsrc.v8d.tar.gz
# cd jpeg-8d
# ./configure
# make
# sudo make install

2b. nvdidia-cg

The same reason as for jpeg, there was no pkgconfig file installed by the mint package and makepanda was not able to find it. The vanilla version worked fine.
URL for 32-bit Version is developer.download.nvidia.com/cg … 12_x86.tgz

# wget http://developer.download.nvidia.com/cg/Cg_3.1/Cg-3.1_April2012_x86_64.tgz
# tar xf Cg-3.1_April2012_x86_64.tgz
# cd usr
# sudo cp -p bin/* /usr/bin/
# sudo cp -pr include/Cg/ /usr/include/
# sudo cp -p lib64/* /usr/lib/
# sudo cp -pr local/* /usr/local/

2c. update dynamic linker

# ldconfig
  1. Unpack Source
# wget http://www.panda3d.org/download/panda3d-1.7.2/panda3d-1.7.2.tar.gz
# tar xf panda3d-1.7.2.tar.gz
  1. Apply patch

nothing new, just the video4linux stuff and makepanda was not able to find the zlib

Put this in a file, I called it “panda3d-1.7.2.mint.13.patch”:

diff -ru panda3d-1.7.2.orig/makepanda/makepanda.py panda3d-1.7.2/makepanda/makepanda.py
--- panda3d-1.7.2.orig/makepanda/makepanda.py   2011-04-14 11:38:28.000000000 +0200
+++ panda3d-1.7.2/makepanda/makepanda.py        2012-12-01 10:11:23.858146816 +0100
@@ -536,7 +536,7 @@
     SmartPkgEnable("JPEG",      "",          ("jpeg"), "jpeglib.h")
     SmartPkgEnable("OPENSSL",   "openssl",   ("ssl", "crypto"), ("openssl/ssl.h", "openssl/crypto.h"))
     SmartPkgEnable("PNG",       "libpng",    ("png"), "png.h")
-    SmartPkgEnable("ZLIB",      "",          ("z"), "zlib.h")
+    SmartPkgEnable("ZLIB",      "zlib",          ("z"), "zlib.h")
     if (RTDIST and sys.platform == "darwin" and "PYTHONVERSION" in SDK):
         # Don't use the framework for the OSX rtdist build. I'm afraid it gives problems somewhere.
         SmartPkgEnable("PYTHON",    "", SDK["PYTHONVERSION"], (SDK["PYTHONVERSION"], SDK["PYTHONVERSION"] + "/Python.h"), tool = SDK["PYTHONVERSION"] + "-config")
diff -ru panda3d-1.7.2.orig/panda/src/vision/webcamVideoCursorV4L.cxx panda3d-1.7.2/panda/src/vision/webcamVideoCursorV4L.cxx
--- panda3d-1.7.2.orig/panda/src/vision/webcamVideoCursorV4L.cxx        2010-12-02 18:47:28.000000000 +0100
+++ panda3d-1.7.2/panda/src/vision/webcamVideoCursorV4L.cxx     2012-12-01 10:10:35.501907006 +0100
@@ -19,7 +19,7 @@
 #include <fcntl.h>
 #include <sys/mman.h>
 #include <sys/ioctl.h>
-#include <linux/videodev.h>
+//#include <linux/videodev.h>
 #include <linux/videodev2.h>

 #ifdef HAVE_JPEG
diff -ru panda3d-1.7.2.orig/panda/src/vision/webcamVideoV4L.cxx panda3d-1.7.2/panda/src/vision/webcamVideoV4L.cxx
--- panda3d-1.7.2.orig/panda/src/vision/webcamVideoV4L.cxx      2010-08-29 19:53:31.000000000 +0200
+++ panda3d-1.7.2/panda/src/vision/webcamVideoV4L.cxx   2012-12-01 10:10:35.501907006 +0100
@@ -21,7 +21,7 @@

 #include <fcntl.h>
 #include <sys/ioctl.h>
-#include <linux/videodev.h>
+//#include <linux/videodev.h>
 #include <linux/videodev2.h>

 TypeHandle WebcamVideoV4L::_type_handle;
@@ -33,7 +33,9 @@
 //               the global list _all_webcams.
 ////////////////////////////////////////////////////////////////////
 void find_all_webcams_v4l() {
+#ifdef LINUX_VIDEODEV_H
   struct video_capability cap;
+#endif
   struct v4l2_capability cap2;

   vector_string devs;
@@ -114,6 +116,7 @@
         }
       }

+#ifdef LINUX_VIDEODEV_H
       // Check for Video4Linux capabilities
       if (ioctl(fd, VIDIOCGCAP, &cap) != -1) {
         if (cap.type & VID_TYPE_CAPTURE) {
@@ -121,6 +124,7 @@
           continue;
         }
       }
+#endif
     }
     close(fd);
   }
# cd panda3d-1.7.2
# patch -p1 <../panda3d-1.7.2.mint.13.patch
  1. makepanda
# makepanda/makepanda.py --everything
  1. Installation
# su
# python makepanda/installpanda.py
# ldconfig
# cp built/etc/Config.prc built/etc/Confauto.prc /usr/local/etc/

This leaves me with a working version of panda3d. Where working means I am able to start all the examples. Except those ones with shaders, but this video card does not support any, so I think it’s fine.

I still have some trouble with the model search path for some of the examples, but that can’t be too hard to figure out…

cheers
flo

updated for nvidia-cg toolkit/shader support