X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; q=dns; s=default; b=eW35McrJcobDJPpRRSjRrNuPsEQd/SrpwkaDOod2hME c3Vd1OHqZenNMTCVlrI6iy55RI2gL7Hed5uO285SoYlitbUIVM94Yb/j0HdNREQF 1PEUIOifwzOnszN03gxJE2CHQJGAy2iL9VrRL7sFwunEgrLQhnEXb1ZhfaEKEgSo = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; s=default; bh=HT8uC15P2Qyvfi4Z2S6tltdl0t8=; b=Pyzzj+topa/lAkuVM ZR8aqV9+Q3qgLiYCcvSoPe1FsUOqmaLFvI5HapBvVhktzksAJxYhy7UVdOMwWIPN FInOPtj3Cu/mfxh8RY2jBr+K5EFYKWt2nHPiNd0Hf0XVHGyVh/Tw1CeMdici/n7+ /YtzTyVybI8+Q5CY4lw8GDbGdY= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-HELO: smtp105.biz.mail.gq1.yahoo.com X-Yahoo-SMTP: ycweUreswBCK.d0cygTP5tXwHncbOU7YVeVfIxOQoyRMI2IuIKLmUqE- Message-ID: <5481F709.2010207@molconn.com> Date: Fri, 05 Dec 2014 13:18:49 -0500 From: LMH User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:33.0) Gecko/20100101 Firefox/33.0 SeaMonkey/2.30 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: advice about setting up the eigen library for use with cygwin g++ References: <5480D570 DOT 2010608 AT molconn DOT com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Csaba Raduly wrote: > Hi, > > On Thu, Dec 4, 2014 at 10:43 PM, LMH wrote: >> Hello, >> >> As stated, I am writing a few tools with cygwin g++. > (snip) >> 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/ > > If you use Cygwin tools, you shouldn't use paths like > "/cygdrive/c/cygwin/lib". The way to refer to > that directory is /lib (unless your Cygwin is installed somewhere > other than C:\cygwin). > >> >> and using, >> >> g++ -I /cygdrive/c/cygwin/lib/eigen/ >> > > /lib is not really for headers. It mostly contains binaries. A > canonical place for a header-only library would be > /usr/local/include/eigen > > Doesn't eigen supply a makefile with an "install" target? > > Csaba > Hello Csaba, Thanks for the information. I will take your advice and unpack Eigen in /usr/local/include/eigen instead of in /lib and drop the /cygdrive/c/ from the include path. As I mentioned in an earlier post, Eigen is not a compiled library, meaning there is no binary file. As I understand it, you are just supposed to use the src code and header files as is, like you would use any other .cpp and .h files in your build. The main difference is that the files are not located in your trunk src directory. Yaakov Selkowitz mentioned that Eigen is available through ports. I have never used ports, so I'm not sure what the difference is. Is there a difference in the way the Eigen code gets linked to my app if I install Eigen through ports? According to the Eigen page, Eigen isn't installed in the formal sense, like you would install boost through the cygwin package manager. You just put the Eigen folder somewhere and add the top level to the include path. When you write your src, you add includes for the header files you want and compile/link as normal. "If you just want to use Eigen, you can use the header files right away. There is no binary library to link to, and no configured header file. Eigen is a pure template library defined in the headers." This is a sample program from the getting started page, ## my_program.cpp ## #include #include using Eigen::MatrixXd; int main() { MatrixXd m(2,2); m(0,0) = 3; m(1,0) = 2.5; m(0,1) = -1; m(1,1) = m(1,0) + m(0,1); std::cout << m << std::endl; } g++ -I /path/to/eigen/ my_program.cpp -o my_program According to the same page, if you have the Eigen folder, or a symlink to the Eigen folder, in /usr/local/include/, you don't need to use -I. So I guess I still need to figure out if this is going to work as I understand it and if there is some advantage to installing Eigen through ports instead of just unpacking it. 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