View Full Version : How do I modify the include path during a source install.
macgruder
September 6th, 2011, 07:53
I'm trying to source install Cabocha (http://code.google.com/p/cabocha/)
./configure --with-charset=utf8 --enable-utf8-only
However when I run the make command, I get this error:
chunk_learner.cpp:6:19: error: crfpp.h: No such file or directory
crfpp.h does exist at /usr/local/include/crfpp.h so I guess the compiler is not looking in /usr/local/include .
How should I make the compiler look in the correct place?
graudeejs
September 6th, 2011, 08:19
run ./configure --help
There will be some flag or environment that will allow you to add stuff to CFLAGS, you need to add -I/usr/local/include
Might actually be CLFAGS environment, I don't remember.
When you find that you, run ./configure with proper flags/environment
and then run make or you might need to run gmake, if make complains about something weird (lots of Linux source use gmake, to build)
More or less something like that
macgruder
September 6th, 2011, 16:55
(the forum just ate my detailed reply :-( so try again)
Trying the help:
# ./configure --help
Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
LIBS libraries to pass to the linker, e.g. -l<library>
CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir>
CXX C++ compiler command
CXXFLAGS C++ compiler flags
CPP C preprocessor
CXXCPP C++ preprocessor
I tried setting
CFLAGS, CFLAGS, CPPFLAGS with
# CFLAGS="-I/usr/local/include" [etc]
but the same error appears.
Rather than guessing without understanding what I'm doing do you have any other suggestions. The install works fine on OS X Lion (10.7) so I don't believe it a Make issue.
graudeejs
September 6th, 2011, 18:07
Can you show more lines of what is failing, I want to see entire compile line including C compiler
macgruder
September 6th, 2011, 18:58
It turned out to require this:
export C_INCLUDE_PATH=/usr/local/include/:${C_INCLUDE_PATH}
export CPLUS_INCLUDE_PATH=/usr/local/include/:${CPLUS_INCLUDE_PATH}
Out of interest why does such an error occur? Why for example does FreeBSD not look in, which to my beginner's eyes, is an 'obvious' place for a header to be. Is it just my default setting, or is it because of the Cabocha installer itself?
graudeejs
September 6th, 2011, 19:41
That's weird, never saw it. It looks like nonstandard (I think)
kpa
September 6th, 2011, 20:02
I believe it's (again) the very strict separation between the base system and ports. The default include path /usr/include allows the compilation of the base system without having to take the ports into account in any way, the potentially conflicting include files under /usr/local/include are just ignored.
wblock@
September 6th, 2011, 20:36
I'm convinced that the right way to do this with unported software is to make a port. You get all the port infrastructure to handle this kind of thing, make it easy to install and uninstall, and end up with a port that can be added to the ports tree. The trick is to find an existing similar port for use as a template.
graudeejs
September 6th, 2011, 21:56
I'm convinced that the right way to do this with unported software is to make a port. You get all the port infrastructure to handle this kind of thing, make it easy to install and uninstall, and end up with a port that can be added to the ports tree. The trick is to find an existing similar port for use as a template.
and read Porters Handbook (http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/)
macgruder
September 7th, 2011, 06:44
I'm convinced that the right way to do this with unported software is to make a port. You get all the port infrastructure to handle this kind of thing, make it easy to install and uninstall, and end up with a port that can be added to the ports tree. The trick is to find an existing similar port for use as a template.
I think this might be beyond me right now, both in terms of time and skill!
Although if someone could point to something to use as a template it might help.
Essentially, the port requires (and I believe japanese/mecab)
crf++: science/crf++
and would need the patch to look for it.
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.