- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using the 64 bit Intel Visual Fortran compiler through visual studio 2013 and Windows 7 professional and am encountering an error which prevents compilation. I stepped back to the beginning Xeon Phi labs and used the provided code as a simplest case which I knew should work and the error was still present (Code used included for reference).
!dir$ attributes offload : mic :: offload_check subroutine offload_check() #ifdef __MIC__ print *,"Code running on MIC" #else print *,"Code running on host" #endif end subroutine offload_check subroutine mmul(a, lda, b, ldb, c, ldc, n) use omp_lib integer :: lda, ldb, ldc, n real, dimension(n*n) :: a,b,c integer :: i, j, k integer iMaxThreads ! send over the data to the card using the in clause, ! execute the code and return data to the host using inout clause !dir$ offload begin target(mic) in(a:length(n*n)) in(b:length(n*n)) & & inout(c:length(n*n)) ! code to test whether or not running in MIC !dir$ attributes offload : mic :: offload_check call offload_check() iMaxThreads = omp_get_max_threads() print *,"matrix multiplication running with ", iMaxThreads," threads" !$omp parallel do do i = 1, n do j = 1, n do k = 1, n c((j-1)*ldc+i) = c((j-1)*ldc+i) + a((k-1)*lda+i) * b((j-1)*ldb+k) end do end do end do !$omp end parallel do !dir$ end offload end subroutine mmul
The output from the compile attempt was as follows:
1>------ Build started: Project: Test3, Configuration: Debug x64 ------
1>Compiling with Intel(R) Visual Fortran Compiler XE 15.0.2.179 [Intel(R) 64]...
1>omp_offload.f90
1>c:\users\ahess1\documents\visual studio 2013\Projects\Test3\Test3\omp_offload.f90(27): warning #5117: Bad # preprocessor line
1>c:\users\ahess1\documents\visual studio 2013\Projects\Test3\Test3\omp_offload.f90(29): warning #5117: Bad # preprocessor line
1>c:\users\ahess1\documents\visual studio 2013\Projects\Test3\Test3\omp_offload.f90(31): warning #5117: Bad # preprocessor line
1>c:/users/ahess1/documents/visual studio 2013/Projects/Test3/Test3/omp_offload.f90(27): warning #5117: *MIC* Bad # preprocessor line
1>c:/users/ahess1/documents/visual studio 2013/Projects/Test3/Test3/omp_offload.f90(29): warning #5117: *MIC* Bad # preprocessor line
1>c:/users/ahess1/documents/visual studio 2013/Projects/Test3/Test3/omp_offload.f90(31): warning #5117: *MIC* Bad # preprocessor line
1>Linking...
1>icc: error #10037: could not find 'k1om-mpss-linux-ld.exe'
1>Link: error #10037: could not find 'C:\PROGRA~2\Intel\COMPOS~1\bin\intel64_mic\icc.exe'
1>
1>Build log written to "file://c:\users\ahess1\documents\visual studio 2013\Projects\Test3\Test3\x64\Debug\BuildLog.htm"
1>Test3 - 2 error(s), 6 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
The warnings point to the # statements in offload_check and are likely not relevant. I am using x64 as my platform, but have not made any other changes to my properties. Removing the offload directives removes these errors, and allows correct compilation when put together with the main function from the lab. The icc.exe file does seem to exist in the place it is looking for it.
What am I doing wrong here?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you have MPSS installed before you installed the Intel® Fortran compiler? The installation detects the presence of MPSS in determining whether to install the Xeon Phi™ components. If not then, make sure MPSS is installed first and then reinstall the Fortran compiler.
If you installed MPSS, did you also install the Intel® Xeon Phi™ coprocessor essentials.exe? The missing linker noted in the error installs from this Essentials package.
To address the preprocessing errors, enable preprocessing of the source under the property setting: Fortran > Preprocessor > Preprocess Source File (set to Yes (/fpp) )
While it looks odd that icc.exe is used, that is by design.
Hope some of that helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've reinstalled MPSS and the composer, which seems to have solved the error while giving me new and exciting errors. Building the same code gives this:
1>------ Build started: Project: Test3, Configuration: Debug x64 ------
1>Linking...
1>C:\Users\ahess1\AppData\Local\Temp\30124MIC2.o: In function `offload_check':
1>C:/Users/ahess1/documents/visual studio 2013/Projects/Test3/Test3/omp_offload.f90:28: undefined reference to `for_write_seq_lis'
1>C:\Users\ahess1\AppData\Local\Temp\30124MIC2.o: In function `__offload_entry_omp_offload_f90_44_':
1>C:/Users/ahess1/documents/visual studio 2013/Projects/Test3/Test3/omp_offload.f90:53: undefined reference to `for_write_seq_lis'
1>C:/Users/ahess1/documents/visual studio 2013/Projects/Test3/Test3/omp_offload.f90:53: undefined reference to `for_write_seq_lis_xmit'
1>C:/Users/ahess1/documents/visual studio 2013/Projects/Test3/Test3/omp_offload.f90:53: undefined reference to `for_write_seq_lis_xmit'
1>C:/Users/ahess1/documents/visual studio 2013/Projects/Test3/Test3/omp_offload.f90:58: undefined reference to `for_emit_diagnostic'
1>C:/Users/ahess1/documents/visual studio 2013/Projects/Test3/Test3/omp_offload.f90:58: undefined reference to `for_emit_diagnostic'
1>C:/Users/ahess1/documents/visual studio 2013/Projects/Test3/Test3/omp_offload.f90:58: undefined reference to `for_emit_diagnostic'
1>C:/Users/ahess1/documents/visual studio 2013/Projects/Test3/Test3/omp_offload.f90:58: undefined reference to `for_emit_diagnostic'
1>C:/Users/ahess1/documents/visual studio 2013/Projects/Test3/Test3/omp_offload.f90:58: undefined reference to `for_emit_diagnostic'
1>C:\Users\ahess1\AppData\Local\Temp\30124MIC2.o:C:/Users/ahess1/documents/visual studio 2013/Projects/Test3/Test3/omp_offload.f90:58: more undefined references to `for_emit_diagnostic' follow
1>Test3 : error PRJ0019: A tool returned an error code
1>Build log written to "file://C:\Users\ahess1\documents\visual studio 2013\Projects\Test3\Test3\x64\Debug\BuildLog.htm"
1>Test3 - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
The print lines in offload_check seem to be the source of the in function offload_check part and commenting out the print in mmul removes the 'for_write_seq_lis' errors, but I'm not sure where the others are coming from. Again, compiling without the offload directives doesn't give these errors.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This looks like out of sequence specification of files, Fortran library may have been searched before .o file or you tried to link without Ifort. If you don't figure it out show your link step.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
From the build log:
Linking...
Link /OUT:"x64\Debug\Test3.exe" /VERBOSE /NOLOGO /MANIFEST /MANIFESTFILE:"x64\Debug\Test3.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\Users\ahess1\documents\visual studio 2013\Projects\Test3\Test3\x64\Debug\Test3.pdb" /SUBSYSTEM:CONSOLE /IMPLIB:"C:\Users\ahess1\documents\visual studio 2013\Projects\Test3\Test3\x64\Debug\Test3.lib" "x64\Debug\omp_offload.obj" "x64\Debug\Test3.exe.embed.manifest.res"
C:\Users\ahess1\AppData\Local\Temp\66844MIC2.o: In function `__offload_entry_omp_offload_f90_44_':
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I haven't made any extra progress on getting the program to compile since last post. Is there any additional information I could provide to help find a solution and if so where can I look for it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You won't be able to build an executable without a main program. I added one to your code sample. It works find from the command line. Now I'll investigate the issue with VS2013
Patrick
C:\Users\pbkenned\ISN\U549580>U549580-main.exe
Code running on MIC
matrix multiplication running with 224 threads
C:\Users\pbkenned\ISN\U549580>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page