I added the include directories from &quot;make getincludedirs&quot; and I added the line from &quot;make getlinklib&quot;. Eclipse creates a gcc call as follows:<br><br>/home/mdbockman/Documents/Research/codes/petsc/petsc-3.1-p8/linux-gnu-c-debug/bin/mpicc -I/home/mdbockman/Documents/Research/codes/petsc/petsc-3.1-p8/linux-gnu-c-debug/include -I/home/mdbockman/Documents/Research/codes/petsc/petsc-3.1-p8/include -I/home/mdbockman/Documents/Research/codes/petsc/petsc-3.1-p8/linux-gnu-c-debug/include -O0 -g3 -pg -p -Wall -Wl,-rpath,/home/mdbockman/Documents/Research/codes/petsc/petsc-3.1-p8/linux-gnu-c-debug/lib -Wl,-rpath,/home/mdbockman/Documents/Research/codes/petsc/petsc-3.1-p8/linux-gnu-c-debug/lib -L/home/mdbockman/Documents/Research/codes/petsc/petsc-3.1-p8/linux-gnu-c-debug/lib -lpetsc -lX11 -Wl,-rpath,/home/mdbockman/Documents/Research/codes/petsc/petsc-3.1-p8/linux-gnu-c-debug/lib -L/home/mdbockman/Documents/Research/codes/petsc/petsc-3.1-p8/linux-gnu-c-debug/lib -lflapack -lfblas -lnsl -lrt -lm -L/home/mdbockman/Documents/Research/codes/petsc/petsc-3.1-p8/linux-gnu-c-debug/lib -L/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2 -L/usr/lib/x86_64-linux-gnu -ldl -lmpich -lpthread -lrt -lgcc_s -lmpichf90 -lgfortran -lm -lm -ldl -lmpich -lpthread -lrt -lgcc_s -ldl -MMD -MP -MF&quot;SparseMatrixPetsc.d&quot; -MT&quot;SparseMatrixPetsc.d&quot; -o&quot;SparseMatrixPetsc.o&quot; &quot;../SparseMatrixPetsc.c<br>
<br>And when it is compiled I get the following:<br><br><a href="http://pastebin.com/CbRzYcZj">http://pastebin.com/CbRzYcZj</a><br><br>The source file which is being compiled is:<br><br><a href="http://pastebin.com/Q85hXvnS">http://pastebin.com/Q85hXvnS</a><br>
<br>Please have a look. I&#39;m not quite sure what I&#39;m doing wrong but I feel like I&#39;m getting closer and closer to the solution.<br><br>Matt<br><br><div class="gmail_quote">On Wed, Jul 27, 2011 at 11:52 AM, Satish Balay <span dir="ltr">&lt;<a href="mailto:balay@mcs.anl.gov">balay@mcs.anl.gov</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">use:<br>
make getincludedirs<br>
<font color="#888888"><br>
Satish<br>
</font><div><div></div><div class="h5"><br>
On Wed, 27 Jul 2011, Mohammad Mirzadeh wrote:<br>
<br>
&gt; I applogize for the mistake; Include files are actually located<br>
&gt; in $PETSC_DIR/include<br>
&gt;<br>
&gt; On Wed, Jul 27, 2011 at 11:18 AM, Mohammad Mirzadeh &lt;<a href="mailto:mirzadeh@gmail.com">mirzadeh@gmail.com</a>&gt;wrote:<br>
&gt;<br>
&gt; &gt; Ok then. Now I don&#39;t have enough experience with Eclipse so<br>
&gt; &gt; I apologize beforehand if you already know these/have tried them out. If<br>
&gt; &gt; not, hopefully they can be of help. I assume there should be a way in<br>
&gt; &gt; Eclipse to give it the link lib directory. In plain makefile that&#39;s just a<br>
&gt; &gt; simple step when linking. To get all the needed linklibs for petsc, you can<br>
&gt; &gt; do<br>
&gt; &gt;<br>
&gt; &gt; make getlinklibs<br>
&gt; &gt;<br>
&gt; &gt; in the $PETSC_DIR. As for the needed include files, they are all located<br>
&gt; &gt; in<br>
&gt; &gt;<br>
&gt; &gt; $PETSC_DIR/$PETSC_ARCH/include<br>
&gt; &gt;<br>
&gt; &gt; Again, its easy to use these directories along with your makefile. I&#39;m not<br>
&gt; &gt; sure about how you give them to Eclipse though. Hopefully this has been<br>
&gt; &gt; helpful.<br>
&gt; &gt;<br>
&gt; &gt; Best,<br>
&gt; &gt; Mohammad<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; On Wed, Jul 27, 2011 at 10:52 AM, Matt Bockman &lt;<a href="mailto:mdbockma@ucsd.edu">mdbockma@ucsd.edu</a>&gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt;&gt; Just pointing it to the library would be sufficient.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Matt<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; On Wed, Jul 27, 2011 at 10:21 AM, Mohammad Mirzadeh &lt;<a href="mailto:mirzadeh@gmail.com">mirzadeh@gmail.com</a>&gt;wrote:<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;&gt; So do you want to be able to compile PETSc with Eclipse or just point it<br>
&gt; &gt;&gt;&gt; to the library to use in your own applications?<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; On Wed, Jul 27, 2011 at 9:14 AM, Matt Bockman &lt;<a href="mailto:mdbockma@ucsd.edu">mdbockma@ucsd.edu</a>&gt; wrote:<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt; Thanks Mohammad,<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt; I&#39;ll give that a shot. I use Qt Creator for some GUI applications so I<br>
&gt; &gt;&gt;&gt;&gt; am familiar with it, but I&#39;ve never tried doing a non-Qt project in it. I&#39;d<br>
&gt; &gt;&gt;&gt;&gt; really like to get Eclipse to work.<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt; Regarding the makefiles for eclipse. There are makefiles that it<br>
&gt; &gt;&gt;&gt;&gt; generates (which are for GNU make) but I think I can also manually create my<br>
&gt; &gt;&gt;&gt;&gt; makefiles. After sleeping on it, it seems like this might be the best<br>
&gt; &gt;&gt;&gt;&gt; option, unless I can figure out a way to configure eclipse to include the<br>
&gt; &gt;&gt;&gt;&gt; conf/variables and conf/rules files in the makefile.<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt; Matt<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt; On Wed, Jul 27, 2011 at 12:01 AM, Mohammad Mirzadeh &lt;<a href="mailto:mirzadeh@gmail.com">mirzadeh@gmail.com</a><br>
&gt; &gt;&gt;&gt;&gt; &gt; wrote:<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt;&gt; Although this is sort of orthogonal to what you do right now,<br>
&gt; &gt;&gt;&gt;&gt;&gt; I recommend Qt Creator as an alternative IDE to Eclipse. It links nicely<br>
&gt; &gt;&gt;&gt;&gt;&gt; with PETSc(or any other library for that matter) and has excellent c/c++<br>
&gt; &gt;&gt;&gt;&gt;&gt; support.<br>
&gt; &gt;&gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt;&gt; Mohammad<br>
&gt; &gt;&gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt;&gt; On Tue, Jul 26, 2011 at 7:22 PM, Barry Smith &lt;<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>&gt;wrote:<br>
&gt; &gt;&gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt;  There is a tiny bit of information in the PETSc users manual about<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; Eclipse:<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; \section{Eclipse Users} \sindex{eclipse}<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; If you are interested in developing code that uses PETSc from Eclipse<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; or developing PETSc in Eclipse and have knowledge of how to do indexing and<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; build libraries in Eclipse please contact us at \<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; <a href="mailto:trl%7Bpetsc-dev@mcs.anl.gov">trl{petsc-dev@mcs.anl.gov</a>}.<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; To make PETSc an Eclipse package<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; \begin{itemize}<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; \item Install the Mecurial plugin for Eclipse and then import the<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; PETSc repository to Eclipse.<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; \item elected New-&gt;Convert to C/C++ project and selected shared<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; library. After this point you can perform searchs in the code.<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; \end{itemize}<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt;  A PETSc user has provided the following steps to build an Eclipse<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; index for PETSc that can be used with their own code without compiling PETSc<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; source into their project.<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; \begin{itemize}<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; \item In the user project source directory, create a symlink to the<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; petsc/src directory.<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; \item Refresh the project explorer in Eclipse, so the new symlink is<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; followed.<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; \item Right-click on the project in the project explorer, and choose<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; &quot;Index -&gt; Rebuild&quot;. The index should now be build.<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; \item Right-click on the PETSc symlink in the project explorer, and<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; choose &quot;Exclude from build...&quot; to make sure Eclipse does not try to compile<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; PETSc with the project.<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; \end{itemize}<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; We&#39;d love to have someone figure out how to do it right and include<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; that information.<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt;   Barry<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; On Jul 26, 2011, at 4:32 PM, Matt Bockman wrote:<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; &gt; Has anyone gotten PETSc to work w/Eclipse? Eclipse nicely generates<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; all my makefiles for me for my current project (which is written in C++).<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; I&#39;d like to link PETSc w/my application but I&#39;m not sure how to do this.<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; &gt; Suggestions?<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; &gt; Thanks,<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; &gt; Matt<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;<br>
&gt;<br>
<br>
</div></div></blockquote></div><br>