how to build an mt version of shared lib for zookeeper under cygwin?
hi, all: Is it possible to build an mt version of zookeeper dll lib? I've tried, cygzookeeper_st-2.dll come out successfully, but not zookeeper_mt.dll. Official sites says the st version is for the platform that without a pthread lib or the pthread lib is not stable. Does the cygwin pthread lib falls into the unstable category? Is there any work-around to generate mt dll? Bellow is the warning: *** Warning: linker path does not have real file for library -lpthread. *** I have the capability to make that library automatically link in when *** you link to this library. But I can only do this if you have a *** shared version of the library, which you do not appear to have *** because I did check the linker path looking for a file starting *** with libpthread and none of the candidates passed a file format test *** using a file magic. Last file checked: /lib/libpthread.a *** The inter-library dependencies that have been dropped here will be *** automatically added whenever a program is linked with this library *** or is declared to -dlopen it. *** Since this library must not contain undefined symbols, *** because either the platform does not support them or *** it was explicitly requested with -no-undefined, *** libtool will only create a static version of it. 2010-04-07 zd.wbh
Re: how to build an mt version of shared lib for zookeeper under cygwin?
Are you running cygwin 1.7 or 1.5? I believe there was a change btw versions of cygwin on how pthreads was supported. Patrick On 04/07/2010 03:08 AM, zd.wbh wrote: hi, all: Is it possible to build an mt version of zookeeper dll lib? I've tried, cygzookeeper_st-2.dll come out successfully, but not zookeeper_mt.dll. Official sites says the st version is for the platform that without a pthread lib or the pthread lib is not stable. Does the cygwin pthread lib falls into the unstable category? Is there any work-around to generate mt dll? Bellow is the warning: *** Warning: linker path does not have real file for library -lpthread. *** I have the capability to make that library automatically link in when *** you link to this library. But I can only do this if you have a *** shared version of the library, which you do not appear to have *** because I did check the linker path looking for a file starting *** with libpthread and none of the candidates passed a file format test *** using a file magic. Last file checked: /lib/libpthread.a *** The inter-library dependencies that have been dropped here will be *** automatically added whenever a program is linked with this library *** or is declared to -dlopen it. *** Since this library must not contain undefined symbols, *** because either the platform does not support them or *** it was explicitly requested with -no-undefined, *** libtool will only create a static version of it. 2010-04-07 zd.wbh
Re: Errors while running sytest
Great. I was just responding with a different soln: '--- Looks like the fatjar does not include junit class. Also, the -jar option does not use the classpath environment variable. Here is an excerpt from the man page of java: -jar Execute a program encapsulated in a JAR archive. The first argument is the name of a JAR file instead of a startup class name. In order for this option to work, the manifest of the JAR file must When you use this option, the JAR file is the source of all user classes, and other user class path settings are ignored. So you will have to use the main class in fatjar with the java -classpath option with all the libraries in the classpath. Java -cp log4j:junit:fatjar org.apache.zookeeper.util.FatJarMain server ... But putting it in build and including it as part of fatjar is much more convenient!!! Thanks mahadev On 4/7/10 1:09 PM, Vishal K vishalm...@gmail.com wrote: Hi, It works for me now. Just for the record, I had to copy junit*.jar to buil/lib because fat.jar expects it to be there. Then, I had to rebuild fatjar.jar. On Wed, Apr 7, 2010 at 12:10 AM, Vishal K vishalm...@gmail.com wrote: Hi, I am trying to run systest on a 3 node cluster ( http://svn.apache.org/repos/asf/hadoop/zookeeper/trunk/src/java/systest/READM E.txt ). When I reach the 4th step which is to actually run the test I get exception shown below. Exception in thread main java.lang.NoClassDefFoundError: junit/framework/TestC ase at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632) at java.lang.ClassLoader.defineClass(ClassLoader.java:616) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:14 1) at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) at java.net.URLClassLoader.access$000(URLClassLoader.java:58) at java.net.URLClassLoader$1.run(URLClassLoader.java:197) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at org.apache.zookeeper.util.FatJarMain.main(FatJarMain.java:97) Caused by: java.lang.ClassNotFoundException: junit.framework.TestCase at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) ... 15 more Looks like it is not able to find classes in junit. However, my classpath is set right: :/opt/zookeeper-3.3.0/zookeeper.jar:/opt/zookeeper-3.3.0/lib/junit-4.4.jar:/o pt/ zookeeper-3.3.0/lib/log4j-1.2.15.jar:/opt/zookeeper-3.3.0/build/test/lib/juni t-4.8.1.jar Any suggestions how I can get around this problem? Thanks.
Re: Re: how to build an mt version of shared lib for zookeeper under cygwin?
likely to be the latest version. I need the sync api but zookeeper_st only provides async interface, do i need any additional libs? I've already installed the pthread stubs pkg-config metadata. $ uname -srv CYGWIN_NT-5.1 1.7.3(0.225/5/3) 2010-04-03 11:26 2010-04-08 Will Are you running cygwin 1.7 or 1.5? I believe there was a change btw versions of cygwin on how pthreads was supported. Patrick On 04/07/2010 03:08 AM, zd.wbh wrote: hi, all: Is it possible to build an mt version of zookeeper dll lib? I've tried, cygzookeeper_st-2.dll come out successfully, but not zookeeper_mt.dll. Official sites says the st version is for the platform that without a pthread lib or the pthread lib is not stable. Does the cygwin pthread lib falls into the unstable category? Is there any work-around to generate mt dll? Bellow is the warning: *** Warning: linker path does not have real file for library -lpthread. *** I have the capability to make that library automatically link in when *** you link to this library. But I can only do this if you have a *** shared version of the library, which you do not appear to have *** because I did check the linker path looking for a file starting *** with libpthread and none of the candidates passed a file format test *** using a file magic. Last file checked: /lib/libpthread.a *** The inter-library dependencies that have been dropped here will be *** automatically added whenever a program is linked with this library *** or is declared to -dlopen it. *** Since this library must not contain undefined symbols, *** because either the platform does not support them or *** it was explicitly requested with -no-undefined, *** libtool will only create a static version of it. 2010-04-07 zd.wbh
Re: Re: how to build an mt version of shared lib for zookeeper under cygwin?
and zookeeper is the latest build too , zookeeper-3.3.0 2010-04-08 Will Are you running cygwin 1.7 or 1.5? I believe there was a change btw versions of cygwin on how pthreads was supported. Patrick On 04/07/2010 03:08 AM, zd.wbh wrote: hi, all: Is it possible to build an mt version of zookeeper dll lib? I've tried, cygzookeeper_st-2.dll come out successfully, but not zookeeper_mt.dll. Official sites says the st version is for the platform that without a pthread lib or the pthread lib is not stable. Does the cygwin pthread lib falls into the unstable category? Is there any work-around to generate mt dll? Bellow is the warning: *** Warning: linker path does not have real file for library -lpthread. *** I have the capability to make that library automatically link in when *** you link to this library. But I can only do this if you have a *** shared version of the library, which you do not appear to have *** because I did check the linker path looking for a file starting *** with libpthread and none of the candidates passed a file format test *** using a file magic. Last file checked: /lib/libpthread.a *** The inter-library dependencies that have been dropped here will be *** automatically added whenever a program is linked with this library *** or is declared to -dlopen it. *** Since this library must not contain undefined symbols, *** because either the platform does not support them or *** it was explicitly requested with -no-undefined, *** libtool will only create a static version of it. 2010-04-07 zd.wbh
Re: how to build an mt version of shared lib for zookeeper under cygwin?
when you run configure what does it say for pthreads? My cygwin says this: checking for pthread_mutex_lock in -lpthread... yes Do you have pthreads libs in /usr/lib? I see: $ ls /usr/lib/*pth* /usr/lib/libpthread.a* You could also try running configure and the build, capture all the output and attach as a gzip'd file (or create a jira and attach there if you like). Should help to get to the bottom of the issue. Patrick On 04/07/2010 06:36 PM, zd.wbh wrote: likely to be the latest version. I need the sync api but zookeeper_st only provides async interface, do i need any additional libs? I've already installed the pthread stubs pkg-config metadata. $ uname -srv CYGWIN_NT-5.1 1.7.3(0.225/5/3) 2010-04-03 11:26 2010-04-08 Will Are you running cygwin 1.7 or 1.5? I believe there was a change btw versions of cygwin on how pthreads was supported. Patrick On 04/07/2010 03:08 AM, zd.wbh wrote: hi, all: Is it possible to build an mt version of zookeeper dll lib? I've tried, cygzookeeper_st-2.dll come out successfully, but not zookeeper_mt.dll. Official sites says the st version is for the platform that without a pthread lib or the pthread lib is not stable. Does the cygwin pthread lib falls into the unstable category? Is there any work-around to generate mt dll? Bellow is the warning: *** Warning: linker path does not have real file for library -lpthread. *** I have the capability to make that library automatically link in when *** you link to this library. But I can only do this if you have a *** shared version of the library, which you do not appear to have *** because I did check the linker path looking for a file starting *** with libpthread and none of the candidates passed a file format test *** using a file magic. Last file checked: /lib/libpthread.a *** The inter-library dependencies that have been dropped here will be *** automatically added whenever a program is linked with this library *** or is declared to -dlopen it. *** Since this library must not contain undefined symbols, *** because either the platform does not support them or *** it was explicitly requested with -no-undefined, *** libtool will only create a static version of it. 2010-04-07 zd.wbh