Forums : The Ohcount Project

Dear Open Hub Users,

We’re excited to announce that we will be moving the Open Hub Forum to https://community.blackduck.com/s/black-duck-open-hub. Beginning immediately, users can head over, register, get technical help and discuss issue pertinent to the Open Hub. Registered users can also subscribe to Open Hub announcements here.


On May 1, 2020, we will be freezing https://www.openhub.net/forums and users will not be able to create new discussions. If you have any questions and concerns, please email us at [email protected]

Cannot compile ohcount

Hello,

I have all of the dependencies installed, and when I try to compile ohcount, I get the following error:

...

Compiling xmlschema.rl

Compiling xslt.rl

Building src/parser.c (will take a while)

src/parser.c: In function âohcountparseâ:

src/parser.c:17: warning: implicit declaration of function âohcount
hashparserfrom_languageâ

src/parser.c:17: warning: initialization makes pointer from integer without a cast

src/parser.c:22: error: dereferencing pointer to incomplete type


GCC Info:

[root@au01 ohcount]# gcc -v

Using built-in specs.

Target: i386-redhat-linux

Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-_cxaatexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=i386-redhat-linux
Thread model: posix

gcc version 4.1.2 20080704 (Red Hat 4.1.2-44)


irb

irb(main):001:0> require 'mkmf'

=> true

irb(main):002:0> havelibrary('pcre','pcrecompile')

checking for pcre_compile() in -lpcre... yes

=> true


uname -a

Linux au01.synergy8.com 2.6.18-8.1.6.el5 #1 SMP Thu Jun 14 17:46:09 EDT 2007 i686 i686 i386 GNU/Linux

Any help would be greatly appreciated.

Thanks,

Scott

http://www.synergy8.com/

ScottMcNaught over 15 years ago
 

Hi Scott,

I don't have a complete answer but I may have some clues.

It looks like you are missing the declaration for function ohcount_hash_parser_from_language, which is supposed to be defined in file src/hash/parser_hash.h.

That header file is generated by gperf during the build. So two questions: is this header file being successfully generated, and does it contain the declaration for this function?

I hope this is a link in the chain to a solution. I'm not the original author of the gperf portion of this code, so my understanding is admittedly incomplete.

Thanks,
Robin

Robin Luckey over 15 years ago
 

Hi Robin,

That did in fact answer my question - thank you.

I had installed gperf after doing an initial build and seeing it was missing. It seems that if you install gperf AFTER doing a build, you have to wipe the directory, reextract the tar.gz and then build again.

Thanks again.

Scott

ScottMcNaught over 15 years ago
 

The CMake build for ohcount emits a message 'GNU gperf executable not found, you need it in order to build ohcount', and does not have the same side effects as pointed out by Scott if you install gperf after to receive this error message.

Guilherme Balen... over 15 years ago
 

Hi Guilherme,

Yes I did get that GNU perf command not found error message on the first time I built ohcount, but when its not installed, it makes a set of empty header files. Then the next time you build ohcount, the empty header files are picked up and gperf is not run.

My guess as to why this is is because you have a file exists check in the build script, and then in the generateheaders script, it pipes to a file gperf ... > header.h. So when gperf is not installed, the headers are created empty. Then the second run, the file exists check evaluates true because it sees that there are actually headers there.

All of this is not a big problem, it just caused me to scratch my head for a while :)

ScottMcNaught over 15 years ago
 

Hello Scott,

Sorry, in my last post I forgot to mention where you can get the ohcount with CMake building. It is located at GitHub. The new build instructions is located in README file. I maintained the script named 'build' for compatibility with previous versions, but I recommend you to use the new build instructions.

Basically, instead of doing:

> bash build

Now you do:

> mkdir ../ohcountbuild
> cd ../ohcount
build
> cmake ../ohcount
> make
> make test

Guilherme Balen... over 15 years ago
 

I see - well thank you Robin and Guilherme for all your help. I have it compiled and running.

Cheers,

Scott

ScottMcNaught over 15 years ago