Software Archive
Read-only legacy content
17061 Discussions

Compile and link against k1om library/RPM

JJK
New Contributor III
545 Views

hi all,

when answering another thread (https://software.intel.com/en-us/forums/intel-many-integrated-core/topic/674887) I ran into an old problem:

How does one compile and especially link a library of program natively for the Xeon Phi that makes use of another library that is supplied as a k1om RPM ?

More specifically: when building UnixODBC natively I need to link it against libltdl ; the k1om RPMs include a libltdl7-2.4.2-r2.0.k1om.rpm which is installed on the Phi. How do I compile and link using this library? do I need to install the k1om RPM on the host system?

 

0 Kudos
1 Reply
P__Robert
Beginner
545 Views


Copy/unpack the k1om bins tar-ball

Hey, I use this process to establish cross-compilation:

 

cp mpss-3.7-k1om.tar /home/

cd /home/

tar xvf mpss-3.7-k1om.tar

cd /home/mpss-3.7/k1om/

for rpm in *.rpm; do rpm2cpio $rpm | cpio -idm; done

#done

 

For CMAKE builds use this on the command line.


-DCMAKE_FIND_ROOT_PATH=/home/mpss-3.7/k1om \
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \

 

 

For other build systems, include the appropriate directories.

For ex.

$SRC/configure \
CC=icc \
CXX=icpc \
CFLAGS="-mmic -fPIC -I/home/mpss-3.7/k1om/usr/include/" \
CPPFLAGS="-mmic -fPIC -I/home/mpss-3.7/k1om/usr/include/" \
LDFLAGS="-L/home/mpss-3.7/k1om/usr/lib64/" \
--host=x86_64
make install

0 Kudos
Reply