Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building with Intel Fortran fails config test #360

Closed
bryanwweber opened this issue Aug 15, 2016 · 2 comments
Closed

Building with Intel Fortran fails config test #360

bryanwweber opened this issue Aug 15, 2016 · 2 comments

Comments

@bryanwweber
Copy link
Member

bryanwweber commented Aug 15, 2016

I'm building 8ada40f with the Intel compilers. The configuration test for Fortran fails and tries to fall back to gfortran with ifort specified in cantera.conf. It appears the reason is because gfortran is used to build the object and ifort is used to link. Moving the

env['F77'] = env['F90'] = env['F95'] = env['F03'] = env['FORTRAN']
env['F77FLAGS'] = env['F90FLAGS'] = env['F95FLAGS'] = env['F03FLAGS'] = env['FORTRANFLAGS']

lines above the Fortran config checks causes the check to pass. It seems SCons is not picking up the correct compiler for builds (maybe it expects env['F90'] for the file?)

config.log:

.sconf_temp/conftest_11.f90 <-
  |
  |program main
  |   write(*,'(a)') 'Hello, world!'
  |end program main
  |
gfortran -o .sconf_temp/conftest_11.o -c .sconf_temp/conftest_11.f90
ifort -o .sconf_temp/conftest_11 -pthread .sconf_temp/conftest_11.o -L/opt/intel/composerxe/mkl/lib/intel64
Errors follow... missing gfortran symbols

cantera.conf:

CXX = 'icpc'
CC = 'icc'
f90_interface = 'y'
FORTRAN = 'ifort'
FORTRANFLAGS = '-O3 -xHost'
blas_lapack_libs = 'mkl_rt,mkl_intel_lp64,mkl_core,mkl_intel_thread,iomp5'
blas_lapack_dir = '/opt/intel/composerxe/mkl/lib/intel64/'
env_vars = 'all'
cc_flags = ''
optimize_flags = '-O3 -Wall -xHost -fp-model precise'

Also, -pthread is deprecated in the Intel Fortran compilers: https://software.intel.com/en-us/node/525222 The replacement is -reentrancy threaded

@speth
Copy link
Member

speth commented Aug 15, 2016

Those lines shouldn't be above the check, because the check may set env['FORTRAN']. Instead, I think what needs to be done is in the function check_fortran, the line

env['FORTRAN'] = compiler

should be replaced with

env['F77'] = env['F90'] = env['F95'] = env['F03'] = env['FORTRAN'] = compiler

The setting of the flags can go above the whole thing.

Regarding the deprecation of -pthread: In what version is it deprecated? In what version does the -reentrancy threaded option appear? The Intel docs don't make it easy to compare for older versions, and even then, I'd rather not have to detect which specific version of the Intel compiler someone is using.

@bryanwweber
Copy link
Member Author

bryanwweber commented Aug 16, 2016

OK I pushed a fix for this: 5435af2

Re the deprecation: I don't know what versions (I have 2016 update 3), and since its only a warning, I think we can ignore it until it actually gets removed. It seems like its been "deprecated" for a while based on some Intel forum posts, so maybe they don't plan on removing it soon. However, the new "Open Source" and other free licenses require renewal every year, so I think more people will be on newer versions of the compiler (maybe), so hopefully more people will have the replacement option available.

I'm closing this issue because the commit above fixes the actual issue and I don't think we should do anything about the deprecation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants