Date: Tue, 1 Feb 2005 05:21:01 GMT From: Sangwoo Shim <ssw@neo.redjade.org> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/76941: Patch to science/vmd: compile and run vmd on amd64 machine. Message-ID: <200502010521.j115L1CS068452@www.freebsd.org> Resent-Message-ID: <200502010530.j115UT4v084965@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 76941 >Category: ports >Synopsis: Patch to science/vmd: compile and run vmd on amd64 machine. >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Feb 01 05:30:28 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Sangwoo Shim >Release: RELENG_5 of Mon Jan 31, 2005 >Organization: Seoul Natl' Univ. (in Korea) >Environment: FreeBSD swoo.org 5.3-STABLE FreeBSD 5.3-STABLE #1: Mon Jan 31 10:07:28 KST 2005 root@swoo.org:/usr/obj/usr/src/sys/SANGWOO amd64 >Description: science/vmd doesn't work on amd64 architecture. (It doesn't compile, either.) With following patch, I've successfully run vmd, read pdb file, etc etc. >How-To-Repeat: >Fix: This patch is against entire vmd port directory. (cd /usr/ports/science; diff -urN vmd.orig vmd) Or, retrive bzip2ed vmd port at http://www.swoo.org/~sangwoo/vmd.tar.bz2 %%% diff -urN vmd.orig/Makefile vmd/Makefile --- vmd.orig/Makefile Fri Sep 3 18:02:31 2004 +++ vmd/Makefile Sat Jan 22 16:01:16 2005 @@ -55,8 +55,13 @@ ${REINPLACE_CMD} "s/python2.2/${PYTHON_VERSION}/" ${WRKSRC}/configure do-build: +.ifdef ${ARCH} == "amd64" + cd ${WRKDIR}/plugins && ${SETENV} ${MAKE_ENV} PLUGINDIR=${WRKSRC}/plugins ${GMAKE} FREEBSDAMD64 distrib + cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} TCL_INCLUDE_DIR=${PREFIX}/include/tcl8.4 TK_INCLUDE_DIR=${PREFIX}/include/tk8.4 ${GMAKE} freebsd.amd64.opengl +.else cd ${WRKDIR}/plugins && ${SETENV} ${MAKE_ENV} PLUGINDIR=${WRKSRC}/plugins ${GMAKE} FREEBSD distrib cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} TCL_INCLUDE_DIR=${PREFIX}/include/tcl8.4 TK_INCLUDE_DIR=${PREFIX}/include/tk8.4 ${GMAKE} freebsd.opengl +.endif cd ${WRKSRC}/src && ${SETENV} ${MAKE_ENV} ${GMAKE} all do-install: diff -urN vmd.orig/files/patch-AtomParser.C vmd/files/patch-AtomParser.C --- vmd.orig/files/patch-AtomParser.C Sun Aug 22 01:34:57 2004 +++ vmd/files/patch-AtomParser.C Sat Jan 22 16:10:36 2005 @@ -5,7 +5,7 @@ #endif -#if !defined(_MSC_VER) && !defined(ARCH_MACOSX) -+#if !defined(_MSC_VER) && !defined(ARCH_MACOSX) && !defined(ARCH_FREEBSD) ++#if !defined(_MSC_VER) && !defined(ARCH_MACOSX) && !defined(ARCH_FREEBSD) && !defined(ARCH_FREEBSDAMD64) #include <values.h> #endif diff -urN vmd.orig/files/patch-Make-arch vmd/files/patch-Make-arch --- vmd.orig/files/patch-Make-arch Thu Jan 1 09:00:00 1970 +++ vmd/files/patch-Make-arch Sat Jan 22 15:49:28 2005 @@ -0,0 +1,31 @@ +--- ../plugins/Make-arch.orig Fri Nov 14 07:50:25 2003 ++++ ../plugins/Make-arch Fri Jan 21 19:30:53 2005 +@@ -9,6 +9,7 @@ + @echo "--------------------------------------" + @echo " AIX4" + @echo " FREEBSD" ++ @echo " FREEBSDAMD64" + @echo " HPUX11" + @echo " IRIX6" + @echo " IRIX6_64" +@@ -142,6 +143,20 @@ + "CXX = g++" \ + "CCFLAGS = -O2 -Wall -ansi -I/usr/local/include/tcl8.4" \ + "CXXFLAGS = -O2 -Wall" \ ++ "TCLLDFLAGS = -L/usr/local/lib -ltcl84" \ ++ "NM = nm -p" \ ++ "RANLIB = touch" \ ++ "SHLD = gcc -shared" ++ ++FREEBSDAMD64: ++ $(MAKE) dynlibs staticlibs \ ++ "ARCH = FREEBSDAMD64" \ ++ "COPTO = -fPIC -m64 -o " \ ++ "LOPTO = -fPIC -m64 -o " \ ++ "CC = gcc" \ ++ "CXX = g++" \ ++ "CCFLAGS = -m64 -O2 -Wall -ansi -I/usr/local/include/tcl8.4" \ ++ "CXXFLAGS = -m64 -O2 -Wall" \ + "TCLLDFLAGS = -L/usr/local/lib -ltcl84" \ + "NM = nm -p" \ + "RANLIB = touch" \ diff -urN vmd.orig/files/patch-Makefile vmd/files/patch-Makefile --- vmd.orig/files/patch-Makefile Sun Aug 22 01:34:57 2004 +++ vmd/files/patch-Makefile Sat Jan 22 15:59:37 2005 @@ -1,6 +1,6 @@ ---- Makefile-ooo Fri Dec 5 13:20:58 2003 -+++ Makefile Thu Aug 12 00:12:06 2004 -@@ -52,11 +52,11 @@ +--- Makefile.orig Sat Dec 6 04:20:58 2003 ++++ Makefile Sat Jan 22 15:58:12 2005 +@@ -52,11 +52,14 @@ ## FreeBSD builds freebsd.mesa: @@ -11,6 +11,9 @@ freebsd.opengl: - ./configure FREEBSD OPENGL FLTK TK IMD VRPN SILENT SPACEBALL TCL PTHREADS ACTC LIBTACHYON PYTHON NUMPY + ./configure FREEBSD OPENGL FLTK TK IMD SILENT TCL PTHREADS PYTHON NUMPY ++ ++freebsd.amd64.opengl: ++ ./configure FREEBSDAMD64 OPENGL FLTK TK IMD SILENT TCL PTHREADS PYTHON NUMPY diff -urN vmd.orig/files/patch-configure vmd/files/patch-configure --- vmd.orig/files/patch-configure Fri Sep 3 18:02:31 2004 +++ vmd/files/patch-configure Sat Jan 22 15:56:31 2005 @@ -1,6 +1,23 @@ ---- configure-xxx Fri Dec 5 13:20:58 2003 -+++ configure Thu Aug 12 00:22:30 2004 -@@ -1174,8 +1174,10 @@ +--- configure.orig Sat Dec 6 04:20:58 2003 ++++ configure Sat Jan 22 15:55:09 2005 +@@ -46,6 +46,7 @@ + # --------------------------------------------------------------- + # AIX4 - compile on an RS/6000 machine (gcc/g++/xlc/xlC) + # FREEBSD - compile on a FreeBSD machine (gcc/g++) ++# FREEBSDAMD64- compile on a FreeBSD machine (gcc/g++) + # HPUX11 - compile on an HP-UX 11.0 machine (cc/CC/cc/aCC) + # IRIX6 - compile on an SGI, IRIX 6.X or later, 32-bit ABI + # IRIX6_64 - compile on an SGI, IRIX 6.X or later, 64-bit ABI +@@ -116,7 +117,7 @@ + + #################### Parse command line options ########### + # list of allowed architectures +-@archlist=('IRIX6', 'IRIX6_64', 'FREEBSD', 'HPUX11', 'AIX4', 'LINUX', 'LINUXALPHA', 'LINUXAMD64', 'LINUXPPC', 'MACOSX', 'TRU64', 'SOLARIS2', 'SOLARIS2_64', 'SOLARISX86', 'WIN32'); ++@archlist=('IRIX6', 'IRIX6_64', 'FREEBSD', 'FREEBSDAMD64', 'HPUX11', 'AIX4', 'LINUX', 'LINUXALPHA', 'LINUXAMD64', 'LINUXPPC', 'MACOSX', 'TRU64', 'SOLARIS2', 'SOLARIS2_64', 'SOLARISX86', 'WIN32'); + + if ($#ARGV == -1) { + $text = `cat configure.options`; # XFree 4.0 Direct Rendering Interface and GLX $opengl_dir = "/usr/X11R6"; @@ -13,11 +30,70 @@ $opengl_libs = "-lGL -lGLU"; $arch_lex = "flex"; -@@ -1209,7 +1211,7 @@ +@@ -1209,7 +1212,66 @@ # this is to make tcl happy, # also needed for plugins - $system_libs .= " -ldl"; ++ # $system_libs .= " -ldl"; ++ ++ if ($config_python) { ++ # this is to make python happy ++ $system_libs .= " -lutil"; ++ } ++ ++ # this is necessary for the embedded Python interpreter to dynamically ++ # load shared libraries. It increases the size of the binary by 200k. ++ $arch_lopts .= " -Xlinker -export-dynamic"; ++} ++ ++ ++ ++if ($config_arch eq "FREEBSDAMD64") { ++ $def_imageviewer="display %s"; ++ if ($config_lp64) { ++ print "LP64 ABI is already the default on this platform.\n"; ++ } ++ ++ # XFree 4.0 Direct Rendering Interface and GLX ++ $opengl_dir = "/usr/X11R6"; ++# -DGLX_GLXEXT_LEGACY is required for patched OpenGLExtensions.C to compile. ++# See patched OpenGLExtensions.C for explanation. ++ $opengl_include = "-DGLX_GLXEXT_LEGACY -I$opengl_dir/include"; ++ $opengl_library = "-L$opengl_dir/lib -L/usr/local/lib"; ++ $opengl_libs = "-lGL -lGLU"; ++ ++ $arch_lex = "flex"; ++ $arch_yacc = "bison -b y -d "; # If standard yacc doesn't work ++ ++ $arch_cc = "gcc"; ++ $arch_ccpp = "g++"; ++ $arch_depend_flag = "-MM"; ++ $arch_shld = "ld -shared"; ++ $arch_shlibname = "so"; ++ $arch_shcppopts = "-fPIC"; ++ $arch_shldopts = "-L/usr/local/lib -L/usr/X11R6/lib"; ++ ++ $arch_opt_flag = "-m64 -Wall -O6 -ffast-math"; ++ $arch_copts = "-m64 -Wall -O6 -ffast-math"; ++ ++ if ($config_static) { ++ $arch_lopts = "-static"; ++ $mesa_libs = "-lMesaGL -lMesaGLU -L/usr/X11R6/lib -lXext -lX11"; ++ } else { ++ $arch_lopts = ""; ++ $mesa_libs = "-lGL -lGLU -L/usr/X11R6/lib -lXext -lX11"; ++ } ++ ++ if ($config_shared) { ++ $arch_lopts = "-shared"; ++ } ++ ++ # a hack - to be removed, just keeps make happy ++ $arch_template_repository = "foobar"; ++ ++ # this is to make tcl happy, ++ # also needed for plugins + # $system_libs .= " -ldl"; if ($config_python) { diff -urN vmd.orig/files/patch-utilities.C vmd/files/patch-utilities.C --- vmd.orig/files/patch-utilities.C Thu Jan 1 09:00:00 1970 +++ vmd/files/patch-utilities.C Sat Jan 22 16:16:32 2005 @@ -0,0 +1,11 @@ +--- src/utilities.C.orig Sat Jan 22 16:15:24 2005 ++++ src/utilities.C Sat Jan 22 16:15:45 2005 +@@ -275,7 +275,7 @@ + return stringdup("Windows User"); + } + #else +-#if defined(ARCH_FREEBSD) || defined(ARCH_MACOSX) || defined(ARCH_LINUX) || defined(ARCH_LINUXALPHA) || defined(ARCH_LINUXAMD64) || defined(ARCH_LINUXPPC) ++#if defined(ARCH_FREEBSD) || defined(ARCH_FREEBSDAMD64) || defined(ARCH_MACOSX) || defined(ARCH_LINUX) || defined(ARCH_LINUXALPHA) || defined(ARCH_LINUXAMD64) || defined(ARCH_LINUXPPC) + return stringdup(getlogin()); + #else + return stringdup(cuserid(NULL)); diff -urN vmd.orig/files/patch-vmd vmd/files/patch-vmd --- vmd.orig/files/patch-vmd Thu Jan 1 09:00:00 1970 +++ vmd/files/patch-vmd Tue Feb 1 14:08:03 2005 @@ -0,0 +1,11 @@ +--- bin/vmd.orig Tue Feb 1 14:05:15 2005 ++++ bin/vmd Tue Feb 1 14:05:59 2005 +@@ -194,6 +194,8 @@ + # The standard options + if (`uname -m` == "i386") then + set ARCH=FREEBSD ++ else if (`uname -m` == "amd64") then ++ set ARCH=FREEBSDAMD64 + endif + set VMD_WINTERM=xterm + set VMD_WINOPTS='-sb -sl 1000 -e' %%% >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200502010521.j115L1CS068452>