Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
ORG.Asm
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
23
Issues
23
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
ORG.Asm
ORG.Asm
Commits
ee441f69
Commit
ee441f69
authored
Nov 23, 2012
by
Eric Coissac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initial commit
parent
95f0e9c6
Changes
44
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
44 changed files
with
21976 additions
and
0 deletions
+21976
-0
distutils.ext/obidistutils/__init__.py
distutils.ext/obidistutils/__init__.py
+0
-0
distutils.ext/obidistutils/command/__init__.py
distutils.ext/obidistutils/command/__init__.py
+209
-0
distutils.ext/obidistutils/command/build.py
distutils.ext/obidistutils/command/build.py
+21
-0
distutils.ext/obidistutils/command/build_cexe.py
distutils.ext/obidistutils/command/build_cexe.py
+206
-0
distutils.ext/obidistutils/command/build_ctools.py
distutils.ext/obidistutils/command/build_ctools.py
+105
-0
distutils.ext/obidistutils/command/build_filters.py
distutils.ext/obidistutils/command/build_filters.py
+10
-0
distutils.ext/obidistutils/command/build_scripts.py
distutils.ext/obidistutils/command/build_scripts.py
+102
-0
distutils.ext/obidistutils/command/install_scripts.py
distutils.ext/obidistutils/command/install_scripts.py
+34
-0
distutils.ext/obidistutils/core.py
distutils.ext/obidistutils/core.py
+167
-0
distutils.ext/obidistutils/dist.py
distutils.ext/obidistutils/dist.py
+30
-0
python/orgasm/__init__.py
python/orgasm/__init__.py
+0
-0
python/orgasm/assembler/__init__.py
python/orgasm/assembler/__init__.py
+483
-0
python/orgasm/graph/__init__.py
python/orgasm/graph/__init__.py
+1
-0
python/orgasm/graph/_graph.c
python/orgasm/graph/_graph.c
+11038
-0
python/orgasm/graph/_graph.pxd
python/orgasm/graph/_graph.pxd
+29
-0
python/orgasm/graph/_graph.pyx
python/orgasm/graph/_graph.pyx
+409
-0
python/orgasm/indexer/__init__.py
python/orgasm/indexer/__init__.py
+21
-0
python/orgasm/indexer/_orgasm.c
python/orgasm/indexer/_orgasm.c
+4885
-0
python/orgasm/indexer/_orgasm.cfiles
python/orgasm/indexer/_orgasm.cfiles
+18
-0
python/orgasm/indexer/_orgasm.pyx
python/orgasm/indexer/_orgasm.pyx
+121
-0
python/orgasm/samples/__init__.py
python/orgasm/samples/__init__.py
+21
-0
setup.py
setup.py
+68
-0
src/Makefile
src/Makefile
+73
-0
src/_sse.h
src/_sse.h
+1047
-0
src/buffer.c
src/buffer.c
+74
-0
src/buildcode.c
src/buildcode.c
+52
-0
src/buildcomplement.c
src/buildcomplement.c
+58
-0
src/buildindex.c
src/buildindex.c
+137
-0
src/compsort.c
src/compsort.c
+313
-0
src/debug.c
src/debug.c
+32
-0
src/debug.h
src/debug.h
+22
-0
src/decode.c
src/decode.c
+123
-0
src/encode.c
src/encode.c
+339
-0
src/fastq.c
src/fastq.c
+213
-0
src/global.mk
src/global.mk
+20
-0
src/indexinput.c
src/indexinput.c
+57
-0
src/indexoutput.c
src/indexoutput.c
+70
-0
src/littlebigman.c
src/littlebigman.c
+24
-0
src/load.c
src/load.c
+89
-0
src/lookfor.c
src/lookfor.c
+492
-0
src/malloc.c
src/malloc.c
+53
-0
src/orgasm.h
src/orgasm.h
+151
-0
src/orgasmi.c
src/orgasmi.c
+116
-0
src/sort.c
src/sort.c
+443
-0
No files found.
distutils.ext/obidistutils/__init__.py
0 → 100644
View file @
ee441f69
distutils.ext/obidistutils/command/__init__.py
0 → 100644
View file @
ee441f69
"""distutils.command.build_clib
Implements the Distutils 'build_clib' command, to build a C/C++ library
that is included in the module distribution and needed by an extension
module."""
__revision__
=
"$Id: build_clib.py 77704 2010-01-23 09:23:15Z tarek.ziade $"
# XXX this module has *lots* of code ripped-off quite transparently from
# build_ext.py -- not surprisingly really, as the work required to build
# a static library from a collection of C source files is not really all
# that different from what's required to build a shared object file from
# a collection of C source files. Nevertheless, I haven't done the
# necessary refactoring to account for the overlap in code between the
# two modules, mainly because a number of subtle details changed in the
# cut 'n paste. Sigh.
import
os
from
distutils.core
import
Command
from
distutils.errors
import
DistutilsSetupError
from
distutils.ccompiler
import
customize_compiler
from
distutils
import
log
def
show_compilers
():
from
distutils.ccompiler
import
show_compilers
show_compilers
()
class
build_cexe
(
Command
):
description
=
"build C/C++ executable distributed with Python extensions"
user_options
=
[
(
'build-cexe'
,
'x'
,
"directory to build C/C++ libraries to"
),
(
'build-temp'
,
't'
,
"directory to put temporary build by-products"
),
(
'debug'
,
'g'
,
"compile with debugging information"
),
(
'force'
,
'f'
,
"forcibly build everything (ignore file timestamps)"
),
(
'compiler='
,
'c'
,
"specify the compiler type"
),
]
boolean_options
=
[
'debug'
,
'force'
]
help_options
=
[
(
'help-compiler'
,
None
,
"list available compilers"
,
show_compilers
),
]
def
initialize_options
(
self
):
self
.
build_cexe
=
None
self
.
build_temp
=
None
# List of executables to build
self
.
executables
=
None
# Compilation options for all libraries
self
.
include_dirs
=
None
self
.
define
=
None
self
.
undef
=
None
self
.
debug
=
None
self
.
force
=
0
self
.
compiler
=
None
def
finalize_options
(
self
):
# This might be confusing: both build-cexe and build-temp default
# to build-temp as defined by the "build" command. This is because
# I think that C libraries are really just temporary build
# by-products, at least from the point of view of building Python
# extensions -- but I want to keep my options open.
self
.
set_undefined_options
(
'build'
,
(
'build_temp'
,
'build_cexe'
),
(
'build_temp'
,
'build_temp'
),
(
'compiler'
,
'compiler'
),
(
'debug'
,
'debug'
),
(
'force'
,
'force'
))
self
.
executables
=
self
.
distribution
.
executables
if
self
.
executables
:
self
.
check_executable_list
(
self
.
executables
)
if
self
.
include_dirs
is
None
:
self
.
include_dirs
=
self
.
distribution
.
include_dirs
or
[]
if
isinstance
(
self
.
include_dirs
,
str
):
self
.
include_dirs
=
self
.
include_dirs
.
split
(
os
.
pathsep
)
# XXX same as for build_ext -- what about 'self.define' and
# 'self.undef' ?
def
run
(
self
):
if
not
self
.
executables
:
return
# Yech -- this is cut 'n pasted from build_ext.py!
from
distutils.ccompiler
import
new_compiler
self
.
compiler
=
new_compiler
(
compiler
=
self
.
compiler
,
dry_run
=
self
.
dry_run
,
force
=
self
.
force
)
customize_compiler
(
self
.
compiler
)
if
self
.
include_dirs
is
not
None
:
self
.
compiler
.
set_include_dirs
(
self
.
include_dirs
)
if
self
.
define
is
not
None
:
# 'define' option is a list of (name,value) tuples
for
(
name
,
value
)
in
self
.
define
:
self
.
compiler
.
define_macro
(
name
,
value
)
if
self
.
undef
is
not
None
:
for
macro
in
self
.
undef
:
self
.
compiler
.
undefine_macro
(
macro
)
self
.
build_executables
(
self
.
executables
)
def
check_executable_list
(
self
,
executables
):
"""Ensure that the list of executables is valid.
`executable` is presumably provided as a command option 'executables'.
This method checks that it is a list of 2-tuples, where the tuples
are (executable_name, build_info_dict).
Raise DistutilsSetupError if the structure is invalid anywhere;
just returns otherwise.
"""
if
not
isinstance
(
executables
,
list
):
raise
DistutilsSetupError
,
\
"'executables' option must be a list of tuples"
for
exe
in
executables
:
if
not
isinstance
(
exe
,
tuple
)
and
len
(
exe
)
!=
2
:
raise
DistutilsSetupError
,
\
"each element of 'executables' must a 2-tuple"
name
,
build_info
=
exe
if
not
isinstance
(
name
,
str
):
raise
DistutilsSetupError
,
\
"first element of each tuple in 'executables' "
+
\
"must be a string (the executables name)"
if
'/'
in
name
or
(
os
.
sep
!=
'/'
and
os
.
sep
in
name
):
raise
DistutilsSetupError
,
\
(
"bad executable name '%s': "
+
"may not contain directory separators"
)
%
\
exe
[
0
]
if
not
isinstance
(
build_info
,
dict
):
raise
DistutilsSetupError
,
\
"second element of each tuple in 'executables' "
+
\
"must be a dictionary (build info)"
def
get_executable_names
(
self
):
# Assume the executables list is valid -- 'check_executable_list()' is
# called from 'finalize_options()', so it should be!
if
not
self
.
executables
:
return
None
exe_names
=
[]
for
(
exe_name
,
build_info
)
in
self
.
executables
:
exe_names
.
append
(
exe_name
)
return
exe_names
def
get_source_files
(
self
):
self
.
check_executable_list
(
self
.
executables
)
filenames
=
[]
for
(
exe_name
,
build_info
)
in
self
.
executables
:
sources
=
build_info
.
get
(
'sources'
)
if
sources
is
None
or
not
isinstance
(
sources
,
(
list
,
tuple
)):
raise
DistutilsSetupError
,
\
(
"in 'executables' option (library '%s'), "
"'sources' must be present and must be "
"a list of source filenames"
)
%
exe_name
filenames
.
extend
(
sources
)
return
filenames
def
build_executables
(
self
,
executables
):
for
(
exe_name
,
build_info
)
in
executables
:
sources
=
build_info
.
get
(
'sources'
)
if
sources
is
None
or
not
isinstance
(
sources
,
(
list
,
tuple
)):
raise
DistutilsSetupError
,
\
(
"in 'executables' option (library '%s'), "
+
"'sources' must be present and must be "
+
"a list of source filenames"
)
%
exe_name
sources
=
list
(
sources
)
log
.
info
(
"building '%s' library"
,
exe_name
)
# First, compile the source code to object files in the library
# directory. (This should probably change to putting object
# files in a temporary build directory.)
macros
=
build_info
.
get
(
'macros'
)
include_dirs
=
build_info
.
get
(
'include_dirs'
)
objects
=
self
.
compiler
.
compile
(
sources
,
output_dir
=
self
.
build_temp
,
macros
=
macros
,
include_dirs
=
include_dirs
,
debug
=
self
.
debug
)
# Now "link" the object files together into a static library.
# (On Unix at least, this isn't really linking -- it just
# builds an archive. Whatever.)
self
.
compiler
.
link_executable
(
objects
,
exe_name
,
output_dir
=
self
.
build_cexe
,
debug
=
self
.
debug
)
distutils.ext/obidistutils/command/build.py
0 → 100644
View file @
ee441f69
'''
Created on 20 oct. 2012
@author: coissac
'''
from
distutils.command.build
import
build
as
ori_build
class
build
(
ori_build
):
def
has_ctools
(
self
):
return
self
.
distribution
.
has_ctools
()
def
has_executables
(
self
):
return
self
.
distribution
.
has_executables
()
sub_commands
=
[(
'build_ctools'
,
has_ctools
),
(
'build_cexe'
,
has_executables
)]
\
+
ori_build
.
sub_commands
distutils.ext/obidistutils/command/build_cexe.py
0 → 100644
View file @
ee441f69
'''
Created on 20 oct. 2012
@author: coissac
'''
from
distutils.core
import
Command
import
os
from
distutils.ccompiler
import
customize_compiler
from
distutils.errors
import
DistutilsSetupError
from
distutils
import
log
##
#
# Completely inspired from the build_clib command
#
##
def
show_compilers
():
from
distutils.ccompiler
import
show_compilers
show_compilers
()
class
build_cexe
(
Command
):
description
=
"build C/C++ executable distributed with Python extensions"
user_options
=
[
(
'build-cexe'
,
'x'
,
"directory to build C/C++ libraries to"
),
(
'build-temp'
,
't'
,
"directory to put temporary build by-products"
),
(
'debug'
,
'g'
,
"compile with debugging information"
),
(
'force'
,
'f'
,
"forcibly build everything (ignore file timestamps)"
),
(
'compiler='
,
'c'
,
"specify the compiler type"
),
]
boolean_options
=
[
'debug'
,
'force'
]
help_options
=
[
(
'help-compiler'
,
None
,
"list available compilers"
,
show_compilers
),
]
def
initialize_options
(
self
):
self
.
build_cexe
=
None
self
.
build_temp
=
None
# List of executables to build
self
.
executables
=
None
# Compilation options for all libraries
self
.
include_dirs
=
None
self
.
define
=
None
self
.
undef
=
None
self
.
debug
=
None
self
.
force
=
0
self
.
compiler
=
None
def
finalize_options
(
self
):
# This might be confusing: both build-cexe and build-temp default
# to build-temp as defined by the "build" command. This is because
# I think that C libraries are really just temporary build
# by-products, at least from the point of view of building Python
# extensions -- but I want to keep my options open.
self
.
set_undefined_options
(
'build'
,
(
'build_scripts'
,
'build_cexe'
),
(
'build_temp'
,
'build_temp'
),
(
'compiler'
,
'compiler'
),
(
'debug'
,
'debug'
),
(
'force'
,
'force'
))
self
.
executables
=
self
.
distribution
.
executables
if
self
.
executables
:
self
.
check_executable_list
(
self
.
executables
)
if
self
.
include_dirs
is
None
:
self
.
include_dirs
=
self
.
distribution
.
include_dirs
or
[]
if
isinstance
(
self
.
include_dirs
,
str
):
self
.
include_dirs
=
self
.
include_dirs
.
split
(
os
.
pathsep
)
# XXX same as for build_ext -- what about 'self.define' and
# 'self.undef' ?
def
run
(
self
):
if
not
self
.
executables
:
return
self
.
mkpath
(
self
.
build_cexe
)
# Yech -- this is cut 'n pasted from build_ext.py!
from
distutils.ccompiler
import
new_compiler
self
.
compiler
=
new_compiler
(
compiler
=
self
.
compiler
,
dry_run
=
self
.
dry_run
,
force
=
self
.
force
)
customize_compiler
(
self
.
compiler
)
if
self
.
include_dirs
is
not
None
:
self
.
compiler
.
set_include_dirs
(
self
.
include_dirs
)
if
self
.
define
is
not
None
:
# 'define' option is a list of (name,value) tuples
for
(
name
,
value
)
in
self
.
define
:
self
.
compiler
.
define_macro
(
name
,
value
)
if
self
.
undef
is
not
None
:
for
macro
in
self
.
undef
:
self
.
compiler
.
undefine_macro
(
macro
)
self
.
build_executables
(
self
.
executables
)
def
check_executable_list
(
self
,
executables
):
"""Ensure that the list of executables is valid.
`executable` is presumably provided as a command option 'executables'.
This method checks that it is a list of 2-tuples, where the tuples
are (executable_name, build_info_dict).
Raise DistutilsSetupError if the structure is invalid anywhere;
just returns otherwise.
"""
if
not
isinstance
(
executables
,
list
):
raise
DistutilsSetupError
,
\
"'executables' option must be a list of tuples"
for
exe
in
executables
:
if
not
isinstance
(
exe
,
tuple
)
and
len
(
exe
)
!=
2
:
raise
DistutilsSetupError
,
\
"each element of 'executables' must a 2-tuple"
name
,
build_info
=
exe
if
not
isinstance
(
name
,
str
):
raise
DistutilsSetupError
,
\
"first element of each tuple in 'executables' "
+
\
"must be a string (the executables name)"
if
'/'
in
name
or
(
os
.
sep
!=
'/'
and
os
.
sep
in
name
):
raise
DistutilsSetupError
,
\
(
"bad executable name '%s': "
+
"may not contain directory separators"
)
%
\
exe
[
0
]
if
not
isinstance
(
build_info
,
dict
):
raise
DistutilsSetupError
,
\
"second element of each tuple in 'executables' "
+
\
"must be a dictionary (build info)"
def
get_executable_names
(
self
):
# Assume the executables list is valid -- 'check_executable_list()' is
# called from 'finalize_options()', so it should be!
if
not
self
.
executables
:
return
None
exe_names
=
[]
for
(
exe_name
,
build_info
)
in
self
.
executables
:
exe_names
.
append
(
exe_name
)
return
exe_names
def
get_source_files
(
self
):
self
.
check_executable_list
(
self
.
executables
)
filenames
=
[]
for
(
exe_name
,
build_info
)
in
self
.
executables
:
sources
=
build_info
.
get
(
'sources'
)
if
sources
is
None
or
not
isinstance
(
sources
,
(
list
,
tuple
)):
raise
DistutilsSetupError
,
\
(
"in 'executables' option (library '%s'), "
"'sources' must be present and must be "
"a list of source filenames"
)
%
exe_name
filenames
.
extend
(
sources
)
return
filenames
def
build_executables
(
self
,
executables
):
for
(
exe_name
,
build_info
)
in
executables
:
sources
=
build_info
.
get
(
'sources'
)
if
sources
is
None
or
not
isinstance
(
sources
,
(
list
,
tuple
)):
raise
DistutilsSetupError
,
\
(
"in 'executables' option (library '%s'), "
+
"'sources' must be present and must be "
+
"a list of source filenames"
)
%
exe_name
sources
=
list
(
sources
)
log
.
info
(
"building '%s' program"
,
exe_name
)
# First, compile the source code to object files in the library
# directory. (This should probably change to putting object
# files in a temporary build directory.)
macros
=
build_info
.
get
(
'macros'
)
include_dirs
=
build_info
.
get
(
'include_dirs'
)
objects
=
self
.
compiler
.
compile
(
sources
,
output_dir
=
self
.
build_tmp
,
macros
=
macros
,
include_dirs
=
include_dirs
,
debug
=
self
.
debug
)
# Now "link" the object files together into a static library.
# (On Unix at least, this isn't really linking -- it just
# builds an archive. Whatever.)
self
.
compiler
.
link_executable
(
objects
,
exe_name
,
output_dir
=
self
.
build_cexe
,
debug
=
self
.
debug
)
distutils.ext/obidistutils/command/build_ctools.py
0 → 100644
View file @
ee441f69
'''
Created on 20 oct. 2012
@author: coissac
'''
import
os
from
obidistutils.command.build_cexe
import
build_cexe
from
distutils.ccompiler
import
customize_compiler
from
distutils.errors
import
DistutilsSetupError
from
distutils
import
log
class
build_ctools
(
build_cexe
):
description
=
"build C/C++ executable not distributed with Python extensions"
def
initialize_options
(
self
):
build_cexe
.
initialize_options
(
self
)
# List of tools to build
self
.
ctools
=
None
self
.
build_ctools
=
None
def
finalize_options
(
self
):
# This might be confusing: both build-cexe and build-temp default
# to build-temp as defined by the "build" command. This is because
# I think that C libraries are really just temporary build
# by-products, at least from the point of view of building Python
# extensions -- but I want to keep my options open.
self
.
set_undefined_options
(
'build'
,
(
'build_temp'
,
'build_ctools'
),
(
'build_temp'
,
'build_temp'
),
(
'compiler'
,
'compiler'
),
(
'debug'
,
'debug'
),
(
'force'
,
'force'
))
self
.
ctools
=
self
.
distribution
.
ctools
if
self
.
ctools
:
self
.
check_executable_list
(
self
.
ctools
)
if
self
.
include_dirs
is
None
:
self
.
include_dirs
=
self
.
distribution
.
include_dirs
or
[]
if
isinstance
(
self
.
include_dirs
,
str
):
self
.
include_dirs
=
self
.
include_dirs
.
split
(
os
.
pathsep
)
# XXX same as for build_ext -- what about 'self.define' and
# 'self.undef' ?
def
run
(
self
):
if
not
self
.
ctools
:
return
# Yech -- this is cut 'n pasted from build_ext.py!
from
distutils.ccompiler
import
new_compiler
self
.
compiler
=
new_compiler
(
compiler
=
self
.
compiler
,
dry_run
=
self
.
dry_run
,
force
=
self
.
force
)
customize_compiler
(
self
.
compiler
)
if
self
.
include_dirs
is
not
None
:
self
.
compiler
.
set_include_dirs
(
self
.
include_dirs
)
if
self
.
define
is
not
None
:
# 'define' option is a list of (name,value) tuples
for
(
name
,
value
)
in
self
.
define
:
self
.
compiler
.
define_macro
(
name
,
value
)
if
self
.
undef
is
not
None
:
for
macro
in
self
.
undef
:
self
.
compiler
.
undefine_macro
(
macro
)
self
.
build_executables
(
self
.
ctools
)
def
build_executables
(
self
,
executables
):
for
(
exe_name
,
build_info
)
in
executables
:
sources
=
build_info
.
get
(
'sources'
)
if
sources
is
None
or
not
isinstance
(
sources
,
(
list
,
tuple
)):
raise
DistutilsSetupError
,
\
(
"in 'executables' option (library '%s'), "
+
"'sources' must be present and must be "
+
"a list of source filenames"
)
%
exe_name
sources
=
list
(
sources
)
log
.
info
(
"building '%s' program"
,
exe_name
)
# First, compile the source code to object files in the library
# directory. (This should probably change to putting object
# files in a temporary build directory.)
macros
=
build_info
.
get
(
'macros'
)
include_dirs
=
build_info
.
get
(
'include_dirs'
)
objects
=
self
.
compiler
.
compile
(
sources
,
output_dir
=
self
.
build_temp
,
macros
=
macros
,
include_dirs
=
include_dirs
,
debug
=
self
.
debug
)
# Now "link" the object files together into a static library.
# (On Unix at least, this isn't really linking -- it just
# builds an archive. Whatever.)
print
"coucou"
self
.
compiler
.
link_executable
(
objects
,
exe_name
,
output_dir
=
self
.
build_ctools
,
debug
=
self
.
debug
)
distutils.ext/obidistutils/command/build_filters.py
0 → 100644
View file @
ee441f69
'''
Created on 20 oct. 2012
@author: coissac
'''
from
obidistutils.command.build_scripts
import
build_scripts
class
build_filters
(
build_scripts
):
pass
distutils.ext/obidistutils/command/build_scripts.py
0 → 100644
View file @
ee441f69
'''
Created on 20 oct. 2012
@author: coissac
'''
import
os.path
from
distutils.command.build_scripts
import
build_scripts
as
ori_build_scripts
,
\
first_line_re
from
distutils.util
import
convert_path
from
distutils
import
log
,
sysconfig
from
distutils.dep_util
import
newer
from
stat
import
ST_MODE
class
build_scripts
(
ori_build_scripts
):
def
copy_scripts
(
self
):
"""Copy each script listed in 'self.scripts'; if it's marked as a
Python script in the Unix way (first line matches 'first_line_re',
ie. starts with "\#!" and contains "python"), then adjust the first
line to refer to the current Python interpreter as we copy.
"""
self
.
mkpath
(
self
.
build_dir
)
rawbuild_dir
=
os
.
path
.
join
(
os
.
path
.
dirname
(
self
.
build_dir
),
'raw_scripts'
)
self
.
mkpath
(
rawbuild_dir
)