MacBook Pro 编译支持CUDA的MSIEVE

之前试过在CentOS 6上编译GMP-ECM和MSIEVE,后来有一天发现本机的MacPorts带的GMP-ECM不是最新版,当前6.4.4的情况下,MacPorts里的才6.3. 顺道也想侥幸一下看看这个2012款的rmbp能不能上CUDA,于是开始折腾。 环境 MacBook Pro with Retina Display 2012 (GT 650 M) OS X 10.10.4 MacPorts 安装CUDA环境 CUDA Toolkit官方下载地址是:https://developer.nvidia.com/cuda-downloads 下载里目前最新版本是7.0.29,但是下载完成之后设置里还会提示有新版。 另外,Nvidia官方还给了个NVIDIA CUDA Getting Started Guide for Mac OS X. 我就简单地装了这个toolkit 没配环境变了。 第一次尝试 最早的尝试基于MacPorts自带的gmp和gmp-ecm编译CUDA版本的msieve,顺道还编译了个CPU版本的

这俩拿 RSA-39 的跑,都正常。但是自己生成了个RSA-256的,就有个ECM里报出的assert,没法工作。于是尝试编译ecm。 中间试过好几种方案,最后记录最后的版本 最新版 GMP, GMP-ECM, MSIEVE 最新版 GMP-ECM 也自带GPU的计算了,于是我也就把这个加了进去。 首先,从项目源上拉下最新版本

编译 GMP,原本是拉的最新release,但是中间遇到了一些问题,asm的编译不过去,于是也用trunk了。

编译 ECM

第一次configure的时候报当前系统不支持cuda,发现了个bug,报了官方,然后继续了,又发现这个错误: … Continue reading “MacBook Pro 编译支持CUDA的MSIEVE”

Build GMP-ECM on CentOS 6

1 Download GMP-ECM from http://ecm.gforge.inria.fr/ 2 Download GMP-5.1.1 from PUIAS: http://springdale.math.ias.edu/data/puias/computational/6/x86_64/ wget http://springdale.math.ias.edu/data/puias/6/x86_64/os/RPM-GPG-KEY-puias -P /etc/pki/rpm/ Just wget all gmp511-*.rpm and rpm -i 3 Build GMP-ECM ./configure … –with-gmp-include=/usr/local/gmp/5.1.1/include –with-gmp-lib=/usr/local/gmp/5.1.1/lib64 make 4 Build MSIEVE with ECM Edit Makefile, add -I and -L to GMP-ECM prefix/{lib,include} make 5 Add GMP-5.1.1 to ld.so.conf ldconfig 6 RUN msieve Incoming … Continue reading “Build GMP-ECM on CentOS 6”

Factoring Integer on OS X with CADO-NFS

Environment: Mac OS X 10.10, MacPorts 2.3.3, CADO-NFS 2.1.1 Dependencies Make sure all dependencies are installed. CADO-NFS Required software tools Required software tools GMP: usually installed in most Linux distributions (on some Linux distributions you need to install libgmp*-dev including gmp.h, which is not installed by default). Note: make sure to configure GMP with –enable-shared … Continue reading “Factoring Integer on OS X with CADO-NFS”

Collections: Integer factorization

Integer factorization: http://en.wikipedia.org/wiki/Integer_factorization In number theory, integer factorization or prime factorization is the decomposition of a composite number into smaller non-trivial divisors, which when multiplied together equal the original integer. msieve: http://sourceforge.net/projects/msieve/ Msieve is a C library implementing a suite of algorithms to factor large integers. It contains an implementation of the SIQS and GNFS … Continue reading “Collections: Integer factorization”