- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- troubles building librdkafka
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2014 08:10 PM
10-19-2014 08:10 PM
troubles building librdkafka
hi, All:
I'm try to compile the 3rd opensource library: librdkafka, and then solve some compile problems. but can't handle the last problem.
the first step, compile librdkafka library, and no errror happen.
echo "uname is HP-UX;"
uname is HP-UX;
Creating shared library librdkafka.so.1
aCC rdqueue.o rdkafka.o rdkafka_broker.o rdkafka_msg.o rdkafka_topic.o rdkafka_defaultconf.o rdkafka_timer.o rdkafka_offset.o rdcrc32.o rdgz.o rdaddr.o rdrand.o rdthread.o rdlog.o -mt -lpthread -lrt -bdynamic -o librdkafka.so.1
Creating static library librdkafka.a
ar rcs librdkafka.a rdqueue.o rdkafka.o rdkafka_broker.o rdkafka_msg.o rdkafka_topic.o rdkafka_defaultconf.o rdkafka_timer.o rdkafka_offset.o rdcrc32.o rdgz.o rdaddr.o rdrand.o rdthread.o rdlog.o
Checking librdkafka integrity
librdkafka.so.1 OK
librdkafka.a OK
when compile the example, and occur the link error.
aCC -I../src rdkafka_example.c -mt -lpthread -lrt -o rdkafka_example \ ../src/librdkafka.a
ld: Unsatisfied symbol "spinlock(lock*)" in file ../src/librdkafka.a[rdkafka.o]
ld: Unsatisfied symbol "atomic_lock_in_use" in file ../src/librdkafka.a[rdkafka.o]
ld: Unsatisfied symbol "spinunlock(lock*)" in file ../src/librdkafka.a[rdkafka.o]
ld: Unsatisfied symbol "atomic_op_lock" in file ../src/librdkafka.a[rdkafka.o]
I was brathered this problem some day.hope some help!
thinks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2014 09:08 PM
10-19-2014 09:08 PM
Re: troubles building librdkafka
>aCC ... -mt -lpthread -lrt -bdynamic -o librdkafka.so.1
Change -bdynamic to just -b.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2014 11:42 PM
10-19-2014 11:42 PM
Re: troubles building librdkafka
change to -b, but no effect.
for test, I create a simple test code, like:
//-------------------------------------Test code begin ------------------------------------------
#ifndef _KERNEL
#define _KERNEL
#endif
#include <sys/spinlock.h>
int main (int argc, char **argv)
{
printf("spinlock test\n");
int kk = 0;
lock_t t;
spinlock(&t);
return 0;
}
//-------------------------------------Test code end ------------------------------------------
and compile, the same thing is occur:
----------------------------------------- compile begin -----------------------------------------------------
aCC -I../src -mt -D_INCLUDE__STDC__ -D_INCLUDE_POSIX4_SOURCE -D__HP_NO_STRING_OVERLOADS -D_INCLUDE_POSIX_SOURCE -D_XOPEN_SOURCE_EXTENDED -D_INCLUDE_HPUX_SOURCE -D_HPUX_SOURCE -D__STDC__ -D_PROTOTYPES rdkafka_example.c -o rdkafka_example \
-mt -lpthread -lrt
ld: Unsatisfied symbol "spinlock(lock*)" in file rdkafka_example.o
----------------------------------------- compile end -----------------------------------------------------
here whether we need linke some library about spinlock?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2014 12:02 AM - edited 10-20-2014 11:22 PM
10-20-2014 12:02 AM - edited 10-20-2014 11:22 PM
Re: troubles building librdkafka, no spinlocks
>ld: Unsatisfied symbol "spinlock(lock*)"
Ah, these are C++ mangled names. Why are you developing with aC++?
The header file <sys/spinlock.h> hasn't been C++ified.
You could try doing:
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/spinlock.h>
#ifdef __cplusplus
} // extern "C"
#endif
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2014 02:04 AM
10-20-2014 02:04 AM
Re: troubles building librdkafka
here likely exist some conflict define, when I use the extern "C" define, some happen!
code:
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/spinlock.h>
#ifdef __cplusplus
} // extern "C"
#endif
compile error:
"/usr/include/sys/kern_svcs.h", line 58: error #2338: more than one instance
of overloaded function "strtol" has "C" linkage
extern long strtol __((const char *));
^
"/usr/include/sys/kern_svcs.h", line 80: error #2338: more than one instance
of overloaded function "sleep" has "C" linkage
extern int sleep __((void *, int));
^
"/usr/include/sys/kern_svcs.h", line 93: error #2338: more than one instance
of overloaded function "sprintf" has "C" linkage
extern int sprintf __((char *str,int len,const char *fmt, ...));
^
oh, for schedule pressure, I replace spinlock with pthread_mutex, and it's work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2014 03:54 AM - edited 10-20-2014 11:22 PM
10-20-2014 03:54 AM - edited 10-20-2014 11:22 PM
Re: troubles building librdkafka, no spinlocks
>here likely exist some conflict define, when I use the extern "C" define, some happen!
>#define _KERNEL
Most likely it is illegal for you to define _KERNEL when you are developing for user space.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2014 06:00 AM
10-20-2014 06:00 AM
Re: troubles building librdkafka
if don't define _KERNEL, then can't refer spinlock struct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2014 09:20 AM - edited 10-20-2014 11:22 PM
10-20-2014 09:20 AM - edited 10-20-2014 11:22 PM
Re: troubles building librdkafka, no spinlocks
>if don't define _KERNEL, then can't refer spinlock struct.
Then it isn't available for user space.
I just took a look and there are no man pages nor are there any library routines to support this.
Just some internal ones for libpthread.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2022 07:59 PM
05-08-2022 07:59 PM
Re: troubles building librdkafka
I know this topic would be a bit old for you. However, if you can help would be very appreciated.
I am currently building the librdkafka for my HPUX as well, however, I am not even able to rebuild the library. My system does not have bash, mklove, cmake, so I can not generated the required config.h & Makefile.config.
Just wondering how did you generate the config.h & Makefile.config? are you able to share your config.h & Makefile.config?
Regards,