10gic / vanitygen-plusplus

A vanity address generator for BTC, ETH, LTC, TRX and 100+ more crypto currencies.
GNU Affero General Public License v3.0
248 stars 90 forks source link

Building fails #45

Closed K0-RR closed 1 year ago

K0-RR commented 1 year ago

Here is my log from Linux Mint.

cc -ggdb -O3 -Wall   -c -o vanitygen.o vanitygen.c
cc -ggdb -O3 -Wall   -c -o pattern.o pattern.c
cc -ggdb -O3 -Wall   -c -o util.o util.c
cc -ggdb -O3 -Wall   -c -o groestl.o groestl.c
cc -ggdb -O3 -Wall   -c -o sha3.o sha3.c
cc -ggdb -O3 -Wall   -c -o ed25519.o ed25519.c
cc -ggdb -O3 -Wall   -c -o stellar.o stellar.c
cc -ggdb -O3 -Wall   -c -o base32.o base32.c
cc -ggdb -O3 -Wall   -c -o crc16.o crc16.c
cc -ggdb -O3 -Wall   -c -o simplevanitygen.o simplevanitygen.c
cc -ggdb -O3 -Wall   -c -o bech32.o bech32.c
cc -ggdb -O3 -Wall   -c -o segwit_addr.o segwit_addr.c
cc vanitygen.o pattern.o util.o groestl.o sha3.o ed25519.o stellar.o base32.o crc16.o simplevanitygen.o bech32.o segwit_addr.o -o vanitygen++ -ggdb -O3 -Wall -lpcre -lcrypto -lm -lpthread
cc -ggdb -O3 -Wall   -c -o keyconv.o keyconv.c
cc keyconv.o util.o groestl.o sha3.o -o keyconv -ggdb -O3 -Wall -lpcre -lcrypto -lm -lpthread
cc -ggdb -O3 -Wall   -c -o oclvanitygen.o oclvanitygen.c
cc -ggdb -O3 -Wall   -c -o oclengine.o oclengine.c
In file included from /usr/include/CL/cl.h:32,
                 from oclengine.c:43:
/usr/include/CL/cl_version.h:34:9: note: #pragma message: cl_version.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 220 (OpenCL 2.2)
   34 | #pragma message("cl_version.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 220 (OpenCL 2.2)")
      |         ^~~~~~~
oclengine.c: In function ‘vg_ocl_dump_info’:
oclengine.c:346:37: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘cl_ulong’ {aka ‘long unsigned int’} [-Wformat=]
  346 |  fprintf(stderr, "Global memory: %llu\n",
      |                                  ~~~^
      |                                     |
      |                                     long long unsigned int
      |                                  %lu
  347 |         vg_ocl_device_getulong(did, CL_DEVICE_GLOBAL_MEM_SIZE));
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |         |
      |         cl_ulong {aka long unsigned int}
oclengine.c:348:38: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘cl_ulong’ {aka ‘long unsigned int’} [-Wformat=]
  348 |  fprintf(stderr, "Max allocation: %llu\n",
      |                                   ~~~^
      |                                      |
      |                                      long long unsigned int
      |                                   %lu
  349 |         vg_ocl_device_getulong(did, CL_DEVICE_MAX_MEM_ALLOC_SIZE));
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |         |
      |         cl_ulong {aka long unsigned int}
cc oclvanitygen.o oclengine.o pattern.o util.o groestl.o sha3.o -o oclvanitygen++ -ggdb -O3 -Wall -lpcre -lcrypto -lm -lpthread -lOpenCL
/usr/bin/ld: cannot find -lOpenCL
collect2: error: ld returned 1 exit status
make: *** [Makefile:42: oclvanitygen++] Error 1
Error: Process completed with exit code 2.
K0-RR commented 1 year ago

Same issue on Fedora 36

10gic commented 1 year ago

It looks like you don't have the OpenCL library installed. Please install it firstly, before building oclvanitygen++. If you just need vanitygen++ (It does not depend on the OpenCL library), you can just run make instead of make all.

K0-RR commented 1 year ago

I tried only make and now I'm getting this error:

~/vanitygen-plusplus$ make
cc -ggdb -O3 -Wall   -c -o vanitygen.o vanitygen.c
vanitygen.c: In function ‘vg_thread_loop’:
vanitygen.c:83:9: warning: ‘EC_KEY_get0_group’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
   83 |         pgroup = EC_KEY_get0_group(pkey);
      |         ^~~~~~
In file included from vanitygen.c:28:
/usr/include/openssl/ec.h:1034:39: note: declared here
 1034 | OSSL_DEPRECATEDIN_3_0 const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key);
      |                                       ^~~~~~~~~~~~~~~~~
vanitygen.c:102:9: warning: ‘EC_POINT_make_affine’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
  102 |         EC_POINT_make_affine(pgroup, pbatchinc, vxcp->vxc_bnctx);
      |         ^~~~~~~~~~~~~~~~~~~~
In file included from vanitygen.c:28:
/usr/include/openssl/ec.h:844:27: note: declared here
  844 | OSSL_DEPRECATEDIN_3_0 int EC_POINT_make_affine(const EC_GROUP *group,
      |                           ^~~~~~~~~~~~~~~~~~~~
vanitygen.c:132:25: warning: ‘EC_KEY_generate_key’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
  132 |                         EC_KEY_generate_key(pkey);
      |                         ^~~~~~~~~~~~~~~~~~~
In file included from vanitygen.c:28:
/usr/include/openssl/ec.h:1101:27: note: declared here
 1101 | OSSL_DEPRECATEDIN_3_0 int EC_KEY_generate_key(EC_KEY *key);
      |                           ^~~~~~~~~~~~~~~~~~~
vanitygen.c:135:33: warning: ‘EC_KEY_get0_private_key’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
  135 |                                 BIGNUM *pkbn = BN_dup(EC_KEY_get0_private_key(pkey));
      |                                 ^~~~~~
In file included from vanitygen.c:28:
/usr/include/openssl/ec.h:1048:37: note: declared here
 1048 | OSSL_DEPRECATEDIN_3_0 const BIGNUM *EC_KEY_get0_private_key(const EC_KEY *key);
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~
vanitygen.c:145:33: warning: ‘EC_KEY_set_private_key’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
  145 |                                 EC_KEY_set_private_key(pkey, pkbn); /* set private key in pkey */
      |                                 ^~~~~~~~~~~~~~~~~~~~~~
In file included from vanitygen.c:28:
/usr/include/openssl/ec.h:1056:27: note: declared here
 1056 | OSSL_DEPRECATEDIN_3_0 int EC_KEY_set_private_key(EC_KEY *key, const BIGNUM *prv);
      |                           ^~~~~~~~~~~~~~~~~~~~~~
vanitygen.c:152:33: warning: ‘EC_KEY_set_public_key’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
  152 |                                 EC_KEY_set_public_key(pkey, origin); /* set public key in pkey */
      |                                 ^~~~~~~~~~~~~~~~~~~~~
In file included from vanitygen.c:28:
/usr/include/openssl/ec.h:1070:27: note: declared here
 1070 | OSSL_DEPRECATEDIN_3_0 int EC_KEY_set_public_key(EC_KEY *key, const EC_POINT *pub);
      |                           ^~~~~~~~~~~~~~~~~~~~~
vanitygen.c:161:32: warning: ‘EC_KEY_get0_private_key’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
  161 |                                EC_KEY_get0_private_key(pkey));
      |                                ^~~~~~~~~~~~~~~~~~~~~~~
In file included from vanitygen.c:28:
/usr/include/openssl/ec.h:1048:37: note: declared here
 1048 | OSSL_DEPRECATEDIN_3_0 const BIGNUM *EC_KEY_get0_private_key(const EC_KEY *key);
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~
vanitygen.c:167:25: warning: ‘EC_KEY_get0_public_key’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
  167 |                         EC_POINT_copy(ppnt[0], EC_KEY_get0_public_key(pkey));
      |                         ^~~~~~~~~~~~~
In file included from vanitygen.c:28:
/usr/include/openssl/ec.h:1062:39: note: declared here
 1062 | OSSL_DEPRECATEDIN_3_0 const EC_POINT *EC_KEY_get0_public_key(const EC_KEY *key);
      |                                       ^~~~~~~~~~~~~~~~~~~~~~
vanitygen.c:223:17: warning: ‘EC_POINTs_make_affine’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
  223 |                 EC_POINTs_make_affine(pgroup, nbatch, ppnt, vxcp->vxc_bnctx);
      |                 ^~~~~~~~~~~~~~~~~~~~~
In file included from vanitygen.c:28:
/usr/include/openssl/ec.h:846:27: note: declared here
  846 | OSSL_DEPRECATEDIN_3_0 int EC_POINTs_make_affine(const EC_GROUP *group, size_t num,
      |                           ^~~~~~~~~~~~~~~~~~~~~
vanitygen.c:238:33: warning: ‘RIPEMD160’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
  238 |                                 RIPEMD160(hash1, sizeof(hash1), &vxcp->vxc_binres[1]);
      |                                 ^~~~~~~~~
In file included from vanitygen.c:27:
/usr/include/openssl/ripemd.h:49:38: note: declared here
   49 | OSSL_DEPRECATEDIN_3_0 unsigned char *RIPEMD160(const unsigned char *d, size_t n,
      |                                      ^~~~~~~~~
vanitygen.c: In function ‘main’:
vanitygen.c:517:33: warning: ‘EC_KEY_get0_group’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
  517 |                                 EC_KEY_get0_group(pkey),
      |                                 ^~~~~~~~~~~~~~~~~
In file included from vanitygen.c:28:
/usr/include/openssl/ec.h:1034:39: note: declared here
 1034 | OSSL_DEPRECATEDIN_3_0 const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key);
      |                                       ^~~~~~~~~~~~~~~~~
vanitygen.c:519:25: warning: ‘EC_KEY_free’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
  519 |                         EC_KEY_free(pkey);
      |                         ^~~~~~~~~~~
In file included from vanitygen.c:28:
/usr/include/openssl/ec.h:1003:28: note: declared here
 1003 | OSSL_DEPRECATEDIN_3_0 void EC_KEY_free(EC_KEY *key);
      |                            ^~~~~~~~~~~
cc -ggdb -O3 -Wall   -c -o pattern.o pattern.c
pattern.c:32:10: fatal error: pcre.h: No such file or directory
   32 | #include <pcre.h>
      |          ^~~~~~~~
compilation terminated.
make: *** [<builtin>: pattern.o] Error 1
10gic commented 1 year ago

Try install pcre library: sudo apt-get install libpcre3-dev. # Debian, Ubuntu, etc sudo yum install pcre-devel # CentOS, Redhat, etc

See: https://stackoverflow.com/questions/22555561/error-building-fatal-error-pcre-h-no-such-file-or-directory

K0-RR commented 1 year ago

That fixed compiling vanitygen, thanks. For oclvanity I was getting this error

oclengine.c:43:10: fatal error: CL/cl.h: No such file or directory
   43 | #include <CL/cl.h>

and after following this guide I fixed it using sudo ln -s /usr/lib/x86_64-linux-gnu/libOpenCL.so.1 /usr/lib/libOpenCL.so. Not sure why I needed this random command and I'm not a fan of blankly copy-pasting something from the internet but that probably had nothing to do with your code so closing.