This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: advice about setting up the eigen library for use with cygwin g++


Eliot Moss wrote:
> On 12/4/2014 4:43 PM, LMH wrote:
>> Hello,
>>
>> As stated, I am writing a few tools with cygwin g++. These tools will
>> make use of the eigen library for some linear algebra (PCA and matrix
>> manipulations). I have never built with a library that was not installed
>> through the cygwin package manager, so I thought I would ask if there
>> was anything I needed to be aware of.
>>
>> Eigen is a header only kind  of thing, so my understanding is that all I
>> need to do is to unpack the src somewhere add the location to the
>> include path.
>>
>> I was thinking of putting Eigen in,
>>
>> /cygdrive/c/cygwin/lib/eigen/
>>
>> and using,
>>
>> g++ -I /cygdrive/c/cygwin/lib/eigen/
>>
>> Does anyone see any issue with this approach? Will there be a problem
>> having a non-cygwin directory in cygwin/lib, meaning something the
>> cygwin install isn't formally aware of? Is there a preferred method for
>> setting up something like this?
> 
> I'm not sure what you mean about a "header only kind of thing".
> Unless already provided in a format built for cygwin, libraries
> have to be recompiled and relinked for use on cygwin, even if
> all your app does is include a header file and then link with
> the library.  Put another way, cygwin is not a Unix virtual
> machine like say, Virtual Box or VMWare.  It is a library that
> translates Unix-like calls into Windows calls, and things have
> to be built specifically to work with it.
> 
> SO I think you need to build and install the library, and then
> build your application using the header files.
> 
> Regards -- Eliot Moss
> 

Thanks for the reply.

> I'm not sure what you mean about a "header only kind of thing".

I guess my understanding of eigen is that it not a library that is
linked to and then accessed dynamically at runtime but rather is an
archive of cpp src code and header files. You use it by including the
header files for the functions you need and the linker bundles the code
specified in the header files into your application. This works no
differently than the other src and header files for your program. There
is no config or make files included with eigen with which to configure,
build, or compile anything.

>From the Eigen site,

"How to "install" Eigen?
In order to use Eigen, you just need to download and extract Eigen's
source code (see the wiki for download instructions). In fact, the
header files in the Eigen sub directory are the only files required to
compile programs using Eigen. The header files are the same for all
platforms. It is not necessary to use CMake or install anything."

"There is no library to link to. The only thing that you need to keep in
mind when compiling is that the compiler must be able to find the Eigen
header files. The directory in which you placed Eigen's source code must
be in the include path. With GCC you use the -I option to achieve this."

I wouldn't have posted this question if I was at all clear on how this
is supposed to work, so the above is just my current understanding. It
may be entirely incorrect. Do you think I am misunderstanding how this
is supposed to work?

LMH




--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]