Engee documentation

Linux

  • The Julia build requires GCC version 4.7 or later.

  • To use external shared libraries that are not on the system library search path, set the variables USE_SYSTEM_XXX=1 and LDFLAGS=-Wl,-rpath,/path/to/dir/contains/libXXX.so in the 'Make.user` file.

  • Instead of setting the variable LDFLAGS, you can also assign the library directory to the environment variable LD_LIBRARY_PATH (both at compile time and at runtime).

  • The USE_SYSTEM_* flags should be used with caution. They are intended only for troubleshooting, porting and packaging in close collaboration of package maintenance specialists with Julia developers to ensure that Julia builds correctly. Only officially provided binaries should be used for use in the production environment. Problems arising from the use of these flags, as a rule, are not accepted for consideration.

  • See also the section dedicated to external dependencies.

Setting up the architecture

To build Julia for a non-universal architecture, you can configure the ARCH' Makefile variable in the `Make.user' file. For additional parameters of the setting, such as `MARCH and JULIA_CPU_TARGET, see the corresponding section `Make.inc'.

For example, to build for a Pentium 4, set the variable MARCH=pentium4 and install the necessary system libraries for the layout. In Ubuntu, these can be, among other things, the libraries lib32gfortran-6-dev, lib32gcc1 and lib32stdc++6.

In addition, you can set MARCH=native and `Make.user' to get a build with maximum performance optimized for the CPU of the current computer.

Troubleshooting Linux builds

The problem Possible solution

OpenBLAS build failed

Set one of the following build parameters in 'Make.user` and repeat the build: <ul><li> OPENBLAS_TARGET_ARCH=BARCELONA (AMD CPU) or OPENBLAS_TARGET_ARCH=NEHALEM (Intel CPU)<ul>Set OPENBLAS_DYNAMIC_ARCH = 0' to disable compilation for multiple architectures in one binary the file.</ul></li><li> `OPENBLAS_NO_AVX2 = 1 disables the AVX2 instructions, which ensures the compilation of OpenBLAS with the parameter OPENBLAS_DYNAMIC_ARCH = 1 to use older versions of binutils. </li><li> With the value USE_SYSTEM_BLAS=1, the library libblas provided by the system is used. <ul><li>Set LIBBLAS=-lopenblas and LIBBLASNAME=libopenblas' to force the use of the OpenBLAS library provided by the system if multiple versions of BLAS are installed. </li></ul></li></ul><p>If you receive an error `../kernel/x86_64/dgemm_kernel_4x4_haswell.S:1709: Error:no such instruction: `vpermpd $0xb1,%ymm0,%ymm0', you must specify `OPENBLAS_DYNAMIC_ARCH =0 or OPENBLAS_NO_AVX2 = 1 or a newer version of binutils (2.18 or later) is required. (Issue # 7653)</p><p> If the linker cannot find gfortran' and the error `julia /usr/bin/x86_64-linux-gnu-ld: cannot find -lgfortran occurs, check the path using the gfortran -print-file-name=libgfortran.so ` and based on the output, perform an export like the following: `export LDFLAGS=-L/usr/lib/gcc/x86_64-linux-gnu/8/.</p>

Illegal Instruction error (Invalid instruction)

Check if the CPU supports AVX instructions, while the OS does not (for example, through virtualization, as described in https://github.com/JuliaLang/julia/issues/3263 [this problem]).