Skip to content

Commit

Permalink
Fix libnexapow
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaolin1579 committed Dec 30, 2023
1 parent 54b5160 commit 01f5c1e
Show file tree
Hide file tree
Showing 7 changed files with 845 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
fetch-depth: 0
- name: Install Build dependencies
run: sudo apt-get install -y cmake build-essential libssl-dev pkg-config libboost-all-dev libsodium-dev libzmq5
run: sudo apt-get install -y cmake cmake ninja-build build-essential libssl-dev pkg-config libboost-all-dev libsodium-dev libzmq5 libgmp-dev
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ before_build:

build_script:
- # Install Linux build-dependencies
- sh: sudo apt-get update -y && sudo apt-get -y install cmake build-essential libssl-dev pkg-config libboost-all-dev libsodium-dev libzmq5 libgmp-dev
- sh: sudo apt-get update -y && sudo apt-get install -y cmake cmake ninja-build build-essential libssl-dev pkg-config libboost-all-dev libsodium-dev libzmq5 libgmp-dev
- # Publish
- cd Miningcore
- dotnet publish -c Release --framework net6.0
Expand Down
2 changes: 1 addition & 1 deletion src/Miningcore/build-libs-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ HAVE_AVX512F=$(../Native/check_cpu.sh avx512f && echo -DHAVE_AVX512F || echo)
export HAVE_FEATURE="$HAVE_AES $HAVE_SSE2 $HAVE_SSE3 $HAVE_SSSE3 $HAVE_AVX $HAVE_AVX2 $HAVE_AVX512F"

(cd ../Native/libmultihash && make -j clean && make -j) && mv ../Native/libmultihash/libmultihash.so "$OutDir"
(cd ../Native/libnexapow && rm -rf secp256k1 && git clone https://github.com/bitcoin-ABC/secp256k1) && (cd ../Native/libnexapow && make clean && make) && mv ../Native/libnexapow/libnexapow.so "$OutDir"
(cd ../Native/libetchash && make -j clean && make -j) && mv ../Native/libetchash/libetchash.so "$OutDir"
(cd ../Native/libethhash && make -j clean && make -j) && mv ../Native/libethhash/libethhash.so "$OutDir"
(cd ../Native/libethhashb3 && make -j clean && make -j) && mv ../Native/libethhashb3/libethhashb3.so "$OutDir"
Expand All @@ -36,5 +35,6 @@ export HAVE_FEATURE="$HAVE_AES $HAVE_SSE2 $HAVE_SSE3 $HAVE_SSSE3 $HAVE_AVX $HAVE
(cd ../Native/libverushash && make clean && make) && mv ../Native/libverushash/libverushash.so "$OutDir"


((cd /tmp && rm -rf secp256k1 && git clone https://github.com/bitcoin-ABC/secp256k1 && cd secp256k1 && git checkout 04fabb44590c10a19e35f044d11eb5058aac65b2 && mkdir build && cd build && cmake -GNinja .. -DCMAKE_C_FLAGS=-fPIC -DSECP256K1_ENABLE_MODULE_RECOVERY=OFF -DSECP256K1_ENABLE_COVERAGE=OFF -DSECP256K1_ENABLE_MODULE_SCHNORR=ON && ninja) && (cd ../Native/libnexapow && cp /tmp/secp256k1/build/libsecp256k1.a . && make clean && make) && mv ../Native/libnexapow/libnexapow.so "$OutDir")
((cd /tmp && rm -rf RandomX && git clone https://github.com/tevador/RandomX && cd RandomX && git checkout tags/v1.1.10 && mkdir build && cd build && cmake -DARCH=native .. && make -j) && (cd ../Native/librandomx && cp /tmp/RandomX/build/librandomx.a . && make -j clean && make -j) && mv ../Native/librandomx/librandomx.so "$OutDir")
((cd /tmp && rm -rf RandomARQ && git clone https://github.com/arqma/RandomARQ && cd RandomARQ && git checkout 14850620439045b319fa6398f5a164715c4a66ce && mkdir build && cd build && cmake -DARCH=native .. && make -j) && (cd ../Native/librandomarq && cp /tmp/RandomARQ/build/librandomx.a . && make -j clean && make -j) && mv ../Native/librandomarq/librandomarq.so "$OutDir")
25 changes: 9 additions & 16 deletions src/Native/libnexapow/Makefile
Original file line number Diff line number Diff line change
@@ -1,27 +1,20 @@
.PHONY: all clean clean-secp256k1 autoconf make-secp256k1

CFLAGS = -g -Wall -c -fPIC -O2 -Wno-pointer-sign -Wno-char-subscripts -Wno-unused-variable -Wno-unused-function -Wno-strict-aliasing -Wno-discarded-qualifiers -Wno-unused-const-variable $(CPU_FLAGS) $(HAVE_FEATURE)
CXXFLAGS = -g -Wall -fPIC -fpermissive -O2 -Wno-char-subscripts -Wno-unused-variable -Wno-unused-function -Wno-strict-aliasing -Wno-sign-compare -std=c++11 $(CPU_FLAGS) $(HAVE_FEATURE)
INC_DIRS = -I. -Isecp256k1/include
CFLAGS = -g -Wall -c -fPIC -O2 -Wno-pointer-sign -Wno-char-subscripts -Wno-unused-variable -Wno-unused-function -Wno-strict-aliasing -Wno-discarded-qualifiers -Wno-unused-const-variable $(CPU_FLAGS) $(HAVE_FEATURE) $(INC_DIRS)
CXXFLAGS = -g -Wall -fPIC -fpermissive -O2 -Wno-char-subscripts -Wno-unused-variable -Wno-unused-function -Wno-strict-aliasing -Wno-sign-compare -std=c++11 $(CPU_FLAGS) $(HAVE_FEATURE) $(INC_DIRS)
LDFLAGS = -shared
LDLIBS = -lgmp
TARGET = libnexapow.so

OBJECTS = exports.o schnorr.o

all: make-secp256k1 $(TARGET)
OBJECTS = exports.o \
schnorr.o

autoconf:
cd ./secp256k1; ./autogen.sh; export CC="gcc -fPIC"; ./configure --enable-module-schnorr;

make-secp256k1:
$(MAKE) -C ./secp256k1
all: $(TARGET)

$(TARGET): $(OBJECTS)
$(CXX) $(LDFLAGS) -o $@ $^ secp256k1/.libs/libsecp256k1.a $(LDLIBS)
$(CXX) $(LDFLAGS) -o $@ $^ libsecp256k1.a $(LDLIBS)

clean-secp256k1: autoconf
$(MAKE) -C ./secp256k1 clean
.PHONY: clean

clean: clean-secp256k1
clean:
$(RM) $(TARGET) $(OBJECTS)

7 changes: 0 additions & 7 deletions src/Native/libnexapow/build_secp256k1.sh

This file was deleted.

Loading

0 comments on commit 01f5c1e

Please sign in to comment.