Intel OneAPI 2022 - libimf.so No such file or directory - during openMPI compilation - intel-oneapi

trying to compile openmpi with intel oneapi 2022.0.1 compilers
OS is 5.4.0-26-generic #30-Ubuntu SMP Mon Apr 20 16:58:30 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
I got the intel compilers as follows (just to make sure I didn't mess anything up at that step)
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
sudo apt install intel-basekit
sudo apt install intel-hpckit
Configuring openmpi with:
./configure --prefix=${HPCX_HOME}/ompi-icc CC=/opt/intel/oneapi/compiler/2022.0.1/linux/bin/intel64/icc CXX=/opt/intel/oneapi/compiler/2022.0.1/linux/bin/intel64/icpc F77=/opt/intel/oneapi/compiler/2022.0.1/linux/bin/intel64/ifort FC=/opt/intel/oneapi/compiler/2022.0.1/linux/bin/intel64/ifort --with-ucx=/usr --with-platform=contrib/platform/mellanox/optimized
my .bashrc has (root has the same .bashrc)
source /opt/intel/oneapi/setvars.sh
export LD_LIBRARY_PATH=/opt/intel/oneapi/compiler/2022.0.1/linux/compiler/lib/intel64_lin
After configure I do : sudo make all install and get the following error:
ld: /opt/intel/oneapi/compiler/2022.0.1/linux/bin/intel64/../../bin/intel64/../../lib/icx-lto.so: error loading plugin: libimf.so: cannot open shared object file: No such file or directory
There is no ifortvars.sh with this new version of oneAPI which seems to have solved similar issues for others in the past.
libimf.so is in:
/opt/intel/oneapi/itac/2021.5.0/bin/rtlib/libimf.so
/opt/intel/oneapi/compiler/2022.0.1/linux/compiler/lib/intel64_lin/libimf.so
/opt/intel/oneapi/intelpython/python3.9/pkgs/intel-cmplr-lib-rt-2022.0.1-intel_3633/lib/libimf.so
/opt/intel/oneapi/intelpython/python3.9/lib/libimf.so
/opt/intel/oneapi/intelpython/python3.9/envs/2022.0.1/lib/libimf.so
Any help and/or advice regarding compiling openmpi with recent intel compilers would be appreciated.

Here is the solution I found but doubt that this is the most elegant way of doing this:
OS is 5.4.0-26-generic #30-Ubuntu SMP Mon Apr 20 16:58:30 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
my .bashrc has (root has the same .bashrc)
source /opt/intel/oneapi/setvars.sh
created intel_libs.conf in
/etc/ld.so.conf.d/ and added the line /opt/intel/oneapi/compiler/2022.0.1/linux/compiler/lib/intel64_lin this is where the libimf.so lives.
sudo ldconfig
compiled openmpi with intel compilers fine after that using:
./configure --prefix={HPCX_HOME}/ompi-icc CC=/opt/intel/oneapi/compiler/2022.0.1/linux/bin/intel64/icc CXX=/opt/intel/oneapi/compiler/2022.0.1/linux/bin/intel64/icpc F77=/opt/intel/oneapi/compiler/2022.0.1/linux/bin/intel64/ifort FC=/opt/intel/oneapi/compiler/2022.0.1/linux/bin/intel64/ifort --with-ucx=/usr --with-platform=contrib/platform/mellanox/optimized
sudo make all
sudo make install
I hope this helps someone else and please let me know if there is a better way of doing this. Cheers

I am also facing similar issue not exactly. I installed the new ifort using the following command lines:
wget https://registrationcenter-download.intel.com/akdlm/irc_nas/18236/l_BaseKit_p_2021.4.0.3422.sh
sudo bash l_BaseKit_p_2021.4.0.3422.sh
wget https://registrationcenter-download.intel.com/akdlm/irc_nas/18211/l_HPCKit_p_2021.4.0.3347.sh
sudo bash l_HPCKit_p_2021.4.0.3347.sh
There is no file called setvars.sh inside the source /opt/intel/oneapi/, also while compiling any mpiifort file it is throwing me an error saying:
error loading plugin: libimf.so: cannot open shared object file: No such file or directory
Not even sure, if this is related to this thread or not, but any further guidance would be very helpful, thanks in advance.

Related

Meet "dyld: Library not loaded of wrong architecture" for libquadmath.0.dylib when running scip

I installed SCIP Optimization Suite from the SCIPOptSuite-7.0.2-Darwin-Ipopt-gcc10.sh installer of precompiled binary.
I also installed gcc and tbb by running:
brew install gcc
brew install tbb
Error message:
$ SCIPOptSuite-7.0.2-Darwin/bin/scip
dyld: Library not loaded: /usr/local/lib/7/i386/libquadmath.0.dylib
Referenced from: /Users/it/VirtualBox/10运筹学/14SCIP/01install/SCIPOptSuite-7.0.2-Darwin/bin/scip
Reason: no suitable image found. Did find:
/usr/local/lib/7/i386/libquadmath.0.dylib: mach-o, but wrong architecture
/usr/local/lib/7/i386/libquadmath.0.dylib: stat() failed with errno=1
/usr/local/lib/7/i386/libquadmath.0.dylib: mach-o, but wrong architecture
[1] 93720 abort SCIPOptSuite-7.0.2-Darwin/bin/scip
There is other libquadmath.0.dylib with x86_64 architecture installed:
$ sudo find / -name libquadmath.0.dylib
Password:
/usr/local/lib/7/i386/libquadmath.0.dylib
/usr/local/lib/7/libquadmath.0.dylib
/usr/local/opt/lib/gcc/7/i386/libquadmath.0.dylib
/usr/local/opt/lib/gcc/7/libquadmath.0.dylib
/usr/local/Cellar/4.6.4/lib/gcc/x86_64-apple-darwin12.5.0/4.6.4/i386/libquadmath.0.dylib
/usr/local/Cellar/4.6.4/lib/gcc/x86_64-apple-darwin12.5.0/4.6.4/libquadmath.0.dylib
/usr/local/Cellar/gcc/10.2.0_2/lib/gcc/10/libquadmath.0.dylib
/usr/local/Cellar/gcc#4.6/4.6.4/lib/gcc/x86_64-apple-darwin12.5.0/4.6.4/i386/libquadmath.0.dylib
/usr/local/Cellar/gcc#4.6/4.6.4/lib/gcc/x86_64-apple-darwin12.5.0/4.6.4/libquadmath.0.dylib
/Users/it/miniconda3/lib/python3.6/site-packages/numpy/.dylibs/libquadmath.0.dylib
/Users/it/miniconda3/lib/python3.6/site-packages/scipy/.dylibs/libquadmath.0.dylib
/Users/it/miniconda3/envs/py2/lib/python2.7/site-packages/scipy/.dylibs/libquadmath.0.dylib
$ lipo /usr/local/lib/7/libquadmath.0.dylib -archs
x86_64
I wonder why scip did not find these dylibs with right architecture?
Thanks very much.
First of all make sure you have the correct version of gcc installed, the installer that you downloaded asks for version 10.
Second, try installing all prerequisites first and then rerunning the installer-script afterwards.
If that does not help, please check the output of otool -L SCIPOptSuite-7.0.2-Darwin/bin/scip and echo $DYLD_LIBRARY_PATH to see if the library in question is loaded.
Lastly, you can try to patch the binary by adjusting the path to the library for the correct one:
install_name_tool -change /usr/local/lib/7/i386/libquadmath.0.dylib /usr/local/Cellar/gcc/10.2.0_2/lib/gcc/10/libquadmath.0.dylib SCIPOptSuite-7.0.2-Darwin/bin/scip

Raspberry Pi -fatal error: sys/cdefs.h: No such file or directory

I'm trying to compile gcc5.3.0 on my Raspberry Pi with latest Raspbian system image.
$ ./configure --enbale-checking=release --enable-languages=c,c++,fortran --host=arm-cortexa7_neon-linux-gnueabihf --build=arm-cortexa7_neon-linux-gnueabihf --target=arm-cortexa7_neon-linux-gnueabihf
$ make
However, the original compiler (gcc4.9) complains about not founding sys/cdefs.h when compiling libgcc.
I checked I have libc6-dev and build-essential installed.
So I used grep -R 'cdefs' /usr/include/ to search it and I found it at /usr/include/bsd/. I created the sys directory and made hard links to these headers under /usr/include/bsd/sys.
This time it gave me a more weird error,
/usr/include/stdio.h:312:8: error: unknown type name 'FILE'.
I searched this on stackoverflow, and there's a similar question, https://stackoverflow.com/a/21047237/5691005. But when I removed /usr/include/sys and /usr/include/bsd, then reinstalled libc6-dev, I cannot find sys/cdefs.h under /usr/include, and the compiler gave errors still.
I'm now totally lost. Any suggestion will be appreciated.
I had similar problem with compiling gcc-8.2. I tried to do as described here with reinstalling:
sudo apt-get --reinstall install libc6 libc6-dev
After that I was locating all missing headers:
find / -name cdefs.h
and copying them to /usr/include:
those steps allowed only to move forward but I still didn't manage to completely build gcc.
The best solution I found is to download compiled version of gcc-8.1 from:
https://solarianprogrammer.com/2017/12/07/raspberry-pi-raspbian-compiling-gcc/
I also ran into this problem when creating a containerized build environment for cross-compiled Qt applications for raspberry pi 4.
I found I needed to edit the mkspec for the linux-rasp-pi4-v3d device and add another cflag so that gcc could find the header from my Raspi sysroot that was used to cross-compile Qt.
Specifically under qtbase/mkspecs/devices/linux-rasp-pi4-v3d-g++/qmake.conf:
QMAKE_CFLAGS = -march=armv8-a -mtune=cortex-a72 -mfpu=crypto-neon-fp-armv8 -I$$[QT_SYSROOT]/usr/include/arm-linux-gnueabihf

install valgrind, Fatal error at startup

I am installing Valgrind but encounter some problems. The info of my platform:
Linux xx-ThinkPad-X61 3.2.0-39-generic-pae #62-Ubuntu SMP Wed Feb 27 22:25:11 UTC 2013 i686 i686 i386 GNU/Linux
I follows the installation instruction of the README file in the valgrind folder.
./configure ->make -> sudo make install.
I can't understand the following reminder in the README file, I just overlooked it.
Important! Do not move the valgrind installation into a place
different from that specified by --prefix at build time. This will
cause things to break in subtle ways, mostly when Valgrind handles
fork/exec calls.
after typing "valgrind ls -l", error appears:
xx#xx-ThinkPad-X61:~/Downloads/valgrind-3.8.1$ valgrind ls -l
==7674== Memcheck, a memory error detector
==7674== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==7674== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==7674== Command: ls -l
==7674==
valgrind: Fatal error at startup: a function redirection
valgrind: which is mandatory for this platform-tool combination
valgrind: cannot be set up. Details of the redirection are:
valgrind:
valgrind: A must-be-redirected function
valgrind: whose name matches the pattern: strlen
valgrind: in an object with soname matching: ld-linux.so.2
valgrind: was not found whilst processing
valgrind: symbols from the object with soname: ld-linux.so.2
valgrind:
valgrind: Possible fixes: (1, short term): install glibc's debuginfo
valgrind: package on this machine. (2, longer term): ask the packagers
valgrind: for your Linux distribution to please in future ship a non-
valgrind: stripped ld.so (or whatever the dynamic linker .so is called)
valgrind: that exports the above-named function using the standard
valgrind: calling conventions for this platform. The package you need
valgrind: to install for fix (1) is called
valgrind:
valgrind: On Debian, Ubuntu: libc6-dbg
valgrind: On SuSE, openSuSE, Fedora, RHEL: glibc-debuginfo
valgrind:
valgrind: Cannot continue -- exiting now. Sorry.
Could someone give some suggestions?
thanks!
I also faced this error, but finally resolved in below manner.
I am having 64 bit Ubuntu 14.04, and my executable is 32 bit. When I run my 32 bit executable with valgrind I got this same error. This error was not resolved even after installing libc6-dbg (using command apt-get install libc6-dbg).
Later I found like whatever libc6-dbg present in my machine was 64 bit and valgrind requires a 32 bit libc6-dbg to run my 32 bit executable. After installing 32 bit libc6-dbg (using the command apt-get install libc6-dbg:i386) it started working.
Valgrind indicates it cannot work because it is missing the libc debug info,
and it indicates which package has to be installed to solve that.
In your case (Ubuntu), you must install
libc6-dbg
apt install -y libc6-dbg
It worked for me. (Note: without :i386.)
A hunch is that Valgrind might have upgraded to 64-bit since the answer
by rashok was written.

Install apache module X-Sendfile on MAMP

How can I install X-Sendfile apache module so that MAMP can use it?
I have followed these instructions to install X-Sendfile, but it didn't work (it seems like it just installed it for the default apache installation). I also tried to manually copy /usr/libexec/apache2/mod_xsendfile.so to /Applications/MAMP/Library/modules/, but that produced the following error when restarting Apache:
Cannot load /Applications/MAMP/Library/modules/mod_xsendfile.so into server: cannot create object file image or add library
naabster's answer is correct if your MAMP binary is built for the same architecture as your kernel. The problem you're having might be that MAMP is not built using the same architecture -- I have Lion running here (10.7.3) with XAMPP 1.7.3 and I just ran across the same issue you were having.
Here's how I figured out what was wrong on my system, and how I fixed it. If your issue is the same as mine, then you should be able to follow along and verify as you go.
First, here's the output of 'uname -a' to show you that what I'm running:
Darwin Tads-Mac-Pro.local 11.3.0 Darwin Kernel Version 11.3.0:
Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64 x86_64
Here are the steps I took to track down the problem and fix it:
Figure out what attributes the other (working) modules had that my freshly-built xsendfile module was missing. I picked mod_headers.so as an example. The command to find that info is 'file [filename]'. I'm running this from a terminal cd'd to the /Applications/XAMPP/xamppfiles/modules directory:
file mod_headers.so
mod_headers.so: Mach-O universal binary with 2 architectures
mod_headers.so (for architecture i386): Mach-O bundle i386
mod_headers.so (for architecture ppc): Mach-O bundle ppc
As you can see, XAMPP kindly provides a universal binary that supports i386 and ppc architectures. However, because the Lion kernel is running x86_64, everything I build using apxs unless I tell it to otherwise will be x86_64.
Check the mach-o bundle type and architecture(s) supported by the module that was built with the recommended apxs build command ('sudo apxs -cia mod_xsendfile.c'). Because we're passing '-i' the apxs will install the .so into the default apache modules dir ... /usr/libexec/apache2...
file /usr/libexec/apache2/mod_xsendfile.so
/usr/libexec/apache2/mod_xsendfile.so: Mach-O 64-bit bundle x86_64
Just to double-check that this is the problem you can also look at the httpd (apache) binary:
file /Applications/XAMPP/xamppfiles/bin/httpd
/Applications/XAMPP/xamppfiles/bin/httpd: Mach-O universal binary with 2 architectures
/Applications/XAMPP/xamppfiles/bin/httpd (for architecture i386): Mach-O executable i386
/Applications/XAMPP/xamppfiles/bin/httpd (for architecture ppc): Mach-O executable ppc
Well now, that certainly will not work with an apache instance built without an x86_64 image. Trust, but verify, eh!
Now that I'm certain I understand the issue, let's re-build the .so with the proper architecture forced on the apxs command line. To do that I'm just adding two new params, Wl (linker flags) and Wc (compiler flags). The -i means 'install' (move .so into the modules directory) and the -a means 'activate' (add or re-enable LoadModule line in the httpd.conf)
sudo apxs -cia -Wl,"-arch i386" -Wc,"-arch i386" mod_xsendfile.c
re-check that our new .so supports an architecture that matches the Apache installed (i386, not x86_64)
file /Applications/XAMPP/xamppfiles/modules/mod_xsendfile.so
/Applications/XAMPP/xamppfiles/modules/mod_xsendfile.so: Mach-O bundle i386
Awesome. Now then, copy this turkey into the XAMPP install dir:
sudo cp /usr/libexec/apache2/mod_xsendfile.so /Applications/XAMPP/xamppfiles/modules/
And add the LoadModule line to the /Applications/XAMPP/xamppfiles/etc/httpd.conf.
LoadModule xsendfile_module modules/mod_xsendfile.so
You should be able to fire up the server using either the UI or the apachectl script found in the xamppfiles/bin directory.
Hope that helps you.
Also, I did a pretty decent due-diligence search and found just about squat looking for 'XAMPP X-SendFile cannot create object' in the Goog. What I did find was your question here, once I eliminated the 'XAMPP' since I was searching for 'XAMPP', not 'MAMP'
I started out with the 'x'AMP stack something like 10 years back using LAMPP, then WAMPP but the ApacheFriends guys call theirs XAMPP now for all of the platforms they support. I prefer using theirs since I know if I have to set up on a Windows server I can just download the same package that I use now but for Windows and I can expect to find all of the same servers installed without (too many) surprises.
So, just to be (very) thorough, the other way to discover these types of problems more easily is via Console.app. Open that up, filter on org.apache.httpd and you should see something similar to this:
httpd: Syntax error on line 117 of /private/etc/apache2/httpd.conf: Cannot load
/usr/libexec/apache2/mod_xsendfile.so into server:
dlopen(/usr/libexec/apache2/mod_xsendfile.so, 10): no suitable image found.
Did find:\n\t/usr/libexec/apache2/mod_xsendfile.so: mach-o, but wrong architecture
You can also get that from a command line when you start the apache server manually:
sudo apachectl -E /tmp/foo.txt -k start; tail -f /tmp/foo.txt
This worked for me:
Install mod_xsendfile according to this for the default OsX Apache server.
copy /usr/libexec/apache2/mod_xsendfile.so to /Applications/MAMP/Library/modules/
Edit the Mamp httpd.conf file and add this line: LoadModule xsendfile_module modules/mod_xsendfile.so
Restart Mamp

Error installing mod_wsgi 3.2

I am trying to install mod_wsgi 3.2 on Mac OSX 10.6.6 and am getting this error when I attempt to make
Installed assemblers are:
/usr/bin/../libexec/gcc/darwin/x86_64/as for architecture x86_64
/usr/bin/../libexec/gcc/darwin/i386/as for architecture i386
lipo: can't open input file: /var/folders/XW/XWYalsEzG3Gkn+PhoNKF0k+++TI/-Tmp-//ccsEgbTa.out (No such file or directory)
apxs:Error: Command failed with rc=65536
.
make: * [mod_wsgi.la] Error 1
This is a late answer, but I found a solution in my searching and wanted to include it here for others. This error typically occurs because you are trying to build libraries for ppc architecture which won't work as xcode4 doesn't no longer includes support for ppc. You can get around this by setting the following in your environment before running your build (I put this in my .bash_profile so I don't beat my head against the wall later):
export ARCHFLAGS="-arch i386 -arch x86_64"
The latest mod_wsgi version is 3.3 for a start, why are you using 3.2? Second, there is a precompiled mod_wsgi.so binary for MacOS X which can be used for Apple supplied Python and Apache, so you do not need to compile it from source code and so avoid need to have installed XCode development tools. The precompile mod_wsgi.so is available from mod_wsgi download page.
As to the errors, it would appear to be a permissions problem for user that you are compiling as. That or you aren't using standard Apple supplied software and have somehow mixed up your PATH so it is grabbing disparate tools from different package distributions. Are you using just Apple tools or have you installed any of MacPorts, fink or HomeBrew?
Edit the Make file like:
CPPFLAGS = -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -DNDEBUG
CFLAGS = -Wc,"-arch i386" -Wc,"-arch x86_64" -Wc
LDFLAGS = -arch i386 -arch x86_64 -F/Library/Frameworks -framework Python -u _PyMac_Error
LDLIBS = -ldl -framework CoreFoundation
I had the same question
In the end,I found I don't have write permission of '/usr/libexec/apache2/'
then I add chmod +w to the folder,,
then install success !!
Hope my answer can be a refer for some others
Good Luck!