Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ jobs:

steps:
- uses: actions/checkout@v1
- name: autogen
run: ./autogen.sh
- name: configure
run: ./configure
- name: make
run: make
- name: make check
run: make check
- name: make test
run: make test
- name: install meson
run: |
sudo apt-get install -y python3-pip ninja-build python3-setuptools
sudo python3 -m pip install meson
- name: compile & test
run: |
meson build
cd build
ninja
sudo ninja install
sudo ldconfig
ninja test
144 changes: 144 additions & 0 deletions include/config_liberasurecode.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
/* include/config_liberasurecode.h.in. Generated from configure.ac by autoheader. */

/* Define to 1 if you have the `calloc' function. */
#mesondefine HAVE_CALLOC

/* Define to 1 if you have the <ctype.h> header file. */
#mesondefine HAVE_CTYPE_H

/* Define to 1 if you have the <dlfcn.h> header file. */
#mesondefine HAVE_DLFCN_H

/* Define to 1 if you have the <errno.h> header file. */
#mesondefine HAVE_ERRNO_H

/* Define to 1 if you have the `free' function. */
#mesondefine HAVE_FREE

/* Define to 1 if you have the <iconv.h> header file. */
#mesondefine HAVE_ICONV_H

/* Define to 1 if you have the <inttypes.h> header file. */
#mesondefine HAVE_INTTYPES_H

/* Define to 1 if you have the <limits.h> header file. */
#mesondefine HAVE_LIMITS_H

/* Define to 1 if you have the `malloc' function. */
#mesondefine HAVE_MALLOC

/* Define to 1 if you have the <malloc.h> header file. */
#mesondefine HAVE_MALLOC_H

/* Define to 1 if you have the <memory.h> header file. */
#mesondefine HAVE_MEMORY_H

/* Define to 1 if you have the `openlog' function. */
#mesondefine HAVE_OPENLOG

/* Define to 1 if you have the <pthread.h> header file. */
#mesondefine HAVE_PTHREAD_H

/* Define to 1 if you have the `realloc' function. */
#mesondefine HAVE_REALLOC

/* Define to 1 if you have the <signal.h> header file. */
#mesondefine HAVE_SIGNAL_H

/* Define to 1 if you have the <stdarg.h> header file. */
#mesondefine HAVE_STDARG_H

/* Define to 1 if you have the <stddef.h> header file. */
#mesondefine HAVE_STDDEF_H

/* Define to 1 if you have the <stdint.h> header file. */
#mesondefine HAVE_STDINT_H

/* Define to 1 if you have the <stdio.h> header file. */
#mesondefine HAVE_STDIO_H

/* Define to 1 if you have the <stdlib.h> header file. */
#mesondefine HAVE_STDLIB_H

/* Define to 1 if you have the <strings.h> header file. */
#mesondefine HAVE_STRINGS_H

/* Define to 1 if you have the <string.h> header file. */
#mesondefine HAVE_STRING_H

/* Define to 1 if you have the <syslog.h> header file. */
#mesondefine HAVE_SYSLOG_H

/* Define to 1 if you have the <sys/stat.h> header file. */
#mesondefine HAVE_SYS_STAT_H

/* Define to 1 if you have the <sys/types.h> header file. */
#mesondefine HAVE_SYS_TYPES_H

/* Define to 1 if you have the <unistd.h> header file. */
#mesondefine HAVE_UNISTD_H

/* Define to the sub-directory where libtool stores uninstalled libraries. */
#mesondefine LT_OBJDIR

/* Name of package */
#mesondefine PACKAGE

/* Define to the address where bug reports for this package should be sent. */
#mesondefine PACKAGE_BUGREPORT

/* Define to the full name of this package. */
#mesondefine PACKAGE_NAME

/* Define to the full name and version of this package. */
#mesondefine PACKAGE_STRING

/* Define to the one symbol short name of this package. */
#mesondefine PACKAGE_TARNAME

/* Define to the home page for this package. */
#mesondefine PACKAGE_URL

/* Define to the version of this package. */
#mesondefine PACKAGE_VERSION

/* The size of `long', as computed by sizeof. */
#mesondefine SIZEOF_LONG

/* Define to 1 if you have the ANSI C header files. */
#mesondefine STDC_HEADERS

/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
#mesondefine _ALL_SOURCE
#endif
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
#mesondefine _GNU_SOURCE
#endif
/* Enable threading extensions on Solaris. */
#ifndef _POSIX_PTHREAD_SEMANTICS
#mesondefine _POSIX_PTHREAD_SEMANTICS
#endif
/* Enable extensions on HP NonStop. */
#ifndef _TANDEM_SOURCE
#mesondefine _TANDEM_SOURCE
#endif
/* Enable general extensions on Solaris. */
#ifndef __EXTENSIONS__
#mesondefine __EXTENSIONS__
#endif


/* Version number of package */
#mesondefine VERSION

/* Define to 1 if on MINIX. */
#mesondefine _MINIX

/* Define to 2 if the system does not provide POSIX.1 features except with
this defined. */
#mesondefine _POSIX_1_SOURCE

/* Define to 1 if you need to in order for `stat' and other things to work. */
#mesondefine _POSIX_SOURCE
94 changes: 94 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
project('erasurecode', 'c', default_options : ['buildtype=debugoptimized', 'c_std=c11', 'optimization=2', 'werror=true'])

ec_inc = [include_directories('include/erasurecode', 'include/isa_l', 'include/rs_vand', 'include/xor_codes')]
# ec_files = [files('get_flags_from_cpuid.c')]
ec_files = []

c_compiler = meson.get_compiler('c')

flags = [['-mmmx','-DINTEL_MMX'],
['-msse', '-DINTEL_SSE'],
['-msse2','-DINTEL_SSE2'],['-msse3','-DINTEL_SSE3'],['-mssse3','-DINTEL_SSSE3'],['-msse4.1','-DINTEL_SSE41'],
['-msse4.2','-DINTEL_SSE42'],['-mavx','-DINTEL_AVX']]

optim_flags = []

foreach f : flags
if c_compiler.has_argument(f[0])
optim_flags += f
endif
endforeach

conf_data = configuration_data()
if c_compiler.has_function('calloc')
conf_data.set('HAVE_CALLOC', 1)
endif

if c_compiler.has_header('ctype.h')
conf_data.set('HAVE_CTYPE_H', '1')
endif

conf_data.set('HAVE_DLFCN_H', '1')
conf_data.set('HAVE_ERRNO_H', '1')
conf_data.set('HAVE_FREE', '1')
conf_data.set('HAVE_ICONV_H', '1')
conf_data.set('HAVE_INTTYPES_H', '1')
conf_data.set('HAVE_LIMITS_H', '1')
conf_data.set('HAVE_MALLOC', '1')
conf_data.set('HAVE_MEMORY_H', '1')
conf_data.set('HAVE_OPENLOG', '1')
conf_data.set('HAVE_PTHREAD_H', '1')
conf_data.set('HAVE_SIGNAL_H', '1')
conf_data.set('HAVE_STDARG_H', '1')
conf_data.set('HAVE_STDDEF_H', '1')
conf_data.set('HAVE_STDINT_H', '1')
conf_data.set('HAVE_STDIO_H', '1')
conf_data.set('HAVE_REALLOC', '1')
conf_data.set('HAVE_STRINGS_H', '1')
conf_data.set('HAVE_STRING_H', '1')
conf_data.set('HAVE_UNISTD_H', '1')
conf_data.set('HAVE_STDLIB_H', '1')
conf_data.set('HAVE_SYSLOG_H', '1')
conf_data.set('HAVE_SYS_STAT_H', '1')
conf_data.set('HAVE_SYS_TYPES_H', '1')
conf_data.set('STDC_HEADERS', '1')
conf_data.set('_ALL_SOURCE', '1')
conf_data.set('_POSIX_PTHREAD_SEMANTICS', '1')
conf_data.set('_TANDEM_SOURCE', '1')
conf_data.set('__EXTENSIONS__', '1')
conf_data.set_quoted('PACKAGE', 'liberasurecode')
conf_data.set_quoted('PACKAGE_BUGREPORT', 'tusharsg AT gmail DOT com, kmgreen2 AT gmail DOT com')
conf_data.set_quoted('PACKAGE_NAME', 'liberasurecode')
conf_data.set_quoted('PACKAGE_STRING', 'liberasurecode -')
conf_data.set_quoted('PACKAGE_TARNAME', 'liberasurecode')
conf_data.set_quoted('PACKAGE_URL', 'https://github.com/openstack/liberasurecode')
conf_data.set('SIZEOF_LONG', '8')
conf_data.set('_GNU_SOURCE', '1')
conf_data.set_quoted('VERSION', '-')
conf_data.set_quoted('PACKAGE_VERSION', '-')

inc = configure_file(input : 'include/config_liberasurecode.h.in',
output : 'config_liberasurecode.h',
configuration : conf_data)

ec_inc += [include_directories('.')]

c_args = ['-D_GNU_SOURCE=1', '-pedantic']
c_args += optim_flags

subdir('src')

zlib_dep = c_compiler.find_library('z')
m_dep = c_compiler.find_library('m')
dl_dep = c_compiler.find_library('dl')
threads_dep = dependency('threads')
ec_deps = [zlib_dep, m_dep, dl_dep, threads_dep]

ec_lib = library('erasurecode', ec_files + [inc], include_directories: ec_inc, dependencies: ec_deps, c_args: c_args, install: true, soversion: 1)

ec_dep = declare_dependency(link_with : ec_lib, dependencies: ec_deps,
include_directories : ec_inc)

liberasurecode_test = executable('liberasurecode_test', files('test/liberasurecode_test.c'), dependencies: [ec_dep])

test('liberasurecode_test', liberasurecode_test)
5 changes: 5 additions & 0 deletions src/backends/isa-l/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ec_files += [files(
'isa_l_common.c',
'isa_l_rs_cauchy.c',
'isa_l_rs_vand.c',
)]
4 changes: 4 additions & 0 deletions src/backends/jerasure/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ec_files += [files(
'jerasure_rs_cauchy.c',
'jerasure_rs_vand.c',
)]
10 changes: 10 additions & 0 deletions src/backends/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
subdir('isa-l')

subdir('jerasure')
subdir('null')
subdir('phazrio')

subdir('rs_vand')
subdir('shss')

subdir('xor')
3 changes: 3 additions & 0 deletions src/backends/null/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ec_files += [files(
'null.c',
)]
3 changes: 3 additions & 0 deletions src/backends/phazrio/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ec_files += [files(
'libphazr.c',
)]
3 changes: 3 additions & 0 deletions src/backends/rs_vand/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ec_files += [files(
'liberasurecode_rs_vand.c',
)]
3 changes: 3 additions & 0 deletions src/backends/shss/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ec_files += [files(
'shss.c',
)]
3 changes: 3 additions & 0 deletions src/backends/xor/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ec_files += [files(
'flat_xor_hd.c',
)]
4 changes: 4 additions & 0 deletions src/builtin/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
subdir('null_code')
subdir('rs_vand')
subdir('xor_codes')

3 changes: 3 additions & 0 deletions src/builtin/null_code/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
library('nullcode', [files(
'null_code.c',
)], soversion: 1, install: true, c_args: c_args)
2 changes: 2 additions & 0 deletions src/builtin/rs_vand/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
library('erasurecode_rs_vand', files('liberasurecode_rs_vand.c', 'rs_galois.c'), include_directories: ec_inc, c_args: c_args, soversion: 1, install: true)
# library('erasurecode_rs_galois', files('rs_galois.c'), include_directories: ec_inc)
9 changes: 9 additions & 0 deletions src/builtin/xor_codes/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ec_files += [files(
'xor_code.c',
'xor_hd_code.c',
)]

library('Xorcode', files(
'xor_code.c',
'xor_hd_code.c',
), include_directories: ec_inc, c_args: c_args, soversion: 1, install: true)
12 changes: 12 additions & 0 deletions src/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
message('dump')
# message(ec_files)

ec_files += [files('erasurecode.c',
'erasurecode_helpers.c',
'erasurecode_postprocessing.c',
'erasurecode_preprocessing.c',
)]

subdir('backends')
subdir('builtin')
subdir('utils')
1 change: 1 addition & 0 deletions src/utils/chksum/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ec_files += [files('alg_sig.c', 'crc32.c', 'md5.c')]
1 change: 1 addition & 0 deletions src/utils/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
subdir('chksum')