Re: [Anl-intel-csa] building a mix of C and Fortran files (file not recognized: File truncated clang-6.0: error: csa-ld command failed with exit code 1 (use -v to see invocation))
This looks like a compiler problem. Pablo, I've put it into Jira as CMPLRS-49490 and assigned it to you. From: Jin, Zheming [mailto:[email protected]] Sent: Tuesday, March 27, 2018 4:46 PM To: Tannenbaum, Barry M <[email protected]>; Narayanaswamy, Ravi <[email protected]>; [email protected] Subject: Re: [Anl-intel-csa] building a mix of C and Fortran files (file not recognized: File truncated clang-6.0: error: csa-ld command failed with exit code 1 (use -v to see invocation)) Hi Barry, Thank you very much for your answers! When I compile a Fortran file with -fopenmp-targets=csa, it produces segfault. Am I right ? Thanks, /soft/restricted/intel_csa/comp/tools/2018-02-21-release/tools/install/bin/clang -O3 -fopenmp -fopenmp-targets=csa -c -o rhs4th3fortsgstr.o rhs4th3fortsgstr.f #0 0x000000000313d478 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/soft/restricted/intel_csa/comp/tools/2018-02-21-release/tools/install/bin/clang+0x313d478) #1 0x000000000313d509 PrintStackTraceSignalHandler(void*) (/soft/restricted/intel_csa/comp/tools/2018-02-21-release/tools/install/bin/clang+0x313d509) #2 0x000000000313b99c llvm::sys::RunSignalHandlers() (/soft/restricted/intel_csa/comp/tools/2018-02-21-release/tools/install/bin/clang+0x313b99c) #3 0x000000000313cd5f SignalHandler(int) (/soft/restricted/intel_csa/comp/tools/2018-02-21-release/tools/install/bin/clang+0x313cd5f) #4 0x00007f0c851525e0 __restore_rt (/usr/lib64/libpthread.so.0+0xf5e0) #5 0x0000000001e59d9c llvm::Twine::Twine(char const*) (/soft/restricted/intel_csa/comp/tools/2018-02-21-release/tools/install/bin/clang+0x1e59d9c) #6 0x00000000038c4e80 clang::driver::tools::OffloadBundler::ConstructJobMultipleOutputs(clang::driver::Compilation&, clang::driver::JobAction const&, llvm::SmallVector<clang::driver::InputInfo, 4u> const&, llvm::SmallVector<clang::driver::InputInfo, 4u> const&, llvm::opt::ArgList const&, char const*) const (/soft/restricted/intel_csa/comp/tools/2018-02-21-release/tools/install/bin/clang+0x38c4e80) .... .... Stack dump: 0. Program arguments: /soft/restricted/intel_csa/comp/tools/2018-02-21-release/tools/install/bin/clang -O3 -fopenmp -fopenmp-targets=csa -c -o rhs4th3fortsgstr.o rhs4th3fortsgstr.f 1. Compilation construction 2. Building compilation jobs 3. Building compilation jobs 4. Building compilation jobs 5. Building compilation jobs 6. Building compilation jobs 7. Building compilation jobs 8. Building compilation jobs make: *** [rhs4th3fortsgstr.o] Segmentation fault ________________________________ From: Tannenbaum, Barry M <[email protected]<mailto:[email protected]>> Sent: Tuesday, March 27, 2018 3:29:01 PM To: Narayanaswamy, Ravi; Jin, Zheming; [email protected]<mailto:[email protected]> Subject: RE: [Anl-intel-csa] building a mix of C and Fortran files (file not recognized: File truncated clang-6.0: error: csa-ld command failed with exit code 1 (use -v to see invocation)) To expand on Ravi's answer, you need to add the OpenMP options to all of the compilations. When OpenMP is used, the link step is assuming that all of the objects are "bundles" - files that contain multiple objects. The error is caused when the link step attempts to extract an object from the bundle, and it fails because some of the file simple objects, not bundles. The result is an empty .o, which causes the linker to give the "file not recognized: File truncated" error. The other workaround is to put the OpenMP code into a shared object, and link the main program against that shared object. All of the files built into the shared object need to be compiled and linked with the OpenMP options, but the main program does not. See $CSA_TOP/samples/omp-offload/shared-obj-demo for an example. From: anl-intel-csa [mailto:[email protected]] On Behalf Of Narayanaswamy, Ravi Sent: Tuesday, March 27, 2018 3:58 PM To: Jin, Zheming <[email protected]<mailto:[email protected]>>; [email protected]<mailto:[email protected]> Subject: Re: [Anl-intel-csa] building a mix of C and Fortran files (file not recognized: File truncated clang-6.0: error: csa-ld command failed with exit code 1 (use -v to see invocation)) You are adding -fopenmp -fopenmp-target=csa only in the link phase. Need to add it compilation phase also. Ravi From: anl-intel-csa [mailto:[email protected]] On Behalf Of Jin, Zheming Sent: Tuesday, March 27, 2018 12:53 PM To: [email protected]<mailto:[email protected]> Subject: [Anl-intel-csa] building a mix of C and Fortran files (file not recognized: File truncated clang-6.0: error: csa-ld command failed with exit code 1 (use -v to see invocation)) The location of the test is /soft/restricted/intel_csa/apps/benchmark/sw4lite/tests/testil. It has standalone tests. You can type 'make' in that directory. "CSA_OPTS := -fopenmp -fopenmp-targets=csa -lm" doesn't work and produces the error at the bottom of the email. Do you know what needs to be changed in the Makefile to fix the error ? Thanks, zheming /soft/restricted/intel_csa/comp/tools/2018-02-21-release/tools/install/bin/clang -c -o rhs4th3fortsgstr.o rhs4th3fortsgstr.f /soft/restricted/intel_csa/comp/tools/2018-02-21-release/tools/install/bin/clang -c -o boundaryOp.o boundaryOp.f /soft/restricted/intel_csa/comp/tools/2018-02-21-release/tools/install/bin/clang -c -o curvilinear4sg.o curvilinear4sg.f /soft/restricted/intel_csa/comp/tools/2018-02-21-release/tools/install/bin/clang -c -o metric.o metric.f /soft/restricted/intel_csa/comp/tools/2018-02-21-release/tools/install/bin/clang -c -o addsgd4.o addsgd4.f /soft/restricted/intel_csa/comp/tools/2018-02-21-release/tools/install/bin/clang -c -o rhs4sg.o rhs4sg.c /soft/restricted/intel_csa/comp/tools/2018-02-21-release/tools/install/bin/clang -c -o rhs4sg_rev.o rhs4sg_rev.c /soft/restricted/intel_csa/comp/tools/2018-02-21-release/tools/install/bin/clang -c -o gettimec.o gettimec.c /soft/restricted/intel_csa/comp/tools/2018-02-21-release/tools/install/bin/clang++ -c -o grid-utilities.o grid-utilities.C /soft/restricted/intel_csa/comp/tools/2018-02-21-release/tools/install/bin/clang++ -c -o rhs4sgcurv.o rhs4sgcurv.C /soft/restricted/intel_csa/comp/tools/2018-02-21-release/tools/install/bin/clang++ -c -o rhs4sgcurv_rev.o rhs4sgcurv_rev.C /soft/restricted/intel_csa/comp/tools/2018-02-21-release/tools/install/bin/clang++ -c -o metricC.o metricC.C /soft/restricted/intel_csa/comp/tools/2018-02-21-release/tools/install/bin/clang++ -c -o addsgd4fort.o addsgd4fort.C /soft/restricted/intel_csa/comp/tools/2018-02-21-release/tools/install/bin/clang++ -c -o addsgd4fort_rev.o addsgd4fort_rev.C /soft/restricted/intel_csa/comp/tools/2018-02-21-release/tools/install/bin/clang++ -c -o testil.o testil.C /soft/restricted/intel_csa/comp/tools/2018-02-21-release/tools/install/bin/clang++ -o main -O3 -fopenmp -fopenmp-targets=csa -lm -L /soft/restricted/intel_csa/comp/tools/2018-02-21-release/tools/local/lib rhs4th3fortsgstr.o boundaryOp.o curvilinear4sg.o metric.o addsgd4.o rhs4sg.o rhs4sg_rev.o gettimec.o grid-utilities.o rhs4sgcurv.o rhs4sgcurv_rev.o metricC.o addsgd4fort.o addsgd4fort_rev.o testil.o /tmp/rhs4th3fortsgstr-46789e.o: file not recognized: File truncated clang-6.0: error: csa-ld command failed with exit code 1 (use -v to see invocation)
participants (1)
-
Tannenbaum, Barry M