Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error compiling- can you help? #31

Closed
sseshachala opened this issue May 21, 2013 · 9 comments
Closed

Error compiling- can you help? #31

sseshachala opened this issue May 21, 2013 · 9 comments

Comments

@sseshachala
Copy link

Downloaded collectd-5.3.0.20130516.tar.gz
In file included from write_top.c:30:0:
/usr/include/zlib.h:1324:21: note: expected ‘gzFile’ but argument is of type ‘struct gzFile_s *
write_top.c:262:2: error: passing argument 1 of ‘gzwrite’ from incompatible pointer type [-Werror]
In file included from write_top.c:30:0:
/usr/include/zlib.h:1324:21: note: expected ‘gzFile’ but argument is of type ‘struct gzFile_s *

write_top.c:263:2: error: passing argument 1 of ‘gzclose’ from incompatible pointer type [-Werror]
In file included from write_top.c:30:0:
/usr/include/zlib.h:1494:24: note: expected ‘gzFile’ but argument is of type ‘struct gzFile_s **’

write_mongodb.c:246:3: error: implicit declaration of function ‘bson_dispose’ [-Werror=implicit-function-declaration]
make[3]: *** [jsonrpc_la-jsonrpc.lo] Error 1
cc1: all warnings being treated as errors
cc1: all warnings being treated as errorsmake[3]: *** [write_mongodb_la-write_mongodb.lo] Error 1

make[3]: *** [write_top_la-write_top.lo] Error 1
make[3]: Leaving directory /home/sysadmin/downloads/collectd-5.3.0.20130516/src' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory/home/sysadmin/downloads/collectd-5.3.0.20130516/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/sysadmin/downloads/collectd-5.3.0.20130516/src'
make: *** [all-recursive] Error 1
sysadmin@build-dev:~/downloads/collectd-5.3.0.20130516$

@ymettier
Copy link
Contributor

Hello,

write_top.c

/usr/include/zlib.h:1324:21: note: expected ‘gzFile’ but argument is of type ‘struct gzFile_s **’
write_top.c:262:2: error: passing argument 1 of ‘gzwrite’ from incompatible pointer type [-Werror]

This looks strange because here is the code :

        gzFile *gfd;
[...]
        gzwrite(gfd, ch->data, ch->len);

I'm wondering where has gzFile_s been defined.

What version of zlib do you have ? On what OS (version, distribution, arch...) are you compiling ?

write_mongodb.c

This is an unmodified code from the original collectd (version 5.3.0). So this is not the best place to ask for help.
However, the error message says that a function bson_dispose() is missing. My internet search engine suggests that you need to install mongodb driver header files (some mongodb-driver-dev.deb or mongodb-driver-devel.rpm if it exists ?).

jsonrpc

write_mongodb.c:246:3: error: implicit declaration of function ‘bson_dispose’ [-Werror=implicit-function-declaration]
make[3]: *** [jsonrpc_la-jsonrpc.lo] Error 1

Those 2 lines have nothing to do together. Write_mongodb.c comes from vanilla collectd. Jsonrpc is a collectd_pw feature that we support but that has nothing to do with mongodb.c.
Was that a correct copy/paste ?

If yes, do you have any developer skill to find out, probably in src/Makefile.am (and maybe in configure.in), why do write_mongodb and jsonrpc mix together ?
This will not help for the 2 other problems below, but this may be another bug that I have no idea how it will happen when collectd_pw is compiled and working.

Regards,
Yves

@sseshachala
Copy link
Author

I am using Ubuntu 12.10 (Quantal Quetzal)

@ymettier
Copy link
Contributor

write_top.c : I will install an ubuntu 12.10 in some virtual machine and try to compile.
Before I do it, could you do some investigation for me ? Could you try to find out where gzFile_s is defined ?

$ grep gzFile_s /usr/include/zlib.h
$ grep gzFile_s /usr/include/* (if not found in zlib.h)
$ grep gzFile_s /usr/include/*/* (if not found before)

For write_mongodb.c problem, on your ubuntu, it seems that you should have mongodb-dev package installed.
http://packages.ubuntu.com/quantal/amd64/mongodb-dev/filelist

I would also like to know if you compile on 32 or 64 bits architecture. uname -a should answer (x86_64 for 64 bits and i*86 for 32 bits)

@sseshachala
Copy link
Author

Thanks. I am able to resolve the above issues on 12.04. 64 bit. I am stuck with write_mongodb.c - line 77 - bson_create() method (I have created the issue on collectd too.
I have installed mongodb driver from the source and all other libraries do exist. for us - mongodb writes need to be enabled since all writes would happen in mongodb. Any chance you could help resolve this?

Thanks

@ymettier
Copy link
Contributor

Hello,

For what I understand :

  • write_top/zlib : you resolved your issue
  • write_mongodb : you opened an issue (#331) at mainstream collectd
  • jsonrpc/mongodb : I and you found nothing that would explain why mongodb and jsonrpc mix together in your case.

Is that right ? If yes, let's close this case to avoid too much unrerelative information to this issue.

Regards,
Yves

@sseshachala
Copy link
Author

1 .
write_top/zlib : you resolved your issue - yes.
write_mongodb : you opened an issue (#331) at mainstream collectd - yes-
jsonrpc/mongodb : I and you found nothing that would explain why mongodb and jsonrpc mix together in your case. - that is correct.

For mongodb - Installed https://github.com/mongodb/mongo-c-driver
mongodb is installed only when we run collectd. You do not need mongodb to be running to compile the collectd. I have the flag ./configure --enable-write_mongodb added to what we have for perf watcher.

sudo apt-get install mongodb graphite-carbon git build-essential autoconf libtool scons
sudo apt-get build-dep collectd

--Install mongo client
git clone https://github.com/mongodb/mongo-c-driver.git
cd mongo-c-driver
scons
make install

@ymettier
Copy link
Contributor

I consider this issue as closed.

About mongodb, it's better to discuss on mainstream mailing-list or in the issue your raised (collectd/collectd#331)

@ymettier
Copy link
Contributor

In file included from write_top.c:30:0: /usr/include/zlib.h:1324:21: note: expected ‘gzFile’ but argument is of type ‘struct gzFile_s **’ write_top.c:262:2: error: passing argument 1 of ‘gzwrite’ from incompatible pointer type [-Werror] In file included from write_top.c:30:0: /usr/include/zlib.h:1324:21: note: expected ‘gzFile’ but argument is of type ‘struct gzFile_s **’ write_top.c:263:2: error: passing argument 1 of ‘gzclose’ from incompatible pointer type [-Werror] In file included from write_top.c:30:0: /usr/include/zlib.h:1494:24: note: expected ‘gzFile’ but argument is of type ‘struct gzFile_s **’
I can reproduce this on Debian Wheezy. So I reopen the case.

Yves

@ymettier ymettier reopened this May 24, 2013
@ymettier
Copy link
Contributor

Hello,

Fixed in ba9f2e80d692c0cea2d1604068dbe0f71cb7f90d, 5babe04227089055be6e5bde23429d776197593d, aa10214d4c498438e56e25e7011d0aeeef226bba and a640de871b150f2a66d9c68d6e5662cbc55a7f64 (sorry, this impacts 4 patches we maintain).

A new version 20130527 (5.3.0 tested and 5.2.1 not tested) was released including these patchs.

Yves

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants