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

Intel 18 Beta Compiler: -openmp not allowed #8941

Closed
mathomp4 opened this issue Apr 13, 2017 · 16 comments
Closed

Intel 18 Beta Compiler: -openmp not allowed #8941

mathomp4 opened this issue Apr 13, 2017 · 16 comments

Comments

@mathomp4
Copy link

All,

I grabbed the Intel 2018 Beta distribution today and went about building the earth system model I work on. In doing so, all our f2py build steps failed because of a change Intel has made. Namely, -openmp is no longer a valid option and only -qopenmp is allowed.

This affects numpy in numpy/distutils/intelccompiler.py and numpy/distutils/fcompiler/intel.py where there are hard-coded -openmp in option strings. I tried adding --f90flags=-qopenmp, but it seemed to just add that flag to the default set and since -openmp was there, bang!

It might best to add something like:

          v = self.get_version()
          if v and v >= '15.0':
              opt.append('-qopenmp')
          else
              opt.append('-openmp')

a la get_flags_linker_so since there are always people using old versions of Intel compilers. Intel has been accepting and promoting -qopenmp since the Intel 15 days at least, so there's been 3 years of warmup.

I am currently not able to test any changes at present as on the cluster I'm working on (where I have Intel 18 installed) I don't have write access to the Python distribution I can use. I've asked the maintainer for help fixing this locally, but I thought numpy themselves should be made aware.

@charris
Copy link
Member

charris commented Apr 13, 2017

Thanks for the report. Let us know the results of your experimentation.

@rgommers rgommers added this to the 1.13.0 release milestone Apr 19, 2017
@rgommers
Copy link
Member

@charris this is kind of important, so I added the 1.13.0 release.

@rgommers rgommers self-assigned this Apr 19, 2017
@charris
Copy link
Member

charris commented Apr 19, 2017

@mathomp4 Any chance that you can get the proposed fix tested soon?

@cgohlke Can you help?

@mathomp4
Copy link
Author

mathomp4 commented Apr 19, 2017

@charris The admin came back yesterday from vacation and I had him hand-change the -openmp to -qopenmp in numpy/distutils/intelccompiler.py and numpy/distutils/fcompiler/intel.py. After that change, everything worked well.

I didn't ask him to try the optioned variant mainly because every Intel compiler we use and support--Intel 15 and higher--all support -qopenmp so it would have been more work during his stressful day back!

I'll try and corner him again, but since I can say -qopenmp works, it's just python if you want to make a versioned version.

ETA: Also, if you do do a versioned version, you may as well make -qopenmp the "else" case. No Intel compiler in the future should use -openmp. (Next up: NAG compiler + numpy!)

@charris charris added the 09 - Backport-Candidate PRs tagged should be backported label Apr 19, 2017
@charris
Copy link
Member

charris commented Apr 19, 2017

Hmm, looks like -qopenmp was added in 15.0, which came out in July 2014. That is probably near enough in time that we need to support both options. @rgommers Thoughts?

@cgohlke
Copy link
Contributor

cgohlke commented Apr 19, 2017

On Python 2.7 for Windows, Intel <=14.0 is required for compatibility with Visual Studio 2008.

@charris
Copy link
Member

charris commented Apr 19, 2017

@cgohlke Thanks for the info.

@mathomp4
Copy link
Author

On Python 2.7 for Windows, Intel <=14.0 is required for compatibility with Visual Studio 2008.

Ouch. Really? On the OS on our cluster, Intel Fortran 14 might work, but anything before that just starts failing in random ways. I've pretty much required 15+. Good catch @cgohlke

@cgohlke
Copy link
Contributor

cgohlke commented Apr 19, 2017

Ouch. Really?

According to https://software.intel.com/en-us/intel-parallel-studio-xe-compilers-required-microsoft-visual-studio VS2008 support was dropped in compiler 15.0:

Intel® Parallel Studio XE 2015 Initial release through update 3 (compiler 15.0) VS2010, VS2012, VS2013 (includes VS2010 Shell)
Intel® Composer XE 2013 SP1 Update 1 or later (compiler 14.0.1) - VS2008, VS2010, VS2012, VS2013 (includes VS2010 Shell)

@charris
Copy link
Member

charris commented Apr 19, 2017

Hmm, we don't use any of the openmp flags for windows. @cgohlke Should we?

@cgohlke
Copy link
Contributor

cgohlke commented Apr 19, 2017

Hmm, we don't use any of the openmp flags for windows.

That's right. No need to worry about Windows then.

@charris
Copy link
Member

charris commented Apr 19, 2017

See #8961.

charris added a commit to charris/numpy that referenced this issue Apr 19, 2017
The '-openmp' option was deprecated in Intel version 15 and removed
in version 18. The replacement is '-qopenmp'.

Closes numpy#8941.

[skip ci]
@rgommers
Copy link
Member

Next up: NAG compiler + numpy!

Wow, that's still alive and in use? Last used it in 2003.

@jeffhammond
Copy link

FWIW -fopenmp is supported by every version of the Intel compilers that I remember using.

@mathomp4
Copy link
Author

@jeffhammond Huh. You are correct. Weird that they obsolete -openmp but not -fopenmp. Not too consistent that.

@rgommers Yeah, NAG is still going on and it is by far the best compiler for checking for Standards Compliance, etc. My usual issue with f2py is the fact we compile our model with FC=mpifort (or mpif90). Thus, f2py must use that as the compiler and then we are stuck with f2py being able to figure out the compiler internally. It works okay, but some MPI stacks don't handle 'mpifort -V' as well as one would hope (they try to link if passed -V; that screws up detection routines).

@jeffhammond
Copy link

@mathomp4 -fopenmp exists for GCC (and now Clang) compatibility, and the Intel compiler aspires to be a drop-in replacement for the system compiler.

-openmp is what MSVC uses (according to the Internet - I don't use Windows) but -o${LETTERS} has a meaning that is inconsistent with -openmp, which breaks compatibility with GCC, Clang and others for the concocted use case below.

$ gcc empty.c -openmp && ./penmp && echo $?
0

charris added a commit to charris/numpy that referenced this issue Apr 21, 2017
The '-openmp' option was deprecated in Intel version 15 and removed
in version 18. The replacement is '-qopenmp'.

Closes numpy#8941.

[skip ci]
@charris charris removed this from the 1.13.0 release milestone Oct 31, 2018
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Oct 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants