Thread: Error Using Autoconf in Cygwin

  1. #1
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465

    Error Using Autoconf in Cygwin

    Code:
    checking whether byte ordering is bigendian... no
    checking for RAWWAVE_PATH argument...
    checking for INCLUDE_PATH argument...
    checking whether to compile realtime support... yes
    checking for cos in -lm... yes
    checking for pthread_create in -lpthread... no
    configure: error: realtime support requires the pthread library!
    
    owner@toshiba-user /cygdrive/c/bin/stk
    $
    Why does it say that I do not have pthreads isntalled? I thought cygwin provides the pthreads components? Is it a problem with the configure script?

  2. #2
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    Yes, Cygwin implements pthread. From http://sourceware.org/pthreads-win32/announcement.html:
    Code:
    The following functions are implemented:
    
          ---------------------------
          PThreads
          ---------------------------
          pthread_attr_init
          pthread_attr_destroy
          pthread_attr_getdetachstate
          pthread_attr_getstackaddr
          pthread_attr_getstacksize
          pthread_attr_setdetachstate
          pthread_attr_setstackaddr
          pthread_attr_setstacksize
    
          pthread_create
          pthread_detach
          pthread_equal
          pthread_exit
          pthread_join
          pthread_once
          pthread_self
    
          pthread_cancel
          pthread_cleanup_pop
          pthread_cleanup_push
          pthread_setcancelstate
          pthread_setcanceltype
          pthread_testcancel
    I suggest trying some basic pthreads programs to see if it's a problem with pthreads or a problem with the configure script. It's probably not the configure script, though.

    Are there any files called /usr/lib/libpthread* or /lib/libpthread* on your system?

    Are you using a modern enough version of cygwin to be able to use the package manager to download the pthreads package? (You may have to use the download-from-internet installer or something.)

    If worst came to worst, you could write a wrapper around the pthread library yourself: http://lists.ximian.com/pipermail/mo...er/001668.html
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  3. #3
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    >> Are there any files called /usr/lib/libpthread* or /lib/libpthread* on your system?

    Are you using a modern enough version of cygwin to be able to use the package manager to download the pthreads package? (You may have to use the download-from-internet installer or something.)

    Those do not exist.

    I have setup.exe

    Do I need anything else?

  4. #4
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    That's very strange, since all of the versions of cygwin here include both /usr/include/pthread.h and /usr/lib/libpthread.a. You must be using a pretty old version of cygwin, or installed it in an unusual way.

    Do I need anything else?
    To download pthread? I don't think so. When I downloaded Cygwin recently with the default installer, I was able to select some packages to install, and later select more packages to install, etc without breaking my installation. I suggest running setup.exe and selecting pthreads.

    But that might not work if your original installation of Cygwin didn't go properly. Are you using a relatively recent version? When you examine the contents of the package list of that version of cygwin online, does it contain pthreads.h and pthreads.a? If so, your installation is probably broken and I'd recommend reinstalling Cygwin.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  5. #5
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    Now, libpthread.a exists in the /lib/ folder

    And pthread.h in the /usr/include/

    I don't get it, could the configure script be broken?

    I've never used autoconf before

  6. #6
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    Code:
    dumpbin /EXPORTS libpthread.a
    
    Microsoft (R) COFF/PE Dumper Version 9.00.20404
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    
    Dump of file libpthread.a
    
    File Type: LIBRARY
    
         Exports
    
           ordinal    name
    
                      ___getreent
                      __pthread_cleanup_pop
                      __pthread_cleanup_push
                      _pthread_atfork
                      _pthread_attr_destroy
                      _pthread_attr_getdetachstate
                      _pthread_attr_getinheritsched
                      _pthread_attr_getschedparam
                      _pthread_attr_getschedpolicy
                      _pthread_attr_getscope
                      _pthread_attr_getstacksize
                      _pthread_attr_init
                      _pthread_attr_setdetachstate
                      _pthread_attr_setinheritsched
                      _pthread_attr_setschedparam
                      _pthread_attr_setschedpolicy
                      _pthread_attr_setscope
                      _pthread_attr_setstacksize
                      _pthread_cancel
                      _pthread_cond_broadcast
                      _pthread_cond_destroy
                      _pthread_cond_init
                      _pthread_cond_signal
                      _pthread_cond_timedwait
                      _pthread_cond_wait
                      _pthread_condattr_destroy
                      _pthread_condattr_getpshared
                      _pthread_condattr_init
                      _pthread_condattr_setpshared
                      _pthread_continue
                      _pthread_create
                      _pthread_detach
                      _pthread_equal
                      _pthread_exit
                      _pthread_getconcurrency
                      _pthread_getschedparam
                      _pthread_getsequence_np
                      _pthread_getspecific
                      _pthread_join
                      _pthread_key_create
                      _pthread_key_delete
                      _pthread_kill
                      _pthread_mutex_destroy
                      _pthread_mutex_getprioceiling
                      _pthread_mutex_init
                      _pthread_mutex_lock
                      _pthread_mutex_setprioceiling
                      _pthread_mutex_trylock
                      _pthread_mutex_unlock
                      _pthread_mutexattr_destroy
                      _pthread_mutexattr_getprioceiling
                      _pthread_mutexattr_getprotocol
                      _pthread_mutexattr_getpshared
                      _pthread_mutexattr_gettype
                      _pthread_mutexattr_init
                      _pthread_mutexattr_setprioceiling
                      _pthread_mutexattr_setprotocol
                      _pthread_mutexattr_setpshared
                      _pthread_mutexattr_settype
                      _pthread_once
                      _pthread_rwlock_destroy
                      _pthread_rwlock_init
                      _pthread_rwlock_rdlock
                      _pthread_rwlock_tryrdlock
                      _pthread_rwlock_trywrlock
                      _pthread_rwlock_unlock
                      _pthread_rwlock_wrlock
                      _pthread_rwlockattr_destroy
                      _pthread_rwlockattr_getpshared
                      _pthread_rwlockattr_init
                      _pthread_rwlockattr_setpshared
                      _pthread_self
                      _pthread_setcancelstate
                      _pthread_setcanceltype
                      _pthread_setconcurrency
                      _pthread_setschedparam
                      _pthread_setspecific
                      _pthread_sigmask
                      _pthread_suspend
                      _pthread_testcancel
                      _sem_close
                      _sem_destroy
                      _sem_getvalue
                      _sem_init
                      _sem_open
                      _sem_post
                      _sem_timedwait
                      _sem_trywait
                      _sem_wait
    
      Summary
    
              14 .idata$2
             16C .idata$4
             16C .idata$5
             890 .idata$6
             170 .idata$7
             590 .text

  7. #7
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Tonto View Post
    Now, libpthread.a exists in the /lib/ folder

    And pthread.h in the /usr/include/

    I don't get it, could the configure script be broken?

    I've never used autoconf before
    It is quite possibly that the way that the configure script is creating the test for the "is there a pthread_create" is not working right with the Windows setup that you have. Without knowing the actual product you are trying to configure, I can't say for sure, but I have seen that sort of thing before, when taking on a product that hasn't been properly tested on the particular platform (even moving between different variations of Linux or from Linux to Solaris can cause this sort of problem).

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  8. #8
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    I am using a project called 'stk' the 'sound toolkit', which has not been tested for use in cygwin. Where would I go to try to fix this problem, tell it that pthreads exist. Would it be within the autoconf script?

  9. #9
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Has it been tested on Windows? If not, then you'll probably have bigger problems.

    If it has been tested on Windows, then you should be able to "hack" the configuration files somehow to make it believe you have pthreads - how, I don't know exactly (autoconf and related files aren't entirely trivial to work on).

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  10. #10
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    It has indeed been tested on windows, it interfaces with directsound and stuff, and has specific sets of windows preprocessor definitions needed to be compiled I believe too. Anyways, I don't want to be a bother, but if there's any more information I can give to help you help me, I'd be happy to regurgitate it :]

  11. #11
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Tonto View Post
    It has indeed been tested on windows, it interfaces with directsound and stuff, and has specific sets of windows preprocessor definitions needed to be compiled I believe too. Anyways, I don't want to be a bother, but if there's any more information I can give to help you help me, I'd be happy to regurgitate it :]
    I have successfully changed some autoconf files and "configure" scripts (that are usually what autoconf provides). But it's not something I can just say "Just do this" - it is more a case of "I guess it's this bit, lets change it and see if it works" - so take a look at the configuration files that you get, see what it does to test for pthreads, try doing the same thing by hand, and see what it does - does it do what you expect, and if not, why not - fix that problem, and the rest should pass.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  12. #12
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    Yeah, so, I just went to the makefiles. They're more familiar to me.

    It compiles everything, generates a biollion object files, but then gives me the error

    Code:
    owner@toshiba-user /cygdrive/c/bin/stk/src
    $ mingw32-make
    
    ...
    ...
    
    /bin/rm -f libstk.a
    process_begin: CreateProcess(NULL, /bin/rm -f libstk.a, ...) failed.
    make (e=2): The system cannot find the file specified.
    mingw32-make: *** [libstk.a] Error 2
    Is this fixable :?

  13. #13
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Tonto View Post
    Yeah, so, I just went to the makefiles. They're more familiar to me.

    It compiles everything, generates a biollion object files, but then gives me the error

    Code:
    owner@toshiba-user /cygdrive/c/bin/stk/src
    $ mingw32-make
    
    ...
    ...
    
    /bin/rm -f libstk.a
    process_begin: CreateProcess(NULL, /bin/rm -f libstk.a, ...) failed.
    make (e=2): The system cannot find the file specified.
    mingw32-make: *** [libstk.a] Error 2
    Is this fixable :?
    Everything in software is fixable - it's just a question of how skilled you need to be to fix it.

    In this case, it looks like it's trying to run an executable named "/bin/rm -f libstk.a", which isn't a particularly likely name for something you'd have on a machine. Looks like command parsing/splitting of arguments is broken somewhere. I have no idea where that happens.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  14. #14
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    Since lots of object files are generated and make halts late in the compilation process, it's probably just a small typo. Perhaps a line reads
    Code:
    "$(RM) $(TARGET)"
    by accident or something.

    Of course, you could always create an executable called "/bin/rm -f libstk.a" which just executes "/bin/rm" -f libstk.a. This script would work:
    Code:
    #!/bin/sh
    # This file must be called "/bin/rm -f libstk.a"
    
    /bin/rm -f libstk.a
    Save it as "/bin/rm -f libstk.a" and make it executable.

    Code:
    $ cat > "/bin/rm -f libstk.a"
    #!/bin/sh
    
    /bin/rm -f libstk.a
    ^D
    $ chmod +x "/bin/rm -f libstk.a"
    where ^D is where you type CTRL-D for end-of-file.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Setting SciTE to work with cygwin
    By Witchfinder in forum C Programming
    Replies: 1
    Last Post: 02-21-2009, 04:12 PM
  2. NetBeans + Cygwin driving me insane
    By Del75 in forum C++ Programming
    Replies: 4
    Last Post: 08-17-2008, 05:03 AM
  3. cygwin sshd weird behavior
    By jEssYcAt in forum Tech Board
    Replies: 6
    Last Post: 05-19-2008, 02:05 PM
  4. Problems with compiling code in cygwin
    By firyace in forum C++ Programming
    Replies: 4
    Last Post: 06-01-2007, 08:16 AM
  5. Cygwin Server
    By osal in forum Networking/Device Communication
    Replies: 0
    Last Post: 03-07-2005, 12:58 PM