* [dpdk-dev] Compiling DPDK is not working on Red Hat 6.7 @ 2016-07-12 10:02 Raslan Darawsheh 2016-07-12 10:09 ` Christian Ehrhardt 0 siblings, 1 reply; 6+ messages in thread From: Raslan Darawsheh @ 2016-07-12 10:02 UTC (permalink / raw) To: dev Hi, When trying to compile DPDK on Red Hat Enterprise Linux Server release 6.7 (Santiago) it fails to compile. This is the compilation error that is being seen: LD test /download/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.a(eal_timer.o): In function `get_tsc_freq': eal_timer.c:(.text+0x152): undefined reference to `clock_gettime' eal_timer.c:(.text+0x190): undefined reference to `clock_gettime' /download/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.a(eal_alarm.o): In function `rte_eal_alarm_set': eal_alarm.c:(.text+0x382): undefined reference to `clock_gettime' /download/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.a(eal_alarm.o): In function `eal_alarm_callback': eal_alarm.c:(.text+0x5e2): undefined reference to `clock_gettime' collect2: ld returned 1 exit status make[5]: *** [test] Error 1 make[4]: *** [test] Error 2 make[3]: *** [app] Error 2 make[2]: *** [all] Error 2 make[1]: *** [pre_install] Error 2 make: *** [install] Error 2 Kindest regards Raslan Darawsheh ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] Compiling DPDK is not working on Red Hat 6.7 2016-07-12 10:02 [dpdk-dev] Compiling DPDK is not working on Red Hat 6.7 Raslan Darawsheh @ 2016-07-12 10:09 ` Christian Ehrhardt 2016-07-12 11:35 ` Raslan Darawsheh 0 siblings, 1 reply; 6+ messages in thread From: Christian Ehrhardt @ 2016-07-12 10:09 UTC (permalink / raw) To: Raslan Darawsheh; +Cc: dev Hi, checking "man clock_gettime" I see: "Link with -lrt (only for glibc versions before 2.17)." RH 6.7 is at glibc 2.12, I haven't check the build, but you might easily run the make with V=1 and see the call. Check if it contains -lrt for the linking step. Christian Ehrhardt Software Engineer, Ubuntu Server Canonical Ltd On Tue, Jul 12, 2016 at 12:02 PM, Raslan Darawsheh <rasland@mellanox.com> wrote: > Hi, > > When trying to compile DPDK on Red Hat Enterprise Linux Server release 6.7 > (Santiago) it fails to compile. > > This is the compilation error that is being seen: > LD test > /download/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.a(eal_timer.o): > In function `get_tsc_freq': > eal_timer.c:(.text+0x152): undefined reference to `clock_gettime' > eal_timer.c:(.text+0x190): undefined reference to `clock_gettime' > /download/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.a(eal_alarm.o): > In function `rte_eal_alarm_set': > eal_alarm.c:(.text+0x382): undefined reference to `clock_gettime' > /download/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.a(eal_alarm.o): > In function `eal_alarm_callback': > eal_alarm.c:(.text+0x5e2): undefined reference to `clock_gettime' > collect2: ld returned 1 exit status > make[5]: *** [test] Error 1 > make[4]: *** [test] Error 2 > make[3]: *** [app] Error 2 > make[2]: *** [all] Error 2 > make[1]: *** [pre_install] Error 2 > make: *** [install] Error 2 > > Kindest regards > Raslan Darawsheh > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] Compiling DPDK is not working on Red Hat 6.7 2016-07-12 10:09 ` Christian Ehrhardt @ 2016-07-12 11:35 ` Raslan Darawsheh 2016-07-12 12:15 ` Thomas Monjalon 0 siblings, 1 reply; 6+ messages in thread From: Raslan Darawsheh @ 2016-07-12 11:35 UTC (permalink / raw) To: Christian Ehrhardt; +Cc: dev I think the option is there as you see: == Build app/test gcc -m64 -pthread -march=native -DRTE_MACHINE_CPUFLAG_SSE -DRTE_MACHINE_CPUFLAG_SSE2 -DRTE_MACHINE_CPUFLAG_SSE3 -DRTE_MACHINE_CPUFLAG_SSSE3 -DRTE_MACHINE_CPUFLAG_SSE4_1 -DRTE_MACHINE_CPUFLAG_SSE4_2 -DRTE_MACHINE_CPUFLAG_AES -DRTE_MACHINE_CPUFLAG_PCLMULQDQ -DRTE_MACHINE_CPUFLAG_AVX -I/tmp/dpdk/x86_64-native-linuxapp-gcc/include -include /tmp/dpdk/x86_64-native-linuxapp-gcc/include/rte_config.h -O3 -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -Wpointer-arith -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral -Wformat-security -Wundef -Wwrite-strings -Werror -Wno-missing-field-initializers -Wno-uninitialized -D_GNU_SOURCE -Wl,-Map=test.map,--cref -o test commands.o test.o resource.o test_resource.o test_resource_c.res.o test_prefetch.o test_byteorder.o test_per_lcore.o test_atomic.o test_malloc.o test_cycles.o test_spinlock.o test_memory.o test_memzone.o test_ring.o test_ring_perf.o test_pmd_perf.o test_rwlock.o test_timer.o test_timer_perf.o test_timer_racecond.o test_mempool.o test_mempool_perf.o test_mbuf.o test_logs.o test_memcpy.o test_memcpy_perf.o test_hash.o test_thash.o test_hash_perf.o test_hash_functions.o test_hash_scaling.o test_hash_multiwriter.o test_debug.o test_errno.o test_tailq.o test_string_fns.o test_cpuflags.o test_mp_secondary.o test_eal_flags.o test_eal_fs.o test_alarm.o test_interrupts.o test_version.o test_func_reentrancy.o test_cmdline.o test_cmdline_num.o test_cmdline_etheraddr.o test_cmdline_portlist.o test_cmdline_ipaddr.o test_cmdline_cirbuf.o test_cmdline_string.o test_cmdline_lib.o test_red.o test_sched.o test_meter.o test_kni.o test_power.o test_power_acpi_cpufreq.o test_power_kvm_vm.o test_common.o test_distributor.o test_distributor_perf.o test_reorder.o test_devargs.o virtual_pmd.o packet_burst_generator.o test_acl.o test_link_bonding.o test_link_bonding_mode4.o test_link_bonding_rssconf.o test_pmd_ring.o test_pmd_ring_perf.o test_kvargs.o -Wl,-export-dynamic -Wl,-export-dynamic -Wl,-export-dynamic -L/tmp/dpdk/x86_64-native-linuxapp-gcc/lib -Wl,--as-needed -Wl,-lrt -Wl,-lm -L/tmp/dpdk/x86_64-native-linuxapp-gcc/lib -Wl,-lrte_kni -Wl,-lrte_port -Wl,-lrte_pdump -Wl,-lrte_distributor -Wl,-lrte_reorder -Wl,-lrte_ip_frag -Wl,-lrte_meter -Wl,-lrte_sched -Wl,--whole-archive -Wl,-lrte_acl -Wl,--no-whole-archive -Wl,-lrte_jobstats -Wl,-lrte_power -Wl,--whole-archive -Wl,-lrte_timer -Wl,-lrte_hash -Wl,-lrte_vhost -Wl,-lrte_kvargs -Wl,-lrte_mbuf -Wl,-lethdev -Wl,-lrte_mempool -Wl,-lrte_ring -Wl,-lrte_eal -Wl,-lrte_cmdline -Wl,-lrte_cfgfile -Wl,-lrte_pmd_bond -Wl,-lrte_pmd_af_packet -Wl,-lrte_pmd_cxgbe -Wl,-lrte_pmd_e1000 -Wl,-lrte_pmd_ena -Wl,-lrte_pmd_enic -Wl,-lrte_pmd_fm10k -Wl,-lrte_pmd_ixgbe -Wl,-lrte_pmd_mlx5 -Wl,-libverbs -Wl,-lrte_pmd_null -Wl,-lrte_pmd_ring -Wl,-lrte_pmd_virtio -Wl,-lrte_pmd_vhost -Wl,-lrte_pmd_vmxnet3_uio -Wl,--no-whole-archive -Wl,-ldl /tmp/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.a(eal_timer.o): In function `get_tsc_freq': eal_timer.c:(.text+0x152): undefined reference to `clock_gettime' eal_timer.c:(.text+0x190): undefined reference to `clock_gettime' /tmp/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.a(eal_alarm.o): In function `rte_eal_alarm_set': eal_alarm.c:(.text+0x382): undefined reference to `clock_gettime' /tmp/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.a(eal_alarm.o): In function `eal_alarm_callback': eal_alarm.c:(.text+0x5e2): undefined reference to `clock_gettime' collect2: ld returned 1 exit status make[5]: *** [test] Error 1 make[4]: *** [test] Error 2 make[3]: *** [app] Error 2 make[2]: *** [all] Error 2 make[1]: *** [pre_install] Error 2 make: *** [install] Error 2 but kindest regards Raslan Darawsheh From: Christian Ehrhardt [mailto:christian.ehrhardt@canonical.com] Sent: Tuesday, July 12, 2016 1:10 PM To: Raslan Darawsheh Cc: dev@dpdk.org Subject: Re: [dpdk-dev] Compiling DPDK is not working on Red Hat 6.7 Hi, checking "man clock_gettime" I see: "Link with -lrt (only for glibc versions before 2.17)." RH 6.7 is at glibc 2.12, I haven't check the build, but you might easily run the make with V=1 and see the call. Check if it contains -lrt for the linking step. Christian Ehrhardt Software Engineer, Ubuntu Server Canonical Ltd On Tue, Jul 12, 2016 at 12:02 PM, Raslan Darawsheh <rasland@mellanox.com<mailto:rasland@mellanox.com>> wrote: Hi, When trying to compile DPDK on Red Hat Enterprise Linux Server release 6.7 (Santiago) it fails to compile. This is the compilation error that is being seen: LD test /download/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.a(eal_timer.o): In function `get_tsc_freq': eal_timer.c:(.text+0x152): undefined reference to `clock_gettime' eal_timer.c:(.text+0x190): undefined reference to `clock_gettime' /download/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.a(eal_alarm.o): In function `rte_eal_alarm_set': eal_alarm.c:(.text+0x382): undefined reference to `clock_gettime' /download/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.a(eal_alarm.o): In function `eal_alarm_callback': eal_alarm.c:(.text+0x5e2): undefined reference to `clock_gettime' collect2: ld returned 1 exit status make[5]: *** [test] Error 1 make[4]: *** [test] Error 2 make[3]: *** [app] Error 2 make[2]: *** [all] Error 2 make[1]: *** [pre_install] Error 2 make: *** [install] Error 2 Kindest regards Raslan Darawsheh ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] Compiling DPDK is not working on Red Hat 6.7 2016-07-12 11:35 ` Raslan Darawsheh @ 2016-07-12 12:15 ` Thomas Monjalon 2016-07-13 6:01 ` Raslan Darawsheh 0 siblings, 1 reply; 6+ messages in thread From: Thomas Monjalon @ 2016-07-12 12:15 UTC (permalink / raw) To: Raslan Darawsheh; +Cc: dev, Christian Ehrhardt Hi, 2016-07-12 11:35, Raslan Darawsheh: > I think the option is there as you see: > [...] > -Wl,--as-needed -Wl,-lrt -Wl,-lm |...] -Wl,-lrte_eal [...] > eal_timer.c:(.text+0x152): undefined reference to `clock_gettime' I suspect we need -lrt after -lrte_eal. Please could you try the following patch? --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -176,6 +176,8 @@ ifeq ($(RTE_DEVEL_BUILD)$(CONFIG_RTE_BUILD_SHARED_LIB),yy) LDFLAGS += -rpath=$(RTE_SDK_BIN)/lib endif +MAPFLAGS = -Map=$@.map --cref + .PHONY: all all: install @@ -190,15 +192,13 @@ build: _postbuild exe2cmd = $(strip $(call dotfile,$(patsubst %,%.cmd,$(1)))) ifeq ($(LINK_USING_CC),1) -override EXTRA_LDFLAGS := $(call linkerprefix,$(EXTRA_LDFLAGS)) -O_TO_EXE = $(CC) $(CFLAGS) \ - $(call linkerprefix,$(LDLIBS)) \ - $(call linkerprefix,$(LDFLAGS)) $(LDFLAGS_$(@)) $(EXTRA_LDFLAGS) \ - -Wl,-Map=$(@).map,--cref -o $@ $(OBJS-y) +O_TO_EXE = $(CC) -o $@ $(CFLAGS) $(OBJS-y) $(call linkerprefix, \ + $(LDLIBS) $(LDFLAGS) $(LDFLAGS_$(@)) $(EXTRA_LDFLAGS) \ + $(MAPFLAGS)) else -O_TO_EXE = $(LD) $(LDLIBS) \ - $(LDFLAGS) $(LDFLAGS_$(@)) $(EXTRA_LDFLAGS) \ - -Map=$(@).map --cref -o $@ $(OBJS-y) +O_TO_EXE = $(LD) -o $@ $(OBJS-y) + $(LDLIBS) $(LDFLAGS) $(LDFLAGS_$(@)) $(EXTRA_LDFLAGS) \ + $(MAPFLAGS) endif O_TO_EXE_STR = $(subst ','\'',$(O_TO_EXE)) #'# fix syntax highlight O_TO_EXE_DISP = $(if $(V),"$(O_TO_EXE_STR)"," LD $(@)") ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] Compiling DPDK is not working on Red Hat 6.7 2016-07-12 12:15 ` Thomas Monjalon @ 2016-07-13 6:01 ` Raslan Darawsheh 2016-07-13 7:45 ` Thomas Monjalon 0 siblings, 1 reply; 6+ messages in thread From: Raslan Darawsheh @ 2016-07-13 6:01 UTC (permalink / raw) To: Thomas Monjalon; +Cc: dev, Christian Ehrhardt It seems that the patch fixed the issue. Kindest regards Raslan Darawsheh -----Original Message----- From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] Sent: Tuesday, July 12, 2016 3:16 PM To: Raslan Darawsheh Cc: dev@dpdk.org; Christian Ehrhardt Subject: Re: [dpdk-dev] Compiling DPDK is not working on Red Hat 6.7 Hi, 2016-07-12 11:35, Raslan Darawsheh: > I think the option is there as you see: > [...] > -Wl,--as-needed -Wl,-lrt -Wl,-lm |...] -Wl,-lrte_eal [...] > eal_timer.c:(.text+0x152): undefined reference to `clock_gettime' I suspect we need -lrt after -lrte_eal. Please could you try the following patch? --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -176,6 +176,8 @@ ifeq ($(RTE_DEVEL_BUILD)$(CONFIG_RTE_BUILD_SHARED_LIB),yy) LDFLAGS += -rpath=$(RTE_SDK_BIN)/lib endif +MAPFLAGS = -Map=$@.map --cref + .PHONY: all all: install @@ -190,15 +192,13 @@ build: _postbuild exe2cmd = $(strip $(call dotfile,$(patsubst %,%.cmd,$(1)))) ifeq ($(LINK_USING_CC),1) -override EXTRA_LDFLAGS := $(call linkerprefix,$(EXTRA_LDFLAGS)) -O_TO_EXE = $(CC) $(CFLAGS) \ - $(call linkerprefix,$(LDLIBS)) \ - $(call linkerprefix,$(LDFLAGS)) $(LDFLAGS_$(@)) $(EXTRA_LDFLAGS) \ - -Wl,-Map=$(@).map,--cref -o $@ $(OBJS-y) +O_TO_EXE = $(CC) -o $@ $(CFLAGS) $(OBJS-y) $(call linkerprefix, \ + $(LDLIBS) $(LDFLAGS) $(LDFLAGS_$(@)) $(EXTRA_LDFLAGS) \ + $(MAPFLAGS)) else -O_TO_EXE = $(LD) $(LDLIBS) \ - $(LDFLAGS) $(LDFLAGS_$(@)) $(EXTRA_LDFLAGS) \ - -Map=$(@).map --cref -o $@ $(OBJS-y) +O_TO_EXE = $(LD) -o $@ $(OBJS-y) + $(LDLIBS) $(LDFLAGS) $(LDFLAGS_$(@)) $(EXTRA_LDFLAGS) \ + $(MAPFLAGS) endif O_TO_EXE_STR = $(subst ','\'',$(O_TO_EXE)) #'# fix syntax highlight O_TO_EXE_DISP = $(if $(V),"$(O_TO_EXE_STR)"," LD $(@)") ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] Compiling DPDK is not working on Red Hat 6.7 2016-07-13 6:01 ` Raslan Darawsheh @ 2016-07-13 7:45 ` Thomas Monjalon 0 siblings, 0 replies; 6+ messages in thread From: Thomas Monjalon @ 2016-07-13 7:45 UTC (permalink / raw) To: Raslan Darawsheh; +Cc: dev, Christian Ehrhardt 2016-07-13 06:01, Raslan Darawsheh: > It seems that the patch fixed the issue. Thanks, I've sent the patches: http://dpdk.org/ml/archives/dev/2016-July/043917.html > -----Original Message----- > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > 2016-07-12 11:35, Raslan Darawsheh: > > I think the option is there as you see: > > > [...] > > -Wl,--as-needed -Wl,-lrt -Wl,-lm |...] -Wl,-lrte_eal > [...] > > eal_timer.c:(.text+0x152): undefined reference to `clock_gettime' > > I suspect we need -lrt after -lrte_eal. Do you know where the flag -lrt is set? Is it in your environment LDFLAGS? (it is my guess for the fix). ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-07-13 7:45 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2016-07-12 10:02 [dpdk-dev] Compiling DPDK is not working on Red Hat 6.7 Raslan Darawsheh 2016-07-12 10:09 ` Christian Ehrhardt 2016-07-12 11:35 ` Raslan Darawsheh 2016-07-12 12:15 ` Thomas Monjalon 2016-07-13 6:01 ` Raslan Darawsheh 2016-07-13 7:45 ` Thomas Monjalon
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).