Cannot build 64 bit on CentOS

Machine-specific discussion
Unix, Linux, OS X, OS/2, Windows, ..?
Locked
csfreebird
Posts: 107
Joined: Tue Jan 15, 2013 11:54 am
Location: China, Beijing
Contact:

Cannot build 64 bit on CentOS

Post by csfreebird »

I figure out how to build newLISP on CentOS, but cannot build 64 bit version, Below is my build information.
Environment:
[root@hadoopMaster newlisp-10.6.0]# lsb_release -a
LSB Version: :core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 5.9 (Final)
Release: 5.9
Codename: Final
[root@hadoopMaster newlisp-10.6.0]# uname -a
Linux hadoopMaster.com 2.6.18-348.6.1.el5 #1 SMP Tue May 21 15:29:55 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux
[root@hadoopMaster newlisp-10.6.0]# gcc --version
gcc (GCC) 4.7.2 20121015 (Red Hat 4.7.2-5)
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Since the default configure does not work on CentOS, I find one CMakeLists.txt and modify it,

Code: Select all

cmake_minimum_required (VERSION 2.6)
 
include_directories(${CMAKE_SOURCE_DIR})
 
project(newlisp)
set(NEWLISP_SRC newlisp newlisp.c nl-symbol.c nl-math.c nl-list.c nl-liststr.c
nl-string.c nl-filesys.c nl-sock.c nl-import.c nl-xml.c nl-web.c nl-matrix.c
nl-debug.c pcre.c)
add_executable(newlisp ${NEWLISP_SRC})
#add_library(newlisp SHARED ${NEWLISP_SRC})
 
if(UNIX) 
    add_definitions("-DLINUX")
endif(UNIX)
 
if(WIN)
    add_definitions("-DWIN_32")
endif(WIN)
 
if(APPLE)
    add_definitions("-DMAC_OSX")
endif(APPLE)
 
TARGET_LINK_LIBRARIES(newlisp ffi m dl readline ncurses)
Then I set the environment and build it:

Code: Select all

export CFLAGS=-m64  
cmake .
make VERBOSE=1

Code: Select all

[root@hadoopMaster newlisp-10.6.0]# make VERBOSE=1
/usr/bin/cmake -H/opt/newlisp-10.6.0 -B/opt/newlisp-10.6.0 --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /opt/newlisp-10.6.0/CMakeFiles /opt/newlisp-10.6.0/CMakeFiles/progress.make
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory `/opt/newlisp-10.6.0'
make -f CMakeFiles/newlisp.dir/build.make CMakeFiles/newlisp.dir/depend
make[2]: Entering directory `/opt/newlisp-10.6.0'
cd /opt/newlisp-10.6.0 && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /opt/newlisp-10.6.0 /opt/newlisp-10.6.0 /opt/newlisp-10.6.0 /opt/newlisp-10.6.0 /opt/newlisp-10.6.0/CMakeFiles/newlisp.dir/DependInfo.cmake --color=
Dependee "/opt/newlisp-10.6.0/CMakeFiles/newlisp.dir/DependInfo.cmake" is newer than depender "/opt/newlisp-10.6.0/CMakeFiles/newlisp.dir/depend.internal".
Scanning dependencies of target newlisp
make[2]: Leaving directory `/opt/newlisp-10.6.0'
make -f CMakeFiles/newlisp.dir/build.make CMakeFiles/newlisp.dir/build
make[2]: Entering directory `/opt/newlisp-10.6.0'
/usr/bin/cmake -E cmake_progress_report /opt/newlisp-10.6.0/CMakeFiles 1
[  7%] Building C object CMakeFiles/newlisp.dir/newlisp.c.o
/opt/centos/devtoolset-1.1/root/usr/bin/gcc  -DLINUX -m64  -I/opt/newlisp-10.6.0   -o CMakeFiles/newlisp.dir/newlisp.c.o   -c /opt/newlisp-10.6.0/newlisp.c
/usr/bin/cmake -E cmake_progress_report /opt/newlisp-10.6.0/CMakeFiles 2
[ 14%] Building C object CMakeFiles/newlisp.dir/nl-symbol.c.o
/opt/centos/devtoolset-1.1/root/usr/bin/gcc  -DLINUX -m64  -I/opt/newlisp-10.6.0   -o CMakeFiles/newlisp.dir/nl-symbol.c.o   -c /opt/newlisp-10.6.0/nl-symbol.c
/usr/bin/cmake -E cmake_progress_report /opt/newlisp-10.6.0/CMakeFiles 3
[ 21%] Building C object CMakeFiles/newlisp.dir/nl-math.c.o
/opt/centos/devtoolset-1.1/root/usr/bin/gcc  -DLINUX -m64  -I/opt/newlisp-10.6.0   -o CMakeFiles/newlisp.dir/nl-math.c.o   -c /opt/newlisp-10.6.0/nl-math.c
/usr/bin/cmake -E cmake_progress_report /opt/newlisp-10.6.0/CMakeFiles 4
[ 28%] Building C object CMakeFiles/newlisp.dir/nl-list.c.o
/opt/centos/devtoolset-1.1/root/usr/bin/gcc  -DLINUX -m64  -I/opt/newlisp-10.6.0   -o CMakeFiles/newlisp.dir/nl-list.c.o   -c /opt/newlisp-10.6.0/nl-list.c
/usr/bin/cmake -E cmake_progress_report /opt/newlisp-10.6.0/CMakeFiles 5
[ 35%] Building C object CMakeFiles/newlisp.dir/nl-liststr.c.o
/opt/centos/devtoolset-1.1/root/usr/bin/gcc  -DLINUX -m64  -I/opt/newlisp-10.6.0   -o CMakeFiles/newlisp.dir/nl-liststr.c.o   -c /opt/newlisp-10.6.0/nl-liststr.c
/usr/bin/cmake -E cmake_progress_report /opt/newlisp-10.6.0/CMakeFiles 6
[ 42%] Building C object CMakeFiles/newlisp.dir/nl-string.c.o
/opt/centos/devtoolset-1.1/root/usr/bin/gcc  -DLINUX -m64  -I/opt/newlisp-10.6.0   -o CMakeFiles/newlisp.dir/nl-string.c.o   -c /opt/newlisp-10.6.0/nl-string.c
/usr/bin/cmake -E cmake_progress_report /opt/newlisp-10.6.0/CMakeFiles 7
[ 50%] Building C object CMakeFiles/newlisp.dir/nl-filesys.c.o
/opt/centos/devtoolset-1.1/root/usr/bin/gcc  -DLINUX -m64  -I/opt/newlisp-10.6.0   -o CMakeFiles/newlisp.dir/nl-filesys.c.o   -c /opt/newlisp-10.6.0/nl-filesys.c
/usr/bin/cmake -E cmake_progress_report /opt/newlisp-10.6.0/CMakeFiles 8
[ 57%] Building C object CMakeFiles/newlisp.dir/nl-sock.c.o
/opt/centos/devtoolset-1.1/root/usr/bin/gcc  -DLINUX -m64  -I/opt/newlisp-10.6.0   -o CMakeFiles/newlisp.dir/nl-sock.c.o   -c /opt/newlisp-10.6.0/nl-sock.c
/usr/bin/cmake -E cmake_progress_report /opt/newlisp-10.6.0/CMakeFiles 9
[ 64%] Building C object CMakeFiles/newlisp.dir/nl-import.c.o
/opt/centos/devtoolset-1.1/root/usr/bin/gcc  -DLINUX -m64  -I/opt/newlisp-10.6.0   -o CMakeFiles/newlisp.dir/nl-import.c.o   -c /opt/newlisp-10.6.0/nl-import.c
/usr/bin/cmake -E cmake_progress_report /opt/newlisp-10.6.0/CMakeFiles 10
[ 71%] Building C object CMakeFiles/newlisp.dir/nl-xml-json.c.o
/opt/centos/devtoolset-1.1/root/usr/bin/gcc  -DLINUX -m64  -I/opt/newlisp-10.6.0   -o CMakeFiles/newlisp.dir/nl-xml-json.c.o   -c /opt/newlisp-10.6.0/nl-xml-json.c
/usr/bin/cmake -E cmake_progress_report /opt/newlisp-10.6.0/CMakeFiles 11
[ 78%] Building C object CMakeFiles/newlisp.dir/nl-web.c.o
/opt/centos/devtoolset-1.1/root/usr/bin/gcc  -DLINUX -m64  -I/opt/newlisp-10.6.0   -o CMakeFiles/newlisp.dir/nl-web.c.o   -c /opt/newlisp-10.6.0/nl-web.c
/usr/bin/cmake -E cmake_progress_report /opt/newlisp-10.6.0/CMakeFiles 12
[ 85%] Building C object CMakeFiles/newlisp.dir/nl-matrix.c.o
/opt/centos/devtoolset-1.1/root/usr/bin/gcc  -DLINUX -m64  -I/opt/newlisp-10.6.0   -o CMakeFiles/newlisp.dir/nl-matrix.c.o   -c /opt/newlisp-10.6.0/nl-matrix.c
/usr/bin/cmake -E cmake_progress_report /opt/newlisp-10.6.0/CMakeFiles 13
[ 92%] Building C object CMakeFiles/newlisp.dir/nl-debug.c.o
/opt/centos/devtoolset-1.1/root/usr/bin/gcc  -DLINUX -m64  -I/opt/newlisp-10.6.0   -o CMakeFiles/newlisp.dir/nl-debug.c.o   -c /opt/newlisp-10.6.0/nl-debug.c
/usr/bin/cmake -E cmake_progress_report /opt/newlisp-10.6.0/CMakeFiles 14
[100%] Building C object CMakeFiles/newlisp.dir/pcre.c.o
/opt/centos/devtoolset-1.1/root/usr/bin/gcc  -DLINUX -m64  -I/opt/newlisp-10.6.0   -o CMakeFiles/newlisp.dir/pcre.c.o   -c /opt/newlisp-10.6.0/pcre.c
Linking C executable newlisp
/usr/bin/cmake -E cmake_link_script CMakeFiles/newlisp.dir/link.txt --verbose=1
/opt/centos/devtoolset-1.1/root/usr/bin/gcc  -m64   -fPIC CMakeFiles/newlisp.dir/newlisp.c.o CMakeFiles/newlisp.dir/nl-symbol.c.o CMakeFiles/newlisp.dir/nl-math.c.o CMakeFiles/newlisp.dir/nl-list.c.o CMakeFiles/newlisp.dir/nl-liststr.c.o CMakeFiles/newlisp.dir/nl-string.c.o CMakeFiles/newlisp.dir/nl-filesys.c.o CMakeFiles/newlisp.dir/nl-sock.c.o CMakeFiles/newlisp.dir/nl-import.c.o CMakeFiles/newlisp.dir/nl-xml-json.c.o CMakeFiles/newlisp.dir/nl-web.c.o CMakeFiles/newlisp.dir/nl-matrix.c.o CMakeFiles/newlisp.dir/nl-debug.c.o CMakeFiles/newlisp.dir/pcre.c.o  -o newlisp -rdynamic -lffi -lm -ldl -lreadline -lncurses 
But got 32bit version finally:

Code: Select all

[root@hadoopMaster newlisp-10.6.0]# ./newlisp
newLISP v.10.6.0 32-bit on Linux IPv4/6, options: newlisp -h

TedWalther
Posts: 608
Joined: Mon Feb 05, 2007 1:04 am
Location: Abbotsford, BC
Contact:

Re: Cannot build 64 bit on CentOS

Post by TedWalther »

Did you try ./configure-alt first and see what result it gave?
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence. Nine months later, they left with a baby named newLISP. The women of the ivory towers wept and wailed. "Abomination!" they cried.

csfreebird
Posts: 107
Joined: Tue Jan 15, 2013 11:54 am
Location: China, Beijing
Contact:

Re: Cannot build 64 bit on CentOS

Post by csfreebird »

Thanks, it works.
cmake is not required now. ;)

TedWalther
Posts: 608
Joined: Mon Feb 05, 2007 1:04 am
Location: Abbotsford, BC
Contact:

Re: Cannot build 64 bit on CentOS

Post by TedWalther »

Very glad it worked.
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence. Nine months later, they left with a baby named newLISP. The women of the ivory towers wept and wailed. "Abomination!" they cried.

Locked