Linking error

270 views
Skip to first unread message

Nathan Butcher

unread,
May 15, 2012, 12:59:33 PM5/15/12
to enzo-dev
I am getting a linking error in trying to create the Enzo executable.
cat out.compile produces the following:

/usr/bin/ld: /lib: No such file: File format not recognized
collect2: ld returned 1 exit status

I don't know what file it is looking for. I am working on a laptop
running Ubuntu. Also, I am getting an Error 127 but that has not
stopped anything so far. Thank you.

Nathan Butcher

unread,
May 15, 2012, 1:19:02 PM5/15/12
to enzo-dev
Also, I see in most other screenshots, there is a line that only says
"Linking". What I see is:

Linking enzo executable. Type cat out.compile in case it fails.

Does this mean I have done something wrong or did that change in an
update?

Nathan Goldbaum

unread,
May 15, 2012, 1:22:26 PM5/15/12
to enzo...@googlegroups.com
Hi Nathan,

It looks like you're trying to link against libraries contained in /lib. Are you sure that is a valid path? Usually libraries are installed in somewhere like /usr/local/lib.

-Nathan G.
> --
> You received this message because you are subscribed to the Google Groups "enzo-dev" group.
> To post to this group, send email to enzo...@googlegroups.com.
> To unsubscribe from this group, send email to enzo-dev+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/enzo-dev?hl=en.
>

Nathan Butcher

unread,
May 15, 2012, 1:27:41 PM5/15/12
to enzo-dev
Hello,

It is not a valid path, but assuming it is looking for hdf5 libraries
in that step, they are not in /usr/local/lib. I also do not see a lib
folder in the hdf5-1.8.7 folder. Is it looking for hdf5 libraries?

-Nathan Butcher

Nathan Goldbaum

unread,
May 15, 2012, 1:33:22 PM5/15/12
to enzo...@googlegroups.com
Hi Nathan,

I can't tell you where hdf5 is installed on your machine. Usually I check for things like that by looking for executables that are installed along with hdf5. So if I do

$ which h5ls

on my machine, it tells me that h5ls is located in /opt/local/bin. Lo and behold, I have hdf5 libraries in /opt/local/lib.

You'll need to do something similar on your machine and edit the Makefile you're using to reflect the paths of all of the libraries enzo links against.

Hope that was helpful :)

-Nathan

Nathan Butcher

unread,
May 15, 2012, 2:01:33 PM5/15/12
to enzo-dev
Thanks for the help. I am unable to find any executable that go with
hdf5. Does that mean it did not get installed properly? I have a
folder called hdf5-1.8.7, but no executables.

Nathan Butcher

Daniel R. Reynolds

unread,
May 15, 2012, 2:25:43 PM5/15/12
to enzo...@googlegroups.com
Hi Nathan B.,

When building Enzo, it looks for a machine-specific Makefile that tells
Enzo where all of your libraries (e.g. HDF5) are located. I'll assume
that you have set up one of these files already, and that you have told
Enzo to look to that file for the relevant definitions. If you're using
the release version of enzo from the googlecode site, then if you
haven't yet set up this file I'd recommend that you start with
Make.mach.linux-gnu (in src/enzo of the distribution) and customize it
for your machine.

I also use Ubuntu, and to build Enzo I believe that I only needed to
install hdf5 and openmpi via the package manager. If these are not
already installed, I believe that you can install everything you'll need
in one step with the command
sudo apt-get install libhdf5-openmpi-dev openmpi-bin libopenmpi-dev
FYI -- I'm using Ubuntu version 12.04, though I think that the above
package names should be valid for older distributions as well.

The relevant files and paths that should then be installed, and that
you'll need to add to your machine-specific Makefile, are:
HDF5 -- libraries are installed in /usr/lib/ and headers are
installed in /usr/include
OpenMPI -- compiler wrapper scripts mpicxx, mpicc, mpif77 and mpif90
are all installed in /usr/bin

Hopefully that helps.

-Dan

------------------------------------
Dr. Daniel R. Reynolds
Assistant Professor of Mathematics
Southern Methodist University

214-768-4339
http://faculty.smu.edu/reynolds/
------------------------------------

Nathan Butcher

unread,
May 17, 2012, 11:19:51 AM5/17/12
to enzo...@googlegroups.com
Hello,

I think I made a serious error in trying to set up the path to the hdf5 libraries and headers, so I have started over from the yt checkout. I have hdf5 and openmpi installed through package manager. I am now getting an error when I try to build the executable that reads:

mpic++  -c -o AdiabaticExpansionInitialize.o -DLINUX -DH5_USE_16_API   -D__max_subgrids=100000 -D__max_baryons=20 -D__max_cpu_per_node=8 -D__memory_pool_size=100000 -DINITS64 -DLARGE_INTS -DCONFIG_PINT_8 -DIO_32     -DUSE_MPI   -DCONFIG_PFLOAT_8 -DCONFIG_BFLOAT_8  -DUSE_HDF5_GROUPS    -DTRANSFER   -DNEW_GRID_IO -DFAST_SIB -DBITWISE_IDENTICALITY -DFLUX_FIX     -DSET_ACCELERATION_BOUNDARY  -g -I/usr/local/hdf5/1.8.2s/include            -I. AdiabaticExpansionInitialize.C

In file included from /usr/include/c++/4.4/bits/stl_tree.h:62,
                 from /usr/include/c++/4.4/map:60,
                 from /usr/lib/openmpi/include/openmpi/ompi/mpi/cxx/mpicxx.h:36,
                 from /usr/lib/openmpi/include/mpi.h:1886,
                 from /usr/include/H5public.h:57,
                 from /usr/include/hdf5.h:24,
                 from AMRH5writer.h:24,
                 from Grid.h:20,
                 from AdiabaticExpansionInitialize.C:28:
/usr/include/c++/4.4/bits/stl_algobase.h:232:56: error: macro "min" passed 3 arguments, but takes just 2
/usr/include/c++/4.4/bits/stl_algobase.h:253:56: error: macro "max" passed 3 arguments, but takes just 2
In file included from /usr/include/c++/4.4/bits/stl_algobase.h:63,
                 from /usr/include/c++/4.4/bits/stl_tree.h:62,
                 from /usr/include/c++/4.4/map:60,
                 from /usr/lib/openmpi/include/openmpi/ompi/mpi/cxx/mpicxx.h:36,
                 from /usr/lib/openmpi/include/mpi.h:1886,
                 from /usr/include/H5public.h:57,
                 from /usr/include/hdf5.h:24,
                 from AMRH5writer.h:24,
                 from Grid.h:20,
                 from AdiabaticExpansionInitialize.C:28:
/usr/include/c++/4.4/bits/cpp_type_traits.h:269: error: redefinition of ‘struct std::__is_floating<double>’
/usr/include/c++/4.4/bits/cpp_type_traits.h:263: error: previous definition of ‘struct std::__is_floating<double>’
In file included from /usr/include/c++/4.4/bits/stl_tree.h:62,
                 from /usr/include/c++/4.4/map:60,
                 from /usr/lib/openmpi/include/openmpi/ompi/mpi/cxx/mpicxx.h:36,
                 from /usr/lib/openmpi/include/mpi.h:1886,
                 from /usr/include/H5public.h:57,
                 from /usr/include/hdf5.h:24,
                 from AMRH5writer.h:24,
                 from Grid.h:20,
                 from AdiabaticExpansionInitialize.C:28:
/usr/include/c++/4.4/bits/stl_algobase.h:186: error: expected unqualified-id before ‘const’
/usr/include/c++/4.4/bits/stl_algobase.h:186: error: expected ‘)’ before ‘const’
/usr/include/c++/4.4/bits/stl_algobase.h:186: error: expected ‘)’ before ‘const’
/usr/include/c++/4.4/bits/stl_algobase.h:186: error: expected initializer before ‘const’
/usr/include/c++/4.4/bits/stl_algobase.h:209: error: expected unqualified-id before ‘const’
/usr/include/c++/4.4/bits/stl_algobase.h:209: error: expected ‘)’ before ‘const’
/usr/include/c++/4.4/bits/stl_algobase.h:209: error: expected ‘)’ before ‘const’
/usr/include/c++/4.4/bits/stl_algobase.h:209: error: expected initializer before ‘const’
/usr/include/c++/4.4/bits/stl_algobase.h:232: error: ‘std::min’ declared as an ‘inline’ variable
/usr/include/c++/4.4/bits/stl_algobase.h:232: error: template declaration of ‘const _Tp& std::min’
/usr/include/c++/4.4/bits/stl_algobase.h:235: error: expected primary-expression before ‘if’
/usr/include/c++/4.4/bits/stl_algobase.h:235: error: expected ‘}’ before ‘if’
/usr/include/c++/4.4/bits/stl_algobase.h:237: error: expected unqualified-id before ‘return’
/usr/include/c++/4.4/bits/stl_algobase.h:253: error: ‘max’ declared as an ‘inline’ variable
/usr/include/c++/4.4/bits/stl_algobase.h:253: error: template declaration of ‘const _Tp& max’
/usr/include/c++/4.4/bits/stl_algobase.h:256: error: expected primary-expression before ‘if’
/usr/include/c++/4.4/bits/stl_algobase.h:256: error: expected ‘}’ before ‘if’
/usr/include/c++/4.4/bits/stl_algobase.h:258: error: expected unqualified-id before ‘return’
/usr/include/c++/4.4/bits/stl_algobase.h:259: error: expected declaration before ‘}’ token


Nathan Butcher

Nathan Butcher

unread,
May 17, 2012, 4:42:02 PM5/17/12
to enzo...@googlegroups.com
Hello,

The issue is resolved, it was a path error in the machine make file that I missed. Thank you for the help.


Nathan Butcher

On Tuesday, May 15, 2012 12:59:33 PM UTC-4, Nathan Butcher wrote:
Reply all
Reply to author
Forward
0 new messages