cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jmartinez
Adventurer
Adventurer
7,094 Views
Registered: ‎06-09-2016

can't compile Mcap linux drivers

Hello,

I'm trying to compile the MCAP drivers in Linux with the last version of Ubuntu like says in the Xilinx answer 64761.

 

First I downloaded the pciutils (version 3.5.1 and also tried with 3.3.1) and then run the makefile with the Path sets to the pciutils install directory but I receive the next errors:

 

gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -I/home/raptorlab/Downloads/pciutils-3.3.1/lib -I/home/raptorlab/Downloads/pciutils-3.3.1 -I. mcap.c libmcap.a /home/raptorlab/Downloads/pciutils-3.3.1/lib/libpci.a -lz -o mcap
/home/raptorlab/Downloads/pciutils-3.3.1/lib/libpci.a(names-hwdb.o): In function `pci_id_hwdb_lookup':
names-hwdb.c:(.text+0xd4): undefined reference to `udev_hwdb_get_properties_list_entry'
names-hwdb.c:(.text+0xe9): undefined reference to `udev_list_entry_get_next'
names-hwdb.c:(.text+0xfd): undefined reference to `udev_list_entry_get_name'
names-hwdb.c:(.text+0x114): undefined reference to `udev_list_entry_get_value'
names-hwdb.c:(.text+0x249): undefined reference to `udev_new'
names-hwdb.c:(.text+0x256): undefined reference to `udev_hwdb_new'
/home/raptorlab/Downloads/pciutils-3.3.1/lib/libpci.a(names-hwdb.o): In function `pci_id_hwdb_free':
names-hwdb.c:(.text+0x27e): undefined reference to `udev_hwdb_unref'
names-hwdb.c:(.text+0x294): undefined reference to `udev_unref'
collect2: error: ld returned 1 exit status
Makefile:32: recipe for target 'mcap' failed
make: *** [mcap] Error 1

 

I have run all the steps In the install guide until try to compile the mcap library and the pciutils compiled correctly but at this point I feel loosed. The paths are correctly and the files are there but i don't know why there aren't those functions inside the names-hwdb.c file

 

The FPGA board is correctly configure and recognized as Xilinx board with lspci commands (and with the windows drivers the MCAP APP works correctly).

 

some ideas?.

 

P.D. I put this post inside the PCI express group because is related to the PCIe but maybe another place is better but i didn't find it.

 

*this is the output for the pciutils make:

 

raptorlab@raptorlab-desktop:~/Downloads/pciutils-3.3.1$ make
cd lib && ./configure
Configuring libpci for your system... x86_64--linux 4.4.0-24-generic x86_64 linux
Looking for access methods... sysfs proc i386-ports dump
Checking for zlib support... yes (auto-detected)
Checking for DNS support... yes (auto-detected)
Checking for libkmod... no (auto-detected)
Checking for udev hwdb support... yes (auto-detected)
Checking whether to build a shared library... no (set manually)
make -C lib all
make[1]: Entering directory '/home/raptorlab/Downloads/pciutils-3.3.1/lib'
gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes   -c -o init.o init.c
gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes   -c -o access.o access.c
gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes   -c -o generic.o generic.c
gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes   -c -o dump.o dump.c
gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes   -c -o names.o names.c
gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes   -c -o filter.o filter.c
gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes   -c -o names-hash.o names-hash.c
gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes   -c -o names-parse.o names-parse.c
gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes   -c -o names-net.o names-net.c
gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes   -c -o names-cache.o names-cache.c
gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes   -c -o names-hwdb.o names-hwdb.c
gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes   -c -o params.o params.c
gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes   -c -o caps.o caps.c
gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes   -c -o sysfs.o sysfs.c
gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes   -c -o proc.o proc.c
gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes   -c -o i386-ports.o i386-ports.c
rm -f libpci.a
ar rcs libpci.a init.o access.o generic.o dump.o names.o filter.o names-hash.o names-parse.o names-net.o names-cache.o names-hwdb.o params.o caps.o sysfs.o proc.o i386-ports.o
ranlib libpci.a
sed <libpci.pc.in >libpci.pc -e 's,@PREFIX@,/usr/local,' \
    -e 's,@INCDIR@,/usr/local/include,' \
    -e 's,@LIBDIR@,/usr/local/lib,' \
    -e 's,@IDSDIR@,/usr/local/share,' \
    -e 's,@VERSION@,3.3.1,' \
    -e 's,@LDLIBS@, -lz -lresolv -ludev,'
make[1]: Leaving directory '/home/raptorlab/Downloads/pciutils-3.3.1/lib'
gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes   -c -o lspci.o lspci.c
gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes   -c -o ls-vpd.o ls-vpd.c
gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes   -c -o ls-caps.o ls-caps.c
gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes   -c -o ls-caps-vendor.o ls-caps-vendor.c
gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes   -c -o ls-ecaps.o ls-ecaps.c
gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes    -c -o ls-kernel.o ls-kernel.c
gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes   -c -o ls-tree.o ls-tree.c
gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes   -c -o ls-map.o ls-map.c
gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes   -c -o common.o common.c
gcc   lspci.o ls-vpd.o ls-caps.o ls-caps-vendor.o ls-ecaps.o ls-kernel.o ls-tree.o ls-map.o common.o lib/libpci.a  -lz -lresolv -ludev  -o lspci
gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes   -c -o setpci.o setpci.c
gcc   setpci.o common.o lib/libpci.a  -lz -lresolv -ludev -o setpci
gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes   -c -o example.o example.c
gcc   example.o lib/libpci.a  -lz -lresolv -ludev -o example
M=`echo 2015-04-09 | sed 's/-01-/-January-/;s/-02-/-February-/;s/-03-/-March-/;s/-04-/-April-/;s/-05-/-May-/;s/-06-/-June-/;s/-07-/-July-/;s/-08-/-August-/;s/-09-/-September-/;s/-10-/-October-/;s/-11-/-November-/;s/-12-/-December-/;s/\(.*\)-\(.*\)-\(.*\)/\3 \2 \1/'` ; sed <lspci.man >lspci.8 "s/@TODAY@/$M/;s/@VERSION@/pciutils-3.3.1/;s#@IDSDIR@#/usr/local/share#"
M=`echo 2015-04-09 | sed 's/-01-/-January-/;s/-02-/-February-/;s/-03-/-March-/;s/-04-/-April-/;s/-05-/-May-/;s/-06-/-June-/;s/-07-/-July-/;s/-08-/-August-/;s/-09-/-September-/;s/-10-/-October-/;s/-11-/-November-/;s/-12-/-December-/;s/\(.*\)-\(.*\)-\(.*\)/\3 \2 \1/'` ; sed <setpci.man >setpci.8 "s/@TODAY@/$M/;s/@VERSION@/pciutils-3.3.1/;s#@IDSDIR@#/usr/local/share#"
M=`echo 2015-04-09 | sed 's/-01-/-January-/;s/-02-/-February-/;s/-03-/-March-/;s/-04-/-April-/;s/-05-/-May-/;s/-06-/-June-/;s/-07-/-July-/;s/-08-/-August-/;s/-09-/-September-/;s/-10-/-October-/;s/-11-/-November-/;s/-12-/-December-/;s/\(.*\)-\(.*\)-\(.*\)/\3 \2 \1/'` ; sed <pcilib.man >pcilib.7 "s/@TODAY@/$M/;s/@VERSION@/pciutils-3.3.1/;s#@IDSDIR@#/usr/local/share#"
sed <update-pciids.sh >update-pciids "s@^DEST=.*@DEST=/usr/local/share/pci.ids.gz@;s@^PCI_COMPRESSED_IDS=.*@PCI_COMPRESSED_IDS=1@"
chmod +x update-pciids
M=`echo 2015-04-09 | sed 's/-01-/-January-/;s/-02-/-February-/;s/-03-/-March-/;s/-04-/-April-/;s/-05-/-May-/;s/-06-/-June-/;s/-07-/-July-/;s/-08-/-August-/;s/-09-/-September-/;s/-10-/-October-/;s/-11-/-November-/;s/-12-/-December-/;s/\(.*\)-\(.*\)-\(.*\)/\3 \2 \1/'` ; sed <update-pciids.man >update-pciids.8 "s/@TODAY@/$M/;s/@VERSION@/pciutils-3.3.1/;s#@IDSDIR@#/usr/local/share#"
gzip -9n <pci.ids >pci.ids.gz

 

Tags (1)
0 Kudos
5 Replies
jmartinez
Adventurer
Adventurer
7,045 Views
Registered: ‎06-09-2016

I have solved it installing fedora 20 ...

 

 

0 Kudos
liuzhou
Visitor
Visitor
2,735 Views
Registered: ‎05-11-2017

I meet the same problem in centos 7.2.

I find hwdb is a new feature for pciutil. it is not a must. It can be use define to remove this feature. 

so I remove the code "pci_id_hwdb_lookup" and "pci_id_hwdb_free" in names-hwdb.c.

Now it is ok. 

Hope this solution is helpful.

 

0 Kudos
pedro_uno
Advisor
Advisor
1,993 Views
Registered: ‎02-12-2013

I get the same problem in Ubuntu 16.04. I downloaded and compiled against pciutils-3.3.1.

 

I cannot run Fedora 20 and I'm not sure I understand the final post. I'm guessing he is saying use a #define statement and #ifdef to remove part of the pciutils source code.

 

Is there an official Xilinx response to this problem with the MCAP library in Linux?

 

$ make PCIUTILS_PATH=/home/pedro/Downloads/xilinx/ultrascale/pciutils-3.3.1
gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -I/home/pedro/Downloads/xilinx/ultrascale/pciutils-3.3.1/lib/ -I/home/pedro/Downloads/xilinx/ultrascale/pciutils-3.3.1 -I. mcap.c libmcap.a /home/pedro/Downloads/xilinx/ultrascale/pciutils-3.3.1/lib//libpci.a -lz -o mcap
/home/pedro/Downloads/xilinx/ultrascale/pciutils-3.3.1/lib//libpci.a(names-hwdb.o): In function `pci_id_hwdb_lookup':
names-hwdb.c:(.text+0xd4): undefined reference to `udev_hwdb_get_properties_list_entry'
names-hwdb.c:(.text+0xe9): undefined reference to `udev_list_entry_get_next'
names-hwdb.c:(.text+0xfd): undefined reference to `udev_list_entry_get_name'
names-hwdb.c:(.text+0x114): undefined reference to `udev_list_entry_get_value'
names-hwdb.c:(.text+0x249): undefined reference to `udev_new'
names-hwdb.c:(.text+0x256): undefined reference to `udev_hwdb_new'
/home/pedro/Downloads/xilinx/ultrascale/pciutils-3.3.1/lib//libpci.a(names-hwdb.o): In function `pci_id_hwdb_free':
names-hwdb.c:(.text+0x27e): undefined reference to `udev_hwdb_unref'
names-hwdb.c:(.text+0x294): undefined reference to `udev_unref'
collect2: error: ld returned 1 exit status
Makefile:32: recipe for target 'mcap' failed
make: *** [mcap] Error 1

----------------------------------------
DSP in hardware and software
-----------------------------------------
0 Kudos
pedro_uno
Advisor
Advisor
1,982 Views
Registered: ‎02-12-2013

OK, in the pciutils (3.31) download folder I edited lib/config.h. In there, I commented out PCI_HAVE_HWDB like this.

 

//#define PCI_HAVE_HWDB

 

Then I compiled pciutils.

 

Then I compiled mcap as described in the READM.  Now the ./mcap executable runs.  Thanks

 

$ make PCIUTILS_PATH=/download path/pciutils
gcc -L/home/pedro/github/pciutils/lib/ -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -I/home/pedro/github/pciutils/lib/ -I/home/pedro/github/pciutils -I. -c mcap_lib.c  -o mcap_lib.o -lpci
mcap_lib.c: In function ‘Checkforcompletion’:
mcap_lib.c:208:6: warning: unused variable ‘delay’ [-Wunused-variable]
  u32 delay;
      ^
ar rcs libmcap.a mcap_lib.o
cc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -I/home/pedro/github/pciutils/lib/ -I/home/pedro/github/pciutils -I.   -c -o mcap.o mcap.c
gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -I/home/pedro/github/pciutils/lib/ -I/home/pedro/github/pciutils -I. mcap.c libmcap.a /home/pedro/github/pciutils/lib//libpci.a -lz -o mcap

----------------------------------------
DSP in hardware and software
-----------------------------------------
0 Kudos
mtoumi
Visitor
Visitor
1,155 Views
Registered: ‎07-02-2018

The udev link error are addressed by updating the mcap makefile as follow:

mcap: mcap.o

         gcc $(CFLAGS) mcap.c $(MCAPLIB) $(PCILIB) -lz -ludev -o mcap