Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28619 Discussions

Fatal error in ld, terminated by segmentation violation

Wener
Beginner
1,738 Views

I have installed oneAPI Base Toolkit and HPC Toolkit in my WSL2 system.

The system information is 

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.5 LTS" 

The gcc version is: gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)

The compiler used is Interl Fortran compiler(classic) on the HPC Toolkit. So it is /opt/intel/oneapi/compiler/2021.2.0/linux/bin/intel64/ifort

As I had encoutered the ld problem with my own codes, I went back to the examples given in https://software.intel.com/content/www/us/en/develop/download/776979.html to check the fortran compiler. The same problems happened:

ifort -V src/driver.o src/matvec.o -o matvec
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.2.0 Build 20210228_000000
Copyright (C) 1985-2021 Intel Corporation. All rights reserved.

ifort: error #10106: Fatal error in ld, terminated by segmentation violation
Makefile:35: recipe for target 'matvec' failed
make: *** [matvec] Error 1

I found a solved post in the forum https://community.intel.com/t5/Intel-Fortran-Compiler/ld-fatal-error/td-p/1226358. But I now have oneAPI installed, which seems to be a more intergrated and last updated version. Do I really need to go backe to the parallel_studio_xe_2020 version to get rid of the ld problem?

The LD_PATH variable is  echo $LD_LIBRARY_PATH
/opt/intel/oneapi/vpl/2021.2.2/lib:/opt/intel/oneapi/tbb/2021.2.0/env/../lib/intel64/gcc4.8:/opt/intel/oneapi/mpi/2021.2.0//libfabric/lib:/opt/intel/oneapi/mpi/2021.2.0//lib/release:/opt/intel/oneapi/mpi/2021.2.0//lib:/opt/intel/oneapi/mkl/latest/lib/intel64:/opt/intel/oneapi/itac/2021.2.0/slib:/opt/intel/oneapi/ippcp/2021.2.0/lib/intel64:/opt/intel/oneapi/ipp/2021.2.0/lib/intel64:/opt/intel/oneapi/dnnl/2021.2.0/cpu_dpcpp_gpu_dpcpp/lib:/opt/intel/oneapi/debugger/10.1.1/dep/lib:/opt/intel/oneapi/debugger/10.1.1/libipt/intel64/lib:/opt/intel/oneapi/debugger/10.1.1/gdb/intel64/lib:/opt/intel/oneapi/dal/2021.2.0/lib/intel64:/opt/intel/oneapi/compiler/2021.2.0/linux/lib:/opt/intel/oneapi/compiler/2021.2.0/linux/lib/x64:/opt/intel/oneapi/compiler/2021.2.0/linux/lib/emu:/opt/intel/oneapi/compiler/2021.2.0/linux/lib/oclfpga/host/linux64/lib:/opt/intel/oneapi/compiler/2021.2.0/linux/lib/oclfpga/linux64/lib:/opt/intel/oneapi/compiler/2021.2.0/linux/compiler/lib/intel64_lin:/opt/intel/oneapi/compiler/2021.2.0/linux/compiler/lib:/opt/intel/oneapi/ccl/2021.2.0/lib/cpu_gpu_dpcpp

Does anygone have any solution to this problem?

WY

 

 

Labels (2)
0 Kudos
9 Replies
Steve_Lionel
Honored Contributor III
1,712 Views

You need to run the commands manually and see what the ld message said. There is no useful information in what you posted. Be aware that other posts of the same general symptom may be unrelated. If you need more help, you'll need to attach a test case that demonstrates the problem.

0 Kudos
Wener
Beginner
1,689 Views

You can find the test case in the attached file. The error messages are: 

ifort -V src/driver.o src/matvec.o -o matvec
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.2.0 Build 20210228_000000
Copyright (C) 1985-2021 Intel Corporation. All rights reserved.

ifort: error #10106: Fatal error in ld, terminated by segmentation violation
Makefile:35: recipe for target 'matvec' failed
make: *** [matvec] Error 1

0 Kudos
Wener
Beginner
1,680 Views

Or even an easy helloworld program gives me this problem. You can find the serial_hello.f90 in attached file and compile with the command:

ifort serial_hello.f90 -o serial_hello

The error message is 

ifort: error #10106: Fatal error in ld, terminated by segmentation violation

0 Kudos
mecej4
Honored Contributor III
1,672 Views

On your system, are you able to compile, link and run a C program using GCC? If not, that problem has to be solved before attempting to get Ifort to work.

0 Kudos
Wener
Beginner
1,669 Views

For the above serial_hello.f90 program, gfortran works and so does ifx. Only ifort produce the ld segmentation error. 

0 Kudos
andrew_4619
Honored Contributor III
1,667 Views

GETENV is not a Fortran command, it is a system extension. If you wish to use that in intel Fortran add USE IFPORT.  Read the help topic on GETENV, you may have linked to a GENENV in the C library runtime but the calling will probably be invalid.

0 Kudos
Wener
Beginner
1,663 Views

I can remove than line. I can just compile a program that aims to print a 'Hello world' (see the attached file). The same error takes place.

0 Kudos
mecej4
Honored Contributor III
1,653 Views

I do not know whether the following pertains to your installation of Ifort-Linux on WSL2, but I do remember that WSL1 did not support any 32-bit executables. Because of that, I could not use a Fortran compiler (LF 64 8.1) that generated 64-bit a.outs, but used a toolchain that included some 32-bit utility programs.

0 Kudos
andrew_4619
Honored Contributor III
1,655 Views

OK I only have windows so cannot help in detail with your OS but the problem suggests to me that your installation/environment/runtime are not correct. Maybe others can help. 

0 Kudos
Reply