Skip to content
Snippets Groups Projects
Commit e7be7573 authored by Radek Hušek's avatar Radek Hušek Committed by Radek Hušek
Browse files

Clean up option definitions

parent 856526e7
No related branches found
No related tags found
No related merge requests found
default: groupConnectivity.so clean_obj default: groupConnectivity.so clean_obj
groupConnectivity.so: groupConnectivity.pyx group-connectivity.h setup.py compileTimeOptions.h rings.h fast-array.h parmap.py groupConnectivity.so: groupConnectivity.pyx group-connectivity.h setup.py compileTimeOptions.h generateCompileTimeOptions.sh rings.h fast-array.h parmap.py
./generateCompileTimeOptions.sh > options.h
python setup.py build_ext python setup.py build_ext
cp build/lib*/groupConnectivity.so . cp build/lib*/groupConnectivity.so .
clean_obj: clean_obj:
rm -f *.o groupConnectivity.cpp rm -f *.o groupConnectivity.cpp options.h
rm -rf build rm -rf build
clean: clean_obj clean: clean_obj
......
#ifndef __COMPILE_TIME_OPTIONS_H__ #error "DON'T include directly"
#define __COMPILE_TIME_OPTIONS_H__
// bool; use vector<bool> instead of vector<size_t> for classes // bool; use vector<bool> instead of vector<size_t> for classes
#ifndef SAVE_MEMORY BOOL_OPTION(SAVE_MEMORY, 1)
#define SAVE_MEMORY 1
#endif
#if SAVE_MEMORY
#pragma message "SAVE_MEMORY ON"
#else
#pragma message "SAVE_MEMORY off"
#endif
BOOL_OPTION(OPTIMIZED_MAPPINGS, 1)
#ifndef OPTIMIZED_MAPPINGS BOOL_OPTION(OPTIMIZE_COMBINE, 0)
#define OPTIMIZED_MAPPINGS 1
#endif
#if OPTIMIZED_MAPPINGS
#pragma message "OPTIMIZED_MAPPINGS ON"
#else
#pragma message "OPTIMIZED_MAPPINGS off"
#endif
#ifndef OPTIMIZE_COMBINE
#define OPTIMIZE_COMBINE 0
#endif
#if OPTIMIZE_COMBINE
#pragma message "OPTIMIZE_COMBINE ON"
#else
#pragma message "OPTIMIZE_COMBINE off"
#endif
#ifndef USE_NEXT_FORB
#define USE_NEXT_FORB 1
#endif
#if USE_NEXT_FORB
#pragma message "USE_NEXT_FORB ON"
#else
#pragma message "USE_NEXT_FORB off"
#endif
BOOL_OPTION(USE_NEXT_FORB, 1)
#ifndef MAX_EDGES #ifndef MAX_EDGES
#define MAX_EDGES 48 #define MAX_EDGES 48
#endif #endif
#endif
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#define __FAST_ARRAY_H__ #define __FAST_ARRAY_H__
#include "rings.h" #include "rings.h"
#include "options.h"
template < typename Ring > template < typename Ring >
struct Mapping { struct Mapping {
......
#!/bin/bash
cat <<EOF
#ifndef __COMPILE_TIME_OPTIONS_H__
#define __COMPILE_TIME_OPTIONS_H__
EOF
tail -n +2 compileTimeOptions.h |
sed -re 's/BOOL_OPTION\((.*), *(.*)\)/#ifndef \1\
#define \1 \2\
#endif\
#if \1\
#pragma message "\1 ON"\
#else\
#pragma message "\1 off"\
#endif\
/'
cat <<EOF
#endif
EOF
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#define __GROUP_CONNECTIVITY_H__ #define __GROUP_CONNECTIVITY_H__
#include <vector> #include <vector>
#include "compileTimeOptions.h" #include "options.h"
#include "rings.h" #include "rings.h"
#include "fast-array.h" #include "fast-array.h"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment