[OMPI users] Issues with compilers
Dear Open MPI support team, I am trying to install Open MPI with Intel compiler suite for the Fortran side and GNU compiler suite for the C side. For factors that don’t depend upon me, I’m not allowed to change the C compiler suite to Intel one since that would mean an additional license. Problem arises with the fact that the installation should not dynamically depend on Intel libraries, so the flag “-static-intel” (or similar) should be passed to the Fortran compiler. I’ve seen in the FAQ that this problem is solved by passing an Autotools option “-Wc,-static-intel” to the variable LDFLAGS when invoking configure with Intel compilers. This works if both C/C++ and Fortran compilers are from Intel. However, it crashes if the compiler suite is mixed since GNU C/C++ does not recognise the “-static-intel” option. Is there any way to bypass this crash and to indicate that such option should only be passed when using Fortran compiler? Configure call to reproduce the crash is made as follows: *./configure --prefix=/usr/local/ --libdir=/usr/local/lib64/ --includedir=/usr/local/include/ CC=gcc CXX=g++ 'FLAGS=-O2 -m64' 'CFLAGS=-O2 -m64' 'CXXFLAGS=-O2 -m64' FC=ifort 'FCFLAGS=-O2 -m64' LDFLAGS=-Wc,-static-intel* Please, find attached the output from configure and config.log. Additional data: · Operating system SLES12 SP3. · Open MPI version 4.0.5 · Intel Fortran compiler version 17.0.6 · GNU C/C++ compiler version 4.8.5. I’ll very much appreciate any help provided to solve this problem. Kind regards, Álvaro outputs.tar.bz2 Description: Binary data
Re: [OMPI users] Issues with compilers
On Jan 22, 2021, at 9:49 AM, Alvaro Payero Pinto via users wrote: > > I am trying to install Open MPI with Intel compiler suite for the Fortran > side and GNU compiler suite for the C side. For factors that don’t depend > upon me, I’m not allowed to change the C compiler suite to Intel one since > that would mean an additional license. Yoinks. I'll say right off that this will be a challenge. > Problem arises with the fact that the installation should not dynamically > depend on Intel libraries, so the flag “-static-intel” (or similar) should be > passed to the Fortran compiler. I’ve seen in the FAQ that this problem is > solved by passing an Autotools option “-Wc,-static-intel” to the variable > LDFLAGS when invoking configure with Intel compilers. This works if both > C/C++ and Fortran compilers are from Intel. However, it crashes if the > compiler suite is mixed since GNU C/C++ does not recognise the > “-static-intel” option. The problem is that the same LDFLAGS value is used for all 3 languages (C, C++, Fortran), because they can all be compiled into a single application. So the Autotools don't separate out different LDFLAGS for the different languages. > Is there any way to bypass this crash and to indicate that such option should > only be passed when using Fortran compiler? Keep in mind that there's also two different cases here: 1. When compiling Open MPI itself 2. When compiling MPI applications You can customize the behavior of the mpifort wrapper compiler by editing share/openmpi/mpifort-wrapper-data.txt. #1 is likely to be a bit more of a challenge. ...but the thought occurs to me that #2 may be sufficient. You might want to try it and see if your MPI applications have the Intel libraries statically linked, and that's enough...? > Configure call to reproduce the crash is made as follows: > > ./configure --prefix=/usr/local/ --libdir=/usr/local/lib64/ > --includedir=/usr/local/include/ CC=gcc CXX=g++ 'FLAGS=-O2 -m64' 'CFLAGS=-O2 > -m64' 'CXXFLAGS=-O2 -m64' FC=ifort 'FCFLAGS=-O2 -m64' > LDFLAGS=-Wc,-static-intel The other, slightly more invasive mechanism you could try if #2 is not sufficient is to write your own wrapper compiler script that intercepts / strips out -Wc,-static-intel for the C and C++ compilers. For example: ./configure CC=my_gcc_wrapper.sh CXX=my_g++_wrapper.sh ... LDFLAGS=-Wc,-static-intel Those two scripts are simple shell scripts that strip -Wc,-static-intel if it sees it, but otherwise just invoke gcc/g++ with all other contents of $*. It's a gross hack, but it might work. -- Jeff Squyres jsquy...@cisco.com
Re: [OMPI users] Issues with compilers
As a work-around, but not a 'solution', it's worth pointing out that the (new) Intel compilers are now *usable* for free - no licensing cost or login needed. (As are the MKL, Intel MPI, etc). Link: https://software.intel.com/content/www/us/en/develop/tools/oneapi/all-toolkits.html They've got Yum/Apt repos, tgz files, even Docker images you can use to get them. No need for 'root' access to install with the tgz files or use via Singularity if you have it. Note that they're easy to install, and even copy, but *not* legally distributable, and use implies consent to the EULA on the site. I've used them to good effect already. Just download, install, add to your path, then build OpenMPI with Intel Fortran + Intel C/C++ and you're good to go, so long as you aren't distributing them. Cheers, - Brian On Fri, Jan 22, 2021 at 8:12 AM Jeff Squyres (jsquyres) via users < users@lists.open-mpi.org> wrote: > On Jan 22, 2021, at 9:49 AM, Alvaro Payero Pinto via users < > users@lists.open-mpi.org> wrote: > > > > I am trying to install Open MPI with Intel compiler suite for the > Fortran side and GNU compiler suite for the C side. For factors that don’t > depend upon me, I’m not allowed to change the C compiler suite to Intel one > since that would mean an additional license. > > Yoinks. I'll say right off that this will be a challenge. > > > Problem arises with the fact that the installation should not > dynamically depend on Intel libraries, so the flag “-static-intel” (or > similar) should be passed to the Fortran compiler. I’ve seen in the FAQ > that this problem is solved by passing an Autotools option > “-Wc,-static-intel” to the variable LDFLAGS when invoking configure with > Intel compilers. This works if both C/C++ and Fortran compilers are from > Intel. However, it crashes if the compiler suite is mixed since GNU C/C++ > does not recognise the “-static-intel” option. > > The problem is that the same LDFLAGS value is used for all 3 languages (C, > C++, Fortran), because they can all be compiled into a single application. > So the Autotools don't separate out different LDFLAGS for the different > languages. > > > Is there any way to bypass this crash and to indicate that such option > should only be passed when using Fortran compiler? > > Keep in mind that there's also two different cases here: > > 1. When compiling Open MPI itself > 2. When compiling MPI applications > > You can customize the behavior of the mpifort wrapper compiler by editing > share/openmpi/mpifort-wrapper-data.txt. > > #1 is likely to be a bit more of a challenge. > > ...but the thought occurs to me that #2 may be sufficient. You might want > to try it and see if your MPI applications have the Intel libraries > statically linked, and that's enough...? > > > Configure call to reproduce the crash is made as follows: > > > > ./configure --prefix=/usr/local/ --libdir=/usr/local/lib64/ > --includedir=/usr/local/include/ CC=gcc CXX=g++ 'FLAGS=-O2 -m64' > 'CFLAGS=-O2 -m64' 'CXXFLAGS=-O2 -m64' FC=ifort 'FCFLAGS=-O2 -m64' > LDFLAGS=-Wc,-static-intel > > The other, slightly more invasive mechanism you could try if #2 is not > sufficient is to write your own wrapper compiler script that intercepts / > strips out -Wc,-static-intel for the C and C++ compilers. For example: > > ./configure CC=my_gcc_wrapper.sh CXX=my_g++_wrapper.sh ... > LDFLAGS=-Wc,-static-intel > > Those two scripts are simple shell scripts that strip -Wc,-static-intel if > it sees it, but otherwise just invoke gcc/g++ with all other contents of $*. > > It's a gross hack, but it might work. > > -- > Jeff Squyres > jsquy...@cisco.com > >
Re: [OMPI users] Issues with compilers
Hi, what about putting the "-static-intel" into a configuration file for the Intel compiler. Besides the default configuration, one can have a local one and put the path in an environment variable IFORTCFG (there are other ones for C/C++). $ cat myconf --version $ export IFORTCFG=/home/reuti/myconf $ ifort ifort (IFORT) 19.0.5.281 20190815 -- Reuti > Am 22.01.2021 um 15:49 schrieb Alvaro Payero Pinto via users > : > > Dear Open MPI support team, > > I am trying to install Open MPI with Intel compiler suite for the Fortran > side and GNU compiler suite for the C side. For factors that don’t depend > upon me, I’m not allowed to change the C compiler suite to Intel one since > that would mean an additional license. > > Problem arises with the fact that the installation should not dynamically > depend on Intel libraries, so the flag “-static-intel” (or similar) should be > passed to the Fortran compiler. I’ve seen in the FAQ that this problem is > solved by passing an Autotools option “-Wc,-static-intel” to the variable > LDFLAGS when invoking configure with Intel compilers. This works if both > C/C++ and Fortran compilers are from Intel. However, it crashes if the > compiler suite is mixed since GNU C/C++ does not recognise the > “-static-intel” option. > > Is there any way to bypass this crash and to indicate that such option should > only be passed when using Fortran compiler? > > Configure call to reproduce the crash is made as follows: > > ./configure --prefix=/usr/local/ --libdir=/usr/local/lib64/ > --includedir=/usr/local/include/ CC=gcc CXX=g++ 'FLAGS=-O2 -m64' 'CFLAGS=-O2 > -m64' 'CXXFLAGS=-O2 -m64' FC=ifort 'FCFLAGS=-O2 -m64' > LDFLAGS=-Wc,-static-intel > > Please, find attached the output from configure and config.log. > > Additional data: > > · Operating system SLES12 SP3. > · Open MPI version 4.0.5 > · Intel Fortran compiler version 17.0.6 > · GNU C/C++ compiler version 4.8.5. > > I’ll very much appreciate any help provided to solve this problem. > > Kind regards, > > Álvaro > > >