This is a followup to this. I made a little bit of progress, but I'm still flummoxed. I have a more specific question this time.

I am trying to compile a sample program which came with a software package I installed called SUNDIALS. The code is correct (it is supplied as an example with the code).

However, I am getting an error message which indicates that a library cannot find one of the libraries referenced in its #include statement. But the file that it cannot find is in the same directory.

So I am compiling the file /home/<myusername>/sundials/srcdir/examples/cvode/parallelcvAdvDiff_non_p.c, which starts like this:
Code:
#include <stdio.h>#include <stdlib.h>
#include <math.h>


#include <cvode/cvode.h>              /* prototypes for CVODE fcts. */
#include <nvector/nvector_parallel.h> /* definition of N_Vector and macros */
#include <sundials/sundials_types.h>  /* definition of realtype */
#include <sundials/sundials_math.h>   /* definition of EXP */


#include <mpi.h>                      /* MPI constants and types */
...
See the #include <sundials/sundials_types.h>? That file's full location is /home/<myusername>/sundials/srcdir/include/sundials/sundials_types. The compiler finds it. It starts
Code:
#ifndef _SUNDIALSTYPES_H#define _SUNDIALSTYPES_H


#ifdef __cplusplus  /* wrapper to enable C++ usage */
extern "C" {
#endif


#ifndef _SUNDIALS_CONFIG_H
#define _SUNDIALS_CONFIG_H
#include <sundials/sundials_config.h>
#endif


#include <float.h>
Now, see the line #include <sundials/sundials_config.h>? That file is in the same directory as sundials_types., but the compiler can't find it.

The compile command I'm using is
Code:
$ gcc -I/home/schwarz/sundials/cvode-2.6.0/include -L/home/schwarz/sundials/cvode-2.6.0/instdir/lib/ cvAdvDiff_non_p.c
The start of the error message I'm getting is
Code:
In file included from /home/schwarz/sundials/cvode-2.6.0/include/sundials/sundials_nvector.h:50,
                 from /home/schwarz/sundials/cvode-2.6.0/include/cvode/cvode.h:37,
                 from cvAdvDiff_non_p.c:37:
/home/schwarz/sundials/cvode-2.6.0/include/sundials/sundials_types.h:50:38: error: sundials/sundials_config.h: No such file or directory
In file included from /home/schwarz/sundials/cvode-2.6.0/include/cvode/cvode.h:37,
                 from cvAdvDiff_non_p.c:37:
Anybody know why the compiler doesn't find the library's library? How do I fix that?