📄 install.html
字号:
<TITLE>COG 2.1: Installation</TITLE><H1>Installation</H1><H2>Public Domain Version</H2> <P>You can download the compressed tar file <A HREF="cog.tar.gz">cog.tar.gz</A>, decompressed anduntar it:<PRE>/base> gunzip cog.tar.gz/base> tar xf cog.tar</PRE> <P>Then the subdirectory cog contains the complete source code,inclusive this documentation:<PRE>/base> cd cog/base/cog> netscape install.html</PRE><H2>Environment variables</H2> <P>Now, you have to define the environment variables <I>COG_HOME,COG_CONFIG, COG_WORK</I>. <UL> <LI> The variable <I>COG_HOME</I> defines the directory whichcontains the COG source code and documentation. <LI> The variable <I>COG_WORK</I> defines a COG working directory.The perl scripts used to extract C++ code from the test examples putthe resulting files <I>*test.cxx</I> into this directory. <LI>The variable <I>COG_CONFIG</I> defines architecture-specificstuff, mostly various compiler flags which differ for differentcompilers. To find valid values, look into the directory<B><I>$COG_HOME</I>/config/</B> for files <B>*.mk</B>. Their names(without .mk) are possible values for COG_CONFIG. </UL> <P>We also recommend to add the subdirectory<B><I>$COG_HOME</I>/bin</B> to the path. <P>For example, if you use <I>csh</I>, have installed COG in<I>/base</I>, want your test code in <I>/home/cog</I>, andwant to use the compiler options from the file<B><I>$COG_HOME</I>/config/axp.mk</B>, you have to set:<PRE>####### put this into your .cshrc #######setenv COG_HOME /base/cogsetenv COG_WORK /home/cogsetenv COG_CONFIG axpset path = ($COG_HOME/bin $path)</PRE> <P>Feel free to create own files $COG_HOME/config/myflags.mk for yourpreferred set of compiler flags. In this case, you have to setCOG_CONFIG to myflags.<H2>Installation</H2> <P>Now, at least in principle, it should be possible to install COG with<PRE>/base/cog> ./coginstall</PRE> <P>Possibly you have to change the permissions:<PRE>/base/cog> chmod +x coginstall/base/cog> ./coginstall</PRE> <P>If you have <A HREF="#perl">problems with perl</A>, you can do thesame it the following way:<PRE>/base/cog> cp cog.mk Makefile/base/cog> make install</PRE> <P>That's all - you have installed COG. At least, I hope so.<H2>What else?</H2> <P>Now, COG is a library. This COG library you can find in <B><I>$COG_HOME</I>/lib</B> with filename <B>libcog_<I>$COG_CONFIG</I>.a</B> <P>How to use this library you can learn in the <A HREF="tutorial.html">tutorial</A>. <P>It is based on learning by doing. That means, it contains of alot of test code. This is really working test code (means, at leastonce it has worked on my machine). You can extract this test codeusing the perl scripts in <I>$COG_HOME/bin</I>: <UL> <LI> <B>coguse main <I>option</I></B> extracts source code from<B>main<I>option</I>test.html</B> and puts it into<B><I>$COG_WORK</I>/maintest.cxx</B>. This code contains a valid mainprogram. <LI> Some of them work include other files like <I>cogtest.cxx</I>.Code for such files may be extracted with <B>coguse <I>base</I><I>option</I></B>, which extracts source code from<B><I>baseoption</I>test.html</B> and puts it into<B><I>$COG_WORK/base</I>test.cxx</B>. <LI> <B>cog</B> compiles and links <I>maintest.cxx</I> with the COGlibrary, puts it into <B><I>$COG_WORK</I>/test</B> and executes it. </UL><H2>Using test examples</H2> <P>Now you <A HREF="mainstarttest.html">test COG</A>.<H2>Problems</H2> <P>Some problems which may be solved:<H2><A NAME="perl">Another location of perl</A></H2> <P>Somewhere (for example Linux) perl is in /usr/bin, sometimes in/usr/local/bin. We assume it is in /usr/local/bin. If it is in/usr/bin, ask your system administrator to make<PRE>/# ln -s /usr/bin/perl /usr/local/bin/perl</PRE>or replace the header lines of the *.pl files and coginstall into<PRE>#! /usr/bin/perl# this should be the first line of all perl script</PRE><H2>No perl</H2> <P>It is useful to have <B>perl</B> on your machine. If not, this isnot very problematic. <B>perl</B> is used only for the testenvironment, in the perl-scripts <B>cog</B>, <B>coguse</B> and<B>cogrun</B>, and in the initialization script <B>coginstall</B>.It is still easy to use COG, especially the test code in the HTMLdocumentation, without <B>perl</B>: <P>Instead of <B>coginstall</B> you have to make<H2>No OpenGL</H2> <P>In this case, forget the geometry and grid viewer. You can stilluse COG for grid generation. With<PRE>/base/cog> grep NOGL *.mk</PRE> <P>you can find out the files where you have to change something.<H2>Compiler Problems</H2> <P>Read the documentation of your local compiler. May be you find outsome options which allow to compile your code? In this case, put them(following the style of the other $COG_HOME/config/*.mk files) intoyour own file $COG_HOME/config/myflags.mk and set COG_CONFIG to<I>myflags</I>. <P><A HREF="mailto:schmelzer@wias-berlin.de">Send me</A> a mail.I'm always happy if somebody has compiled COG on a new machine.And if something does not compile, tell me about.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -