It is my first time creating RPM package and I followed this documentation to build a simple RPM package. I created source RPM but I can't create binary RPM.
Here is the result when I execute rpmbuild --rebuild /SRPMS/bello-0.1.1.el8.src.rpm:
Installing ../SRPMS/bello-0.1-1.el8.src.rpm
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.LmHvbG
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd /root/rpmbuild/BUILD
+ rm -rf bello-0.1
+ /usr/bin/gzip -dc /root/rpmbuild/SOURCES/bello-0.1.tar.gz
+ /usr/bin/tar -xof -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd bello-0.1
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.k6UGT9
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd bello-0.1
+ CFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
+ export CFLAGS
+ CXXFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
+ export CXXFLAGS
+ FFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules'
+ export FFLAGS
+ FCFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules'
+ export FCFLAGS
+ LDFLAGS='-Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld'
+ export LDFLAGS
+ '[' 1 = 1 ']'
+++ dirname ./configure
++ find . -name config.guess -o -name config.sub
+ '[' 1 = 1 ']'
+ '[' x '!=' 'x-Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld' ']'
++ find . -name ltmain.sh
+ ./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info
/var/tmp/rpm-tmp.k6UGT9: line 49: ./configure: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.k6UGT9 (%build)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.k6UGT9 (%build)
I get the same result when I execute rpmbuild -bb bello.spec command.
Here is my SPEC file:
Name: bello
Version: 0.1
Release: 1%{?dist}
Summary: Hello World example implemented in bash script
License: GPLv3+
URL: https://example.com/%{name}
Source0: https://example.com/%{name}/releases/%{name}-%{version}.tar.gz
Requires: bash
BuildArch: noarch
%description
some description for this basic code.
%prep
%setup -q
%build
%configure
%make_build
%install
mkdir -p %{buildroot}/%{_bindir}
install -m 0755 %{name} %{buildroot}/%{_bindir}/%{name}
%make_install
%files
%{_bindir}/%{name}
%license LICENSE
%doc add-docs-here
%changelog
* Tue Aug 30 2022 talat ayhan <fadedship#gmail.com> - 0.1-1
- First bello package
- Example second item in the changelog for version-release 0.1-1
I am trying to install Algorithm::AhoCorasick::XS on Windows 10, MSYS2:
$ perl Makefile.PL
Generating a Unix-style Makefile
Writing Makefile for Algorithm::AhoCorasick::XS
Writing MYMETA.yml and MYMETA.json
cp lib/Algorithm/AhoCorasick/XS.pm blib/lib/Algorithm/AhoCorasick/XS.pm
Running Mkbootstrap for XS ()
chmod 644 "XS.bs"
"/usr/bin/perl.exe" -MExtUtils::Command::MM -e 'cp_nonempty' -- XS.bs blib/arch/auto/Algorithm/AhoCorasick/XS/XS.bs 644
g++ -c -Wall -std=c++11 -DUSEIMPORTLIB -march=x86-64 -mtune=generic -O2 -pipe -DVERSION=\"0.04\" -DXS_VERSION=\"0.04\" "-I/usr/lib/perl5/core_perl/CORE" Matcher.cpp
"/usr/bin/perl.exe" "/usr/share/perl5/core_perl/ExtUtils/xsubpp" -C++ -typemap '/usr/share/perl5/core_perl/ExtUtils/typemap' -typemap '/home/hakon/perl/cpan-source/Algorithm-AhoCorasick-XS-0.04/perlobject.map' -typemap '/home/hakon/perl/cpan-source/Algorithm-AhoCorasick-XS-0.04/typemap' -typemap '/home/hakon/perl/cpan-source/Algorithm-AhoCorasick-XS-0.04/typemap' ac.xs > ac.xsc
mv ac.xsc ac.c
g++ -c -Wall -std=c++11 -DUSEIMPORTLIB -march=x86-64 -mtune=generic -O2 -pipe -DVERSION=\"0.04\" -DXS_VERSION=\"0.04\" "-I/usr/lib/perl5/core_perl/CORE" ac.c
In file included from ac.xs:11:
ppport.h:4594: warning: "WIDEST_UTYPE" redefined
4594 | # define WIDEST_UTYPE U64TYPE
|
In file included from /usr/lib/perl5/core_perl/CORE/perl.h:2753,
from ac.xs:5:
/usr/lib/perl5/core_perl/CORE/handy.h:1251: note: this is the location of the previous definition
1251 | # define WIDEST_UTYPE U64
|
In file included from /usr/lib/perl5/core_perl/CORE/perl.h:28,
from ac.xs:5:
/usr/lib/perl5/core_perl/CORE/config.h:1011:20: error: ‘sigjmp_buf’ does not name a type; did you mean ‘Sigjmp_buf’?
1011 | #define Sigjmp_buf sigjmp_buf
| ^~~~~~~~~~
/usr/lib/perl5/core_perl/CORE/cop.h:34:5: note: in expansion of macro ‘Sigjmp_buf’
34 | Sigjmp_buf je_buf; /* uninit if je_prev is NULL */
| ^~~~~~~~~~
make: *** [Makefile:341: ac.o] Error 1
What can be the problem here?
It seems like the C++ option -std=c++11 is confusing MSYS2. In Makefile.PL line #20, we have:
CCFLAGS => '-Wall -std=c++11',
if I remove -std=c++11 and save the file and recompile, it works fine:
$ make clean
$ perl Makefile.PL
$ make
cp lib/Algorithm/AhoCorasick/XS.pm blib/lib/Algorithm/AhoCorasick/XS.pm
Running Mkbootstrap for XS ()
chmod 644 "XS.bs"
"/usr/bin/perl.exe" -MExtUtils::Command::MM -e 'cp_nonempty' -- XS.bs blib/arch/auto/Algorithm/AhoCorasick/XS/XS.bs 644
g++ -c -Wall -DUSEIMPORTLIB -march=x86-64 -mtune=generic -O2 -pipe -DVERSION=\"0.04\" -DXS_VERSION=\"0.04\" "-I/usr/lib/perl5/core_perl/CORE" Matcher.cpp
"/usr/bin/perl.exe" "/usr/share/perl5/core_perl/ExtUtils/xsubpp" -C++ -typemap '/usr/share/perl5/core_perl/ExtUtils/typemap' -typemap '/home/hakon/perl/cpan-source/Algorithm-AhoCorasick-XS-0.04/perlobject.map' -typemap '/home/hakon/perl/cpan-source/Algorithm-AhoCorasick-XS-0.04/typemap' -typemap '/home/hakon/perl/cpan-source/Algorithm-AhoCorasick-XS-0.04/typemap' ac.xs > ac.xsc
mv ac.xsc ac.c
g++ -c -Wall -DUSEIMPORTLIB -march=x86-64 -mtune=generic -O2 -pipe -DVERSION=\"0.04\" -DXS_VERSION=\"0.04\" "-I/usr/lib/perl5/core_perl/CORE" ac.c
In file included from ac.xs:11:
ppport.h:4594: warning: "WIDEST_UTYPE" redefined
4594 | # define WIDEST_UTYPE U64TYPE
|
In file included from /usr/lib/perl5/core_perl/CORE/perl.h:2753,
from ac.xs:5:
/usr/lib/perl5/core_perl/CORE/handy.h:1251: note: this is the location of the previous definition
1251 | # define WIDEST_UTYPE U64
|
g++ -c -Wall -DUSEIMPORTLIB -march=x86-64 -mtune=generic -O2 -pipe -DVERSION=\"0.04\" -DXS_VERSION=\"0.04\" "-I/usr/lib/perl5/core_perl/CORE" test.c
rm -f blib/arch/auto/Algorithm/AhoCorasick/XS/XS.dll
g++ --shared -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--enable-auto-image-base -fstack-protector-strong Matcher.o ac.o test.o -o blib/arch/auto/Algorithm/AhoCorasick/XS/XS.dll \
/usr/lib/perl5/core_perl/CORE/msys-perl5_32.dll \
chmod 755 blib/arch/auto/Algorithm/AhoCorasick/XS/XS.dll
Manifying 1 pod document
$ make test
"/usr/bin/perl.exe" -MExtUtils::Command::MM -e 'cp_nonempty' -- XS.bs blib/arch/auto/Algorithm/AhoCorasick/XS/XS.bs 644
PERL_DL_NONLAZY=1 "/usr/bin/perl.exe" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/basic.t ....... ok
t/details.t ..... ok
t/edge_cases.t .. ok
t/utf8.t ........ ok
t/variation.t ... ok
All tests successful.
Files=5, Tests=1624, 2 wallclock secs ( 0.14 usr 0.06 sys + 0.64 cusr 0.85 csys = 1.69 CPU)
Result: PASS
See also this question.
I have been working in Eclipse based IDE called Vitis (IDE from Xilinx).
I have an automatically generated software project containing three automatically
generated Makefiles. Organization of the project is following:
zynq_fsbl
-Makefile_level_01
-main.c
-zynq_fsbl_bsp
-Makefile_level_02
-ps7_cortexa9_0
-code
-include
-Config.h
-lib
-libsrc
-peripheral_01
-src
-driver_peripheral_01.c
-driver_peripheral_01.h
-Makefile_level_03_01
-peripheral_02
-src
-driver_peripheral_02.c
-driver_peripheral_02.h
-Makefile_level_03_02
- ... same pattern repeats for other perpherals
Makefile_level_01 contains:
# Auto Generated by Xilinx generate_app. Modify at your own risk
CC := arm-none-eabi-gcc
CC_FLAGS := -MMD -MP -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard
CFLAGS :=
LN_FLAGS := -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -Wl,-build-id=none -specs=Xilinx.spec -lrsa -Wl,--start-group,-lxil,-lgcc,-lc,--end-group -Wl,--start-group,-lxilffs,-lxil,-lgcc,-lc,--end-group -Wl,--start-group,-lrsa,-lxil,-lgcc,-lc,--end-group -Wl,--gc-sections
c_SOURCES := $(wildcard *.c)
S_SOURCES := $(wildcard *.S)
INCLUDES := $(wildcard *.h)
OBJS := $(patsubst %.c, %.o, $(c_SOURCES))
OBJS += $(patsubst %.S, %.o, $(S_SOURCES))
LSCRIPT := -Tlscript.ld
CURRENT_DIR = $(shell pwd)
DEPFILES := $(patsubst %.o, %.d, $(OBJS))
LIBS := zynq_fsbl_bsp/ps7_cortexa9_0/lib/libxil.a
EXEC := executable.elf
INCLUDEPATH := -Izynq_fsbl_bsp/ps7_cortexa9_0/include -I.
LIBPATH := -Lzynq_fsbl_bsp/ps7_cortexa9_0/lib -L./
all: $(EXEC)
$(EXEC): $(LIBS) $(OBJS) $(INCLUDES)
$(CC) -o $# $(OBJS) $(CC_FLAGS) $(CFLAGS) $(LN_FLAGS) $(LIBPATH) $(LSCRIPT)
$(LIBS):
$(MAKE) -C zynq_fsbl_bsp
%.o:%.c
$(CC) $(CC_FLAGS) $(CFLAGS) -c $< -o $# $(INCLUDEPATH)
%.o:%.S
$(CC) $(CC_FLAGS) $(CFLAGS) -c $< -o $# $(INCLUDEPATH)
%.o:%.s
$(CC) $(CC_FLAGS) $(CFLAGS) -c $< -o $# $(INCLUDEPATH)
clean:
rm -rf $(OBJS) $(LIBS) $(EXEC) *.o
-include $(DEPFILES)
Makefile_level_02 contains:
# Makefile generated by Xilinx.
PROCESSOR = ps7_cortexa9_0
LIBRARIES = ${PROCESSOR}/lib/libxil.a
BSP_MAKEFILES := $(wildcard $(PROCESSOR)/libsrc/*/src/Makefile)
SUBDIRS := $(patsubst %/Makefile, %, $(BSP_MAKEFILES))
ifneq (,$(findstring win,$(RDI_PLATFORM)))
SHELL = CMD
endif
all: libs
#echo 'Finished building libraries'
include: $(addsuffix /make.include,$(SUBDIRS))
libs: $(addsuffix /make.libs,$(SUBDIRS))
clean: $(addsuffix /make.clean,$(SUBDIRS))
$(PROCESSOR)/lib/libxil.a: $(PROCESSOR)/lib/libxil_init.a
cp -f $< $#
%/make.include: $(if $(wildcard $(PROCESSOR)/lib/libxil_init.a),$(PROCESSOR)/lib/libxil.a,)
#echo "Running Make include in $(subst /make.include,,$#)"
$(MAKE) -C $(subst /make.include,,$#) -s include "SHELL=$(SHELL)" "COMPILER=arm-none-eabi-gcc" "ASSEMBLER=arm-none-eabi-as" "ARCHIVER=arm-none-eabi-ar" "COMPILER_FLAGS= -O2 -c" "EXTRA_COMPILER_FLAGS=-mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -nostartfiles -g -Wall -Wextra"
%/make.libs: include
#echo "Running Make libs in $(subst /make.libs,,$#)"
$(MAKE) -C $(subst /make.libs,,$#) -s libs "SHELL=$(SHELL)" "COMPILER=arm-none-eabi-gcc" "ASSEMBLER=arm-none-eabi-as" "ARCHIVER=arm-none-eabi-ar" "COMPILER_FLAGS= -O2 -c" "EXTRA_COMPILER_FLAGS=-mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -nostartfiles -g -Wall -Wextra"
%/make.clean:
$(MAKE) -C $(subst /make.clean,,$#) -s clean
clean:
rm -f ${PROCESSOR}/lib/libxil.a
Makefile_level_03 for peripheral_01 contains:
COMPILER=
ARCHIVER=
CP=cp
COMPILER_FLAGS=
EXTRA_COMPILER_FLAGS=
LIB=libxil.a
LEVEL=0
RELEASEDIR=../../../lib
INCLUDEDIR=../../../include
INCLUDES=-I./. -I${INCLUDEDIR}
INCLUDEFILES=*.h
LIBSOURCES=*.c
OUTS = *.o
libs:
echo "Compiling driver_peripheral_01 ..."
$(COMPILER) $(COMPILER_FLAGS) $(EXTRA_COMPILER_FLAGS) $(INCLUDES) $(LIBSOURCES)
$(ARCHIVER) -r ${RELEASEDIR}/${LIB} ${OUTS}
make clean
include:
${CP} $(INCLUDEFILES) $(INCLUDEDIR)
clean:
rm -rf ${OUTS}
My problem is that I am not able to compile the driver_peripheral_01.c module due to the problem with
Config.h header file inclusion. The "fatal error: Config.h: No such file or directory" is being invoked despite the fact that I have copied the header file in question into the include subdirectory in project directory structure. Does anybody have any idea why the make cannot find the Config.h header file? Thanks for any suggestions.
I am running a trinity RNASeq Assembly software on Ubuntu server and the following error is occuring for Pair-end reads input.
can't locate auto/threads/error.al in #INC (#INC contains:
I checked for threads library and it's already in the perl library.
Any thoughts on this?
$ perl -V
Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
Platform:
osname=linux, osvers=2.6.9-42.0.3.elsmp, archname=x86_64-linux-thread-multi
uname='linux builder6.centos.org 2.6.9-42.0.3.elsmp #1 smp fri oct 6 06:28:26 cdt 2006 x86_64 x86_64 x86_64 gnulinux '
config_args='-des -Doptimize=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Dversion=5.8.8 -Dmyhostname=localhost -Dperladmin=root#localhost -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dinstallprefix=/usr -Dprefix=/usr -Dlibpth=/usr/local/lib64
/lib64 /usr/lib64 -Dprivlib=/usr/lib/perl5/5.8.8
-Dsitelib=/usr/lib/perl5/site_perl/5.8.8 -Dvendorlib=/usr/lib/perl5/vendor_perl/5.8.8 -Darchlib=/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi -Dsitearch=/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi -Dvendorarch=/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi
-Darchname=x86_64-linux -Dvendorprefix=/usr -Dsiteprefix=/usr -Duseshrplib -Dusethreads -Duseithreads -Duselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl=n -Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less -isr -Dd_gethostent_r_proto -Ud_endhostent_r_proto -Ud_sethostent_r_proto -Ud_endprotoent_r_proto -Ud_setprotoent_r_proto -Ud_endservent_r_proto -Ud_setservent_r_proto -Dinc_version_list=5.8.7 5.8.6 5.8.5 -Dscriptdir=/usr/bin'
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=define use64bitall=define uselongdouble=undef
usemymalloc=n, bincompat5005=undef Compiler:
cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
optimize='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic',
cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -I/usr/include/gdbm'
ccversion='', gccversion='4.1.1 20070105 (Red Hat 4.1.1-52)', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define Linker and Libraries:
ld='gcc', ldflags =''
libpth=/usr/local/lib64 /lib64 /usr/lib64
libs=-lresolv -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
perllibs=-lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
libc=, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version='2.5' Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE'
cccdlflags='-fPIC', lddlflags='-shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic'
Characteristics of this binary (from libperl): Compile-time
options: MULTIPLICITY PERL_IMPLICIT_CONTEXT
PERL_MALLOC_WRAP USE_64_BIT_ALL USE_64_BIT_INT
USE_ITHREADS USE_LARGE_FILES USE_PERLIO
USE_REENTRANT_API Built under linux Compiled at Nov 8 2007 06:49:06 %ENV:
PERL5LIB="/fs/home/anuphap/usr/lib/perl5:/fs/home/anuphap/usr/lib/perl5/site_perl:/fs/home/anuphap/usr/lib64/perl5:/fs/home/anuphap/usr/lib64/perl5/site_perl"
#INC:
/fs/home/anuphap/usr/lib/perl5/5.8.8
/fs/home/anuphap/usr/lib/perl5
/fs/home/anuphap/usr/lib/perl5/site_perl/5.8.8/x86_64-linux-thread-multi
/fs/home/anuphap/usr/lib/perl5/site_perl/5.8.8
/fs/home/anuphap/usr/lib/perl5/site_perl
/fs/home/anuphap/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi
/fs/home/anuphap/usr/lib64/perl5/5.8.8
/fs/home/anuphap/usr/lib64/perl5
/fs/home/anuphap/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi
/fs/home/anuphap/usr/lib64/perl5/site_perl/5.8.8
/fs/home/anuphap/usr/lib64/perl5/site_perl
/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi
/usr/lib64/perl5/site_perl/5.8.7/x86_64-linux-thread-multi
/usr/lib64/perl5/site_perl/5.8.6/x86_64-linux-thread-multi
/usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.8
/usr/lib/perl5/site_perl/5.8.7
/usr/lib/perl5/site_perl/5.8.6
/usr/lib/perl5/site_perl/5.8.5
/usr/lib/perl5/site_perl
/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi
/usr/lib64/perl5/vendor_perl/5.8.7/x86_64-linux-thread-multi
/usr/lib64/perl5/vendor_perl/5.8.6/x86_64-linux-thread-multi
/usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.8
/usr/lib/perl5/vendor_perl/5.8.7
/usr/lib/perl5/vendor_perl/5.8.6
/usr/lib/perl5/vendor_perl/5.8.5
/usr/lib/perl5/vendor_perl
/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi
/usr/lib/perl5/5.8.8
You need to install a version of Perl that has threads support. How to install:
wget http://www.cpan.org/src/5.0/perl-5.20.2.tar.gz
tar -xzf perl-5.20.2.tar.gz
cd perl-5.20.2
./Configure -des -Dprefix=$HOME/localperl
make
make test
make install
Read both INSTALL and README.yoursystem for more detailed information.
I'm compiling some CUDA/C to run as a MEX library in Matlab, and I am getting the following error:
Error using mex
/usr/lib/x86_64-linux-gnu/libc_nonshared.a(atexit.oS): In function `atexit':
(.text+0x12): undefined reference to `__cxa_atexit'
collect2: error: ld returned 1 exit status
I'm assuming this means I need to link in some additional library, but what?
My current compile command is:
mex -L/usr/local/cuda/lib64 -lcudart -I./ A.cpp B.cpp C.cu D.cpp
I have several kernels to compile into mex, and interestingly some of them work and some of them don't. I don't immediately see what the difference is between them - I certainly don't call atexit anywhere in my source.
Here is the output of a verbose mex:
Verbose mode is on.
Neither -compatibleArrayDims nor -largeArrayDims is selected.
Using -compatibleArrayDims. In the future, MATLAB will require the use of
-largeArrayDims and remove the -compatibleArrayDims option.
For more information:
http://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html.
... Looking for compiler 'nvcc' ...
... Looking for environment variable 'MW_NVCC_PATH' ...Yes ('/usr/local/cuda-6.5/bin/nvcc').
... Looking for folder '/usr/local/cuda-6.5/bin' ...Yes.
... Looking for file '/usr/local/cuda-6.5/bin/nvcc' ...Yes.
... Executing command 'which g++' ...Yes ('/usr/bin/g++').
... Executing command 'g++ -print-file-name=libstdc++.so' ...Yes ('/usr/lib/gcc/x86_64-linux-gnu/4.8/libstdc++.so').
Found installed compiler 'nvcc'.
Options file details
-------------------------------------------------------------------
Compiler location: /usr/local/cuda-6.5/bin/nvcc
Options file: /home/nick/Documents/FrameLab/matlab/mex/source codes/mex_CUDA_glnxa64.xml
CMDLINE2 : /usr/bin/g++ -pthread -Wl,--no-undefined -shared -O -Wl,--version-script,"/usr/local/MATLAB/R2014a/extern/lib/glnxa64/mexFunction.map" /tmp/mex_86382821022260_3849/Atx_fan_mf.o /tmp/mex_86382821022260_3849/Atx_fan_mf_gpu_new.o /tmp/mex_86382821022260_3849/Atx_fan_mf_gpu_new_fb.o /tmp/mex_86382821022260_3849/Atx_fan_mf_cpu_new.o /tmp/mex_86382821022260_3849/Atx_fan_mf_cpu_new_fb.o /tmp/mex_86382821022260_3849/find_l.o /tmp/mex_86382821022260_3849/find_area.o -lcudart -L/usr/local/cuda/lib64 -Wl,-rpath-link,/usr/local/MATLAB/R2014a/bin/glnxa64 -L"/usr/local/MATLAB/R2014a/bin/glnxa64" -lmx -lmex -lmat -lm -lmwgpu /usr/local/MATLAB/R2014a/bin/glnxa64/libcudart.so.5.5 -o Atx_fan_mf.mexa64
CXX : /usr/local/cuda-6.5/bin/nvcc
DEFINES : -DMX_COMPAT_32 --compiler-options=-D_GNU_SOURCE,-DMATLAB_MEX_FILE
MATLABMEX : -DMATLAB_MEX_FILE
NVCCFLAGS : -gencode=arch=compute_30,code=\"sm_30,compute_30\" $NVCC_FLAGS
CXXFLAGS : --compiler-options=-ansi,-fexceptions,-fPIC,-fno-omit-frame-pointer,-pthread
INCLUDE : -I./ -I"/usr/local/MATLAB/R2014a/extern/include" -I"/usr/local/MATLAB/R2014a/toolbox/distcomp/gpu/extern/include/"
CXXOPTIMFLAGS : -O -DNDEBUG
CXXDEBUGFLAGS : -g
LDXX : /usr/bin/g++
LDFLAGS : -pthread -Wl,--no-undefined
LDTYPE : -shared
LINKEXPORT : -Wl,--version-script,"/usr/local/MATLAB/R2014a/extern/lib/glnxa64/mexFunction.map"
LINKLIBS : -lcudart -L/usr/local/cuda/lib64 -Wl,-rpath-link,/usr/local/MATLAB/R2014a/bin/glnxa64 -L"/usr/local/MATLAB/R2014a/bin/glnxa64" -lmx -lmex -lmat -lm -lmwgpu /usr/local/MATLAB/R2014a/bin/glnxa64/libcudart.so.5.5
LDOPTIMFLAGS : -O
LDDEBUGFLAGS : -g
OBJEXT : .o
LDEXT : .mexa64
NVCC : /usr/local/cuda-6.5/bin/nvcc
GCC : /usr/bin/g++
CPPLIB_DIR : /usr/lib/gcc/x86_64-linux-gnu/4.8/libstdc++.so
MATLABROOT : /usr/local/MATLAB/R2014a
ARCH : glnxa64
SRC : "/home/nick/Documents/FrameLab/matlab/mex/source codes/Atx_fan_mf.cpp";"/home/nick/Documents/FrameLab/matlab/mex/source codes/Atx_fan_mf_gpu_new.cu";"/home/nick/Documents/FrameLab/matlab/mex/source codes/Atx_fan_mf_gpu_new_fb.cu";"/home/nick/Documents/FrameLab/matlab/mex/source codes/Atx_fan_mf_cpu_new.cpp";"/home/nick/Documents/FrameLab/matlab/mex/source codes/Atx_fan_mf_cpu_new_fb.cpp";"/home/nick/Documents/FrameLab/matlab/mex/source codes/find_l.cpp";"/home/nick/Documents/FrameLab/matlab/mex/source codes/find_area.cpp"
OBJ : /tmp/mex_86382821022260_3849/Atx_fan_mf.o;/tmp/mex_86382821022260_3849/Atx_fan_mf_gpu_new.o;/tmp/mex_86382821022260_3849/Atx_fan_mf_gpu_new_fb.o;/tmp/mex_86382821022260_3849/Atx_fan_mf_cpu_new.o;/tmp/mex_86382821022260_3849/Atx_fan_mf_cpu_new_fb.o;/tmp/mex_86382821022260_3849/find_l.o;/tmp/mex_86382821022260_3849/find_area.o
OBJS : /tmp/mex_86382821022260_3849/Atx_fan_mf.o /tmp/mex_86382821022260_3849/Atx_fan_mf_gpu_new.o /tmp/mex_86382821022260_3849/Atx_fan_mf_gpu_new_fb.o /tmp/mex_86382821022260_3849/Atx_fan_mf_cpu_new.o /tmp/mex_86382821022260_3849/Atx_fan_mf_cpu_new_fb.o /tmp/mex_86382821022260_3849/find_l.o /tmp/mex_86382821022260_3849/find_area.o
SRCROOT : /home/nick/Documents/FrameLab/matlab/mex/source codes/Atx_fan_mf
DEF : /tmp/mex_86382821022260_3849/Atx_fan_mf.def
EXP : Atx_fan_mf.exp
LIB : Atx_fan_mf.lib
EXE : Atx_fan_mf.mexa64
ILK : Atx_fan_mf.ilk
MANIFEST : Atx_fan_mf.mexa64.manifest
TEMPNAME : Atx_fan_mf
EXEDIR :
EXENAME : Atx_fan_mf
OPTIM : -O -DNDEBUG
LINKOPTIM : -O
CMDLINE1_0 : /usr/local/cuda-6.5/bin/nvcc -c -DMX_COMPAT_32 --compiler-options=-D_GNU_SOURCE,-DMATLAB_MEX_FILE -I./ -I"/usr/local/MATLAB/R2014a/extern/include" -I"/usr/local/MATLAB/R2014a/toolbox/distcomp/gpu/extern/include/" -gencode=arch=compute_30,code=\"sm_30,compute_30\" $NVCC_FLAGS --compiler-options=-ansi,-fexceptions,-fPIC,-fno-omit-frame-pointer,-pthread -O -DNDEBUG "/home/nick/Documents/FrameLab/matlab/mex/source codes/Atx_fan_mf.cpp" -o /tmp/mex_86382821022260_3849/Atx_fan_mf.o
CMDLINE1_1 : /usr/local/cuda-6.5/bin/nvcc -c -DMX_COMPAT_32 --compiler-options=-D_GNU_SOURCE,-DMATLAB_MEX_FILE -I./ -I"/usr/local/MATLAB/R2014a/extern/include" -I"/usr/local/MATLAB/R2014a/toolbox/distcomp/gpu/extern/include/" -gencode=arch=compute_30,code=\"sm_30,compute_30\" $NVCC_FLAGS --compiler-options=-ansi,-fexceptions,-fPIC,-fno-omit-frame-pointer,-pthread -O -DNDEBUG "/home/nick/Documents/FrameLab/matlab/mex/source codes/Atx_fan_mf_gpu_new.cu" -o /tmp/mex_86382821022260_3849/Atx_fan_mf_gpu_new.o
CMDLINE1_2 : /usr/local/cuda-6.5/bin/nvcc -c -DMX_COMPAT_32 --compiler-options=-D_GNU_SOURCE,-DMATLAB_MEX_FILE -I./ -I"/usr/local/MATLAB/R2014a/extern/include" -I"/usr/local/MATLAB/R2014a/toolbox/distcomp/gpu/extern/include/" -gencode=arch=compute_30,code=\"sm_30,compute_30\" $NVCC_FLAGS --compiler-options=-ansi,-fexceptions,-fPIC,-fno-omit-frame-pointer,-pthread -O -DNDEBUG "/home/nick/Documents/FrameLab/matlab/mex/source codes/Atx_fan_mf_gpu_new_fb.cu" -o /tmp/mex_86382821022260_3849/Atx_fan_mf_gpu_new_fb.o
CMDLINE1_3 : /usr/local/cuda-6.5/bin/nvcc -c -DMX_COMPAT_32 --compiler-options=-D_GNU_SOURCE,-DMATLAB_MEX_FILE -I./ -I"/usr/local/MATLAB/R2014a/extern/include" -I"/usr/local/MATLAB/R2014a/toolbox/distcomp/gpu/extern/include/" -gencode=arch=compute_30,code=\"sm_30,compute_30\" $NVCC_FLAGS --compiler-options=-ansi,-fexceptions,-fPIC,-fno-omit-frame-pointer,-pthread -O -DNDEBUG "/home/nick/Documents/FrameLab/matlab/mex/source codes/Atx_fan_mf_cpu_new.cpp" -o /tmp/mex_86382821022260_3849/Atx_fan_mf_cpu_new.o
CMDLINE1_4 : /usr/local/cuda-6.5/bin/nvcc -c -DMX_COMPAT_32 --compiler-options=-D_GNU_SOURCE,-DMATLAB_MEX_FILE -I./ -I"/usr/local/MATLAB/R2014a/extern/include" -I"/usr/local/MATLAB/R2014a/toolbox/distcomp/gpu/extern/include/" -gencode=arch=compute_30,code=\"sm_30,compute_30\" $NVCC_FLAGS --compiler-options=-ansi,-fexceptions,-fPIC,-fno-omit-frame-pointer,-pthread -O -DNDEBUG "/home/nick/Documents/FrameLab/matlab/mex/source codes/Atx_fan_mf_cpu_new_fb.cpp" -o /tmp/mex_86382821022260_3849/Atx_fan_mf_cpu_new_fb.o
CMDLINE1_5 : /usr/local/cuda-6.5/bin/nvcc -c -DMX_COMPAT_32 --compiler-options=-D_GNU_SOURCE,-DMATLAB_MEX_FILE -I./ -I"/usr/local/MATLAB/R2014a/extern/include" -I"/usr/local/MATLAB/R2014a/toolbox/distcomp/gpu/extern/include/" -gencode=arch=compute_30,code=\"sm_30,compute_30\" $NVCC_FLAGS --compiler-options=-ansi,-fexceptions,-fPIC,-fno-omit-frame-pointer,-pthread -O -DNDEBUG "/home/nick/Documents/FrameLab/matlab/mex/source codes/find_l.cpp" -o /tmp/mex_86382821022260_3849/find_l.o
CMDLINE1_6 : /usr/local/cuda-6.5/bin/nvcc -c -DMX_COMPAT_32 --compiler-options=-D_GNU_SOURCE,-DMATLAB_MEX_FILE -I./ -I"/usr/local/MATLAB/R2014a/extern/include" -I"/usr/local/MATLAB/R2014a/toolbox/distcomp/gpu/extern/include/" -gencode=arch=compute_30,code=\"sm_30,compute_30\" $NVCC_FLAGS --compiler-options=-ansi,-fexceptions,-fPIC,-fno-omit-frame-pointer,-pthread -O -DNDEBUG "/home/nick/Documents/FrameLab/matlab/mex/source codes/find_area.cpp" -o /tmp/mex_86382821022260_3849/find_area.o
CMDLINE3_0 : rm -f /tmp/mex_86382821022260_3849/Atx_fan_mf.o
CMDLINE3_1 : rm -f /tmp/mex_86382821022260_3849/Atx_fan_mf_gpu_new.o
CMDLINE3_2 : rm -f /tmp/mex_86382821022260_3849/Atx_fan_mf_gpu_new_fb.o
CMDLINE3_3 : rm -f /tmp/mex_86382821022260_3849/Atx_fan_mf_cpu_new.o
CMDLINE3_4 : rm -f /tmp/mex_86382821022260_3849/Atx_fan_mf_cpu_new_fb.o
CMDLINE3_5 : rm -f /tmp/mex_86382821022260_3849/find_l.o
CMDLINE3_6 : rm -f /tmp/mex_86382821022260_3849/find_area.o
-------------------------------------------------------------------
Building with 'nvcc'.
/usr/local/cuda-6.5/bin/nvcc -c -DMX_COMPAT_32 --compiler-options=-D_GNU_SOURCE,-DMATLAB_MEX_FILE -I./ -I"/usr/local/MATLAB/R2014a/extern/include" -I"/usr/local/MATLAB/R2014a/toolbox/distcomp/gpu/extern/include/" -gencode=arch=compute_30,code=\"sm_30,compute_30\" $NVCC_FLAGS --compiler-options=-ansi,-fexceptions,-fPIC,-fno-omit-frame-pointer,-pthread -O -DNDEBUG "/home/nick/Documents/FrameLab/matlab/mex/source codes/Atx_fan_mf.cpp" -o /tmp/mex_86382821022260_3849/Atx_fan_mf.o
/usr/local/cuda-6.5/bin/nvcc -c -DMX_COMPAT_32 --compiler-options=-D_GNU_SOURCE,-DMATLAB_MEX_FILE -I./ -I"/usr/local/MATLAB/R2014a/extern/include" -I"/usr/local/MATLAB/R2014a/toolbox/distcomp/gpu/extern/include/" -gencode=arch=compute_30,code=\"sm_30,compute_30\" $NVCC_FLAGS --compiler-options=-ansi,-fexceptions,-fPIC,-fno-omit-frame-pointer,-pthread -O -DNDEBUG "/home/nick/Documents/FrameLab/matlab/mex/source codes/Atx_fan_mf_gpu_new.cu" -o /tmp/mex_86382821022260_3849/Atx_fan_mf_gpu_new.o
/usr/local/cuda-6.5/bin/nvcc -c -DMX_COMPAT_32 --compiler-options=-D_GNU_SOURCE,-DMATLAB_MEX_FILE -I./ -I"/usr/local/MATLAB/R2014a/extern/include" -I"/usr/local/MATLAB/R2014a/toolbox/distcomp/gpu/extern/include/" -gencode=arch=compute_30,code=\"sm_30,compute_30\" $NVCC_FLAGS --compiler-options=-ansi,-fexceptions,-fPIC,-fno-omit-frame-pointer,-pthread -O -DNDEBUG "/home/nick/Documents/FrameLab/matlab/mex/source codes/Atx_fan_mf_gpu_new_fb.cu" -o /tmp/mex_86382821022260_3849/Atx_fan_mf_gpu_new_fb.o
/usr/local/cuda-6.5/bin/nvcc -c -DMX_COMPAT_32 --compiler-options=-D_GNU_SOURCE,-DMATLAB_MEX_FILE -I./ -I"/usr/local/MATLAB/R2014a/extern/include" -I"/usr/local/MATLAB/R2014a/toolbox/distcomp/gpu/extern/include/" -gencode=arch=compute_30,code=\"sm_30,compute_30\" $NVCC_FLAGS --compiler-options=-ansi,-fexceptions,-fPIC,-fno-omit-frame-pointer,-pthread -O -DNDEBUG "/home/nick/Documents/FrameLab/matlab/mex/source codes/Atx_fan_mf_cpu_new.cpp" -o /tmp/mex_86382821022260_3849/Atx_fan_mf_cpu_new.o
/usr/local/cuda-6.5/bin/nvcc -c -DMX_COMPAT_32 --compiler-options=-D_GNU_SOURCE,-DMATLAB_MEX_FILE -I./ -I"/usr/local/MATLAB/R2014a/extern/include" -I"/usr/local/MATLAB/R2014a/toolbox/distcomp/gpu/extern/include/" -gencode=arch=compute_30,code=\"sm_30,compute_30\" $NVCC_FLAGS --compiler-options=-ansi,-fexceptions,-fPIC,-fno-omit-frame-pointer,-pthread -O -DNDEBUG "/home/nick/Documents/FrameLab/matlab/mex/source codes/Atx_fan_mf_cpu_new_fb.cpp" -o /tmp/mex_86382821022260_3849/Atx_fan_mf_cpu_new_fb.o
/usr/local/cuda-6.5/bin/nvcc -c -DMX_COMPAT_32 --compiler-options=-D_GNU_SOURCE,-DMATLAB_MEX_FILE -I./ -I"/usr/local/MATLAB/R2014a/extern/include" -I"/usr/local/MATLAB/R2014a/toolbox/distcomp/gpu/extern/include/" -gencode=arch=compute_30,code=\"sm_30,compute_30\" $NVCC_FLAGS --compiler-options=-ansi,-fexceptions,-fPIC,-fno-omit-frame-pointer,-pthread -O -DNDEBUG "/home/nick/Documents/FrameLab/matlab/mex/source codes/find_l.cpp" -o /tmp/mex_86382821022260_3849/find_l.o
/usr/local/cuda-6.5/bin/nvcc -c -DMX_COMPAT_32 --compiler-options=-D_GNU_SOURCE,-DMATLAB_MEX_FILE -I./ -I"/usr/local/MATLAB/R2014a/extern/include" -I"/usr/local/MATLAB/R2014a/toolbox/distcomp/gpu/extern/include/" -gencode=arch=compute_30,code=\"sm_30,compute_30\" $NVCC_FLAGS --compiler-options=-ansi,-fexceptions,-fPIC,-fno-omit-frame-pointer,-pthread -O -DNDEBUG "/home/nick/Documents/FrameLab/matlab/mex/source codes/find_area.cpp" -o /tmp/mex_86382821022260_3849/find_area.o
/usr/bin/g++ -pthread -Wl,--no-undefined -shared -O -Wl,--version-script,"/usr/local/MATLAB/R2014a/extern/lib/glnxa64/mexFunction.map" /tmp/mex_86382821022260_3849/Atx_fan_mf.o /tmp/mex_86382821022260_3849/Atx_fan_mf_gpu_new.o /tmp/mex_86382821022260_3849/Atx_fan_mf_gpu_new_fb.o /tmp/mex_86382821022260_3849/Atx_fan_mf_cpu_new.o /tmp/mex_86382821022260_3849/Atx_fan_mf_cpu_new_fb.o /tmp/mex_86382821022260_3849/find_l.o /tmp/mex_86382821022260_3849/find_area.o -lcudart -L/usr/local/cuda/lib64 -Wl,-rpath-link,/usr/local/MATLAB/R2014a/bin/glnxa64 -L"/usr/local/MATLAB/R2014a/bin/glnxa64" -lmx -lmex -lmat -lm -lmwgpu /usr/local/MATLAB/R2014a/bin/glnxa64/libcudart.so.5.5 -o Atx_fan_mf.mexa64
I'm wondering if I should try using a different version of g++ or the c++ libraries? I'm not sure how to change the CPPLIB_DIR variable...Matlab has made it more difficult to mess with mex settings in 2014a.
Thanks for any thoughts!
I got the same error using Matlab 2015 Prerelease on Ubuntu 14.04 with CUDA 6.5 and g++4.8. Thanks to Matlab support we figured out, that manually linking does the trick. Here is my compile script for the matlab mex/gpu example:
myArch = computer('arch'); pathToOpts = fullfile(matlabroot, ... 'toolbox', 'distcomp', 'gpu', ... 'extern', 'src', 'mex', myArch,'gcc',... ['mex_CUDA_' myArch '.xml']); copyfile(pathToOpts,'.','f')
mex -v -largeArrayDims mexGPUExample.cu -lstdc++ -lc