You could also pass in the variables to make, as in

 

make CC=/my/gcc CXX=/my/g++ …

 

Ed R

 

From: SPDK <spdk-bounces@lists.01.org> on behalf of liupan1234 <liupan1234@163.com>
Reply-To: Storage Performance Development Kit <spdk@lists.01.org>
Date: Tuesday, October 24, 2017 at 11:44 PM
To: Storage Performance Development Kit <spdk@lists.01.org>
Subject: Re: [SPDK] compile error in old linux kernel version

 

Hi Daniel, Gang and Ziye

 

Thank you all for the help. This issue is resolved now, and the root cause is below:

 

My original gcc was very old: gcc 4.1.2, so I clone an our "internal" maintained version gcc 4.9.2(with some internal changes), and set "path" env variable to point 4.9.2/bin.

 

But, in spdk/mk/cc.mk,  I found it used "CC", not gcc:

CC=cc

CXX=g++

CCAR=ar

CC_TYPE=gcc

 

In normal case, cc is just a link of gcc in the same bin dir. But for this "internal" gcc 4.9.2, "cc" is not existed ... 

 

So I changed spdk/Makefile, and use "gcc" as the option of detect_cc.sh, and it works now.

 

Thanks

Pan 

 

 

 

 

At 2017-10-25 01:36:29, "Verkamp, Daniel" <daniel.verkamp@intel.com> wrote:

Hi Pan,

 

Which Linux distribution are you using?

 

GCC 4.9.2 should be new enough to have -march=native support (it was added in GCC 4.2).

 

You can try removing the ‘-march=native’ option in mk/spdk.common.mk to see if that resolves your problem.

 

Thanks,

-- Daniel

 

From: SPDK [mailto:spdk-bounces@lists.01.org] On Behalf Of Cao, Gang
Sent: Tuesday, October 24, 2017 12:23 AM
To: Storage Performance Development Kit <spdk@lists.01.org>
Subject: Re: [SPDK] compile error in old linux kernel version

 

For devtoolset, you may also refer to http://linux.web.cern.ch/linux/devtoolset/

 

From: SPDK [mailto:spdk-bounces@lists.01.org] On Behalf Of liupan1234
Sent: Tuesday, October 24, 2017 3:13 PM
To: Storage Performance Development Kit <spdk@lists.01.org>
Subject: Re: [SPDK] compile error in old linux kernel version

 

I just need to compile spdk successful under 2.6.32


At 2017-10-24 15:01:47, "Cao, Gang" <gang.cao@intel.com> wrote:

Have you installed the “devtoolset-1.1”?

 

By the way, which component of SPDK are you trying to enable on the old linux kernel 2.6.32 here?

 

From: SPDK [mailto:spdk-bounces@lists.01.org] On Behalf Of liupan1234
Sent: Tuesday, October 24, 2017 2:53 PM
To: Storage Performance Development Kit <spdk@lists.01.org>
Subject: Re: [SPDK] compile error in old linux kernel version

 

scl could work, but error below:

 

[root@e18g06550.et15sqa /etc/yum.repos.d]

#scl enable devtoolset-1.1 bash

Unable to open /etc/scl/prefixes/devtoolset-1.1!

 

At 2017-10-24 14:37:42, "Cao, Gang" <gang.cao@intel.com> wrote:

Have you checked whether scl can work? If it is workable, the scl-utils-build may be not required.

 

# scl

Need at least 3 arguments.

Run scl --help to get help.

 

From: SPDK [mailto:spdk-bounces@lists.01.org] On Behalf Of liupan1234
Sent: Tuesday, October 24, 2017 2:35 PM
To: Storage Performance Development Kit <spdk@lists.01.org>
Subject: Re: [SPDK] compile error in old linux kernel version

 

I can install scl-utils now, but for scl-utils-build,  I could not

#yum install scl-utils scl-utils-build -b current

Loaded plugins: bestyumcache, branch, fastestmirror, security

Loading mirror speeds from cached hostfile

Setting up Install Process

Package scl-utils-20120927-9.el5.x86_64 already installed and latest version

No package scl-utils-build available.

Nothing to do

 

Could you tell me where I could go to download this scl-utils-build?

 Great Thanks


At 2017-10-24 14:14:01, "Cao, Gang" <gang.cao@intel.com> wrote:

On redhat, you can try:

 

yum install scl-utils scl-utils-build

 

For more about scl, https://access.redhat.com/documentation/en-US/Red_Hat_Developer_Toolset/1/html-single/Software_Collections_Guide/

 

From: SPDK [mailto:spdk-bounces@lists.01.org] On Behalf Of liupan1234
Sent: Tuesday, October 24, 2017 1:58 PM
To: Storage Performance Development Kit <spdk@lists.01.org>
Subject: Re: [SPDK] compile error in old linux kernel version

 

Hi Gang,

 

[wanjun.lp@e18g06550.et15sqa /home/wanjun.lp/ussos]

$scl enable devtoolset-1.1 bash

-bash: scl: command not found

 

what is the mean of scl?

 

 

 

 

 

At 2017-10-24 12:18:25, "Cao, Gang" <gang.cao@intel.com> wrote:

Hi Pan,

 

Try below command before running the “make” command:

 

scl enable devtoolset-1.1 bash

 

You may replace "bash" with their preferred shell.

 

Thanks,

Gang

 

From: SPDK [mailto:spdk-bounces@lists.01.org] On Behalf Of liupan1234
Sent: Tuesday, October 24, 2017 11:47 AM
To: spdk@lists.01.org
Subject: [SPDK] compile error in old linux kernel version

 

Hi All,

 

I met an error when I tried to compile spdk under linux kernel 2.6.32, and gcc version is 4.9.2:

$make DPDK_DIR=../dpdk/build/

  CC lib/bdev/bdev.o

bdev.c:1: error: bad value (native) for -march= switch

bdev.c:1: error: bad value (native) for -mtune= switch

make[2]: *** [bdev.o] Error 1

make[1]: *** [bdev] Error 2

make: *** [lib] Error 2

bdev.c:1: error: bad value (native) for -march= switch

 

Could you give me some help?

 

Thanks very much!

Pan