Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build fixes #13

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
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
44 changes: 14 additions & 30 deletions Build-gcc/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ RM := rm
-include subdir.mk
-include objects.mk

DEBUG_FLAGS= -g
CXXFLAGS= -std=c++11 -fopenmp -I/opt/local/include -I/usr/local/include -Wall -fpic
LDFLAGS= -L /opt/local/lib -L /usr/local/lib


ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(C++_DEPS)),)
-include $(C++_DEPS)
Expand All @@ -35,53 +40,32 @@ endif

-include ../makefile.defs

.DEFAULT_GOAL := libzerocoin
.DEFAULT_GOAL := libzerocoin.so

# Add inputs and outputs from these tool invocations to the build variables

# All Target
all: libzerocoin test tutorial
all: libzerocoin.so test tutorial

# Tool invocations
libzerocoin: $(OBJS) $(USER_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: Cross G++ Linker'
g++ -fopenmp -L/opt/local/lib -shared -o "libzerocoin.so" $(OBJS) $(USER_OBJS) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '
libzerocoin.so: $(OBJS) $(USER_OBJS)
${CXX} ${LDFLAGS} -shared -o "libzerocoin.so" $(OBJS) $(USER_OBJS) $(LIBS)

test: $(OBJS) $(USER_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: Cross G++ Linker'
g++ -fopenmp -L/opt/local/lib -o "tests" ../Tests.cpp $(OBJS) $(USER_OBJS) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '
${CXX} ${LDFLAGS} -o "tests" ../Tests.cpp $(OBJS) $(USER_OBJS) $(LIBS)

paramgen: $(OBJS) $(USER_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: Cross G++ Linker'
g++ -fopenmp -L/opt/local/lib -o "paramgen" ../paramgen.cpp $(OBJS) $(USER_OBJS) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '
${CXX} ${LDFLAGS} -o "paramgen" ../paramgen.cpp $(OBJS) $(USER_OBJS) $(LIBS)

benchmark: $(OBJS) $(USER_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: Cross G++ Linker'
g++ -fopenmp -L/opt/local/lib -o "benchmark" ../Benchmark.cpp $(OBJS) $(USER_OBJS) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '
${CXX} ${LDFLAGS} -o "benchmark" ../Benchmark.cpp $(OBJS) $(USER_OBJS) $(LIBS)

tutorial: $(OBJS) $(USER_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: Cross G++ Linker'
g++ -fopenmp -L/opt/local/lib -o "tutorial" ../Tutorial.cpp $(OBJS) $(USER_OBJS) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '
${CXX} ${LDFLAGS} -o "tutorial" ../Tutorial.cpp $(OBJS) $(USER_OBJS) $(LIBS)

# Other Targets
clean:
-$(RM) $(C++_DEPS)$(OBJS)$(C_DEPS)$(CC_DEPS)$(LIBRARIES)$(CPP_DEPS)$(CXX_DEPS)$(C_UPPER_DEPS) libzerocoin.so tests benchmark paramgen
-@echo ' '
-$(RM) -f $(C++_DEPS)$(OBJS)$(C_DEPS)$(CC_DEPS)$(LIBRARIES)$(CPP_DEPS)$(CXX_DEPS)$(C_UPPER_DEPS) libzerocoin.so tests benchmark paramgen

.PHONY: all clean dependents
.SECONDARY:
Expand Down
2 changes: 1 addition & 1 deletion Build-gcc/objects.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

USER_OBJS :=

LIBS := -I/opt/local/include -lboost_system-mt -lcrypto
LIBS := -I/opt/local/include -lboost_system -lcrypto

6 changes: 1 addition & 5 deletions Build-gcc/subdir.mk
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ CPP_DEPS += \

# Each subdirectory must supply rules for building sources it contributes
%.o: ../%.cpp
@echo 'Building file: $<'
@echo 'Invoking: Cross G++ Compiler'
g++ -fopenmp -g -L/opt/local/lib -I/opt/local/include -g -Wall -fpic -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '
${CXX} ${CXXFLAGS} ${DEBUG_FLAGS} -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"


13 changes: 0 additions & 13 deletions bitcoin_bignum/serialize.h
Original file line number Diff line number Diff line change
Expand Up @@ -895,19 +895,6 @@ class CDataStream
iterator insert(iterator it, const char& x=char()) { return vch.insert(it, x); }
void insert(iterator it, size_type n, const char& x) { vch.insert(it, n, x); }

void insert(iterator it, const_iterator first, const_iterator last)
{
assert(last - first >= 0);
if (it == vch.begin() + nReadPos && (unsigned int)(last - first) <= nReadPos)
{
// special case for inserting at the front when there's room
nReadPos -= (last - first);
memcpy(&vch[nReadPos], &first[0], last - first);
}
else
vch.insert(it, first, last);
}

void insert(iterator it, std::vector<char>::const_iterator first, std::vector<char>::const_iterator last)
{
assert(last - first >= 0);
Expand Down