📄 osx-howto.txt
字号:
Some comments on "Getting OOPIC working on Mac OS X":1). Xoopic works fine with gcc 3.3 on Linux these days. There shouldnot be too much trouble when using gcc 3.3 on OS X.2). XGrafix used not to work with Tcl/Tk 8.4 due to a problem in theTcl scripts that come with it. This has since been fixed, so you cansafely use Tcl 8.4 if it is already on your system. No need to gothrough the trouble of instaling Tcl/Tk 8.3. (Note that Tcl/Tk 8.3and earlier also still work.)3). The problem with the "single capital letter variables" may havemore to do with the dummy arguments used in many constructors andaccessors than with the variable name itself. (Thanks to Brad Shadwick,who dug this out.) For example, many accessors look like this:void setA(Scalar _A) {A = _A;}The symbol "_A" is reserved for the implementation, as all symbolsstarting with an underscore are. On Mac OS X, <ctype.h> uses thesymbols "_A" and "_B", which clashes with the "illegal" use of thesesymbols in Xoopic. Fortunately, a lot of such cases seem to have beendealt with by now.4). Building XGrafix used to generate lots of warnings. A recentcode clean-up took care of most of them. The remaining ones areprobably pretty harmless. (Only xgprintgif.h might need some changessome day.)Raoul Trines, Feb. 16, 2005--------------A brief howto on getting oopic working onMac OS X (thanks go to Scott Kovaleski):1). Install X11R6/XDarwin (can obtain most up to date version from Fink)2). Use "sudo gcc_select 3.1", to switch to the gcc3.1 compilers. I don' t know if gcc3.3 will work or not.3). Download and install Tcl/Tk 8.3.5 (the Unix version, NOT the Mac version). I had to do this from source... Fink distributes 8.4.5, which didn't work. I recommend doing this from a directory hung off of "/" (like "/Download", for instance) especially if you have multiple partitions (as I do). The use of spaces in path names (which Mac allows) can cause some infuriating problems in the configure and make steps.4). Fink has some of the other optional packages, like FFTW and HDF5, if you want that capability.5). Get and unpack xgrafix and xoopic.6). Configure, make, and install xgrafix. You will probably need to use all of the "--with-XXX" flags for the newly installed Tcl and Tk. You should get warnings but no errors.7). Configure xoopic. Use the "--with-XXX" flags again for Tcl and Tk.8). In order to "make", some minor surgery must be done to a few of the source files. Basically, the compiler doesn't like variables with a single, capital letter (e.g. Scalar Q). It will return an error if these are found. I edited the source and header files, and changed those single capital letter variables to something else (e.g. "Scalar Q" and other occurrences of Q become "Scalar Q1". The errors are thus eliminated. I have included what I think is a complete list of the files I changed. Look for variables in them like "A", "B", "Q", "R", "L", "C", "I". If an error comes up, look in the offending source file for a single capital letter and add a one to it (or something else). (You can just run make, as I did, and the compiler will tell you which files are a problem and the line number of the problem).9). After making those changes, make and make install should run without incident... and you are ready to go.List of source files to modify:=====================In oopic/physicsboundary.cppconducto.cppdielectr.cppdielectr.heqpot.cppexitport.cppexitport.hiloop.cppiloop.hovector.hpolar.cppspacetimefunc.hspbound.cppIn oopic/advisorboundg.cppdielecg.cppA discussion related to getting oopic working on OSX:On Mar 7, 2004, at 7:51 PM, Jim McKinnon wrote:> Scott,> I am also interested in getting XOOPIC on Mac OSX. If you could share > the> procedure you followed, I am sure other OSX users will very much > appreciate> it.>> Regards,> Jim>> On 3/5/04 9:46 AM, "Scott Kovaleski" <kovaleskis@missouri.edu> wrote:>>> All,>>>> To anyone interested, I managed to get XOOPIC and XGRAFIX to work on>> Mac OSX, running XDarwin. As I had said in previous posts, XOOPIC>> appeared to work, but XGRAFIX was having trouble. I installed Tcl/Tk>> 8.3.5 from source (the package available from Fink is 8.4.5), and the>> XGRAFIX problems disappeared, everything appears to work flawlessly.>>>> Scott>>>>>> On Mar 3, 2004, at 8:49 AM, Scott Kovaleski wrote:>>>>> All,>>>>>> Did a little more digging. Apparently the gui problem below is an>>> issue with xgrafix and Tcl. The error occurs in xginitc.c, function>>> XGInitTclTk at the line>>>>>> 450 if(Tcl_Eval(interp,TclCommand)!=TCL_OK) {>>>>>> I have TclTk 8.4.1. Is that version OK to run with xgrafix?>>>>>> Scott>>>>>> On Feb 27, 2004, at 9:35 AM, Scott Kovaleski wrote:>>>>>>> All,>>>>>>>> Firstly, I got xoopic to install on Mac OS X, 10.3 (Panther). I >>>> have>>>> XDarwin (Xfree86) 4.3.99.16-2, and Tcl/Tk 8.4.1-12, both installed>>>> from Fink. I compiled the code with gcc3.1. Some minor surgery was>>>> required on the source files. It appears that the Apple versions of>>>> gcc don't like variables with single capital letter names. For>>>> instance, in spacetimefunc.h, SpaceTimeFunction uses A and C, for >>>> the>>>> AC and DC amplitudes of a time dependent variable (at least I think>>>> that is right). So I got a parse error in that file during make. I>>>> changed the names to A1 and C1 (and made similar changes in other>>>> files), and no problems. I have run xoopic with the -nox flag, and>>>> it appears to run properly (at least without errors, and it will>>>> write dump files).>>>>>>>> Secondly, is there anyway (a post processor or something) to look at>>>> the xoopic output if xoopic is run in batch mode (with the -nox>>>> flag)?>>>>>>>> Thirdly, I am having problems with xgrafix. When I try to run>>>> xoopic with the gui, I get the following error, and it quits:>>>> **********************************************>>>> Starting XOOPIC version 2.51b(c) Copyright 1995-2002 The >>>> Regents>>>> of the University of California.Plasma Theory and Simulation>>>> GroupUniversity of California at>>>> Berkeleyhttp://ptsg.eecs.berkeley.edu>>>> Starting program. Reading input file.>>>> Input file is 'deposition.inp'>>>>>>>> XGrafix version 2.60>>>> (c) Copyright 1991-2002 The Regents of the University of>>>> California>>>>>>>> XGrafix is running on The XFree86 Project, Inc version 40399016>>>> of the X Window System, X11 R0>>>> Display name .............. :0.0>>>> Display width ............. 1680>>>> Display height ............ 1029>>>> Color plane depth ......... 24>>>>>>>> Error in initialization>>>> can't import command "mc": already exists>>>> *************************************************>>>>>>>> I think this must be a problem with xgrafix, since i can run xoopic>>>> -nox without error. Any thoughts on what might be causing this>>>> problem? I got lots of warnings, but no errors when I ran make, and>>>> I have included the output at the end of this file if that helps.>>>>>>>> Any help on the last couple of problems would be great.>>>>>>>> Regards,>>>>>>>> Scott Kovaleski>>>>>>>> Assistant Professor>>>> Electrical and Computer Engineering Department>>>> The University of Missouri-Columbia>>>> 227 Engineering Building West>>>> Columbia, MO 65211>>>>>>>> Phone: (573) 882-8377>>>> Fax: (573) 882-0397>>>> E-mail: kovaleskis@missouri.edu>>>>>>>> Output when making xgrafix:>>>>>>>> [mu-020235:~/Downloads/xgrafix] kovalesk% make>>>> make all-recursive>>>> Making all in config>>>> make[2]: Nothing to be done for `all'.>>>> Making all in src>>>> gcc -DHAVE_CONFIG_H -I. -I. -I../. -I/sw/include -I/sw/include>>>> -DXGTCL=\"/usr/local/lib\" -I/usr/X11R6/include -Wall -Wno-unused>>>> -g -DXPMENABLED -DTcl75_Tk41 -c `test -f xgpaint2d.c || echo>>>> './'`xgpaint2d.c>>>> xgpaint2d.c: In function `Paint_Window':>>>> xgpaint2d.c:217: warning: implicit declaration of function `malloc'>>>> xgpaint2d.c:250: warning: implicit declaration of function `free'>>>> gcc -DHAVE_CONFIG_H -I. -I. -I../. -I/sw/include -I/sw/include>>>> -DXGTCL=\"/usr/local/lib\" -I/usr/X11R6/include -Wall -Wno-unused>>>> -g -DXPMENABLED -DTcl75_Tk41 -c `test -f xgprint.c || echo>>>> './'`xgprint.c>>>> xgprint.c: In function `PostScriptOpenWindow':>>>> xgprint.c:273: warning: implicit declaration of function `malloc'>>>> xgprint.c:313: warning: implicit declaration of function `free'>>>> gcc -DHAVE_CONFIG_H -I. -I. -I../. -I/sw/include -I/sw/include
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -