GithubHelp home page GithubHelp logo

benedictpaten / sonlib Goto Github PK

View Code? Open in Web Editor NEW
28.0 10.0 25.0 1.59 MB

Small general purpose library for C and Python with focus on bioinformatics.

License: MIT License

Makefile 0.78% C 86.69% C++ 2.00% Python 10.01% HTML 0.42% Shell 0.07% CSS 0.02%

sonlib's Introduction

sonLib

sonLib is a compact C/Python library for sequence analysis in bioinformatics.

(c) 2006 - 2012 The Author(s). See LICENSE.txt for details.

Author

Benedict Paten

Description

For basic data-structures in C it contains:

  • array lists (automatically resizing)
  • hashes
  • sets (backed by hashes)
  • sorted sets (backed by an AVL tree)
  • containers (for putting primitives into the above data-structures)
  • better string functions
  • simple exception mechanism
  • logging functions

For bioinformatic data-structures it contains (or will contain):

  • Fasta I/O functions
  • MAF I/O functions
  • Newick tree I/O functions

For more details see the Full README in doc/README

sonlib's People

Contributors

adamnovak avatar adderan avatar benedictpaten avatar dentearl avatar diekhans avatar epaull avatar glennhickey avatar hannes-ucsc avatar ifiddes avatar joelarmstrong avatar mr-c avatar ngannguyen avatar robsyme avatar tpesout avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sonlib's Issues

sonLib cannot find pthread_create

Hey @benedictpaten,

I'm trying to compile cactus with PhyloP support and am encountering the following error:

$ make
Building dependency sonLib
Building dependency pinchesAndCacti
Building dependency matchingAndOrdering
Building dependency cPecan
Building dependency hal
cd api && make all
make[1]: Entering directory '/cactus-github/api'
cp inc/cactus*.h ../lib//
gcc -std=c99 -O3 -g -Wall --pedantic -funroll-loops -DNDEBUG  -I /cactus-github/submodules/sonLib/lib -I inc -I ../lib// -c impl/cactus*.c
ar rc cactusLib.a *.o
ranlib cactusLib.a 
rm *.o
mv cactusLib.a ../lib//
gcc -std=c99 -O3 -g -Wall --pedantic -funroll-loops -DNDEBUG  -I /cactus-github/submodules/sonLib/lib -I inc -I ../lib/ -I impl -I tests -o ../bin//cactusAPITests tests/allTests.c tests/cactus*.c ../lib//cactusLib.a /cactus-github/submodules/sonLib/lib/sonLib.a /cactus-github/submodules/sonLib/lib/cuTest.a    -lz -lm
make[1]: Leaving directory '/cactus-github/api'
cd setup && make all
make[1]: Entering directory '/cactus-github/setup'
gcc -std=c99 -O3 -g -Wall --pedantic -funroll-loops -DNDEBUG  -I /cactus-github/submodules/sonLib/lib  -I../lib/ -o ../bin//cactus_setup cactus_setup.c ../lib//cactusLib.a /cactus-github/submodules/sonLib/lib/sonLib.a /cactus-github/submodules/sonLib/lib/cuTest.a    -lz -lm
make[1]: Leaving directory '/cactus-github/setup'
cd blastLib && make all
make[1]: Entering directory '/cactus-github/blastLib'
gcc -std=c99 -O3 -g -Wall --pedantic -funroll-loops -DNDEBUG  -I /cactus-github/submodules/sonLib/lib  -I inc -I ../lib// -c blastAlignmentLib.c
ar rc cactusBlastAlignment.a *.o
ranlib cactusBlastAlignment.a 
rm *.o
mv cactusBlastAlignment.a ../lib//
cp blastAlignmentLib.h ../lib//
make[1]: Leaving directory '/cactus-github/blastLib'
cd caf && make all
make[1]: Entering directory '/cactus-github/caf'
gcc -std=c99 -O3 -g -Wall --pedantic -funroll-loops -DNDEBUG  -I /cactus-github/submodules/sonLib/lib -I inc -I ../lib// -c impl/*.c
impl/giantComponent.c: In function 'stCaf_breakupComponentGreedily':
impl/giantComponent.c:38:13: warning: variable 'edgeScore' set but not used [-Wunused-but-set-variable]
     int64_t edgeScore = INT64_MAX;
             ^
ar rc stCaf.a *.o
ranlib stCaf.a 
rm *.o
mv stCaf.a ../lib//
cp inc/*.h ../lib//
gcc -std=c99 -O3 -g -Wall --pedantic -funroll-loops -DNDEBUG  -I /cactus-github/submodules/sonLib/lib -I inc -I impl -I../lib/ -o ../bin//stCafTests tests/*.c impl/*.c ../lib//stCaf.a ../lib//cactusBlastAlignment.a /cactus-github/submodules/sonLib/lib/stPinchesAndCacti.a /cactus-github/submodules/sonLib/lib/3EdgeConnected.a ../lib//cactusLib.a /cactus-github/submodules/sonLib/lib/sonLib.a /cactus-github/submodules/sonLib/lib/cuTest.a    -lz -lm
impl/giantComponent.c: In function 'stCaf_breakupComponentGreedily':
impl/giantComponent.c:38:13: warning: variable 'edgeScore' set but not used [-Wunused-but-set-variable]
     int64_t edgeScore = INT64_MAX;
             ^
/cactus-github/submodules/sonLib/lib/sonLib.a(stThreadPool.o): In function `stThreadPool_construct':
/cactus-github/submodules/sonLib/C/impl/stThreadPool.c:144: undefined reference to `pthread_create'
/cactus-github/submodules/sonLib/C/impl/stThreadPool.c:144: undefined reference to `pthread_create'
/cactus-github/submodules/sonLib/C/impl/stThreadPool.c:144: undefined reference to `pthread_create'
/cactus-github/submodules/sonLib/C/impl/stThreadPool.c:144: undefined reference to `pthread_create'
/cactus-github/submodules/sonLib/C/impl/stThreadPool.c:144: undefined reference to `pthread_create'
/cactus-github/submodules/sonLib/lib/sonLib.a(stThreadPool.o):/cactus-github/submodules/sonLib/C/impl/stThreadPool.c:144: more undefined references to `pthread_create' follow
/cactus-github/submodules/sonLib/lib/sonLib.a(stThreadPool.o): In function `stThreadPool_destruct':
/cactus-github/submodules/sonLib/C/impl/stThreadPool.c:195: undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status
Makefile:23: recipe for target '../bin//stCafTests' failed
make[1]: *** [../bin//stCafTests] Error 1
make[1]: Leaving directory '/cactus-github/caf'
Makefile:25: recipe for target 'all.caf' failed
make: *** [all.caf] Error 2

I'm following the PhyloP support instructions described in the HAL repo, trying to compile Cactus via the Cactus Makefile. I'm using gcc v4.9.2 on a custom Ubuntu-derived OS.

compile error in sonLibList

Hi,

I am trying to install sonList on a Debian system. The compile fails with the following error:

gcc -std=c99 -O3 -g -Wall -Werror --pedantic -funroll-loops -lm      -I inc -I ../lib/ -c impl/*.c
cc1: warnings being treated as errors
impl/sonLibList.c: In function ‘stList_peek’:
impl/sonLibList.c:87: error: assuming signed overflow does not occur when assuming that (X - c) >= X is always false

If I change -O3 to -O2 the problem does not occur.

Here is my GCC information:

> gcc -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.3.2-1.1' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-cld --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.3.2 (Debian 4.3.2-1.1)

make test error

Get this error with make test. Also python can't find the modules.
.../bin/sh: 1: sonLib_kvDatabaseTest: not found
E/bin/sh: 1: sonLibTests: not found

E

ERROR: testFastaReadWriteC (bioioTest.TestCase)

Tests consistency with C version of this function.

Traceback (most recent call last):
File "/OSM/HOME-MEL/all29c/bin/sonLib/bioioTest.py", line 185, in testFastaReadWriteC
system(command)
File "/OSM/HOME-MEL/all29c/bin/sonLib/bioio.py", line 185, in system
raise RuntimeError("Command: %s exited with non-zero status %i" % (command, sts))
RuntimeError: Command: sonLib_fastaCTest /tmp/tmp8537yf /tmp/tmpG6V7Df exited with non-zero status 127

ERROR: testCigarReadWrite (cigarsTest.TestCase)

Tests the C code for reading and writing cigars against the python parser for cigars.

Traceback (most recent call last):
File "/OSM/HOME-MEL/all29c/bin/sonLib/cigarsTest.py", line 57, in testCigarReadWrite
system(command)
File "/OSM/HOME-MEL/all29c/bin/sonLib/bioio.py", line 185, in system
raise RuntimeError("Command: %s exited with non-zero status %i" % (command, sts))
RuntimeError: Command: sonLib_cigarTest /tmp/tmpBZs1ok True exited with non-zero status 127

ERROR: testSonLibKVTokyoCabinet (kvdbTest.TestCase)

Traceback (most recent call last):
File "/OSM/HOME-MEL/all29c/bin/sonLib/kvdbTest.py", line 18, in testSonLibKVTokyoCabinet
system("sonLib_kvDatabaseTest --type=tokyocabinet")
File "/OSM/HOME-MEL/all29c/bin/sonLib/bioio.py", line 185, in system
raise RuntimeError("Command: %s exited with non-zero status %i" % (command, sts))
RuntimeError: Command: sonLib_kvDatabaseTest --type=tokyocabinet exited with non-zero status 127

ERROR: testSonLibCTests (main.TestCase)

Run m,ost the sonLib CuTests, fail if any of them fail.

Traceback (most recent call last):
File "allTests.py", line 30, in testSonLibCTests
system("sonLibTests %s" % getLogLevelString())
File "/OSM/HOME-MEL/all29c/bin/sonLib/bioio.py", line 185, in system
raise RuntimeError("Command: %s exited with non-zero status %i" % (command, sts))
RuntimeError: Command: sonLibTests CRITICAL exited with non-zero status 127


Ran 19 tests in 20.710s

FAILED (errors=4)
make: *** [test] Error 4

make test error

I met the same problem when running the make test command, it gave the error "RuntimeError: Command: sonLib_kvDatabaseTest --type=tokyocabinet exited with non-zero status 128"

I don't know whether this error will make the program not work in next step ?

Does not respect standard CC/CXX Makefile variables

I'm trying to build sonLib with a compiler other than the "gcc" and "g++" found on my PATH.

Running make CC=/usr/bin/gcc CXX=/usr/bin/g++ just calls the versions on my PATH and not the ones I asked for.

sonLibTests core down

Hi,
I installed sonLib as the instructions.
Many apps can run normally, like cPecanLastz, but two of them like sonLib_fastaCTest, sonLib_cigarTest can not and tell me they are core dumped.

I used strace and it prints like this:

[zoum@diggers bin]$ strace ./sonLib_fastaCTest
execve("./sonLib_fastaCTest", ["./sonLib_fastaCTest"], [/* 34 vars */]) = 0
brk(NULL) = 0x1517000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3593111000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/home/zoum/srcs/lzo-2.10/zm/lib/tls/x86_64/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/home/zoum/srcs/lzo-2.10/zm/lib/tls/x86_64", 0x7ffc236c1f10) = -1 ENOENT (No such file or directory)
open("/home/zoum/srcs/lzo-2.10/zm/lib/tls/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/home/zoum/srcs/lzo-2.10/zm/lib/tls", 0x7ffc236c1f10) = -1 ENOENT (No such file or directory)
open("/home/zoum/srcs/lzo-2.10/zm/lib/x86_64/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/home/zoum/srcs/lzo-2.10/zm/lib/x86_64", 0x7ffc236c1f10) = -1 ENOENT (No such file or directory)
open("/home/zoum/srcs/lzo-2.10/zm/lib/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/home/zoum/srcs/lzo-2.10/zm/lib", {st_mode=S_IFDIR|0755, st_size=114, ...}) = 0
open("/usr/lib64/tls/x86_64/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/tls/x86_64", 0x7ffc236c1f10) = -1 ENOENT (No such file or directory)
open("/usr/lib64/tls/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/tls", {st_mode=S_IFDIR|0555, st_size=6, ...}) = 0
open("/usr/lib64/x86_64/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/x86_64", 0x7ffc236c1f10) = -1 ENOENT (No such file or directory)
open("/usr/lib64/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20S\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1137024, ...}) = 0
mmap(NULL, 3150120, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f3592bef000
mprotect(0x7f3592cf0000, 2093056, PROT_NONE) = 0
mmap(0x7f3592eef000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x100000) = 0x7f3592eef000
close(3) = 0
open("/home/zoum/srcs/lzo-2.10/zm/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib64/tls/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240%\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=2151672, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3593110000
mmap(NULL, 3981792, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f3592822000
mprotect(0x7f35929e4000, 2097152, PROT_NONE) = 0
mmap(0x7f3592be4000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1c2000) = 0x7f3592be4000
mmap(0x7f3592bea000, 16864, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f3592bea000
close(3) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f359310e000
arch_prctl(ARCH_SET_FS, 0x7f359310e740) = 0
mprotect(0x7f3592be4000, 16384, PROT_READ) = 0
mprotect(0x7f3592eef000, 4096, PROT_READ) = 0
mprotect(0x61b000, 4096, PROT_READ) = 0
mprotect(0x7f3593112000, 4096, PROT_READ) = 0
brk(NULL) = 0x1517000
brk(0x1538000) = 0x1538000
brk(NULL) = 0x1538000
open(NULL, O_RDONLY) = -1 EFAULT (Bad address)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV (core dumped) +++
段错误(吐核)

How can i fix this? Thank you very much.

Syntax error in bioio.py, line 431?

Hi,

I get this error when running make test on hal. I also get the same error when I try to run hal2assemblyHub.py.

Example:

bash-4.2$ hal2assemblyHub.py myhal.hal myhub_hub --lod
> --alignability --gcContent --cladeExclusiveRegions --maxThreads 96
> |& tee hal2assemblyHub.out
Traceback (most recent call last):
File "/w5home/ybukhman/hal-20200815/hal/bin/hal2assemblyHub.py", line 24, in
from sonLib.bioio import system, getTempFile
File "/w5home/ybukhman/hal-20200815/sonLib/bioio.py", line 431
os.chmod(dirName, 0777)
^
SyntaxError: invalid token

importing weirdness

In a subclass Target def, in the run method, calling from sonLib.bioio import newickTreeParser leads to a recursive import problem. For example:

class SimTree( Target ):
    """                                                                                              
    The SimTree class runs the entire simulation. It begins by either calling one Tree() or          
    two Tree() targets depending on the newick tree. It then waits for the simulation to complete.   
    """
    def __init__(self, options):
        Target.__init__(self)
        self.options = options
    def run(self):
        from sonLib.bioio import newickTreeParser # this is the offending call
        nt = newickTreeParser( self.options.inputNewick, 0.0 )
        if nt.distance == 0:
            self.addChildTarget( Tree( nt.left,  'Left Branch',  self.options.simDir, self.options) )
            self.addChildTarget( Tree( nt.right, 'Right Branch', self.options.simDir, self.options) )
        else:
            self.addChildTarget( Tree( nt, 'Stem', self.options.simDir, self.options) )

error in "make test"

Hi Benedict,

When I first ran "make test" I got many error massages like that:

.Running the command: sonLib_cigarTest /tmp/tmpKviSbo False
/bin/sh: sonLib_cigarTest: command not found
E......Running the command: sonLib_kvDatabaseTest --type=kyototycoon --host=localhost --port=1978
/bin/sh: sonLib_kvDatabaseTest: command not found
E.Running the command: sonLib_kvDatabaseTest --type=tokyocabinet
/bin/sh: sonLib_kvDatabaseTest: command not found
ERunning the command: sonLibTests DEBUG
/bin/sh: sonLibTests: command not found
E
======================================================================
ERROR: Tests consistency with C version of this function.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/gpfs2/projects/gec/tool/assemblathon1/sonLib/bioioTest.py", line 165, in testFastaReadWriteC
    system(command)
  File "/gpfs2/projects/gec/tool/assemblathon1/sonLib/bioio.py", line 160, in system
    raise RuntimeError("Command: %s exited with non-zero status %i" % (command, i))
RuntimeError: Command: sonLib_fastaCTest /tmp/tmp0t00zf /tmp/tmpbVNOKW exited with non-zero status 32512

After adding sonLib/bin to $PATH manually, only following one error were remained:


======================================================================
ERROR: testSonLibKVKyotoTycoon (kvdbTest.TestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/gpfs2/projects/gec/tool/assemblathon1/sonLib/kvdbTest.py", line 22, in testSonLibKVKyotoTycoon
    system("sonLib_kvDatabaseTest --type=kyototycoon --host=localhost --port=1978")
  File "/gpfs2/projects/gec/tool/assemblathon1/sonLib/bioio.py", line 160, in system
    raise RuntimeError("Command: %s exited with non-zero status %i" % (command, i))
RuntimeError: Command: sonLib_kvDatabaseTest --type=kyototycoon --host=localhost --port=1978 exited with non-zero status 32768

----------------------------------------------------------------------
Ran 18 tests in 22.743s


Can I ask how I can remove it?
Thank you.

Yun

The identity function is not a hash function

uint64_t stHash_pointer(const void *k) {
/*if (sizeof(const void *) > 4) {
int64_t key = (int64_t) (size_t) k;
key = (~key) + (key << 18); // key = (key << 18) - key - 1;
key = key ^ (key >> 31);
key = key * 21; // key = (key + (key << 2)) + (key << 4);
key = key ^ (key >> 11);
key = key + (key << 6);
key = key ^ (key >> 22);
return (uint64_t) key;
}*/
return (uint64_t) (size_t) k; //Just use the low order bits
}

Conversion to 64 types broke stSet and stInTuple

src/comparatorAPI.c:571:35: error: incompatible pointer types passing 'uint64_t (const void *)' to parameter of type 'uint32_t (*)(const void *)' [-Werror,-Wincompatible-pointer-types]
    stSet *set = stSet_construct3(uint64Key, uint64EqualKey, free);
                                  ^~~~~~~~~
../../sonLib/lib/sonLibSet.h:44:36: note: passing argument to parameter 'hashKey' here
stSet *stSet_construct3(uint32_t (*hashKey)(const void *), int (*hashEqualsKey)(const void *, const void *),
                                   ^
src/comparatorAPI.c:902:21: error: implicit declaration of function 'stIntTuple_construct2' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    stIntTuple *i = stIntTuple_construct2( pos, INT64_MAX);
                    ^
src/comparatorAPI.c:902:21: note: did you mean 'stIntTuple_construct'?
    stIntTuple *i = stIntTuple_construct2( pos, INT64_MAX);
                    ^~~~~~~~~~~~~~~~~~~~~
                    stIntTuple_construct
../../sonLib/lib/sonLibTuples.h:27:13: note: 'stIntTuple_construct' declared here
stIntTuple *stIntTuple_construct(int32_t length, ...);
            ^
src/comparatorAPI.c:902:17: error: incompatible integer to pointer conversion initializing 'stIntTuple *' (aka 'int *') with an expression of type 'int' [-Werror,-Wint-conversion]
    stIntTuple *i = stIntTuple_construct2( pos, INT64_MAX);
                ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/comparatorAPI.c:909:12: error: implicit declaration of function 'stIntTuple_get' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    return stIntTuple_get(j, 0) <= pos && pos < stIntTuple_get(j, 1);
           ^
src/comparatorAPI.c:909:12: note: did you mean 'stIntTuple_length'?
    return stIntTuple_get(j, 0) <= pos && pos < stIntTuple_get(j, 1);
           ^~~~~~~~~~~~~~
           stIntTuple_length
../../sonLib/lib/sonLibTuples.h:57:9: note: 'stIntTuple_length' declared here
int32_t stIntTuple_length(stIntTuple *intTuple);
        ^
src/comparatorAPI.c:957:41: error: incompatible pointer types passing 'uint64_t (const void *)' to parameter of type 'uint32_t (*)(const void *)' [-Werror,-Wincompatible-pointer-types]
    stHash *posHash = stHash_construct3(aPositionKey, aPositionEqualKey, aPosition_destruct, free);
                                        ^~~~~~~~~~~~
../../sonLib/lib/sonLibHash.h:43:38: note: passing argument to parameter 'hashKey' here
stHash *stHash_construct3(uint32_t (*hashKey)(const void *), int (*hashEqualsKey)(const void *, const void *),
                                     ^
5 errors generated.
make[1]: *** [src/comparatorAPI.o] Error 1
rm src/comparatorRandom.o
make: *** [mafComparator.all] Error 2

Ubuntu compile issue

Hi, I'm trying to install sonLib for Cactus on an ubuntu system.

make all fails with:

$ make all
cd externalTools && make all
make[1]: Entering directory `/home/rob/src/sonLib/externalTools'
cd cutest && make all
make[2]: Entering directory `/home/rob/src/sonLib/externalTools/cutest'
gcc -std=c99 -O3 -g -Wall -Werror --pedantic -funroll-loops -lm  -c CuTest.c
ar rc cuTest.a *.o
ranlib cuTest.a
rm -f *.o
mv cuTest.a ../../lib/
cp CuTest.h ../../lib/
make[2]: Leaving directory `/home/rob/src/sonLib/externalTools/cutest'
make[1]: Leaving directory `/home/rob/src/sonLib/externalTools'
cd C && make all
make[1]: Entering directory `/home/rob/src/sonLib/C'
cp inc/*.h ../lib/
gcc -std=c99 -O3 -g -Wall -Werror --pedantic -funroll-loops -lm      -I inc -I ../lib/ -c impl/*.c
cc1: warnings being treated as errors
impl/commonC.c: In function ‘getTempFile’:
impl/commonC.c:842:11: error: ignoring return value of ‘tmpnam’, declared with attribute warn_unused_result
cc1: warnings being treated as errors
impl/stSafeC.c: In function ‘stSafeCErr’:
impl/stSafeC.c:26:10: error: ignoring return value of ‘write’, declared with attribute warn_unused_result
impl/stSafeC.c:27:10: error: ignoring return value of ‘write’, declared with attribute warn_unused_result
make[1]: *** [../lib/sonLib.a] Error 1
make[1]: Leaving directory `/home/rob/src/sonLib/C'
make: *** [cP] Error 2

gcc version is:

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.5.2-8ubuntu4' --with-bugurl=file:///usr/share/doc/gcc-4.5/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.5 --enable-shared --enable-multiarch --with-multiarch-defaults=x86_64-linux-gnu --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib/x86_64-linux-gnu --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.5 --libdir=/usr/lib/x86_64-linux-gnu --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-gold --enable-ld=default --with-plugin-ld=ld.gold --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4) 

Is this something I can fix from here? My apologies I'm missing something obvious, or if this doesn't warrant filing a new issue.

errors in "make test"

...running Tokyo Cabinet sonLibKVDatabase tests
Running test case readWriteAndRemoveRecords
Exception: ST_KV_DATABASE_EXCEPTION: requested Tokyo Cabinet database, however sonlib is not compiled with Tokyo Cabinet support
Uncaught exception
ERunning test case test_st_logging
OKAY This is important, really
OKAY Bar foo
OKAY This is important, really
OKAY Hello world
OKAY Bar foo
OKAY This is important, really
Running test case test_st_system
1
Running test case test_stTree_construct
Running test case test_stTree_getSetParent
Running test case test_stTree_getChildNumber
Running test case test_stTree_getChild
sh: Running test case test_stTree_getSetBranchLength
thisProgramDoesNotExist: not found
Running test case test_stTree_getSetClientData
Running test case test_stTree_newickTreeParser
Running test case test_stTree_label
Running test case test_stTree_getNumNodes
Running test case test_stTree_equals
Running test case test_stTree_clone
Running test case test_stString_copy
Running test case test_stString_print
Running test case test_stString_getNextWord
Running test case test_stString_replace
Running test case test_stString_join
Running test case test_stString_join2
Running test case test_stString_split
Running test case test_stString_getSubString
Running test case test_stIntTuple_construct
Running test case test_stIntTuple_hashKey
Running test case test_stIntTuple_cmpFn
Running test case test_stIntTuple_equalsFn
Running test case test_stIntTuple_length
Running test case test_stIntTuple_getPosition
Running test case test_stInt64Tuple_construct
Running test case test_stInt64Tuple_hashKey
Running test case test_stInt64Tuple_cmpFn
Running test case test_stInt64Tuple_equalsFn
Running test case test_stInt64Tuple_length
Running test case test_stInt64Tuple_getPosition
Running test case test_stDoubleTuple_construct
Running test case test_stDoubleTuple_hashKey
Running test case test_stDoubleTuple_cmpFn
Running test case test_stDoubleTuple_equalsFn
Running test case test_stDoubleTuple_length
Running test case test_stDoubleTuple_getPosition
Running test case test_stHash_search
Running test case test_stHash_remove
Running test case test_stHash_removeAndFreeKey
Running test case test_stHash_insert
Running test case test_stHash_size
Running test case test_stHash_testIterator
Running test case test_stHash_construct
Running test case test_stHash_testGetKeys
Running test case test_stHash_testGetValues
Running test case test_stSet_search
Running test case test_stSet_remove
Running test case test_stSet_removeAndFreeKey
Running test case test_stSet_insert
Running test case test_stSet_size
Running test case test_stSet_testIterator
Running test case test_stSet_construct
Running test case test_stSet_testGetKeys
Running test case test_stSet_getUnion
Running test case test_stSet_getIntersection
Running test case test_stSet_getDifference
Running test case test_stList_construct
Running test case test_stList_append
Running test case test_stList_appendAll
Running test case test_stList_length
Running test case test_stList_get
Running test case test_stList_set
Running test case test_stList_peek
Running test case test_stList_pop
Running test case test_stList_remove
Running test case test_stList_removeFirst
Running test case test_stList_contains
Running test case test_stList_copy
Running test case test_stList_reverse
Running test case test_stList_iterator
Running test case test_stList_nullList
Running test case test_stList_sort
Running test case test_stList_getSortedSet
Running test case test_stList_filter
Running test case test_stSortedSet_construct
Running test case test_stSortedSet_copyConstruct
Running test case test_stSortedSet
Running test case test_stSortedSetIterator
Running test case test_stSortedSetIterator_getIteratorFrom
Running test case test_stSortedSetEquals
Running test case test_stSortedSetIntersection
Running test case test_stSortedSetUnion
Running test case test_stSortedSetDifference
Running test case test_stSortedSet_searchLessThanOrEqual
Running test case test_stSortedSet_searchLessThan
Running test case test_stSortedSet_searchGreaterThanOrEqual
Running test case test_stSortedSet_searchGreaterThan
Running test case testThrow
Running test case testOk
Running test case testTryReturn
Running test case test_st_randomInt
Running test case test_st_randomInt_distribution_0
Running test case test_st_randomInt64_range_0
Running test case test_st_randomInt64_distribution_0
Running test case test_st_random
Running test case test_st_randomChoice
Running test case test_stCompression_compressAndDecompress_Lots
Running test case test_stCompression_compressAndDecompress_Big
Running test case test_stFile_getLineFromFile
Running test case test_stFile_pathJoin
Running test case test_stFile_exists
Running test case test_stFile_isDir
Running test case test_stFile_getFileNamesInDirectory
Running test case readAndUpdateRecord
Running test case readAndUpdateRecords
.F..........................................................................................................

There was 1 failure:

  1. test_st_system: tests/sonLibCommonTest.c:45: assert failed

!!!FAILURES!!!
Runs: 108 Passes: 107 Fails: 1

E

ERROR: testSonLibKVTokyoCabinet (kvdbTest.TestCase)

Traceback (most recent call last):
File "/home/gbio/sonLib/kvdbTest.py", line 18, in testSonLibKVTokyoCabinet
system("sonLib_kvDatabaseTest --type=tokyocabinet")
File "/home/gbio/sonLib/bioio.py", line 163, in system
raise RuntimeError("Command: %s exited with non-zero status %i" % (command, sts))
RuntimeError: Command: sonLib_kvDatabaseTest --type=tokyocabinet exited with non-zero status 128

ERROR: Run m,ost the sonLib CuTests, fail if any of them fail.

Traceback (most recent call last):
File "allTests.py", line 30, in testSonLibCTests
system("sonLibTests %s" % getLogLevelString())
File "/home/gbio/sonLib/bioio.py", line 163, in system
raise RuntimeError("Command: %s exited with non-zero status %i" % (command, sts))
RuntimeError: Command: sonLibTests CRITICAL exited with non-zero status 1


Ran 18 tests in 16.341s

FAILED (errors=2)
make: *** [test] Error 2

sonLib fails to compile with 'make' on MacOS 10.6.6

...
cd C && make all
cp inc/.h ../lib/
gcc -std=c99 -O3 -g -Wall -Werror --pedantic -funroll-loops -lm -I/usr/local/mysql/include -DHAVE_MYSQL=1 -I inc -I ../lib/ -c impl/
.c
impl/sonLibKVDatabase_TokyoCabinet.c:18:20: error: tcutil.h: No such file or directory
impl/sonLibKVDatabase_TokyoCabinet.c:19:19: error: tcbdb.h: No such file or directory
impl/sonLibKVDatabase_TokyoCabinet.c:31: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘’ token
impl/sonLibKVDatabase_TokyoCabinet.c: In function ‘destructDB’:
impl/sonLibKVDatabase_TokyoCabinet.c:46: error: ‘TCBDB’ undeclared (first use in this function)
impl/sonLibKVDatabase_TokyoCabinet.c:46: error: (Each undeclared identifier is reported only once
impl/sonLibKVDatabase_TokyoCabinet.c:46: error: for each function it appears in.)
impl/sonLibKVDatabase_TokyoCabinet.c:46: error: ‘dbImpl’ undeclared (first use in this function)
cc1: warnings being treated as errors
impl/sonLibKVDatabase_TokyoCabinet.c:48: warning: implicit declaration of function ‘tcbdbclose’
impl/sonLibKVDatabase_TokyoCabinet.c:49: warning: implicit declaration of function ‘tcbdberrmsg’
impl/sonLibKVDatabase_TokyoCabinet.c:49: warning: implicit declaration of function ‘tcbdbecode’
impl/sonLibKVDatabase_TokyoCabinet.c:51: warning: implicit declaration of function ‘tcbdbdel’
impl/sonLibKVDatabase_TokyoCabinet.c: At top level:
impl/sonLibKVDatabase_TokyoCabinet.c:66: error: expected ‘)’ before ‘
’ token
impl/sonLibKVDatabase_TokyoCabinet.c: In function ‘containsRecord’:
impl/sonLibKVDatabase_TokyoCabinet.c:71: warning: implicit declaration of function ‘recordExists’
impl/sonLibKVDatabase_TokyoCabinet.c: In function ‘insertRecord’:
impl/sonLibKVDatabase_TokyoCabinet.c:75: error: ‘TCBDB’ undeclared (first use in this function)
impl/sonLibKVDatabase_TokyoCabinet.c:75: error: ‘dbImpl’ undeclared (first use in this function)
impl/sonLibKVDatabase_TokyoCabinet.c:79: warning: implicit declaration of function ‘tcbdbput’
impl/sonLibKVDatabase_TokyoCabinet.c: In function ‘updateRecord’:
impl/sonLibKVDatabase_TokyoCabinet.c:85: error: ‘TCBDB’ undeclared (first use in this function)
impl/sonLibKVDatabase_TokyoCabinet.c:85: error: ‘dbImpl’ undeclared (first use in this function)
impl/sonLibKVDatabase_TokyoCabinet.c: In function ‘numberOfRecords’:
impl/sonLibKVDatabase_TokyoCabinet.c:95: error: ‘TCBDB’ undeclared (first use in this function)
impl/sonLibKVDatabase_TokyoCabinet.c:95: error: ‘dbImpl’ undeclared (first use in this function)
impl/sonLibKVDatabase_TokyoCabinet.c:96: warning: implicit declaration of function ‘tcbdbrnum’
impl/sonLibKVDatabase_TokyoCabinet.c: In function ‘getRecord2’:
impl/sonLibKVDatabase_TokyoCabinet.c:100: error: ‘TCBDB’ undeclared (first use in this function)
impl/sonLibKVDatabase_TokyoCabinet.c:100: error: ‘dbImpl’ undeclared (first use in this function)
impl/sonLibKVDatabase_TokyoCabinet.c:103: warning: implicit declaration of function ‘tcbdbget’
impl/sonLibKVDatabase_TokyoCabinet.c:103: warning: initialization makes pointer from integer without a cast
impl/sonLibKVDatabase_TokyoCabinet.c: In function ‘removeRecord’:
impl/sonLibKVDatabase_TokyoCabinet.c:131: error: ‘TCBDB’ undeclared (first use in this function)
impl/sonLibKVDatabase_TokyoCabinet.c:131: error: ‘dbImpl’ undeclared (first use in this function)
impl/sonLibKVDatabase_TokyoCabinet.c:132: warning: implicit declaration of function ‘tcbdbout’
impl/sonLibKVDatabase_TokyoCabinet.c: In function ‘startTransaction’:
impl/sonLibKVDatabase_TokyoCabinet.c:138: error: ‘TCBDB’ undeclared (first use in this function)
impl/sonLibKVDatabase_TokyoCabinet.c:138: error: ‘dbImpl’ undeclared (first use in this function)
impl/sonLibKVDatabase_TokyoCabinet.c:139: warning: implicit declaration of function ‘tcbdbtranbegin’
impl/sonLibKVDatabase_TokyoCabinet.c: In function ‘commitTransaction’:
impl/sonLibKVDatabase_TokyoCabinet.c:145: error: ‘TCBDB’ undeclared (first use in this function)
impl/sonLibKVDatabase_TokyoCabinet.c:145: error: ‘dbImpl’ undeclared (first use in this function)
impl/sonLibKVDatabase_TokyoCabinet.c:147: warning: implicit declaration of function ‘tcbdbtrancommit’
impl/sonLibKVDatabase_TokyoCabinet.c: In function ‘abortTransaction’:
impl/sonLibKVDatabase_TokyoCabinet.c:153: error: ‘TCBDB’ undeclared (first use in this function)
impl/sonLibKVDatabase_TokyoCabinet.c:153: error: ‘dbImpl’ undeclared (first use in this function)
impl/sonLibKVDatabase_TokyoCabinet.c:154: warning: implicit declaration of function ‘tcbdbtranabort’
impl/sonLibKVDatabase_TokyoCabinet.c: In function ‘stKVDatabase_initialise_tokyoCabinet’:
impl/sonLibKVDatabase_TokyoCabinet.c:162: warning: implicit declaration of function ‘constructDB’
impl/sonLibKVDatabase_TokyoCabinet.c:162: warning: assignment makes pointer from integer without a cast
make[1]: *** [../lib/sonLib.a] Error 1
make: *** [cP] Error 2

'make all' warning & 'make test' error: invalid syntax

Hi all,
I'm having an issue with 'make all' and make test. I'm using a lua system to load modules.

Commands:
git clone https://github.com/benedictpaten/sonLib.git
cd sonLib
module use -a /projects/academic/vaalbert/modulefiles/Allluas
module load anaconda3
module load sonLib
make all
make test

Selected output from 'make all':
gcc -std=c99 -O3 -g -Wall --pedantic -funroll-loops -DNDEBUG -I../externalTools/quicktree_1.1/include/ -I inc -I ../lib/ -c impl/.c
impl/sonLibList.c: In function ‘st_list_sortP’:
impl/sonLibList.c:258:13: warning: ISO C forbids conversion of object pointer to function pointer type [-Wpedantic]
return ((int (
)(const void *, const void ))fn)(((char **)a), *((char **)b));
^
impl/sonLibList.c: In function ‘stList_sort’:
impl/sonLibList.c:262:76: warning: ISO C forbids conversion of function pointer to object pointer type [-Wpedantic]
sort_r(list->list, stList_length(list), sizeof(void *), st_list_sortP, (void *)cmpFn);
^
impl/sonLibList.c: In function ‘st_list_sort2P’:
impl/sonLibList.c:267:56: warning: ISO C forbids conversion of object pointer to function pointer type [-Wpedantic]
int (*cmpFn)(const void *, const void *, void ) = (int ()(const void *, const void *, void *))(((void **)extra)[0]);
^
impl/sonLibList.c: In function ‘stList_sort2’:
impl/sonLibList.c:273:24: warning: ISO C forbids conversion of function pointer to object pointer type [-Wpedantic]
void *extra[2] = { (void *)cmpFn, (void *)extraArg };

Selected output from 'make test':
PYTHONPATH=.. PATH=../../bin:$PATH python allTests.py --testLength=SHORT --logLevel=CRITICAL
Traceback (most recent call last):
File "allTests.py", line 8, in
import bioioTest
File "/projects/academic/vaalbert/modulefiles/sonLib/bioioTest.py", line 69
print "Got %s levels, %s fileNo and %s maxTempFiles" % (levels, fileNo, maxTempFiles)
^
SyntaxError: invalid syntax
make: *** [test] Error 1

Any help with this issue would be greatly appreciated. Thank you!
-Steve

Maftools doesn't compile with sonlib out of the box

Hi,

I see an error when I try to compile MafTools:
gcc -std=c99 -c src/comparatorRandom.c -o src/comparatorRandom.o.tmp -O3 -Wall -Werror --pedantic -funroll-loops -DNDEBUG -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -I ../../sonLib/lib -I ../inc -I ../external
cc1: warnings being treated as errors
In file included from ../../sonLib/lib/sonLib.h:36,
from src/comparatorRandom.h:30,
from src/comparatorRandom.c:28:
../../sonLib/lib/sonLibEulerTour.h:16: error: function declaration isn’t a prototype

I'm not sure why strict flags are set. I added 'void' to the call in EulerTour and it compiles now.
-Carrie

compile problem: comparison between pointer and zero character constant [-Wpointer-compare]

Hi,

When I compile the C files, I get such warnings:

/root/miniconda3/bin/x86_64-conda-linux-gnu-cc -std=c99 -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /root/miniconda3/include -O3 -g -Wall --pedantic -funroll-loops -DNDEBUG       -I../externalTools/quicktree_1.1/include/ -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /root/miniconda3/include -I inc -I ../lib/  -c impl/*.c
impl/bioioC.c: In function 'parseInt':
impl/bioioC.c:268:23: warning: comparison between pointer and zero character constant [-Wpointer-compare]
  268 |         while(*string != '\0' && !isspace(**string)) {
      |                       ^~
impl/bioioC.c:268:15: note: did you mean to dereference the pointer?
  268 |         while(*string != '\0' && !isspace(**string)) {
      |               ^
impl/bioioC.c: In function 'parseFloat':
impl/bioioC.c:289:23: warning: comparison between pointer and zero character constant [-Wpointer-compare]
  289 |         while(*string != '\0' && !isspace(**string)) {
      |                       ^~
impl/bioioC.c:289:15: note: did you mean to dereference the pointer?
  289 |         while(*string != '\0' && !isspace(**string)) {
      |               ^
impl/bioioC.c: In function 'parseString':
impl/bioioC.c:310:23: warning: comparison between pointer and zero character constant [-Wpointer-compare]
  310 |         while(*string != '\0' && !isspace(**string)) {
      |                       ^~
impl/bioioC.c:310:15: note: did you mean to dereference the pointer?
  310 |         while(*string != '\0' && !isspace(**string)) {
      |               ^
impl/sonLibList.c: In function 'st_list_sortP':
impl/sonLibList.c:258:13: warning: ISO C forbids conversion of object pointer to function pointer type [-Wpedantic]
  258 |     return ((int (*)(const void *, const void *))fn)(*((char **)a), *((char **)b));
      |             ^
impl/sonLibList.c: In function 'stList_sort':
impl/sonLibList.c:262:76: warning: ISO C forbids conversion of function pointer to object pointer type [-Wpedantic]
  262 |     sort_r(list->list, stList_length(list), sizeof(void *), st_list_sortP, (void *)cmpFn);
      |                                                                            ^
impl/sonLibList.c: In function 'st_list_sort2P':
impl/sonLibList.c:267:56: warning: ISO C forbids conversion of object pointer to function pointer type [-Wpedantic]
  267 |     int (*cmpFn)(const void *, const void *, void *) = (int (*)(const void *, const void *, void *))(((void **)extra)[0]);
      |                                                        ^
impl/sonLibList.c: In function 'stList_sort2':
impl/sonLibList.c:273:24: warning: ISO C forbids conversion of function pointer to object pointer type [-Wpedantic]
  273 |     void *extra[2] = { (void *)cmpFn, (void *)extraArg };

and finally when I try commands in ./bin, I get Segmentation fault. I think it's the pointer problem, but I see many platforms and get no solutions.

Thanks!

custom Tokyo Cabinet install

install.mk hardcodes paths to the Tokyo DB .h file -- please make this a (documented) configurable variable (via environment variable), so that I don't have to hack the Makefiles.

Please tag a recent release

Can you please tag a recent release of sonLib? The last release tag is from 2012. I would like to use and build sonLib consistently with a tagged version, which is much nicer than using commit hashes.

Compile error on Ubuntu

Hi,

I've been working to compile this library to use Cactus under Ubuntu 11.10 to no avail. Following issue #5 raised in September by robsymes, I obtained the same error:

$ make all
cd externalTools && make all
make[1]: Entering directory /home/ber23w/apps/CACTUS_FILES/benedictpaten-sonLib-194abd1/externalTools' cd cutest && make all make[2]: Entering directory/home/ber23w/apps/CACTUS_FILES/benedictpaten-sonLib-194abd1/externalTools/cutest'
gcc -std=c99 -O3 -g -Wall -Werror --pedantic -funroll-loops -lm -fopenmp -c CuTest.c
ar rc cuTest.a .o
ranlib cuTest.a
rm -f *.o
mv cuTest.a ../../lib/
cp CuTest.h ../../lib/
make[2]: Leaving directory /home/ber23w/apps/CACTUS_FILES/benedictpaten-sonLib-194abd1/externalTools/cutest' make[1]: Leaving directory/home/ber23w/apps/CACTUS_FILES/benedictpaten-sonLib-194abd1/externalTools'
cd C && make all
make[1]: Entering directory `/home/ber23w/apps/CACTUS_FILES/benedictpaten-sonLib-194abd1/C'
gcc -std=c99 -O3 -g -Wall -Werror --pedantic -funroll-loops -lm -fopenmp -I/usr/include/mysql -DHAVE_MYSQL=1 -I inc -I ../lib/ -c impl/
.c
impl/stSafeC.c: In function ‘stSafeCErr’:
impl/stSafeC.c:26:10: error: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Werror=unused-result]
impl/stSafeC.c:27:10: error: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Werror=unused-result]
cc1: all warnings being treated as errors

make[1]: *** [../lib/sonLib.a] Error 1
make[1]: Leaving directory /home/ber23w/apps/CACTUS_FILES/benedictpaten-sonLib-194abd1/C' make: *** [cP] Error 2

Based on the suggestion made by Glenn Hickey, I removed the -Werror flag and found I obtained the following new error:

$ make all
cd externalTools && make all
make[1]: Entering directory /home/ber23w/apps/CACTUS_FILES/benedictpaten-sonLib-194abd1/externalTools' cd cutest && make all make[2]: Entering directory/home/ber23w/apps/CACTUS_FILES/benedictpaten-sonLib-194abd1/externalTools/cutest'
make[2]: Nothing to be done for all'. make[2]: Leaving directory/home/ber23w/apps/CACTUS_FILES/benedictpaten-sonLib-194abd1/externalTools/cutest'
make[1]: Leaving directory /home/ber23w/apps/CACTUS_FILES/benedictpaten-sonLib-194abd1/externalTools' cd C && make all make[1]: Entering directory/home/ber23w/apps/CACTUS_FILES/benedictpaten-sonLib-194abd1/C'
gcc -std=c99 -O3 -g -Wall --pedantic -funroll-loops -lm -fopenmp -I/usr/include/mysql -DHAVE_MYSQL=1 -I inc -I ../lib/ -c >impl/.c
impl/stSafeC.c: In function ‘stSafeCErr’:
impl/stSafeC.c:26:10: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
impl/stSafeC.c:27:10: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
g++ -g -Wall -funroll-loops -lm -I inc -I ../lib/ -c impl/
.cpp
ar rc sonLib.a .o
ranlib sonLib.a
rm *.o
mv sonLib.a ../lib/
gcc -std=c99 -O3 -g -Wall --pedantic -funroll-loops -lm -fopenmp -I/usr/include/mysql -DHAVE_MYSQL=1 -I inc -I ../lib -o ../bin/sonLibTests.tmp tests/allTests.c tests/sonLib
.c ../lib/sonLib.a ../lib/cuTest.a -Wl,-Bsymbolic-functions -rdynamic -L/usr/lib/mysql -lmysqlclient -lz -Wl,-Bsymbolic-functions -rdynamic -L/usr/lib/mysql -lmysqlclient
../lib/sonLib.a(hashTableC.o): In function create_hashtable': /home/ber23w/apps/CACTUS_FILES/benedictpaten-sonLib-194abd1/C/impl/hashTableC.c:61: undefined reference toceilf'
../lib/sonLib.a(hashTableC.o): In function hashtable_expand': /home/ber23w/apps/CACTUS_FILES/benedictpaten-sonLib-194abd1/C/impl/hashTableC.c:132: undefined reference toceilf'
collect2: ld returned 1 exit status
make[1]: *** [../bin/sonLibTests] Error 1
make[1]: Leaving directory `/home/ber23w/apps/CACTUS_FILES/benedictpaten-sonLib-194abd1/C'
make: *** [cP] Error 2

I see the development fork was merged back to the head on 21st December, but have still found this issue. Similar to Rob, I'm not sure if I've missed something simple myself, but would appreciate any advice on how I might correct this.

gcc & kernel version:

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6.1/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.1-9ubuntu3' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)

$ uname -a
Linux banks 3.0.0-13-generic #22-Ubuntu SMP Wed Nov 2 13:27:26 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.