Hi,
I would like to share with you the verbose output from compiling the code
below on one side with the gcc that comes with the distribution on our
gaia-cluster and with the gcc that is available via easybuild and modules.
For details about the compilation etc. of the latter, please refer to
Fotis :)
On 06.08.12 14:34, "Kenneth Hoste" <[email protected]> wrote:
>
>On 08/03/2012 04:42 PM, Cédric LACZNY wrote:
>> Hello,
>>
>> I just have a little comment to add to point 4 :)
>>
>>
>>
>> On 03.08.12 16:25, "Fotis Georgatos" <[email protected]> wrote:
>>> (4) Compiling/Linking against boost and such libraries
>>>
>>> While building Cufflinks, Cedric came across this issue:
>>>
>>>http://stackoverflow.com/questions/11688893/decoding-gcc-specs-file-line
>>>
>>> To summarize what I understand, there is a subtle difference in the gcc
>>> spec strings and we wonder if there is some funny interaction between
>>> Debian/Easybuild/gcc; can you supply the following command from your
>>>side?
>>>
>>> $ gcc -dumpspecs|grep -A1 multilib:
>>> # Most RHEL clones give: . !m64 !m32;64:../lib64 m64 !m32;32:../lib
>>>!m64
>>> m32;
>>> (check it character-per-character, it's hard exercise for the human
>>> reader)
>>
>> Actually, there is no problem in the compilation of Cufflinks (we are
>> interested in the most recent version, being 2.0.2 IIRC). It is building
>> fine and linking correctly against the (by us) specified boost-version
>> 1.50. Needed some patching and renaming, but this is nicely handled via
>> the easyconfig and easyblock.
>> The problem arised when I wanted to link against the as-a-dependency
>> easybuild-built boost version (1.50) with a simple C++ program. Even
>> though the easybuild does specify the LIBRARY_PATH environment variable
>> (set using make_module_req_guess() ) to point correctly to the "local"
>> libs (the easybuild ones, in opposite to the default system libraries),
>> when using the GCC with goalf (eventually coming from easybuild) the
>>order
>> of the paths in LIBRARY_PATH is somehow mixed up thus making the gcc
>>pick
>> the system libs (under /usr...) instead of the "local" libs (1.50).
>> Interestingly, using the dummy gcc does not cause this problem and uses
>> LIBRARY_PATH as it is found e.g. With the env command - no mix up seems
>>to
>> occur.
>> If you wonder why Cufflinks worked fine: this is simply because it uses
>> "-L/with/boost/libs/dir" and this gets top-priority in linking, even
>> before LIBRARY_PATH.
>
>I have seen an issue like this, but this was caused by one of the
>Makefiles redefining LD_LIBRARY_PATH itself.
>
>Other than this, I don't see why this would happen.
>
>Can you collect verbose output when building the simple C++ program,
>using -v?
>
>It should spit out (a) whether it's trying to use the library found in
>LD_LIBRARY_PATH, and (b) if it does, why it doesn't use it.
>
Code:
#include <boost/regex.hpp>
#include <iostream>
#include <string>
int main()
{
std::string line;
boost::regex pat( "^Subject: (Re: |Aw: )*(.*)" );
while (std::cin)
{
std::getline(std::cin, line);
boost::smatch matches;
if (boost::regex_match(line, matches, pat))
std::cout << matches[2] << std::endl;
}
}
Command:
g++ -v -o Test_boost_linking test_boost_linking.cpp -lboost_regex
As you can see, this is nothing fancy. I attached the outputs for the
different gcc-versions as well as some environment information included.
The, for me, interesting point is the fact that in the case of g++-4.4.5
(distribution provided) the manually-set LIBRARY_PATH variable seems to be
correctly respected (at the beginning of the list in the verbose output,
s. line 35 of respective file) while for g++-4.6.3 it gets integrated
*somewhere* in the LIBRARY_PATH returned by the verbose output (s. line
40, character 223 and following).
When building with g++-4.4.5, it is using a manually installed boost
installation (s. the path difference: apps vs. easybuild). When building
with g++-4.6.3, it should use the boost-installation that was compiled
with easybuild and goalf, where we used our easyconfig and easyblock (s.
github). I would expect it to be independent of all this, as long as the
same compiler-version was used of course respectively and as long as the
environment is correctly/completely set, which seems to be the case ;)
In case you would want further information, please feel free to ask :)
Regarding the hackathon, sadly, I will not be able to participate. My main
research work is keeping me more than busy, although I would have been
really happy to hack around with you guys.
I wish you a lot of fun already in advance!
>
>
>regards,
>
>Kenneth
Best,
Cedric
Cedric Laczny,
PhD Student
UNIVERSITÉ DU LUXEMBOURG
LUXEMBOURG CENTRE FOR SYSTEMS BIOMEDICINE
Campus Belval | House of Biomedicine
7, avenue des Hauts-Fourneaux
L-4362 Esch-sur-Alzette
T +352 46 66 44 6398
F +352 46 66 44 6949
[email protected] http://lcsb.uni.lu <http://lcsb.uni.lu/>
-----
This message is confidential and may contain privileged information. It is
intended for the named recipient only. If you receive it in error please
notify me and permanently delete the original message and any copies.
-----
=== env | grep boost ===
CPLUS_INCLUDE_PATH=/home/clusterusers/claczny/apps/software/boost-1.50.0/include
LIBRARY_PATH=/home/clusterusers/claczny/apps/software/boost-1.50.0/lib
LD_LIBRARY_PATH=/home/clusterusers/claczny/apps/software/boost-1.50.0/lib
=== g++ verbose ===
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.4.5-8'
--with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.4 --enable-shared --enable-multiarch
--enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib --enable-nls
--enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc
--with-arch-32=i586 --with-tune=generic --enable-checking=release
--build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.5 (Debian 4.4.5-8)
COLLECT_GCC_OPTIONS='-v' '-o' 'Test_boost_linking' '-shared-libgcc'
'-mtune=generic'
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/cc1plus -quiet -v -D_GNU_SOURCE
test_boost_linking.cpp -quiet -dumpbase test_boost_linking.cpp -mtune=generic
-auxbase test_boost_linking -version -o /tmp/cc1cfHAN.s
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../x86_64-linux-gnu/include"
ignoring nonexistent directory "/usr/include/x86_64-linux-gnu"
#include "..." search starts here:
#include <...> search starts here:
/home/clusterusers/claczny/apps/software/boost-1.50.0/include
/usr/include/c++/4.4
/usr/include/c++/4.4/x86_64-linux-gnu
/usr/include/c++/4.4/backward
/usr/local/include
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/include
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed
/usr/include
End of search list.
GNU C++ (Debian 4.4.5-8) version 4.4.5 (x86_64-linux-gnu)
compiled by GNU C version 4.4.5, GMP version 4.3.2, MPFR version
3.0.0-p3.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 5a2e15051eaa06a84cf6320b754ba993
COLLECT_GCC_OPTIONS='-v' '-o' 'Test_boost_linking' '-shared-libgcc'
'-mtune=generic'
as -V -Qy -o /tmp/ccoqSbZX.o /tmp/cc1cfHAN.s
GNU assembler version 2.20.1 (x86_64-linux-gnu) using BFD version (GNU Binutils
for Debian) 2.20.1-system.20100303
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.4.5/:/usr/lib/gcc/x86_64-linux-gnu/4.4.5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.4.5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.4.5/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/home/clusterusers/claczny/apps/software/boost-1.50.0/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/4.4.5/:/usr/lib/gcc/x86_64-linux-gnu/4.4.5/:/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/:/lib/../lib/:/usr/lib/../lib/:/home/clusterusers/claczny/apps/software/boost-1.50.0/lib/:/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'Test_boost_linking' '-shared-libgcc'
'-mtune=generic'
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/collect2 --build-id --eh-frame-hdr -m
elf_x86_64 --hash-style=both -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o
Test_boost_linking /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crt1.o
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crti.o
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/crtbegin.o
-L/home/clusterusers/claczny/apps/software/boost-1.50.0/lib/../lib
-L/usr/lib/gcc/x86_64-linux-gnu/4.4.5 -L/usr/lib/gcc/x86_64-linux-gnu/4.4.5
-L/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib -L/lib/../lib
-L/usr/lib/../lib -L/home/clusterusers/claczny/apps/software/boost-1.50.0/lib
-L/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../.. /tmp/ccoqSbZX.o -lboost_regex
-lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/crtend.o
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crtn.o
=== ldd ===
linux-vdso.so.1 => (0x00007ffff13ff000)
libboost_regex.so.1.50.0 =>
/home/clusterusers/claczny/apps/software/boost-1.50.0/lib/libboost_regex.so.1.50.0
(0x00007f39d3b32000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f39d380c000)
libm.so.6 => /lib/libm.so.6 (0x00007f39d3589000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f39d3373000)
libc.so.6 => /lib/libc.so.6 (0x00007f39d3012000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00007f39d2df5000)
libicuuc.so.44 => /usr/lib/libicuuc.so.44 (0x00007f39d2aa6000)
libicui18n.so.44 => /usr/lib/libicui18n.so.44 (0x00007f39d26d2000)
libicudata.so.44 => /usr/lib/libicudata.so.44 (0x00007f39d1694000)
librt.so.1 => /lib/librt.so.1 (0x00007f39d148c000)
/lib64/ld-linux-x86-64.so.2 (0x00007f39d3e47000)
libdl.so.2 => /lib/libdl.so.2 (0x00007f39d1288000)
=== env | grep boost ===
CPLUS_INCLUDE_PATH=/home/clusterusers/claczny/easybuild/software/boost/1.50.0-goalf-1.1.0-no-OFED/include
LIBRARY_PATH=/home/clusterusers/claczny/easybuild/software/boost/1.50.0-goalf-1.1.0-no-OFED/lib
LD_LIBRARY_PATH=/home/clusterusers/claczny/easybuild/software/boost/1.50.0-goalf-1.1.0-no-OFED/lib:/opt/apps/easybuild/software/ScaLAPACK/1.8.0-GCC-4.6.3-OpenMPI-1.4.5-no-OFED-ATLAS-3.8.4-LAPACK-3.4.0-BLACS-1.1/lib:/opt/apps/easybuild/software/BLACS/1.1-GCC-4.6.3-OpenMPI-1.4.5-no-OFED/lib:/opt/apps/easybuild/software/FFTW/3.3.1-GCC-4.6.3-OpenMPI-1.4.5-no-OFED/lib:/opt/apps/easybuild/software/ATLAS/3.8.4-GCC-4.6.3-LAPACK-3.4.0/lib:/opt/apps/easybuild/software/LAPACK/3.4.0-GCC-4.6.3/lib:/opt/apps/easybuild/software/OpenMPI/1.4.5-GCC-4.6.3-no-OFED/lib:/opt/apps/easybuild/software/GCC/4.6.3/lib64:/opt/apps/easybuild/software/GCC/4.6.3/lib
_LMFILES_=/opt/apps/easybuild/modules/all/GCC/4.6.3:/opt/apps/easybuild/modules/all/OpenMPI/1.4.5-GCC-4.6.3-no-OFED:/opt/apps/easybuild/modules/all/LAPACK/3.4.0-GCC-4.6.3:/opt/apps/easybuild/modules/all/ATLAS/3.8.4-GCC-4.6.3-LAPACK-3.4.0:/opt/apps/easybuild/modules/all/FFTW/3.3.1-GCC-4.6.3-OpenMPI-1.4.5-no-OFED:/opt/apps/easybuild/modules/all/BLACS/1.1-GCC-4.6.3-OpenMPI-1.4.5-no-OFED:/opt/apps/easybuild/modules/all/ScaLAPACK/1.8.0-GCC-4.6.3-OpenMPI-1.4.5-no-OFED-ATLAS-3.8.4-LAPACK-3.4.0-BLACS-1.1:/opt/apps/easybuild/modules/all/goalf/1.1.0-no-OFED:/home/clusterusers/claczny/easybuild/modules/all/boost/1.50.0-goalf-1.1.0-no-OFED
LOADEDMODULES=GCC/4.6.3:OpenMPI/1.4.5-GCC-4.6.3-no-OFED:LAPACK/3.4.0-GCC-4.6.3:ATLAS/3.8.4-GCC-4.6.3-LAPACK-3.4.0:FFTW/3.3.1-GCC-4.6.3-OpenMPI-1.4.5-no-OFED:BLACS/1.1-GCC-4.6.3-OpenMPI-1.4.5-no-OFED:ScaLAPACK/1.8.0-GCC-4.6.3-OpenMPI-1.4.5-no-OFED-ATLAS-3.8.4-LAPACK-3.4.0-BLACS-1.1:goalf/1.1.0-no-OFED:boost/1.50.0-goalf-1.1.0-no-OFED
SOFTROOTBOOST=/home/clusterusers/claczny/easybuild/software/boost/1.50.0-goalf-1.1.0-no-OFED
=== g++ verbose ===
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/opt/apps/easybuild/software/GCC/4.6.3/libexec/gcc/x86_64-unknown-linux-gnu/4.6.3/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --enable-languages=c,c++,fortran,lto --enable-lto
--enable-checking=release --enable-cxx --disable-multilib --enable-shared=yes
--enable-static=yes --enable-threads=posix --enable-gold=default
--enable-plugins --enable-ld --with-plugin-ld=ld.gold --enable-bootstrap
--prefix=/opt/apps/easybuild/software/GCC/4.6.3
--with-local-prefix=/opt/apps/easybuild/software/GCC/4.6.3
Thread model: posix
gcc version 4.6.3 (GCC)
COLLECT_GCC_OPTIONS='-v' '-o' 'Test_boost_linking' '-shared-libgcc'
'-mtune=generic' '-march=x86-64'
/opt/apps/easybuild/software/GCC/4.6.3/libexec/gcc/x86_64-unknown-linux-gnu/4.6.3/cc1plus
-quiet -v -D_GNU_SOURCE test_boost_linking.cpp -quiet -dumpbase
test_boost_linking.cpp -mtune=generic -march=x86-64 -auxbase test_boost_linking
-version -o /tmp/ccgmMlqv.s
GNU C++ (GCC) version 4.6.3 (x86_64-unknown-linux-gnu)
compiled by GNU C version 4.6.3, GMP version 5.0.4, MPFR version 3.0.1,
MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory
"/opt/apps/easybuild/software/GCC/4.6.3/lib/gcc/x86_64-unknown-linux-gnu/4.6.3/../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/home/clusterusers/claczny/easybuild/software/boost/1.50.0-goalf-1.1.0-no-OFED/include
/opt/apps/easybuild/software/GCC/4.6.3/lib/gcc/x86_64-unknown-linux-gnu/4.6.3/../../../../include/c++/4.6.3
/opt/apps/easybuild/software/GCC/4.6.3/lib/gcc/x86_64-unknown-linux-gnu/4.6.3/../../../../include/c++/4.6.3/x86_64-unknown-linux-gnu
/opt/apps/easybuild/software/GCC/4.6.3/lib/gcc/x86_64-unknown-linux-gnu/4.6.3/../../../../include/c++/4.6.3/backward
/opt/apps/easybuild/software/GCC/4.6.3/lib/gcc/x86_64-unknown-linux-gnu/4.6.3/include
/opt/apps/easybuild/software/GCC/4.6.3/include
/opt/apps/easybuild/software/GCC/4.6.3/lib/gcc/x86_64-unknown-linux-gnu/4.6.3/include-fixed
/usr/include
End of search list.
GNU C++ (GCC) version 4.6.3 (x86_64-unknown-linux-gnu)
compiled by GNU C version 4.6.3, GMP version 5.0.4, MPFR version 3.0.1,
MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 7053196c8924373b546eb80666eac3a4
COLLECT_GCC_OPTIONS='-v' '-o' 'Test_boost_linking' '-shared-libgcc'
'-mtune=generic' '-march=x86-64'
as --64 -o /tmp/ccvwZol4.o /tmp/ccgmMlqv.s
COMPILER_PATH=/opt/apps/easybuild/software/GCC/4.6.3/libexec/gcc/x86_64-unknown-linux-gnu/4.6.3/:/opt/apps/easybuild/software/GCC/4.6.3/libexec/gcc/x86_64-unknown-linux-gnu/4.6.3/:/opt/apps/easybuild/software/GCC/4.6.3/libexec/gcc/x86_64-unknown-linux-gnu/:/opt/apps/easybuild/software/GCC/4.6.3/lib/gcc/x86_64-unknown-linux-gnu/4.6.3/:/opt/apps/easybuild/software/GCC/4.6.3/lib/gcc/x86_64-unknown-linux-gnu/
LIBRARY_PATH=/opt/apps/easybuild/software/GCC/4.6.3/lib/gcc/x86_64-unknown-linux-gnu/4.6.3/:/opt/apps/easybuild/software/GCC/4.6.3/lib/gcc/x86_64-unknown-linux-gnu/4.6.3/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/home/clusterusers/claczny/easybuild/software/boost/1.50.0-goalf-1.1.0-no-OFED/lib/:/opt/apps/easybuild/software/GCC/4.6.3/lib/gcc/x86_64-unknown-linux-gnu/4.6.3/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'Test_boost_linking' '-shared-libgcc'
'-mtune=generic' '-march=x86-64'
/opt/apps/easybuild/software/GCC/4.6.3/libexec/gcc/x86_64-unknown-linux-gnu/4.6.3/collect2
--eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o
Test_boost_linking /usr/lib/../lib64/crt1.o /usr/lib/../lib64/crti.o
/opt/apps/easybuild/software/GCC/4.6.3/lib/gcc/x86_64-unknown-linux-gnu/4.6.3/crtbegin.o
-L/opt/apps/easybuild/software/GCC/4.6.3/lib/gcc/x86_64-unknown-linux-gnu/4.6.3
-L/opt/apps/easybuild/software/GCC/4.6.3/lib/gcc/x86_64-unknown-linux-gnu/4.6.3/../../../../lib64
-L/lib/../lib64 -L/usr/lib/../lib64
-L/home/clusterusers/claczny/easybuild/software/boost/1.50.0-goalf-1.1.0-no-OFED/lib
-L/opt/apps/easybuild/software/GCC/4.6.3/lib/gcc/x86_64-unknown-linux-gnu/4.6.3/../../..
/tmp/ccvwZol4.o -lboost_regex -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc
/opt/apps/easybuild/software/GCC/4.6.3/lib/gcc/x86_64-unknown-linux-gnu/4.6.3/crtend.o
/usr/lib/../lib64/crtn.o
=== ldd ===
linux-vdso.so.1 => (0x00007fff70bff000)
libboost_regex.so.1.42.0 => /usr/lib/libboost_regex.so.1.42.0
(0x00007f620d235000)
libstdc++.so.6 =>
/opt/apps/easybuild/software/GCC/4.6.3/lib64/libstdc++.so.6 (0x00007f620cf30000)
libm.so.6 => /lib/libm.so.6 (0x00007f620ccae000)
libgcc_s.so.1 =>
/opt/apps/easybuild/software/GCC/4.6.3/lib64/libgcc_s.so.1 (0x00007f620ca99000)
libc.so.6 => /lib/libc.so.6 (0x00007f620c737000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00007f620c51b000)
libicudata.so.44 => /usr/lib/libicudata.so.44 (0x00007f620b4de000)
libicui18n.so.44 => /usr/lib/libicui18n.so.44 (0x00007f620b109000)
libicuuc.so.44 => /usr/lib/libicuuc.so.44 (0x00007f620adba000)
librt.so.1 => /lib/librt.so.1 (0x00007f620abb2000)
/lib64/ld-linux-x86-64.so.2 (0x00007f620d551000)
libdl.so.2 => /lib/libdl.so.2 (0x00007f620a9ad000)