How do I modify the include path during a source install.

I'm trying to source install Cabocha

Code:
./configure --with-charset=utf8 --enable-utf8-only

However when I run the make command, I get this error:

Code:
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?
 
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
 
(the forum just ate my detailed reply :-( so try again)

Trying the help:
Code:
# ./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.
 
It turned out to require this:
Code:
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?
 
  • Thanks
Reactions: 0mp
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.
 
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.
 
wblock said:
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
 
wblock said:
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.
 
Back
Top