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

Intel Fortran Compiler not available in XCode 8.3.2

myroslav_p_
Beginner
693 Views

I am trying to add the compiler to use it with XCode, I have version 8.3.2, but it seems to be missing from the list of available compilers there, any idea why this happens? I did set up all the environmental variables beforehand. I also can't run the compiler from the terminal window, I get the following error: 

Undefined symbols for architecture x86_64:

  "_gemm_", referenced from:

      _MAIN__ in ifortkGcltQ.o

ld: symbol(s) not found for architecture x86_64

 

This is the code I was trying to compile:

program test

implicit none
real, dimension(2,2) :: testA, testB, testC

testA = 1
testB = 1
testC = 0  ! I don't think I need this line, but it shouldn't matter

call gemm(testA, testB, testC)

write(*,*) testC

end program test

0 Kudos
7 Replies
Kevin_D_Intel
Employee
693 Views

Our official support for Xcode 8.3 is coming in the PSXE 2017 Update 4 release scheduled for later this month (May) so you might be experiencing Xcode specific issues related to that; however, even with that official support the use of the Fortran compiler under Xcode is limited and it is not recommended. You can search our forum for the history of associated failings with that, most notably is the lack of MODULE support under Xcode.

The error under the terminal window relates to not providing a routine GEMM at link time. If that’s provided by a library then you need to provide the path to and name of the library at link time.

If you wish to use the MKL ?gemm routines, there's additional documentation here, https://software.intel.com/en-us/node/468480. There is also an MKL specific forum, Intel® Math Kernel Library, where you can receive additional help/advice.

0 Kudos
mecej4
Honored Contributor III
693 Views

Apart from the Xcode issues, which I know nothing about, there are two questions that need to be addressed. 

1. Did you specify that your code should be linked with MKL? For example, by using the -mkl flag in the compiler invocation, or in a makefile, or some other way? It is of little use when you display an error message without stating the command line that produced it.

2. The call to GEMM that you have in the code suggests that you are trying to use a generic name for the routine. In that case, you should provide an interface, perhaps by adding a USE BLAS95 statement to your source code. You should also specify the mkl_blas95  library at link time. Alternatively, you can use the F77 interface and call the specific routine, SGEMM and use an expanded argument list that conforms to the SGEMM specification.

Note that questions regarding MKL are answered faster in the separate MKL forum.

0 Kudos
TimP
Honored Contributor III
693 Views

Given, as Kevin said, that Xcode doesn't support Fortran MODULE, you would not be able to use the blas95 gemm generic via any USE.  If you don't wish to try copying an interface block from the blas95 source, you would need the specific sgemm call with the full argument list.

0 Kudos
Steve_Lionel
Honored Contributor III
693 Views

One can use modules when building from Xcode, but if your own source has files with modules, Xcode is incapable of building the sources in the correct order. This is an Apple limitation.

0 Kudos
mecej4
Honored Contributor III
693 Views

However, the option to build using Make is still available, is it not? Or has Apple put a wrench in that, too?

0 Kudos
Kevin_D_Intel
Employee
693 Views

Make is available as is building via the command-line. The limitation with modules and Xcode I was referring to is what Steve described.

0 Kudos
mecej4
Honored Contributor III
693 Views

This may be shot in the dark, but it seems to me that, since the only module relevant to this thread is one of the modules supplied with MKL, i.e., blas95.mod, Myroslav should be able to build with Xcode or the command line. All that he has to do is to add the USE statement to his source code (in the subprogram that calls GEMM) and add the corresponding library, mkl_blas95.lib, to the link-edit command options.

0 Kudos
Reply