-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.cross
63 lines (49 loc) · 2.57 KB
/
README.cross
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
Cross-compiling cado-nfs
It is possible to cross-compile cado-nfs. This has been tested only once,
as a mere curiosity check. This appeared to successfully compile. You may
wish to follow the instructions below, but nothing is guaranteed
concerning the results.
The following assumes that:
- you are building for a system which is called, say, SYSTEM. The
value of SYSTEM quite possibly *must* follow what is returned from
the GNU autotools config.guess program, although this has not been
verified.
- you have already built or obtained cross-compilers for the C and
C++ language, which are accessible from within your $PATH as
SYSTEM-cc, or SYSTEM-gcc, and SYSTEM-c++, or SYSTEM-g++.
- you have also already built the standard linker utilities such as
ld, and these are accessible as SYSTEM-ld
- the include files for SYSTEM-cc can be fetched from the directory
SYSTEM_ROOT, which serves as a virtual root for the host system.
- you have already cross-compiled the Gnu MP library into
SYSTEM_ROOT. Note that the gmp shared libraries must of course
eventually go to the shared system as well.
In all the example code below, be sure to substitute SYSTEM, SYSTEM-cc,
SYSTEM-c++, and SYSTEM_ROOT with the appropriate values. Also substitute
CADO_NFS_SOURCE_ROOT of course.
For cross-compiling cado, do the following:
export GF2X_CONFIGURE_EXTRA_FLAGS=--host=SYSTEM
export PREFIX=SYSTEM_ROOT/usr/local
(of course you may wish to choose another install path on the host
system ; see also README.shared for disabling shared libraries).
Create a file $HOME/SYSTEM-toolchain.cmake, containing the following:
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_VERSION 1)
SET(CMAKE_C_COMPILER SYSTEM-cc)
SET(CMAKE_CXX_COMPILER SYSTEM-c++)
SET(CMAKE_FIND_ROOT_PATH SYSTEM_ROOT)
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
Create a build directory outside of the cado-nfs source tree, and cd to
that directory. From there, do:
cmake -DCMAKE_TOOLCHAIN_FILE=$HOME/SYSTEM-toolchain.cmake CADO_NFS_SOURCE_ROOT
make
make install
Following this, once you copy the files under SYSTEM_ROOT/usr/local to
your target system, you should be able to run cado-nfs.py. Of course,
this assumes that all the *run-time* dependencies of cado-nfs are met
(python3, etc).
Issues with shared libraries (not only system ones, but those cado-nfs
builds and uses itself) are common. To prevent cado-nfs from building
shared libs, see README.shared.