You are not logged in.

#1 2010-04-25 20:50:30

Emeric
Member
From: France
Registered: 2009-03-18
Posts: 32
Website

Unable to use g++ with makepkg

Hi,

I have a brand new Arch install, with a very weird problem.
I can't use g++ to build softwares from AUR. I alway get this error :

make[2]: *** [Context.o] Erreur 1 (Error 1)
make[2]: *** Attente des tâches non terminées.... (waiting for unfinished tasks)
g++: error trying to exec 'cc1plus': execvp: g++: error trying to exec 'cc1plus': execvp: g++: error trying to exec 'cc1plus': execvp: g++: error trying to exec 'cc1plus': execvp: Aucun fichier ou dossier de ce type (No such file or directory)

I have gcc and gcc-libs install (As everyone using Arch I think...), and I can use makepkg to build C softwares.
g++ work as expected when I compil personnal projects.

Google did not help me with that issue, beside telling me (several times) to install g++

Any ideas why this is happening ?
Thanks


"If you're not a part of the solution, there's good money to be made in prolonging the problem"

Offline

#2 2010-04-25 22:35:40

antlechrist
Member
Registered: 2010-04-21
Posts: 26

Re: Unable to use g++ with makepkg

From man g++:

Options Controlling C++ Dialect
...
-no-integrated-cpp
           Performs a compilation in two passes: preprocessing and compiling.  This option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the -B option.  The user supplied compilation
           step can then add in an additional preprocessing step after normal preprocessing but before compiling.  The default is to use the integrated cpp (internal cpp)

           The semantics of this option will change if "cc1", "cc1plus", and "cc1obj" are merged.

I don't know... Did you install gcc with

# pacman -S base-devel

?

Offline

#3 2010-04-26 13:21:29

Emeric
Member
From: France
Registered: 2009-03-18
Posts: 32
Website

Re: Unable to use g++ with makepkg

Gcc came with the core install, base-devel is installed, and reinstalling it (base-devel and gcc) did not change anything unfortunatly...


"If you're not a part of the solution, there's good money to be made in prolonging the problem"

Offline

#4 2010-04-26 13:59:17

grey
Member
From: Europe
Registered: 2007-08-23
Posts: 679

Re: Unable to use g++ with makepkg

What happens if you try to build the package according to PKGBUILD, but not via makepkg? I.e. cd <sources>, then execute the commands in the build () function of PKGBUILD.


Good ideas do not need lots of lies told about them in order to gain public acceptance.

Offline

#5 2010-04-26 14:38:22

Emeric
Member
From: France
Registered: 2009-03-18
Posts: 32
Website

Re: Unable to use g++ with makepkg

Work as exepted until the "make" step, then fail with the same error as stated above...

Last edited by Emeric (2010-04-26 14:39:02)


"If you're not a part of the solution, there's good money to be made in prolonging the problem"

Offline

#6 2010-04-26 14:56:09

grey
Member
From: Europe
Registered: 2007-08-23
Posts: 679

Re: Unable to use g++ with makepkg

Can you isolate the specific compilation command that fails? Depending on the package make might print the commands that it executes to stdout. It would be interesting to see if its compilation or linking that fails.


Good ideas do not need lots of lies told about them in order to gain public acceptance.

Offline

#7 2010-04-26 15:04:23

antlechrist
Member
Registered: 2010-04-21
Posts: 26

Re: Unable to use g++ with makepkg

Emeric wrote:

Work as exepted until the "make" step, then fail with the same error as stated above...

Weird... I built ocropus yesterday and saw cc1plus flying by in the gcc screensaver. Can you post your /etc/makepkg.conf
and the PKGBUILD you're trying to compile?

Offline

#8 2010-04-26 16:02:46

Emeric
Member
From: France
Registered: 2009-03-18
Posts: 32
Website

Re: Unable to use g++ with makepkg

Here is my makepkg.conf
pretty vanilla except for CFLAGS and CXXFLAGS, using march=native.
By the way, why march=native isn't used by default ??

#
# /etc/makepkg.conf
#

#########################################################################
# SOURCE ACQUISITION
#########################################################################
#
#-- The download utilities that makepkg should use to acquire sources
#  Format: 'protocol::agent'
DLAGENTS=('ftp::/usr/bin/wget -c --passive-ftp -t 3 --waitretry=3 -O %o %u'
          'http::/usr/bin/wget -c -t 3 --waitretry=3 -O %o %u'
          'https::/usr/bin/wget -c -t 3 --waitretry=3 --no-check-certificate -O %o %u'
          'rsync::/usr/bin/rsync -z %u %o'
          'scp::/usr/bin/scp -C %u %o')

# Other common tools:
# /usr/bin/snarf
# /usr/bin/lftpget -c
# /usr/bin/curl

#########################################################################
# ARCHITECTURE, COMPILE FLAGS
#########################################################################
#
CARCH="x86_64"
CHOST="x86_64-unknown-linux-gnu"

#-- Exclusive: will only run on x86_64
# -march (or -mcpu) builds exclusively for an architecture
# -mtune optimizes for an architecture, but builds for whole processor family
#CFLAGS="-march=core2 -msse4 -mcx16 -msahf -O2 -pipe" # precise CFLAGS for core i5
CFLAGS="-march=native -O2 -pipe"
CXXFLAGS="-march=native -O2 -pipe"
LDFLAGS="-Wl,--hash-style=gnu -Wl,--as-needed"

#-- Make Flags: change this for DistCC/SMP systems
MAKEFLAGS="-j4"

#########################################################################
# BUILD ENVIRONMENT
#########################################################################
#
# Defaults: BUILDENV=(fakeroot !distcc color !ccache)
#  A negated environment option will do the opposite of the comments below.
#
#-- fakeroot: Allow building packages as a non-root user
#-- distcc:   Use the Distributed C/C++/ObjC compiler
#-- color:    Colorize output messages
#-- ccache:   Use ccache to cache compilation
#
BUILDENV=(fakeroot !distcc color !ccache)
#
#-- If using DistCC, your MAKEFLAGS will also need modification. In addition,
#-- specify a space-delimited list of hosts running in the DistCC cluster.
#DISTCC_HOSTS=""

#########################################################################
# GLOBAL PACKAGE OPTIONS
#   These are default values for the options=() settings
#########################################################################
#
# Default: OPTIONS=(strip docs libtool emptydirs zipman purge)
#  A negated option will do the opposite of the comments below.
#
#-- strip:     Strip symbols from binaries/libraries in STRIP_DIRS
#-- docs:      Save doc directories specified by DOC_DIRS
#-- libtool:   Leave libtool (.la) files in packages
#-- emptydirs: Leave empty directories in packages
#-- zipman:    Compress manual (man and info) pages in MAN_DIRS with gzip
#-- purge:     Remove files specified by PURGE_TARGETS
#
OPTIONS=(strip !docs libtool emptydirs zipman purge)

#-- File integrity checks to use. Valid: md5, sha1, sha256, sha384, sha512
INTEGRITY_CHECK=(md5)
#-- Manual (man and info) directories to compress (if zipman is specified)
MAN_DIRS=({usr{,/local}{,/share},opt/*}/{man,info})
#-- Doc directories to remove (if !docs is specified)
DOC_DIRS=(usr/{,local/}{,share/}{doc,gtk-doc} opt/*/{doc,gtk-doc})
#-- Directories to be searched for the strip option (if strip is specified)
STRIP_DIRS=(bin lib sbin usr/{bin,lib,sbin,local/{bin,lib,sbin}} opt/*/{bin,lib,sbin})
#-- Files to be removed from all packages (if purge is specified)
PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod)

#########################################################################
# PACKAGE OUTPUT
#########################################################################
#
# Default: put built package and cached source in build directory
#
#-- Destination: specify a fixed directory where all packages will be placed
#PKGDEST=/home/packages
#-- Source cache: specify a fixed directory where source files will be cached
#SRCDEST=/home/sources
#-- Packager: name/email of the person or organization building packages
#PACKAGER="John Doe <john@doe.com>"

#########################################################################
# EXTENSION DEFAULTS
#########################################################################
#
# WARNING: Do NOT modify these variables unless you know what you are
#          doing.
#
PKGEXT='.pkg.tar.xz'
SRCEXT='.src.tar.gz'

# vim: set ft=sh ts=2 sw=2 et:

The compilations failed whenever g++ is called. So it happen with a lot of pkgbuild.
So far I tried from AUR:
- sfml
- pysvn
- gimp-resynth
And others. Every time I get (this exemple come from sfml) :

g++ -o Context.o -c Context.cpp -W -Wall -pedantic -I../../../include -I../../ -O2 -DNDEBUG -fPIC
make[2]: *** [Context.o] Erreur 1
g++: error trying to exec 'cc1plus': execvp: Aucun fichier ou dossier de ce type
g++: error trying to exec 'cc1plus': execvp: make[2]: quittant le répertoire « /home/emeric/.......

Other package from AUR are building fine, as long as they don't use g++


"If you're not a part of the solution, there's good money to be made in prolonging the problem"

Offline

#9 2010-04-26 17:17:45

antlechrist
Member
Registered: 2010-04-21
Posts: 26

Re: Unable to use g++ with makepkg

# locate cc1plus
/usr/lib/gcc/i686-pc-linux-gnu/4.5.0/cc1plus
# pacman -Qo /usr/lib/gcc/i686-pc-linux-gnu/4.5.0/cc1plus
/usr/lib/gcc/i686-pc-linux-gnu/4.5.0/cc1plus is owned by gcc 4.5.0-1
# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-pc-linux-gnu/4.5.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --prefix=/usr --enable-languages=c,c++,fortran,objc,obj-c++,ada --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-lto --enable-gnu-unique-object --disable-multilib --disable-libstdcxx-pch --with-system-zlib --with-ppl --with-cloog --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info
Thread model: posix
gcc version 4.5.0 (GCC)

Could you post the output of these commands (for your system, of course smile ?

Offline

#10 2010-04-26 17:20:18

grey
Member
From: Europe
Registered: 2007-08-23
Posts: 679

Re: Unable to use g++ with makepkg

It's a long shot, but did you check that cc1plus (a) exists and (b) is an executable that matches your archtecture?


Good ideas do not need lots of lies told about them in order to gain public acceptance.

Offline

#11 2010-04-26 19:20:40

Emeric
Member
From: France
Registered: 2009-03-18
Posts: 32
Website

Re: Unable to use g++ with makepkg

well well :

#locate cc1plus
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/cc1plus
#pacman -Qo /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/cc1plus
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/cc1plus appartient à gcc 4.5.0-1
#gcc -v
Utilisation des specs internes.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configuré avec: ../configure --prefix=/usr --enable-languages=c,c++,fortran,objc,obj-c++,ada --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-lto --enable-gnu-unique-object --disable-multilib --disable-libstdcxx-pch --with-system-zlib --with-ppl --with-cloog --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info
Modèle de thread: posix
gcc version 4.5.0 (GCC)
#file /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/cc1plus
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/cc1plus: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped

This is definitivly weird...
My old laptop (well not that old) have a very similar arch install. Core2 duo, 64bit, testing enabled. Everything work fine with AUR and gcc 4.5. I use almost the same config files on both laptops.
Right now I am using it to build the softwares that I cannot build on the new laptop.

The only differences between the two laptops is that the new one use a core i5, no swap, a ssd with tmpfs for /tmp and /var/tmp. Could that be problematic ?

Last edited by Emeric (2010-04-26 19:23:26)


"If you're not a part of the solution, there's good money to be made in prolonging the problem"

Offline

#12 2010-04-26 20:15:06

grey
Member
From: Europe
Registered: 2007-08-23
Posts: 679

Re: Unable to use g++ with makepkg

Weird indeed. It's not related to makepkg.conf or your CXXFLAGS, because in the example you posted:

g++ -o Context.o -c Context.cpp -W -Wall -pedantic -I../../../include -I../../ -O2 -DNDEBUG -fPIC
make[2]: *** [Context.o] Erreur 1
g++: error trying to exec 'cc1plus': execvp: Aucun fichier ou dossier de ce type
g++: error trying to exec 'cc1plus': execvp: make[2]: quittant le répertoire « /home/emeric/.......

those flags weren't used. I don't understand how g++ can work for you in private projects and not work here. It's just a straightforward compilation command.


Good ideas do not need lots of lies told about them in order to gain public acceptance.

Offline

#13 2010-04-26 21:51:56

Emeric
Member
From: France
Registered: 2009-03-18
Posts: 32
Website

Re: Unable to use g++ with makepkg

Yes building cpp files with cmake and make works great.

I am gonna try black magic and I get back to you guys...
Anyway thanks for helping me!


"If you're not a part of the solution, there's good money to be made in prolonging the problem"

Offline

#14 2010-04-27 01:29:04

antlechrist
Member
Registered: 2010-04-21
Posts: 26

Re: Unable to use g++ with makepkg

I've been googling with no luck... It is very strange. Let us know if you figure anything new out.

Offline

#15 2010-04-27 10:40:10

Emeric
Member
From: France
Registered: 2009-03-18
Posts: 32
Website

Re: Unable to use g++ with makepkg

I got some news.

Look at this simple exemple :

==> Compilation started...
g++ `gimptool-2.0 --cflags` -O3 -fno-common -ffast-math -frename-registers -fomit-frame-pointer -o resynth resynth.cc `gimptool-2.0 --libs` -lm
g++: error trying to exec 'cc1plus': execvp: Aucun fichier ou dossier de ce type (No such file or directory)
make: *** [resynth] Error 1

So I try to make cc1plus available in the $path variable :

ln -s /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/cc1plus /usr/bin/cc1plus

Tadam ! Now the error during compilation isn't the same :

==> Compilation started...
g++ `gimptool-2.0 --cflags` -O3 -fno-common -ffast-math -frename-registers -fomit-frame-pointer -o resynth resynth.cc `gimptool-2.0 --libs` -lm
In file included from resynth.cc:23:0:
/usr/include/stdio.h:34:21: erreur fatale: stddef.h : Aucun fichier ou dossier de ce type (No such file or directory)
compilation complete.
make: *** [resynth] Error 1

Another "No such file or directory" error...


"If you're not a part of the solution, there's good money to be made in prolonging the problem"

Offline

#16 2010-04-27 12:16:22

grey
Member
From: Europe
Registered: 2007-08-23
Posts: 679

Re: Unable to use g++ with makepkg

Can you reproduce that from the command line? Go to the source directory and then invoke
$ /usr/bin/g++ <arguments>
Since this looks like an environment problem the settings done inside the Makefiles may obscure things.


Good ideas do not need lots of lies told about them in order to gain public acceptance.

Offline

#17 2010-04-27 13:12:16

Emeric
Member
From: France
Registered: 2009-03-18
Posts: 32
Website

Re: Unable to use g++ with makepkg

Wow...
If I go to the source directory and type the same command, the one wich failed during the makepkg, it failed with the same error.
If I add /usr/bin before g++, it work ! And then I can type "makepkg" to build gimp-resynth (because there is only one source file, this is gonna be harder on other pkgbuild)

But what does that mean ?
/usr/bin seem to be in the $path already...


"If you're not a part of the solution, there's good money to be made in prolonging the problem"

Offline

#18 2010-04-27 14:39:27

grey
Member
From: Europe
Registered: 2007-08-23
Posts: 679

Re: Unable to use g++ with makepkg

It means that g++ != /usr/bin/g++. Either you have an alias for g++, or a binary called g++ is somewhere in your path. This should be easy to figure out.
Try locate g++, alias g++ and which g++.

I'm really curious about this one!


Good ideas do not need lots of lies told about them in order to gain public acceptance.

Offline

#19 2010-04-27 15:20:30

Daenyth
Forum Fellow
From: Boston, MA
Registered: 2008-02-24
Posts: 1,244

Re: Unable to use g++ with makepkg

"type g++"

Offline

#20 2010-04-27 15:41:04

Emeric
Member
From: France
Registered: 2009-03-18
Posts: 32
Website

Re: Unable to use g++ with makepkg

We finally got it !!

I found another g++ in /usr/lib/cw/ (and this directory was in my path...)
cw is a wrapper used to color bash output, I installed it right after I finished installing Arch, while reading post installed tips. This is why I haven't been able to build a single c++ pkgbuild...

After removing it (cw), everything is back to normal !

Thank you very much for your help grey and antlechrist, I would have got a really hard time fixing this by myself !!


"If you're not a part of the solution, there's good money to be made in prolonging the problem"

Offline

#21 2010-04-27 15:46:12

Emeric
Member
From: France
Registered: 2009-03-18
Posts: 32
Website

Re: Unable to use g++ with makepkg

"type" is a good tool, I wasn't knowing it. Thanks


"If you're not a part of the solution, there's good money to be made in prolonging the problem"

Offline

#22 2010-04-27 16:06:48

antlechrist
Member
Registered: 2010-04-21
Posts: 26

Re: Unable to use g++ with makepkg

No problem, Emeric. Glad you solved it.

I don't know about cw's tagline, though:

A non-intrusive ANSI color wrapper for common unix-based commands on GNU/linux.

smile

Offline

#23 2010-04-27 17:12:01

Emeric
Member
From: France
Registered: 2009-03-18
Posts: 32
Website

Re: Unable to use g++ with makepkg

cw fail ^^

But it doesn't seems to be maintained since 2007... And it is not that good so it will stay uninstalled !


"If you're not a part of the solution, there's good money to be made in prolonging the problem"

Offline

#24 2011-02-20 07:56:08

bilgee0629
Member
Registered: 2011-01-29
Posts: 57

Re: Unable to use g++ with makepkg

how did you uninstall cw, when i type "pacman -R cw" , it doesn't work?

Offline

Board footer

Powered by FluxBB